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