akw ºÍlinux ÃüÁî
cat awk '{print}'
cat -s awk '{blank = NF == 0 ? ++blank : 0; if (blank <= 1) print;}'
tac awk '{t[NR] = $0;}END{for (i = NR; i >= 1; i--) print t[i];}'
grep patten awk '/patten/{print}'
grep -v patten awk '! /patten/{print}'
head awk 'NR <= 10 {print}' 24.sh
head -1 awk '{print; exit; }' 24.sh
tail awk '{t[n++ % 10] = $0}END{for (i = 0; i < 10; i++) print t[n++ % 10];}'
tail -1 awk '{t = $0}END{print t}'
cut -c 10 awk '{print substr($0, 10, 1)}'
cut -d: -f4 awk -F: '{if (NF > 1) print $4; else print;}'
tr A-Z a-z awk '{print tolower($0);}' se.sh
tr a-z A-Z awk '{print toupper($0);}' se.sh
tr -s ' ' awk '{print gensub(" +", " ", "g")}'
tr -d '\012' awk '{printf "%s", $0}'
wc -l &nb
Ïà¹ØÎĵµ£º
¡¡Í¨¹ý SCSI ÃüÁî¹ÜÀí¼ÆËã»úÉϵÄÊý¾Ý£¬²¢½«Êý¾Ý´«Êäµ½ SCSI É豸¡£ÔÚ±¾ÎÄÖУ¬×÷Õß½éÉÜÁËһЩ SCSI ÃüÁÒÔ¼°ÔÚ Linux? ÖÐʹÓà SCSI API ʱִÐÐ SCSI ÃüÁîµÄ·½·¨¡£Ëû½éÉÜÁË SCSI ¿Í»§»ú/·þÎñÆ÷Ä£Ðͺʹ洢 SCSI ÃüÁîµÄ±³¾°¡£½ÓÏÂÀ´½âÊÍ Linux ͨÓà SCSI Çý¶¯Æ÷ API£¬²¢Ìṩһ¸öʾÀý£¬ÌÖÂÛʹÓÃͨÓÃÇý¶¯Æ÷Ö´ÐÐ inquiry ÃüÁîµÄÏ ......
statº¯Êý½²½â£¨×ª£©
±íÍ·Îļþ: #include <sys/stat.h>
#include <unistd.h>
¶¨Ò庯Êý: int stat(const char *file_name, struct stat *buf);
º¯Êý˵Ã÷: ͨ¹ýÎļþÃûfilename»ñÈ¡ÎļþÐÅÏ¢ ......
Linux³£ÓÃÃüÁî²Î¿¼
1. diff
ÓÃÓÚÎļþ±È½Ï¡£Ò»°ãfile1ÊÇÔÎļþ£¬file2ÊÇУ¨Ð޸Ĺý£©µÄÎļþ¡£
½ô´Õģʽ£ºdiff -u file1 file2
diff -u file1 file2
--- file1 2010-03-06 02:11:43.000000000 +0000
+++ file2 2010-04-14 10:06:45.000000000 +0000
@@ -21,11 +21,9 @@
eeeeee
ffffff
2222 ......