- Archives (compress, extract and so on)
tar cvf archive_name.tar dirname/ # create a new tar archive named archive_name by packing all stuff from dirname
tar xvf archive_name.tar # extracting from existing tar archive
tar tvf archive_name.tar # view an existing tar archive
grepcommand
grep -i "the" demo_file # search for a given string in a file
grep -r "ramesh" * # search for a given string in all files RECURSIVELY
find
find -iname "MyProgram.c" # find files using file-name(case in-sensitive)
find -iname "MyCProgram.c" -exec md5sum {} \;
sed– Stream editor
when copy a DOS file to Unix, one could probably find \r\n at the end of each line. the following command converts the DOS file formate to Unix file format using sed command
sed 's/.$//' filename
between '', it is regular expression, follows pattern s/{been_replaced}/{using_this_to_replace}
awk– tool to process or analyze text files
the basic format of an awk command looks like this:
awk 'pattern {action}' input-file > output-file
using awk command can remove duplicated lines, print specific field from a file and so on.
awk has 8 built-in variables, you can refer to this post