Chinaunix首页 | 论坛 | 博客
  • 博客访问: 40158
  • 博文数量: 18
  • 博客积分: 366
  • 博客等级: 一等列兵
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-26 10:41
文章分类

全部博文(18)

文章存档

2013年(3)

2012年(15)

我的朋友

分类: LINUX

2012-09-30 18:37:35

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) |
0

上一篇:没有了

下一篇:tar 备份

给主人留下些什么吧!~~