Creating and Moving an Invisible file with OS X 10.8 Terminal

两盒软妹~` 提交于 2019-12-13 04:28:54

问题


I'm fairly new to using the terminal, but have so far figured out through various forums how to hide a file from the Finder, but once hidden, I'm obviously unable to move it to the flash drive I want to keep it on, and I can't figure out any way hide the file after it's moved off of the internal drive. I'm using the command line:

Computer-name:~ User$ chflags hidden /users/me/desktop/filename.txt

How do I move the file once it's hidden, or how would I alter the command to hide the file after it's been moved to the flash drive?


回答1:


Definitely this is an AskDifferent ( https://apple.stackexchange.com/ ) kind of question but at the same time, it's pretty straightforward to answer.

1) simply move the file to your flash drive

and then

2) hide it after it's copied /moved to the flash drive using "chflags hidden" and the path to where it lives on the flash drive. Another option is to use "SetFile -aV path/to/file.txt"

And just because it's hidden from the Finder doesn't mean you can't see it when you type in "ls" in Terminal. So you can reverse the steps and copy after you make the file invisible.



来源:https://stackoverflow.com/questions/15755579/creating-and-moving-an-invisible-file-with-os-x-10-8-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!