Avatar of gudii9
gudii9
Flag for United States of America asked on

ls -R vs ls -r

hi,

what is difderence between ls -R vs ls -r

please advise
LinuxLinux NetworkingLinux OS DevLinux Distributions

Avatar of undefined
Last Comment
gudii9

8/22/2022 - Mon
SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Seth Simmons

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Member_2_406981

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
gudii9

ASKER
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?
gudii9

ASKER
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
Your help has saved me hundreds of hours of internet surfing.
fblack61