第7章-02

来源:互联网 发布:股票网络销售话术 编辑:程序博客网 时间:2024/05/20 16:01

Please indicate the source if you want to reprint: http://blog.csdn.net/gaoxiangnumber1
mv: move (rename) files
取得路径的文件名和目录名称
直接查阅一个档案的内容
1.cat(concatenate files and print on the standard output)

2.tac( concatenate and print files in reverse)

3.nl - number lines of files

可翻页检视、资料截取:P216-P220
修改档案时间或建置新档: touch
三个主要的变动时间:默认的情况下,ls 显示出的是该档案的mtime。修改方法详见P221-P222

档案预设权限:umask(set file mode creation mask)。
在默认权限的属性上:
档案:预设没有可执行( x )权限,只有 rw,最大为 666 分,即-rw-rw-rw-
目录:x与能否进入此目录有关,因此默认为所有权限均开放,为 777 分,即drwxrwxrwx。
umask的四个数字中第一个数字是特殊权限用的,后三个数字指的是默认值需要减掉的权限(owner/group/others)。
设定umask:直接在 umask 后面输入 002(想设置的数字)
默认情况下:root的umask为002;一般用户的umask为002。
chattr - change file attributes on a Linux file system 配置文件案隐藏属性
lsattr - list file attributes on a Linux second extended file system

档案特殊权限: SUID, SGID, SBIT:P227
观察文件类型:file

which - locate a command 寻找『执行档』
whereis
- locate the binary, source, and manual page files for a command:寻找特定档案
locate - find files by name(最好用)

locate是经由数据库来搜寻的,而数据库的建立默认是在每天执行一次(每个 distribution 都不同),所以当你新建立起来的档案, 即还在数据库更新之前搜寻 该档案,那么 locate 会告诉你『找不到!』。手动更新 locate 数据库:直接输入 updatedb(可能会等待数分钟的时间)。updatedb:根据 /etc/updatedb.conf 的设定 去搜寻系统硬盘内的文件名,并更新/var/lib/mlocate 内的数据库档案;locate:依据 var/lib/mlocate 内的数据库记载,找出用户输入的关键词文件名。
find - search for files in a directory hierarchy

Please indicate the source if you want to reprint: http://blog.csdn.net/gaoxiangnumber1

0 0
原创粉丝点击