What is 'sudo tar -xzf'? Why it is used?
tar
is basically The GNU version of the tar archiving utility
for more information on tar go to the terminal and type man tar
.
You will find out what exactly xzf
is used for. Basically they flags (options) when you run a tar command.
[-]x --extract --get:
-z --gzip:
-f --file F:
The order of this command does matter though.
Basically your command
sudo tar -xzf utorrent-server-3.0-ubuntu-10.10-27079.tar.gz
will extract the tar.gz
archive that you specify as (utorrent-server-3.0-ubuntu-10.10-27079.tar.gz) as root privileges.
tar
is the Swiss army knife of extracting archives. It can handle many different archives, such as tar.gz
, tar.xz
, tar.bz
, tar.bz2
, tar.lz
...
Your command contains the following three options:
-
-x
= extract -
-z
= gzipped archive -
-f
= get from a file, not a tape drive
To find more help on tar, enter tar --help
or man tar
in your terminal.
So your command extracts the archive utorrent-server-3.0-ubuntu-10.10-27079.tar.gz to a directory. It does not install the utorrent server, unlike dpkg -i
or sudo apt-get install
.
tar
archives for programs typically contain Linux binaries, which you can run with './ binary-name'.