您的位置:首页 > 其它

第7章-01

2015-08-12 22:22 351 查看
Please indicate the source if you want to reprint: http://blog.csdn.net/gaoxiangnumber1

绝对路径的用途:绝对路径的正确度要比较好。一般来说,如果是在写程序 (shell scripts) 来管理系统的条件下,务必使用绝对路径的写法。因为绝对路径的写法虽然比较麻烦,但是可以肯定这个写法绝对不会有问题。 如果使用相对路径在程序当中,则可能由于你执行的工作环境不同,导致一些问题的发生。

cd :变换目录(Change Directory)

pwd :显示目前所在的目录(Print Working Directory)

-P(physical的缩写):avoid all symlinks





mkdir (make directories):建立新目录

-m(mode的缩写):set file mode (as in chmod), not a=rwx - umask

-p(parents的缩写):no error if existing, make parent directories as needed



rmdir :删除空的目录(remove empty directories)

-p(parents的缩写):remove DIRECTORY and its ancestors; e.g., ‘rmdir -p a/b/c’ is similar to ‘rmdir a/b/c a/b a’

rm -r test :递归的删除test及其里面的所有文件。



档案与目录的检视: ls

-a, –all do not ignore entries starting with

全部的档案,连同隐藏档( 开头为 . 的档案) 一起列出来

-l use a long listing format

长数据串行出,包含档案的属性和权限等等数据

-R, –recursive list subdirectories recursively

连同子目录内容一起列出来,等于该目录下的所有档案都会显示出来

复制文件:cp.

[-options]中可以同时出现多个字母选项。

-a, –archive same as -dR –preserve=all

–preserve[=ATTR_LIST] preserve the specified attributes (default: mode, ownership, timestamps), if possible additional attributes: context, links, xattr, all

-i, –interactive prompt before overwrite (overrides a previous -n option)

-p same as –preserve=mode,ownership,timestamps

-R, -r, –recursive copy directories recursively





rm (remove files or directories):移除档案或目录

Please indicate the source if you want to reprint: http://blog.csdn.net/gaoxiangnumber1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: