1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| cat file1 file2 ... | command <> file1_in.txt_or_file1_out.txt
cat file1 | command( sed, grep, awk, grep, etc...) > result.txt
cat file1 | command( sed, grep, awk, grep, etc...) >> result.txt
grep Aug /var/log/messages grep ^Aug /var/log/messages grep [0-9] /var/log/messages grep Aug -R /var/log/*
sed 's/stringa1/stringa2/g' example.txt sed '/^$/d' example.txt sed '/ *#/d; /^$/d' example.txt echo 'esempio' | tr '[:lower:]' '[:upper:]' sed -e '1d' result.txt sed -n '/stringa1/p' sed -e 's/ *$//' example.txt sed -e 's/stringa1//g' example.txt sed -n '1,5p;5q' example.txt sed -n '5p;5q' example.txt sed -e 's/00*/0/g' example.txt
cat -n file1 cat example.txt | awk 'NR%2==1' echo a b c | awk '{print $1}' echo a b c | awk '{print $1,$3}' paste file1 file2 paste -d '+' file1 file2
sort file1 file2 sort file1 file2 | uniq sort file1 file2 | uniq -u sort file1 file2 | uniq -d
comm -1 file1 file2 comm -2 file1 file2 comm -3 file1 file2
|