Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Are the commands' options case sensitive? i.e.

I did

rm -r directory

And

rm -R directory

And I got the same results, whereas when I did

ls -r directory

and

ls -R directory

I got different answers.

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

This is what man pages are for

ls:

http://manpages.ubuntu.com/manpages/raring/man1/ls.1.html

-r, --reverse reverse order while sorting

-R, --recursive list subdirectories recursively

rm:

http://manpages.ubuntu.com/manpages/raring/man1/rm.1.html

-r, -R, --recursive remove directories and their contents recursively

So with the command rm, -r and -R are the same, but not so with ls

share|improve this answer
add comment

Yes, almost everything in Linux is case sensitive.

For example, in your ls command,

   -r, --reverse
      reverse order while sorting

   -R, --recursive
      list subdirectories recursively

Also, like in ln:

   -s, --symbolic
      make symbolic links instead of hard links

   -S, --suffix=SUFFIX
      override the usual backup suffix

However, sometimes the upper and lowercase letter options are the same, like in rm:

   -r, -R, --recursive
      remove directories and their contents recursively

It depends on the command. To best find out if upper and lowercase make a difference, always consult the man pages of a command.

share|improve this answer
add comment

The cases only matter if there is another argument in the opposite case. This is usually how it works, so I would keep the case of the argument the same as what command you want

share|improve this answer
    
Not true, depends on the command –  bodhi.zazen Jun 7 '13 at 21:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.