linux学习

来源:互联网 发布:精算师 工资 知乎 编辑:程序博客网 时间:2024/04/28 06:01

linux隐藏文件以字符“.”(小数点)开头,如.ssh即为隐藏文件。ls -al指令可以列出所有文件的权限与信息,包括隐藏文件.字符.


chmod 777 test.txt。所有用户均有读写执行的权限(读写执行对应的分数为4,2,1)

 chmod a-x test.txt。 所以用户去除执行权限(还有+,=操作)

对应的三种用户身份也可以用u,g,o表示。chmod ugo=x test.txt

chmod u+w,g-x test.txt


linux文件能不能被执行仅与X属性有关,于文件名没有一点关系。



du 指令

如何统计文件的大小

du - estimate file space usage

du [options] [directories and/or files]

DESCRIPTION
       Summarize disk usage of each FILE, recursively for directories.

选项

 -h, --human-readable
              print sizes in human readable format (e.g., 1K 234M 2G)

-s, --summarize
              display only a total for each argument

摘自linux manual

比如统计某个文件夹下所有文件的大小之和

du -sh test

上例即为同为统计test目录下所有文件大小之和







强制结束作业

bkill

-r
               Removes a job from the LSF system without waiting for the
               job to terminate in the operating system.

bkill -r jobID