Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Recursive listing is asking to see the listing of the directory tree including your current directory and any directories and their contents below your current directory.
also, instead of "ls -R", you simply type "find". This will list out all files in, and recursively below, your current working directory. One of the advantages of "find" is that it will list out each file's path, relative to the starting point. It can be very handy in certain situations. For example, let's imagine your username is johndoe, typing
Code:
find ~johndoe | less
will list out the full path of every file in and below your home directory and pipe it to less so you can browse it.
-mark
When and why would you need to use it? What benefits are there to using it? Very confused?
Open a terminal, and type "ls"
then type "ls -R"
The difference between the 2 listings should be obvious. You would use the -R option whenever you need the extra information that it provides.
By the way, I don't think that this is really a good example of recursion....I had thought the definition had to do with a program (function) that called itself.
typing "ls" will list the files and directories in your current working directory. But what about the files and the directories inside the directories inside your current working directory. For that matter, what about the files and directories inside the directories inside the directories inside your current working directories. While we are at it, what about the files and directories inside the directories ... inside the directories ... inside the directories ... inside your current working directory - all the way down until there are no directories left to descend into. For that, you use "ls -R".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.