To compress an entire folder and its’ contents in Linux you use the tar, (Tape ARchive), command.  The tar command is used as follows:

tar -zcf archive-name.tar.gz /home/andy/temp

Where:

  • z: compress archive using gzip program
  • c: create archive
  • f: archive file name

The command above will create a new, compressed, archive file called archive-name.tar.gz in current directory. The contents of the archive file will be the contents of the /home/andy/temp folder.

In order to restore your archive then you need to use following command (it will extract all files in current directory):

tar -zxf archive-name.tar.gz

Where,

  • -x: Extract files

It’s possible to create an ISO from either the original media or from files that already exist on your PC.

To make an ISO from your CD/DVD, place the media in your drive but do not mount it. If it automounts, unmount it.  Now use one of the following commands based upon the type of drive your have:

 # for dvd
 dd if=/dev/dvd of=dvd.iso
 # for cdrom
 dd if=/dev/cdrom of=cd.iso
 # if cdrom is scsi
 dd if=/dev/scd0 of=cd.iso

To make an ISO from files on your hard drive, create a directory which holds the files you want. Then use the mkisofs command.

 mkisofs -o /tmp/cd.iso /tmp/directory/

This results in a file called cd.iso in folder /tmp which contains all the files and directories in /tmp/directory/.  If, however, you want to make a DVD video then you need to use the following command:

 mkisofs -dvd-video -udf -o /tmp/cd.iso /tmp/directory/

For more info, see the man pages for mkisofs, losetup, and dd, or see the CD-Writing-HOWTO at http://www.tldp.org.

This command will give you a detailed breakdown of the memory installed in your system.

sudo lshw -C memory

If you need to see a list of the available partitions, (whether they’re mounted or not), in a Linux machine use the following command:

sudo fdisk -l

the ‘l’ parameter  is used to ‘list’ the available partitions.  If you need to see a list of the available ‘mounted’ partitions then use this command:

df -h

The ‘h’ parameter changes the output from the ‘df’ command so that it is ‘human’ readable.

Follow

Get every new post delivered to your Inbox.