The Linux date, cal, sleep, time, zcat, bzip2, bzcat, df command Introduction

Unix and Linux Command date is displays date, time, time zone, etc.

Sample syntax of date command :

# date

See your terminal, current date of our system is displayed with date command.

Date Format

Now you can display the date in a format of your choice. For this check the man page of date with man date command.

See your terminal after run the command, date is displayed in different format.

Linux cal command

cal’ term stands for calendar. It displays current month’s calendar with current day highlighted.

Sample syntax of cal command :

# cal

See your terminal after run the command, cal command has highlighted current date in current month.

Displaying Past Or Future Month

Now we can also display past or future year’s month with cal command.

Sample syntax of cal command :

# cal <month> <year>

See your terminal after run the command. You can show your calendar.

Linux sleep command

The Linux sleep command let the terminal wait by the specified amount of time. By default it takes time in seconds.

Sample syntax of sleep command :

# sleep

Like example of sleep command :

# sleep 5

Look at the above your terminal, our terminal waits for 5 seconds.

Linux time command

Command time is displays how long it takes to execute a command.

Like example of sleep command :

# time  
# time sleep 5  
# time date  

Look at the above your terminal, command “time” is very fast, command “time sleep 5” takes some time in displaying output but takes little CPU time and command “time date” takes a little time.

Linux zcat command

The Compressed files or zipped files can be viewed with the help of ‘zcat’ command.

Sample syntax of zcat command :

# zcat <filename>

Like example of zcat command :

# zcat acb

See your terminal after run the command, command “zcat acb” displays file ‘acb’ while cat command shows an error.

Here: zmore and zless works same for zipped files as more and less command works for unzipped files.

Linux bzip2 command

The Linux and Unix bzip2 is also used to compress a file like gzip command but takes a little more time but compresses better. Its extension will be (.bz2).

Sample syntax of bzip2 command :

# bzip2 <filename>

Like example of bzip2 command :

# bzip2 acb

See your terminal after run the command, bzip2 command has compressed file ‘acb’ with extension (.bz2). bunzip2

The Linux command bunzip2 decompress a file like gunzip command.

Sample syntax of bunzip2 command :

# bunzip2 <filename>

Like example of bzip2 command :

# bunzip2 acb.bz2

See your terminal after run the command, bunzip2 command has decompressed file ‘acb.bz2’.

Linux bzcat command

Th command bzcat will display the files compressed with bzip command.

Sample syntax of bzcat command :

# bzcat

Like example of bzcat command :

# bzcat acb.bz2

See your command after run the command, bzcat displayed the bzip compressed file ‘acb.bz2’.

Linux df command

Unix or Linux df command tells about the disk space used in the file system. The number of blocks used defines, number of blocks available and the directory where file system is mounted.

Sample syntax of df command :

# df

See your terminal after run the command, the ‘df’ command displays number of blocks used and available and the directory where file system is mounted.

Leave a Reply