tar and remove files simultaneously.

General chat concerning linux or linuxzoo.

Moderator: drgrussell

Post Reply
raghur77
Posts: 1
Joined: Tue May 05, 2009 9:33 am
Are you a robot or a human?: Human

tar and remove files simultaneously.

Post by raghur77 » Tue May 05, 2009 9:36 am

Hi All,

is there any option to tar the files and remove it simultaneously.
Please give me an example or syntax.
thanks in advance.

drgrussell
Site Admin
Posts: 426
Joined: Sat Feb 12, 2005 8:57 pm
Are you a robot or a human?: Human

Re: tar and remove files simultaneously.

Post by drgrussell » Wed May 06, 2009 5:16 pm

--remove-files

The man command is your friend...

Code: Select all

[gordon]$ ls
a  b
[gordon]$ ls -l
total 0
-rw-rw-r-- 1 gordon gordon 0 2009-05-06 17:14 a
-rw-rw-r-- 1 gordon gordon 0 2009-05-06 17:14 b
[gordon]$ tar cvf out.tar --remove-files a b
a
b
[gordon]$ ls
out.tar
[gordon]$
Gordon.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest