歡迎您光臨本站 註冊首頁

Linux命令筆記

←手機掃碼閱讀     火星人 @ 2014-03-23 , reply:0

#
%s/\[.*\]//g 將[與]之間的所有的東西都刪掉
#
z RETURN
z.
z-
將當前行設為首,中,尾
#
sudo mkfs.ext3 -b 4096 -i 8192 /dev/hda6
sudo tune2fs -l /dev/hda6

#
find . -type f -print | xargs grep note ;在所有的文件夾下找文件名含note的文件
xargs與 -exec作用相同
#
find ~ -newer "/etc/passwd" -print0|xargs -0 ls


而且,這個newer默認比較的是last modification time吧?
#
find / -name not*
find . -name "te*" | cpio -pud download;p 從管道複製,d需要時創建目錄,u無條件複製
#
du -s * | sort -rn
du -hms * | sort -rn
df | awk '{print $5"\t"$6}';后一個為顯示5 6列
date | awk '{printf "%s@%s-%s',$4,$6,$2,$3}';與print有相同的用法
#
find / -xdev -name core -atime +3 -print 查找三天內未使用的core文件
find / -local -name core -exec rm -f {} ';'
find ./ -type f -exec grep modification {} ';';在文件中找modification並將文件中的這一行輸出
#
ps -ef | grep vim;查找與vim有關的進程
kill -9 pid 殺死一個進程
#
cp -p 保留屬性
#
查找多個關鍵詞
grep find mycommond | grep type;在mycommond中查找有find 與type的一行
egrep '(find | type)' mycommond;與上面的功能相同

[火星人 ] Linux命令筆記已經有360次圍觀

http://coctec.com/docs/linux/show-post-115682.html