Skip to main content
  1. Posts/

Basic file archiving and compression on linux

·1 min
  1. Archiving a file

    $ tar -cvf filename.tar foldername/location  
    	`-c` create  
    	`-v` verbos output  
    	`-f` set a filename/filelocation  
    
  2. Compressing a file
    a. To compress a file:

    $ gzip filename.tar    
    

    b. Show the file:

    $ ls  
    
  3. Extracting a compressed file
    To unzip and extract a file:

$ tar -xzvf filename.tar.gz