I don't know if this is possible but here is goes:
I want to run this command: ls -laR /
I'd like to search each directory at / except for one.
For example we have: /var
/etc
/tmp
/flash
/shares
I would like to get the output of the recursive search for every directory but /shares. Does anyone know if there is a way to exclude a directory?
Help with the Linux ls command....
Moderator: Thanas
- TrailerParkJawa
- Sith Acolyte
- Posts: 5850
- Joined: 2002-07-04 11:49pm
- Location: San Jose, California
Help with the Linux ls command....
MEMBER of the Anti-PETA Anti-Facist LEAGUE
Why is there a /shares? /flash normally is under /mnt
Anyway, try
There may be a way to exclude stuff with one command, but this works.
There's also a third-party tree program.
Anyway, try
Code: Select all
ls / |grep -v shares|xargs ls -laR
There's also a third-party tree program.
ah.....the path to happiness is revision of dreams and not fulfillment... -SWPIGWANG
Sufficient Googling is indistinguishable from knowledge -somebody
Anything worth the cost of a missile, which can be located on the battlefield, will be shot at with missiles. If the US military is involved, then things, which are not worth the cost if a missile will also be shot at with missiles. -Sea Skimmer
George Bush makes freedom sound like a giant robot that breaks down a lot. -Darth Raptor
- TrailerParkJawa
- Sith Acolyte
- Posts: 5850
- Joined: 2002-07-04 11:49pm
- Location: San Jose, California
There is /shares directory because this is a NAS box running a modified form of Linux. The /shares directory could have 0 files if it is fresh out of the box, or hundreds of thousands of files if it is a production server.
Thanks for the tip, I'll try that syntax and see if it works.
Thanks for the tip, I'll try that syntax and see if it works.
MEMBER of the Anti-PETA Anti-Facist LEAGUE