LPIC 103-2 Process text streams using filters¶
Содержание:
cat
— concatenates files and print on the standard output;cat 1.txt 2.txt > 3.txt
cut
— removes sections from each line of files;cut -c 2,3,4,10 1.txt
expand
— converts tabs to spaces;
unexpand
— convert spaces to tabs;
fmt
— simple optimal text formatter;ex.:fmt -w 10 1.txt
— wraps word by 10 symbols length;
head
— outputs the first part of files (-n n-lines
);
tail
— output the last part of files;tail -n 100; tail -f
;
join
— joins lines of two files on a common field (works like DB join);
less
— stream viewer;
nl
— numbers lines of files;
od
— dumps files in octal and other formats;
paste
— merges lines of files by row;
pr
— converts text files for printing;
sed
— stream editor for filtering and transforming text;sed -e 's/changed/new/' 1.txt
— change changed to new.
sort
— sorts lines of text files;
split
— splits a file into pieces;split -l 2 1.txt
;
tr
— translates or deletes characters;echo Hello | tr -t a-z A-Z
returns HELLO;
uniq
— reports or omit repeated lines;
wc
— print newline, word, and byte counts for each file.