Backup your data using TAR .
Backing up your data might be a nightmare . While we creating a tarball , we may added another file in to it , Also its a dream to extract a specific file from it , but its not true , Linux is like a wand with all spells in it .
1 . tar -cf outputfilename.tar source_files
eg : tar -cf output.tar *
This will create a tar ball of the files that are present in the current directory .
2 . tar -tf output.tar
This will list all the files that are been presented in the tar file .
tar -tvf output.tar - to list files with more details
3 . tar -xf output.tar
To extract the files from the tarball .
4 . tar -xvf output.tar filename - filename corresponds to the file in output.tar .
5 . tar -xf output.tar -C location - to extract files in to the location [directory]
6 . tar -rvf output.tar file.pdf - Its simple to add another file into a tarball .
7 . tar -tf -u output.tar file.pdf - -u is for checking the duplicates in the file . So that while using the above command file.pdf is not been added again . It will neglect it silently .
8 . tar -cf output.tar *.c - to include all the files with the extension .c will be added to output.tar .
9 . tar -cf output.tar --exclude "*.c" - to exclude all the files that ends with extension .c .
10 . tar -df output.tar - to find difference between files .
For video reference : see here
1 . tar -cf outputfilename.tar source_files
eg : tar -cf output.tar *
This will create a tar ball of the files that are present in the current directory .
2 . tar -tf output.tar
This will list all the files that are been presented in the tar file .
tar -tvf output.tar - to list files with more details
3 . tar -xf output.tar
To extract the files from the tarball .
4 . tar -xvf output.tar filename - filename corresponds to the file in output.tar .
5 . tar -xf output.tar -C location - to extract files in to the location [directory]
6 . tar -rvf output.tar file.pdf - Its simple to add another file into a tarball .
7 . tar -tf -u output.tar file.pdf - -u is for checking the duplicates in the file . So that while using the above command file.pdf is not been added again . It will neglect it silently .
8 . tar -cf output.tar *.c - to include all the files with the extension .c will be added to output.tar .
9 . tar -cf output.tar --exclude "*.c" - to exclude all the files that ends with extension .c .
10 . tar -df output.tar - to find difference between files .
For video reference : see here
Comments
Post a Comment