1851750 Members
1762 Online
104062 Solutions
New Discussion

Regarding tar command

 
SOLVED
Go to solution
Kavita Poonia
Regular Advisor

Regarding tar command

Hello there,

I just want to make a tar of a directory which contain subdirectories. Which command should I issue for this to have a tar of that directory.

Thanks a lot!
7 REPLIES 7
TT-Atif
New Member

Re: Regarding tar command

Hi
I am not a *nix expert but I use following command to tar a file
tar -cvf file.tar myfile.txt
This command is creating a tar file (file.tar) for the original file (myfile.txt).

Regards
Kavita Poonia
Regular Advisor

Re: Regarding tar command

Thanks a lot Atif for your reply but i want to make tar of a directory containing subdirectories and not a file.
Yngvi Thorfinnsson
Honored Contributor
Solution

Re: Regarding tar command

Hi , by default the tar will also work on all sub-dirs, i.e.:
tar -cvf home.tar /home
will tar all files and directories under /home
(at least on HP-UX systems)
Sajjad Sahir
Honored Contributor

Re: Regarding tar command

see above answer regarding tar
it will tar all files and subdirectories in that directory under home
if u want to extract it u can use tar -xvf command.
Kavita Poonia
Regular Advisor

Re: Regarding tar command

Thanks a lot Yngvi and Sajjad. Your answers were really helpful.
Sajjad Sahir
Honored Contributor

Re: Regarding tar command

if u want to take tar file has some limitation in size so normally in hp-ux peoples are using fbakcup command for backup
it will take more than 2gb size
Kavita Poonia
Regular Advisor

Re: Regarding tar command

Okay!!!!!!!!!
We can use fbackup too