Transcription of UNIX / Linux Shell Cheat Sheet
{{id}} {{{paragraph}}}
A full PDF and online tutorial is available at 7 Aug 2007 UNIX / Linux Shell Cheat SheetFile ManipulationTest OperatorsVariable Substitution> filecreate (overwrite) file>> fileappend to file # do something>file 2>&1both output and errors to file${V:?err}$V, or err if unset< fileread from filea | bpipe output from 'a' as input to 'b'Numeric TestsConditional Executionless thanc1 || c2run c1; if it fails, run c2 Common Constructsgreater thanc1 && c2run c1; if it works, run c2while read fequal todoread textnot equalCommon utilities and switches echo Line is $f file line greater or equallist files, biggest lastdone < fileby lineleless or equallist files, newest lastFile Testsdirectory sizes (slow)findnewer thansort -nsort numerically (not alpha)matchingdis a directorylist my commandslinesf is a filedownload URLrreadableget fieldwwriteabletouch filecreate filewith delimiterxexecutableread xread x from keyboardget outputString Testsof command=equal tozzero lengthn not zero lengthNetworking a) case is a goodlist all network interfacesway to avoidLogical Testsshow routers ;;iterating&&logical ANDlog in to host as user u b)through many||logical OR!
A full PDF and online tutorial is available at http://steve-parker.org/sh/sh.shtml v1.1 – 7 Aug 2007 UNIX / Linux Shell Cheat Sheet File Manipulation Test Operators ...
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}