work with tar

tar is tape archive
c- create
v – verbose
f – name of file
# tar cvf /home/user.tar /directoryToBeCreated
# file fileName (show shich kind of file is)
z is for compression to tgz
# tar czf /home/user.tar /directoryToBeCreated
Before check what is in side:
# tar tvf filename
The directory names are relative.
# tar xvf
Ordering is important !!!!
-C switch to specific directory:
# tar xvf archiveName.tar -C /tmp
I’m backup the configuration files and after that If I’m removing a configuration file, I can restore it like this:
# tar xvf /root/etc.tar -C / etc/wgetrc
(I’m using etc/wgetrc in order to extract only a file from archive).


# ls -il /etc/hosts
-l long listing and -i is inode
# ln sourceFile destinationFile
# ln /etc/hosts computers
# ls -s sourceFile destinationFile
# ls -s /etc/hosts computers
On soft links the permissions are differents and in pointing to another inode.
Normal user cannot create hard links for /etc/shadow.
Can link to files where you have at least READ permissions.