Every directory in Linux contains the two special directory names "." and "..". The ".." meaning "up-one" in the directory tree and the "." meaning the current node in the tree. This includes the root ("/") directory:
$ ls -la /
total 472
drwxr-xr-x 29 root root 4096 Nov 22 13:03 .
drwxr-xr-x 29 root root 4096 Nov 22 13:03 ..
So executing a command on the directory "/." is really saying "execute this command on the '.' directory inside of '/'", which is just the root itself.
As far as fixing the original permissions... I hope you've made system backups :)
The effect will be the same, so depending on how quick you where to stop this (and how fast your server is) there will be files (and directories!) with incorrect permissions. You should be able to use the find command (the -perm option) to find all files which now have the 777 permission.
If you have a backup system which properly retains permissions you could probably find a way to script the old permissions back if to many files are changed to do it manually. But without a backup there isn't much left but to run to the list of files with 777 permissions and fix them manually.
发布评论
评论(2)
Linux 中的每个目录都包含两个特殊的目录名“.”。和 ”..”。 “..”在目录树中表示“up-one”,“.”表示目录树中的“up-one”。表示树中的当前节点。这包括根(“/”)目录:
因此在目录“/”上执行命令。实际上是在说“在 '.' 上执行此命令” “/”内的目录,它只是根本身。
至于修复原始权限......我希望你已经做了系统备份:)
Every directory in Linux contains the two special directory names "." and "..". The ".." meaning "up-one" in the directory tree and the "." meaning the current node in the tree. This includes the root ("/") directory:
So executing a command on the directory "/." is really saying "execute this command on the '.' directory inside of '/'", which is just the root itself.
As far as fixing the original permissions... I hope you've made system backups :)
效果是相同的,因此根据您在何处停止此操作的速度(以及您的服务器的速度),将会有文件(和目录!)具有不正确的权限。您应该能够使用 find 命令(-perm 选项)来查找现在具有 777 权限的所有文件。
如果您有一个正确保留权限的备份系统,如果许多文件被更改为手动执行此操作,您可能会找到一种方法来编写旧权限的脚本。但如果没有备份,就没有什么办法了,只能运行到具有 777 权限的文件列表并手动修复它们。
The effect will be the same, so depending on how quick you where to stop this (and how fast your server is) there will be files (and directories!) with incorrect permissions. You should be able to use the find command (the -perm option) to find all files which now have the 777 permission.
If you have a backup system which properly retains permissions you could probably find a way to script the old permissions back if to many files are changed to do it manually. But without a backup there isn't much left but to run to the list of files with 777 permissions and fix them manually.