shell

Text Streams and redirection

# program 2> error-to-file
# program 2> /dev/null
# progeam &> output-and-error

sed - Stream Editor

Replace all occurences (g - global) of the word Windows with Linux

# sed 's/Windows/Linux/g' opsys > newopsys

Another example

# sed 's/writable = yes/writable = no/g' /etc/samba/smb.conf > ~/smb.conf

awk - Aho, Weinberger, and Kernighan

Following command will read out the fourth field in /etc/passwd (the group ID) of every user with a listing of “mike”

# awk -F : '/mike/ {print $4}' /etc/passwd

Indices and tables