Difference B/w Tar Command

Taking care of your Linux box.

Difference B/w Tar Command

Postby refra » Tue Mar 01, 2011 1:56 pm

AOA,

what is the difference b/w the following commands:

tar -cvp -f /dev/rmt0 /home

OR

tar -cvpf /dev/rmt0 /home
refra
Naik
 
Posts: 69
Joined: Wed Dec 06, 2006 3:51 pm

Postby lambda » Tue Mar 01, 2011 3:24 pm

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"?
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Postby refra » Wed Mar 02, 2011 11:08 am

Means ?

Please brief
refra
Naik
 
Posts: 69
Joined: Wed Dec 06, 2006 3:51 pm

Postby mudasir » Wed Mar 02, 2011 6:01 pm

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
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Postby khizer » Thu Mar 10, 2011 12:51 pm

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.
khizer
Lance Naik
 
Posts: 20
Joined: Fri Feb 25, 2011 2:40 am
Location: Sharjah


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 2 guests

cron