MAC OS 怎么显示/mac os怎么隐藏文件件和文件扩展名

mac怎么隐藏文件 苹果系统隐藏文件方法汇总,windows,option,文件夹,扩展名,资源库 -
Powered by 第一站长论坛
<span onclick="showDialog('Email:')" title="点击 找回密码">找回密码
后使用快捷导航没有帐号?
查看: 241|回复: 0
04:55:19
|
  mac如何隐藏文件呢?我们知道在 windows 系统下隐藏文件很简单,右键点击选「属性」选择「隐藏」即可,那么在 mac 系统下我们要如何隐藏呢?  隐藏只是保护文件的一种方式,它只是使文件在某些条件下不可见,但实际上还有比隐藏更加强大的方式,那就是加密,或许这才是苹果想要给你的方式。下面我们就具体的来看看几个隐藏文件的方式。  一、用资源库、程序、安装包来隐藏文件  如果你只是想让文件不易被发现,那么有以下几种方式:  1、将文件放入「~/资源库」目录下:  在 Lion 系统之后,系统默认将用户主目录下的「资源库」文件夹作为一个隐藏文件夹,所以你可以在这个目录下建立一个文件夹用于埋藏你的那一堆秘密,甚至你可以放在「~/资源库/Application Support/」然后建立一个文件夹用于放置你的秘密。  点击桌面或者 Finder,然后点击菜单「前往」,按住 option 点击「资源库」即可访问「资源库」文件夹。  2、将文件放在程序中:  Mac 下的程序实际上是一些扩展名为 .app 的文件夹,所以右键点击程序选「显示包内容」就可以看到其中的程序文件和资源文件,那么现在你就可以将资料放到这里,这也算是一种隐藏的方式。  当然你也可以新建一个文件夹,然后命名为 .app 文件,比如 Microsoft Office 2011.app,然后右键点击这个文件选「显示包内容」将资料放到该 App 中,或者直接将你的放置秘密的文件夹改名为Microsoft Office 2011.app 即可。如果要查看文件,只需要右键点击 app,然后选「显示包内容」即可。  二、使文件不可见  这是最常用的方式,也是最踏实的方式,人们总会认为隐藏了别人就看不见了,如果你想在 Mac 下隐藏文件或文件夹有以下几种方式:  1、新建一个隐藏文件夹  在终端中输入 mkdir .文件夹名称  比如说你想在文稿目录下新建一个隐藏文件夹,只需要打开终端,输入 mkdir Documents/.abc 即可在文稿目录下创建一个 .abc 的隐藏文件夹。(如何显示 Mac 隐藏文件看这里《如何显示mac隐藏文件》)  2、将一个文件夹变为隐藏文件夹  在终端中输入 mv file .file 或者 mv folder .folder,即可隐藏。最直接的方式在终端中输入 mv 然后将文件或文件夹拖到终端窗口中,然后输入一个空格加.再将文件拖到这里,然后按 return 执行即可隐藏文件。这就是 Mac 下用在名称前加.的方式来隐藏文件,但在 Mac 下你无法直接在 Finder 中对一个文件直接加.,必须在终端中实现。  三、通过修改文件的隐藏属性  在终端中输入 chflags hidden 然后将文件拖到这里,按 return 执行即可隐藏文件。  chflags 是一个更改文件隐藏属性的命令,他的意思就是 change flags,也就是修改文件的标志,hidden 就是隐藏,所以 chflags hidden 就是隐藏文件。如果要取消隐藏文件,只需要输入「chflags nohidden 文件」即可。以上就是小编为大家带来的苹果系统隐藏文件方法汇总,希望对大家有所帮助,请继续关注phpstudy。相关阅读:mac如何查看隐藏文件夹?苹果mac显示隐藏文件夹方法和命令介绍苹果Mac OS X系统快速显示/恢复隐藏文件的方法介绍
&#26412;&#39029;&#26631;&#39064;:&&#26412;&#39029;&#22320;&#22336;:&
, , , ,
相关帖子
&#8226;9300人阅读
mac os x实用技巧
&Mac有一个设计原则,就是用户不需要看到的或者用户不希望看到的,都不会显示出来。但如果你想要修改其中某些文件,也是可以的,先需要显示所有的文件,可以在终端中输入命令行来实现。
显示系统隐藏的文件
defaults write com.apple.finder AppleShowAllFiles -bool true
KillAll Finder
defaults write com.apple.finder AppleShowAllFiles YES
KillAll Finder
同样可以把这些隐藏文件再隐藏起来
defaults write com.apple.finder AppleShowAllFiles -bool false
KillAll Finder
defaults write com.apple.finder AppleShowAllFiles NO
KillAll Finder
在显示了所有文件之后,那如何把一个不是隐藏的文件修改为隐藏呢,下面介绍两种简单的方法。
方法一:直接在文件或文件夹名前面的加一个‘.’点号,然后系统会弹出修改确认对话框,点好就行了。
方法二:利用命令“chflags hidden” 可以隐藏文件或文件夹。
先打开Terminal(Applications/Utilities/Terminal),然后执行命令
chflags hidden 文件路径 或
chflags hidden 文件夹路径
既可。也可以先输入chflags hidden,然后直接把要隐藏的文件用鼠标选中拖到输入框中,它自动会转换为文件的路径。
要解除文件的隐藏状态,可以使用命令:
chflags nohidden
与前面相对应即可。
上面两种方式,到底有啥区别呢,个人觉得方法一并没有修改文件本身的属性,在linux及unix中,约定好点开头的文件就是隐藏文件。
方法二中修改的是文件本身的隐藏标志,但貌&#20284;在windows上不起作用,只能在linux及unix中有用。而方法一,windows也是可以显示
隐藏的,应该是windows也识别linux及unix中的点号约定。
在网上还发现有一个可以隐藏文件及文件夹的开源工程,提供了一个带界面的程序,可以方便不会使用命令行的用户,地址是/p/hideme4mac/
最后,附加上chflags命令的详细信息。
chflags 命令修改文件的标志(change file flags),包括隐藏标志,其详细使用方法如下:
chflags [-fhv] [-R [-H | -L | -P]] flags file ...
DESCRIPTION
The chflags utility modifies the file flags of the listed files as specified by the flags operand.
The options are as follows:
-f Do not display a diagnostic message if chflags could not modify the flags for file, nor modify
the exit status to reflect such failures.
-H If the -R option is specified, symbolic links on the command line are followed. (Symbolic
links encountered in the tree traversal are not followed.)
-h If the file is a symbolic link, change the file flags of the link itself rather than the file
to which it points.
-L If the -R option is specified, all symbolic links are followed.
-P If the -R option is specified, no symbolic links are followed. This is the default.
-R Change the file flags for the file hierarchies rooted in the files instead of just the files
themselves.
-v Cause chflags to be verbose, showing filenames as the flags are modified. If the -v option is
specified more than once, the old and new flags of the file will also be printed, in octal
The flags are specified as an octal number or a comma separated list of keywords. The following key-
words are currently defined:
arch, archived
set the archived flag (super-user only)
opaque set the opaque flag (owner or super-user only). [Directory is opaque when viewed through
a union mount]
nodump set the nodump flag (owner or super-user only)
sappnd, sappend
set the system append-only flag (super-user only)
schg, schange, simmutable
set the system immutable flag (super-user only)
uappnd, uappend
set the user append-only flag (owner or super-user only)
uchg, uchange, uimmutable
set the user immutable flag (owner or super-user only)
hidden set the hidden flag [Hide item from GUI]
As discussed in chflags(2), the sappnd and schg flags may only be unset when the system is in single-
user mode.
Putting the letters ``no'' before or removing the letters ``no'' from a keyword causes the flag to be
cleared. For example:
nouchg clear the user immutable flag (owner or super-user only)
dump clear the nodump flag (owner or super-user only)
Unless the -H or -L options are given, chflags on a symbolic link always succeeds and has no effect.
The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options
override each other and the command's actions are determined by the last one specified.
You can use &ls -lO& to see the flags of existing files.
下面提供一个中文版
chflags – 改变文件的标志
chflags [-fhv] [-R [-H | -L | -P]] 标志 文件
工具chflags修改指定文件的文件标志。
选项如下:
-f 如果chflags不能修改文件标志,nor modify the exit status to reflect such failures,则不显示诊断信息。
-H 如果开启-R选项,将改变软连接指向的文件的文件标志(遍历树中的软连接除外)。
-h 如果文件是软连接,只改变该链接的文件标志,而不改变该链接所指向的文件的标志。
-L 如果-R选项开启,将改变所有软连接所指向的文件的文件标志。
-P 如果-R选项开启,将不改变所有软连接所指向的文件的文件标志。这是默认选项。
-R Change the file flags for the file hierachies rooted int the files instead of just the files themselves.
-v 当修改标志时显示文件名。如果 –v 出现两次以上,则以八进制同时显示旧标志和新 标志。
文件标志以一个八进制数或一系列以逗号分隔的关键词来显示。下面是当前定义的关 键词:
arch,archived
存档文件标志(超级用户独有)
opaque 不透明文件标志(适用于文件所有者或超级用户)
nodump nodump文件标志(适用于文件所有者和超级用户)
sappnd,sappend
仅允许附加 文件标志(超级用户独有)
schg,schange,simmutable
不可更改 文件标志(超级用户独有)
sunlnk,sunlink
不可删除 文件标志(超级用户独有)
uappnd,uappend
只允许用户附加 文件标志(适用于所有者和超级用户)
uchg,uchange,uimmutable
不允许用户更改 文件标志(适用于所有者和超级用户)
uunlnk,uunlink
不允许用户删除 文件标志(适用于所有者和超级用户)
在关键词前面添加或者去除“no”将清除相应的文件标志。例如:
nouchg 清除 不可更改 文件标志(适用于所有者或超级用户)
dump 清除 nodump 文件标志(适用于所有者或超级用户)
八进制数值对应的文件标志:
0 清除所有文件标志
3 uchg,nodump
Other combinations of keywords may be placed by using the octets assigned.但是,以上这些是最常用的。
你可以使用 “ls -lo”来查看文件的文件标志。
注意:能否改变某些标志依赖于当前内核的安全级别设定。查看security(7)来获得更多的 信息。
退出状态:
成功 0,失败&0.
ls(1), chflags(2), stat(2), fts(3), security(7), symlink(7)
chflags最早出现在4.4BSD当中。
Only a limited number of utilities are chflags aware. Some of these
tools include ls(1), cp(1), find(1), install(1), dump(8), and restore(8).
In particular a tool which is not currently chflags aware is the pax(1)
utility.chio
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:150995次
积分:2138
积分:2138
排名:第15662名
原创:64篇
评论:75条
(4)(4)(2)(1)(8)(15)(30)Mac系统怎么设置隐藏和显示文件或文件夹?
作者:佚名
字体:[ ] 来源:互联网 时间:04-16 11:43:00
Mac系统怎么设置隐藏和显示文件或文件夹?电脑里有重要的文件,怎么隐藏文件夹呢?今天以mac系统为例,教大家怎么隐藏Mac系统设置隐藏和显示文件或文件夹,需要的朋友可以参考下
如果你是一位想探索苹果系统的好奇者,当你想找到Library在哪儿时,却怎么也找不到?,当你想要隐藏自己的秘密时,只能用文件夹堆叠的形式藏起来?不保险吧,万一遇到见到文件夹就不停地往里点的人怎么办?打开终端,将秘密牢牢地锁在虚无之中吧!
1、首先,要确保知道目标文件或文件夹的名称,你不把这个名称正确地输入到终端中,Mac也无能为力啊...
2、打开终端,输入chflags hidden
3、在上述代码的后面加上该文件夹的路径,但是注意,这里的路径是指你用户文件夹里面的路径,所以图中的&秘密&文件夹的路径是 Downloads/秘密
4、回车,这个时候你就会你的秘密文件夹就成功的看不见摸不着了,chflags hidden 文件夹路径,上述的代码就是将文件夹隐藏的方法,同理将一个隐藏的文件夹显示出来的代码是,chflags nohidden 文件夹路径
5、可是,要是连我自己都忘了这儿放了一个隐藏文件夹怎么办?那岂不是把秘密弄丢了?解决方法是不隐藏秘密文件夹,但是隐藏文件夹中的所有文件,这个步骤和隐藏文件夹一样,但是要把文件夹路径改成文件路径,并且要有完整的名称后缀。同时,也有一个更简单的方式,chflags hidden Downloads/秘密/*,上述代码可以让秘密这个文件夹里的所有内容隐藏,但是并不会隐藏文件夹本身,而且你还能看到这个文件夹里应该有两个文件,但却什么都看不到!
注意事项:
1、如何显示Finder的文件路径:顶部菜单栏--&显示--&显示路径栏。
2、如何显示文件夹中的文件数量:顶部菜单栏--&显示--&显示选项--&显示文件信息。
大家感兴趣的内容
12345678910
最近更新的内容

我要回帖

更多关于 mac os怎么隐藏文件 的文章

 

随机推荐