LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-16-2016, 06:02 PM   #1
MikeJames
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
Recursive use of small r and capital R


why can you use both the capital and lower case r when recursively looking for files?
 
Old 03-16-2016, 06:50 PM   #2
offgridguy
Senior Member
 
Registered: Nov 2015
Location: Alberta Canada
Distribution: Windows10, Debian
Posts: 1,111

Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by MikeJames View Post
why can you use both the capital and lower case r when recursively looking for files?
Do you mean on a Linux system or your Windows 7?
 
Old 03-16-2016, 07:19 PM   #3
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,380

Rep: Reputation: 603Reputation: 603Reputation: 603Reputation: 603Reputation: 603Reputation: 603
Depends on the command and how the developer coded it, if the dev allows -r and -R then you can, try reading the man page for the command in question, whatever that is.
 
1 members found this post helpful.
Old 03-16-2016, 07:35 PM   #4
MikeJames
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
I meant within linux, just taking a class and it's confusing why you could use both the lower and upper case of a letter where most other letters mean two different things, like -a list all filenames where as -A excludes . and .. special files. I'm thinking what Keith replied makes sense with the developer codes it makes sense. Thanks,
 
Old 03-16-2016, 07:53 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Read the documentation.
Always.

For example the "ls" command uses both - for different functions. Each command may be different. Or not. It's maybe boring, but the only way to be sure is to read the doco.
 
Old 03-16-2016, 08:10 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,399

Rep: Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486Reputation: 1486
It is pretty unusual for "-r" and "-R" to mean the same thing in a given command. In ls, "R" means "recursive" and "-r" reverses the sorting order. In [I]cp/I] and rsync, "-r" means "recursive", and I don't offhand know what "-R" means in either one without looking at the respective manpages. OK, I see that in cp they do mean the same thing.

Last edited by rknichols; 03-16-2016 at 08:11 PM.
 
1 members found this post helpful.
Old 03-16-2016, 08:28 PM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,205

Rep: Reputation: 197Reputation: 197
Cool

Quote:
Originally Posted by MikeJames View Post
I meant within linux, just taking a class and it's confusing why you could use both the lower and upper case of a letter where most other letters mean two different things, like -a list all filenames where as -A excludes . and .. special files. I'm thinking what Keith replied makes sense with the developer codes it makes sense. Thanks,
Just take it slowly, Linux commands are case sensitive. You'll get a hang of it once you get you used to it.

Android is also case sensitive since it uses Java, if you keep repeating the same mistake you'll get a hang of it and you will easily remember next time you made the same mistake.

Last edited by JJJCR; 03-16-2016 at 08:47 PM. Reason: edit
 
1 members found this post helpful.
Old 03-16-2016, 08:31 PM   #8
hydrurga
Senior Member
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 18.1 MATE
Posts: 3,073

Rep: Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066
An examination of the grep 2.24 source code from http://git.savannah.gnu.org/cgit/grep.git shows the relevant handling code to be:

Code:
case 'R':
  fts_options = basic_fts_options | FTS_LOGICAL;
  /* Fall through.  */
case 'r':
  directories = RECURSE_DIRECTORIES;
  last_recursive = prev_optind;
  break;
meaning that an -r -R, in whichever order, will end up being the same as an -R.
 
1 members found this post helpful.
Old 03-17-2016, 04:40 PM   #9
MikeJames
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Solved, thanks to everyone
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SUID capital S drManhattan Linux - Newbie 4 05-15-2011 11:40 AM
chmod - need help with options capital D and capital F.. cookiedough Linux - Newbie 4 04-04-2011 08:07 PM
capital letters on Fat32 Four Programming 2 07-21-2008 09:38 PM
Capital i shows up as [ {O_o} Linux - Newbie 0 10-06-2004 08:33 PM


All times are GMT -5. The time now is 11:20 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration