macos - OSX - 始终隐藏某些文件

标签 macos terminal

我知道如何在终端中显示和隐藏隐藏文件 - 但是有没有办法在显示隐藏文件时隐藏某些文件,例如 .DS_STORE?可以这么说,使某些文件 super 隐藏吗?

最佳答案

chflags 与隐藏选项一起使用

ie: chflags hide fileToHide 从 Finde 中隐藏文件

chflags nohidden fileToHide来显示文件

请记住手册页中的警告:

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.

这意味着,虽然您不会在 Finder 或打开/保存对话框中看到它,但终端仍然会看到它,并且可能会看到其他不尊重 BSD 标志的程序。

关于macos - OSX - 始终隐藏某些文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/393868/

相关文章:

linux - Git 推送更改文件的所有权导致 500 服务器错误

python - 在 Mac OS X 上为 Python 导入 MySQLdb 时出错

python - 使用 pexpect/bash 时防止换行

c - 如何在linux中使用c执行CMD命令并查看结果

c - 如何检测内存泄漏?

linux - 重命名文件夹中的文件(linux)

bash - 我正在用vim检查手册页,并且有一些奇怪的字符,如何使其正常?

macos - Git 差异 : Write output and exit instead of interactive mode

python - 导入错误 : No module named schedule

java - 如何使用 OSX Lion 在 Mac 上使用 Java 进行开发