使用OS X 10.8 Terminal创建和移动不可见文件 [英] Creating and Moving an Invisible file with OS X 10.8 Terminal

查看:76
本文介绍了使用OS X 10.8 Terminal创建和移动不可见文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用终端还很陌生,但是到目前为止,已经在各种论坛上找到了如何从Finder中隐藏文件的方法,但是一旦隐藏,我显然无法将其移至我想要的闪存驱动器中保持打开状态,将文件从内部驱动器中移出后,我无法找到隐藏文件的任何方法.我正在使用命令行:

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?

推荐答案

肯定是一个AskDifferent( https://apple.stackexchange.com/)这样的问题,但同时,答案也很简单.

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

1)只需将文件移至闪存驱动器

1) simply move the file to your flash drive

然后

2)使用"chflags hidden"和将其复制/移动到闪存驱动器上的路径后,将其隐藏.另一种选择是使用"SetFile -aV path/to/file.txt"

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"

仅因为它已在Finder中隐藏,并不意味着您在Terminal中键入"ls"时看不到它.因此,您可以撤消这些步骤并在使文件不可见之后进行复制.

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.

这篇关于使用OS X 10.8 Terminal创建和移动不可见文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆