第7章-01

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值