LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2009, 12:33 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Rep: Reputation: Disabled
Linux vs. DOS: differences in entering parameters for commands


While learning how to use cp parameters to make cp back up my data as I wanted, I noticed an interesting difference between Linux and MS-DOS, which I was familiar with during its heyday. Using cp in Linux, I wanted the parameters -u, -r and -v, so the syntax was "cp -urv". In DOS,if cp had been the copy command, the syntax of the parameters would be "-u -r -v". I think that makes more sense, because if I looked at "-urv" for the first time and hadn't seen the man page, how would I be sure they were three separate parameters rather than the parameter "urv"?
 
Old 10-26-2009, 12:48 PM   #2
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 52
In some distro, take Gentoo for example, when invoking emerge you might need to add --pretend --verbose to enter parameter 'pretend & verbose'; hence, the emerge -pv is only short form of both parameter.

I guess you get the idea.
 
Old 10-26-2009, 01:34 PM   #3
alphaniner
LQ Newbie
 
Registered: Jan 2009
Distribution: Arch
Posts: 18

Rep: Reputation: 1
Would you prefer it to make more sense the first time, or every other time? You could very well use cp -u -r -v in Linux, but the ability to combine "short options" makes sense in the long run. Like hurry_hui said, the distinction between "short options" and "long options" is - and -- respectively. When I instruct people in the use of *nix, syntax is lesson 0.2.
 
Old 10-26-2009, 03:37 PM   #4
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Original Poster
Rep: Reputation: Disabled
Oh--I didn't know both ways worked.
 
Old 10-26-2009, 05:46 PM   #5
Chromezero
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470

Rep: Reputation: 40
Quote:
Originally Posted by newbiesforever View Post
Oh--I didn't know both ways worked.
They do indeed work. As an example, I use this command from time to time.
Code:
ls -l --color
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the similarity between linux commands and dos commands kamalkirat1 Linux - Software 6 11-21-2008 08:54 PM
Dos Commands under linux? Radiomaan Linux - General 7 02-17-2005 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration