Basic Unix Tools descriptions

Unix some basic tools are use to do basic work like find a file, locate a file, set the date and time, display calendar, etc. It is important for every Linux and Unix user. It is so much important tools.

There are a number of basic Unix tools. Some of them are list below.

zcat / zmore
bzip2 / bunzip2
bzcat / bzmore

Now we will describe basic unix tools. This tools are very helpful for expert public. It is most important for every server linux or unix users.

Linux find command

find command help us to find a particular file within a directory. It is also use to find a list of files having same pattern name. You can practice the command on your terminal now.

find command we may use following symbols :

(.) : For current directory name
(/) : For root

Finding command By Name

Now you can search all the files ending with extension ‘.txt’.

Like example of :

# find . -name “*.txt”

Look your terminal after run the command, all the files ending with ‘.txt’ are list with find command.

Finding By Type

‘-type‘ parameter is use to specify the file type.

Some of the file types are:

f: regular file

d: directory

l: symbolic links

c: character devices

b: block devices

Like example of :

# find . -type d -name “*.bak”

See your terminal after run the command, command (find . -type d -name “*.bak”) displays all the directories ending with ‘.bak’.

Finding Newer Files

The command -newer parameter helps in searching the files which are newer than the mentioned file.

Like example of :

# find . -type d -name ?*.bak?  

See your terminal after run the command, all the files displayed are newer than ‘msg.txt’ file.

Linux locate command

The locate and find are use to search a file by their filename. Here difference is that locate command is a background process and searches the file in database whereas.

find command searches in filesystem. The command locate is much faster than find command.

Now you can are unable to find a file with locate command.

Then it means that your database is out of date, and you can update your database with the updatedb command.

Sample syntax of locate command :

# locate <file name>

Like example of locate command :

# locate sysctl.conf

Look your terminal after run the command, command “locate sysctl.conf” has displayed all the locations of file ‘sysctl.conf’.