Difference B/w Tar Command

Taking care of your Linux box.
Post Reply
refra
Naik
Posts: 70
Joined: Wed Dec 06, 2006 3:51 pm

Difference B/w Tar Command

Post by refra »

AOA,

what is the difference b/w the following commands:

tar -cvp -f /dev/rmt0 /home

OR

tar -cvpf /dev/rmt0 /home
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

the first one takes longer to type.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
refra
Naik
Posts: 70
Joined: Wed Dec 06, 2006 3:51 pm

Post by refra »

Means ?

Please brief
mudasir
Captain
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Location: Dubai
Contact:

Post by mudasir »

Hi,

I do not think that there is any difference.

Like you can take below example.

df -h -T -k
df -hTk

both gives the same result.

So issuing commands with options written separately should not make much of difference.

Yes i can say that the position of arguments/options can make difference like in below example.

iptables -nL (shows result)
iptables -Ln (does not show results)

I hope this can clear things a bit.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
khizer
Lance Naik
Posts: 20
Joined: Fri Feb 25, 2011 2:40 am
Location: Sharjah

Post by khizer »

mudasir wrote:Hi,

I do not think that there is any difference.

Like you can take below example.

df -h -T -k
df -hTk

both gives the same result.

So issuing commands with options written separately should not make much of difference.

Yes i can say that the position of arguments/options can make difference like in below example.

iptables -nL (shows result)
iptables -Ln (does not show results)

I hope this can clear things a bit.
Agree 100%

we normally use

Code: Select all

tar -cvpf filename.tar source
this can be confusing as the last option 'f' in -cvpf is for the file name and so it should come at the end followed by the file name. You can use both -vcpf -pvcf and it will work as long as the f is at the end.

Now what some admins (like me) do is (just to make it simple) that: they use options like 'f' that require an input separately like

Code: Select all

tar -cvp -f filename source 
Its more readable this way :)
-Khizer Naeem Mughal

Knowledge is often mistaken for intelligence. This is like mistaking a cup of milk for a cow.
Post Reply