Need some assistance with the find command
I would like to search through a hierarchy of directories and display all directories that DON'T contain a certain file structure. Is this possible to do with just the find command or will I have to create a script to do it?
In addition, I would like to search through the same hierarchy and find any directories that are only 3 levels deep. For example: root - home +- username ++- Pictures +++- folder1 ++++- folder2 So, let's say I wanted to search the Pictures directory. folder1 is okay, folder2 is okay but I don't want any directories any deeper than that. So, I would like to find any directory that is folder3 or deeper and list it so that I can go through and manually sort my pictures. |
Hi
How about find -maxdepth http://www.linux.com/learn/tutorials...using-gnu-find find Pictures -maxdepth 2 -name file |
Try this
du -h Pictures --max-depth=2 find Pictures -maxdepth 2 -exec ls -ld {} \; |
I knew about max depth, but I really want to show everything that is level 3 or higher. Not a maximum of level 2.
|
All you need is find cmd. Just go through it's manual page: http://linux.die.net/man/1/find and it has all answers.
Search according to files hierarchy: Quote:
Quote:
|
All times are GMT -5. The time now is 11:54 AM. |