
What does this mean and what do I do with it? Learn LInux: 8 - Using Commands: mv,rm,wc,who,sort.FAQ Answer I am downloading a file through ftp that has ".tar," ".tar.gz," or ".tgz" in the filename.

Unable to use a partition, even after formatting i.Handling the various of packages like.That covers the major types of files we will come across in Linux. Those the major files that we will come across in Linux.
#Bundle files with tar install#
To install using this package run the following rpm -ivh "filename".rpm These packages are basically installation packages used in red hat based systems. deb packages are basically installation packages which can be installed using the following dpkg -i "filename".deb deb packages are debian packages, they can be used only in debian based systems like Ubuntu or Linux Mint. bin files are basically installation files, which can be run as. This can be done using the chmod command as chmod 777. To run the installation you need to give it execute permission. bin files are bascially installation files. To compress a file using bunzip we need to use the bzip2.įor bzip2 will create a file of the format "2". To unzip a file compressed in the bunzip format add option "-j" to the tar commands.Īssume we have a file named 2, which is a bunzip compressed tar -jxvf output is similar to what we have seen while extracting the "gunzip" archive, a list of files being extracted. The files compressed using bunzip are of the format ".tar.bz2". Similar to gunzip, there is another tool that is often used for compression, i.e. tar file into a file of the format "tar.gz". To create a compressed file out of a tar file, we can make use of the command gzip.įor gzip above command should "zip" the. If the command executes succeefully, a folder by the name folder1 should be visible in your current directory. To extract them we will have to use the option "-z" with the "tar" command.Īssume we have a file tar -xzvf command would prodcue a list of files that it is extracting.

".tgz" or ".tar.gz" are ".tar" files that are compressed using the gunzip tool. That is why often you will come across files of the format To compress the size you can use tools like "gunzip" or "bunzip". ".tar" files are just archives and generally do not compress the size of the folders. f: To indicate that the filenames are being passed on the command line. v: Verbose, that is why the file names were printed on the screen. You can untar this file using the previously discussed command and the folder1 would appear with the three folders and the respective files in it. To create a ".tar" file of the folder1 run the following tar -cvf folder1.tar you run the ls command now, you should be able to see a file named "folder1.tar" which is an archived file containing all the files of your folders. "three_1",three_2" and three_3" in folder "three"
#Bundle files with tar archive#
Then you can make use of the "tar" command.Ĭreating a "tar" archive retains the folder structure and when you untar the "tar" archive, all the files and folders would be untarred with exactly the same hierarchy.Īssume we have a folder called "folder1" which has 3 folders named "one" "two" and "three" and each of these folders in turn have a files named "one_1", "one_2" ,"one_3" in folder "one". In case you have a huge set of files, with directories and subdirectories which you want to keep intact but still create a single compressed file of all the files. This would by default would be extracted to the present directory with the same name as the ".tar" file name i.e. Let us assume we have a file named "folder1.tar" which we want to untar.įor tar -xvf above example the output shows that the files that were extracted were "folder1" that had "file1" and "file2" in it. f:Indicating that the file name is being passed on the command line. v: Verbose, prints on the terminal the names of the files extracted "tar" is the command to handle the ".tar" files. On command line such files are untarred using the command tar To get the contents out of such a file, in case of the new distros like ubuntu you can just right click on the file and select "extract here" or open using "archive manager" and extract it to where ever you want.

#Bundle files with tar how to#
Aim: To make aware the reader how to handle various kinds of packages in linuxĪ file with ".tar " extension is basically a collection of files and folders put into one package, which is some times called as a tar ball.
