nl - number lines of files
nl 就是可以在你列出文件内容时,在前面添加行号
命令格式:
nl -b style -n format -w width file
style:
1 a : number all lines
2 t : number only nonempty lines
3 pBRE : number only lines that contain a match for the basic regular expression, BRE
format:
ln :行号出现在最左端 no leading zeros
rn : 行号出现在的右端 no leading zeros
rz : 行号出现在右端 leading zeros
width:
行号所占宽度
例如 :nl -b p'3' -n rz -w 10 a
lsattr && chattr
chattr - change file attributes on a Linux second extended file system
lsattr - list file attributes on a Linux second extended file system
i:文件只能读取 不能删除或者 修改增加内容
a:文件只能添加内容
例如:
lsattr file
chattr +ai file
阅读(318) | 评论(0) | 转发(0) |