Skip to main content

Posts

Showing posts with the label awk

Linux and Unix - Manipulating Files

Below is some common commands that I would like to know better so figured, why not and made a post about them: wc -w <file> #This counts the amount of words in a file. wc -l <file> #This counts the number of lines in a file. head <file> #This reviews the first set of text at the beginning of the file. It can be piped out to more using "| more" . tail <file> #Same as above but the end of thr file. This is commonly used to go ahead and tail a log file and watch it as it does stuff, for this however it requires the -f switch. grep <option> <keyword> <file(s)> #Here is where things get a little more complciated. With Grep you can either search files for certain keywords with no options or using options such as -<num> to view num of lines before and after where it was found, or -i for searching without case sensitivity. Keep in mind you can also search many files just using wildcards. sed '/<text...