ls -R vs ls -r

hi,

what is difderence between ls -R vs ls -r

please advise
LVL 7
gudii9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
The information is easily accessible man ls
Look for the description of option -r and -R

Please look into using man <command>
man -k <keyword>
The above will return a list that match the keyword criteria.
Seth SimmonsSr. Systems AdministratorCommented:
from the manual...

-r, --reverse
              reverse order while sorting

-R, --recursive
              list subdirectories recursively

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
andreasSystem AdminCommented:
Or just try it out. Its obvious.

ls

ls -r

ls -R
gudii9Author Commented:
how to test it here
https://www.tutorialspoint.com/unix_terminal_online.php

sh-4.4$ touch 123.txt                                                                                                                              
sh-4.4$ vi 123.txt                                                                                                                                
sh-4.4$ grep -o -b "a" 123.txt                                                                                                                    
0:a                                                                                                                                                
1:a                                                                                                                                                
2:a                                                                                                                                                
3:a                                                                                                                                                
4:a                                                                                                                                                
sh-4.4$ grep -o -b "a" 123.txt|paste -s                                                                                                            
0:a     1:a     2:a     3:a     4:a                                                                                                                
sh-4.4$ touch 456.txt                                                                                                                              
sh-4.4$ ls -r                                                                                                                                      
README.txt  456.txt  123.txt                                                                                                                      
sh-4.4$ ls -R                                                                                                                                      
.:                                                                                                                                                
123.txt  456.txt  README.txt  


it shows pretty similar results though?
gudii9Author Commented:
i see difference
ls just shows with ascending order of file names
ls -r sorts in reverse way and shows
ls _R showing inside files as well for some directories there recursively
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.