50 likes | 157 Views
The | Symbol. Accept stdin. Accept stdin. cmd A. cmd B. cmd C. Generate stdout. Generate stderr. Generate stderr. Generate stdout. Generate stderr. Generate stdout. Example: $ ps – ef | more $ ls | more $ ls sort –r | more. wc (word count).
E N D
The | Symbol Accept stdin Accept stdin cmd A cmd B cmd C Generate stdout Generate stderr Generate stderr Generate stdout Generate stderr Generate stdout Example: $ ps –ef | more $ ls | more $ ls sort –r | more
wc (word count) Definition: Counts words, lines, and characters in a file. Syntax: wc[-lwc] [file. . ] Examples: $ wc /etc/passwd $ wc abcde fghijkl mnoqrstuvwxyz Ctrl-d ls> ls.out | wc -w Enter Enter Enter
head • The head command is used to display the first N lines of a given file Examples: $ head -2 file head [-n] [filename]
tail • The tail command is used to display the last N lines of a given file Examples: $ tail -10 file tail [-n] [filename]