Show folder and only one subfolder using ls in command line
So I have many folders with many subfolders. All I want it to get the folder name and the first subfolder. I tried using ls -R but this give me more than I want it.
Let say I have:
All I want when I execute the command is to show me:
I don't think you can do that with ls, but you can with find:
That was my first guess but maxdepth or the depth option dont work .....give me an argument error
How about showing us the exact command you used? It sounds like you have a syntax error somewhere.
This should work in simple cases, but will throw an error if there are no subdirectories to match.
Which leads me to the big question...what do you need this for? If you tell us what your true goal is, it may be that there's a better solution.
Thanks that's what I wanted
|All times are GMT -5. The time now is 07:53 PM.|