常用命令

来自Shiyin's note
Shen讨论 | 贡献2013年4月18日 (四) 06:28的版本
跳到导航 跳到搜索

umask

umask是对权限的过滤器,因此它的工作方式和chmod恰好相反。全部权限等价与777(rwxrwxrwx),umask值0222(-w--w--w-)则代表权限555(r-xr-xr-x)

dd

cat

  • cat file1 file2 | sort | uniq
取出两个文件的并集(重复的行只保留一份)
  • cat file1 file2 | sort | uniq -d
取出两个文件的交集(只留下同时存在于两个文件中的文件)
  • cat file1 file2 | sort | uniq -u
删除交集,留下其他的行
  • cat file1 file2 > file3
paste file2 to the end of file1 and write to file3

cat and paste

find

awk

tr

sed