≡ Menu

unix computer

What is Big Iron UNIX Computer?

Question: Often I read about bigiron on mailing lists and the Internet forum. What is Big Iron and how it is related to UNIX system?
[click to continue…]

Unpacking or uncompressing gz files under Linux and UNIX systems

Q. How do I open or uncompress .gz extension file under Linux or UNIX computer?

A. The .gz file extension are created using Gzip program which reduces the size of the named files using Lempel-Ziv coding (LZ77). gunzip / gzip is software application used for file compression. gzip is short for GNU zip; the program is a free software replacement for the compress program used in early Unix systems.

Each file is replaced by one with the extension .gz, while keeping the same ownership modes, access and modification times.

To expand i.e. to Unpacking or uncompressing gz files you need to use gunzip program Or gzip -d or zcat program:

Using gunzip command:
$ gunzip file.gz
$ ls file

Using gzip -d command:
$ gzip -d file.gz
$ ls file

If file extension is tar.gz, type the command:
$ tar -zxvf file.tar.gz
Please note that gunzip can currently decompress files created by gzip, zip, compress, compress -H or pack programs.

See also:

How to: Add or display today’s date from a shell script

Q. How can I display or show today's UNIX computer date from a shell script using echo command? How do I store date command output to a variable?

A. Date command is use to print or set the system date and time under Linux/Unix like operating systems. However some time you need to include today's date in shell script. You need to use command substitution in your shell script to display today's date. Bash/sh shell performs the expansion by executing command and replacing the command substitution with the standard output
of the command, with any trailing newlines deleted. Command substitution allows the output of a command to replace the command name. You can use following syntax:

For example, type the following at shell prompt to display today's date:
$ echo "Today is $(date)"

Today is Sat Jan 28 15:48:11 IST 2006

Here is sample script, that stores today's date in TODAY and hostname in HOST variable:

echo "-----------------------------------------------------"
echo "Date: $TODAY                     Host:$HOST"
echo "-----------------------------------------------------"
# add rest code...

Save above script and execute it. See working shell script that notify admin user if Linux/FreeBSD system load crossed certain limit