Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

ls -R vs ls -r

hi,

what is difderence between ls -R vs ls -r

please advise
SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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?
Avatar of 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