Sunday, July 13, 2014

Uncompressing files in linux

gzip Compressed files: 
.gz
.tar.gz
.tgz

To uncompress these files
$ gunzip file.gz
$ tar -zxvf file.tar.gz
$ tar -zxvf file.tgz

bzip Compressed files:
.bz2
.tar.bz2

To uncompress these files
$bunzip2 file.bz2
$tar -xvfj file.tar.bz2

xz Compressed files:
.xz
.tar.xz
To uncompress these files
$xz --decompress file.xz
$tar -xfvJ file.tar.xz

Uncompressing zip files
$unzip file.zip

Tuesday, January 28, 2014

grep command in Linux

grep (Options) "Search String” path/folder
Options:
-i Case insensitive search
-r Recursively search the sub directories
-n Prints the line number

Also we can use:
find . |xargs grep -rn "search string" *