Explore

Loading

Wednesday, February 15, 2012

Unix commands


2.3. Searching with grep
grep Command grep "pattern" filename
command | grep "pattern"
Search Patterns
beginning of line ^
end of line $
any single character .
single character in list or range []
character not in list or range [^]
zero or more of preceding char. or pattern *
zero or more of any character .*
escapes special meaning \
3. C-Shell Features.
3.1 History Substitution
Repeat Previous Command !!
Commands Beginning with str !str
Commands Containing str !?str[?]
All Arguments to Prev. Command !*
Word Designators
All Arguments :*
Last Argument :$
First Argument :^
n'th Argument :n

Unix commands for redirection,pipes,filters


2.1. Command-line Special Characters
Quotes and Escape
Join Words ""
Suppress Filename, Variable Substitution ''
Escape Character \
Separation, Continuation
Command Separation ;
Command-Line Continuation (at end of line) \
2.2. I/O Redirection and Pipes
Standard Output >
(overwrite if exists) >!
Appending to Standard Output >>
Standard Input <
Standard Error and Output >&
Standard Error Separately
( command > output ) >& errorfile
Pipes/ Pipelines command | filter [ | filter]
Filters
Word/Line Count wc [-l]
Last n Lines tail [-n]
Sort lines sort [-n]
Multicolumn Output pr -t
List Spelling Errors ispell

Unix commands-displaying files with less,directory access


1.4. Displaying a File with less
Run less less filename
Next line RETURN
Next Page SPACE
Previous line k
Previous Page b
1.5. Directories
Change Directory cd directory
Make New Directory mkdir directory
Remove Directory rmdir directory
Print Working (Show Current) Directory pwd