Single Post

Header

Wednesday, September 2, 2015

gunzip , tar , unzip commands in Unix/Linux - with Examples

gunzip and tar commands in Linux  (file.tar.gz)

[admin@localhost Desktop]$ ls
linux_grep      new       new file~        practice       test1.txt
linux_grep.txt  new file    sample.tar.gz
[admin@localhost Desktop]$ gunzip sample.tar.gz
[admin@localhost Desktop]$ ls
linux_grep      new       new file~        practice    test1.txt
linux_grep.txt  new file    sample.tar
[admin@localhost Desktop]$ tar -xvf sample.tar
sample/
sample/amiga/
sample/amiga/match.a
sample/amiga/Makefile.gcc
sample/amiga/Makefile.sasc
sample/amiga/tailor.c
sample/amiga/utime.h
sample/atari/

[admin@localhost Desktop]$ ls
sample      new          test1.txt
linux_grep      new file   practice      
linux_grep.txt  new file~  sample.tar
Unzip Command in Linux

[admin@localhost Desktop]$ cp testfolder.zip  practise/
[admin@localhost Desktop]$ cd practise/
[admin@localhost practise]$ ls
sample1.txt  test1  test1.txt  testfolder.zip

[admin@localhost practise]$ unzip testfolder.zip
Archive:  testfolder.zip
   creating: test folder/
 extracting: test folder/test1.txt 
 extracting: test folder/test2.txt

[admin@localhost practise]$ ls
sample1.txt  test1  test1.txt  test folder  testfolder.zip

No comments:

Post a Comment