Linux Basic Commands E-mail
Article Index
Linux Basic Commands
Page 2
Page 3
Page 4

Directory Navigation Command

cd - : Go to previous directory

cd : Go to home directory

mkdir : Making Directory in linux

mkdir [options] directories

OPTIONS:

-m :Set the access mode for the new directories.
-p :Create intervening parent directories if they don't exist.
-v :Print help message for each directory created.

tar: command is used to create archive and extract the archive files.

SYNTAX:

tar [options] [archive-file] [File or directory to be archived]

OPTIONS:
-c : Creates Archive
-x : Extract the archive
-f : creates archive with give filename
-t : displays or lists files in archived file
-u
: archives and adds to an existing archive file
-v : Displays Verbose Information
-A : Concatenates the archive files

Example:-

tar-vxf my_file.tar

tar: the command
vxf: the options
v: provides a description of the unpacked files(optional)
x: to extract the files
f: to designate the archive containing the files (given parameter)
my_file.tar: the name of the archive to retrieve

The gzip and gunzip Commands

The gzip program compresses a single file. One important thing to remember about gzip is that, unlike tar, it replaces your original file with a compressed version

Examples

gzip f1.txt

In the above example command this would compress the f1.txt file as f1.txt.gz in the current directory.

gunzip  f1.txt.gz

In the above example command it would extract the f1.txt from f1.txt.gz.

The bzip2 command is used for compressing and decompressing files.

Data compression, also referred to as just compression, is the process of encoding data using fewer bits.

Example:-

    tar -cf file7.tar file4 file5 file6
    bzip2 file7.tar



 

Translate

English French German Hindi Italian Portuguese Russian Spanish

Enter your email address :