Basic UNIX text manipulation commands:

ctrl + c – stop

ctrl + d – Done with i/p send to program

————————————–
unix syntax;

name [options] args

where name is the command and args are the arguments

————————————–

grep “string” – prints a line with matching string

tail – number ( tail -4) – prints last number of lines ( prints last 4 lines)

head – number – prints out first number of lines

man command – manual of command ex man grep (press q to exit )

sort – sorts the lines alphabetically and according to upper and lower case

grep were | sort – the | takes the results of grep and sends it as the input of sort

cut -d ‘ ‘ -f 1 – takes series of lines and splits it according to the ‘ argument ‘ and gives numbered thing that matches in that line

tr list of char, list or chars – ex tr aeiou eioua here all a is relaced with e and e replaced with I etc.
tr a-z A- Z

sort <file.txt – < means use this as input

sort >file.txt – takes out put and puts it in file.txt

wc – word count ex wc -w <file.txt wc -l <file.txt wc -c <file.txt

curl url – curl http://www.google.com will get google.com and print it in the o/p
curl -o url writes out to the url with contents of the file

This entry was posted on Monday, January 26th, 2009 at 8:52 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply