answersLogoWhite

0

I had a similar problem. I needed to find directories containing JPGs but not MP3s. Here's the solution to that:

find . -type f -name *jpg -printf '%h\n'|sort|uniq -c|sed 's/^\s*[0-9]\+\ //' |
while read dir; do
if [ $(find "$dir" -name *mp3 | wc -l) -eq 0 ]; then
echo $dir;
fi;
done


From this the solution to your problem would become:


find . -type d |
while read dir; do
if [ $( find "$dir" -name | wc -l ) -eq 0 ]; then
echo $dir;
fi;
done

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How long can the total path to a particular file be in Linux from root directory?

4096


What is the main file directory in Linux?

It is the Home Directory.


How do you move files to a directory in Linux?

mv file /path/to/directory


What is the name of the Linux top level directory of the file system?

The /, or root directory.


What is the Linux Filesystem hierarchy used for?

The Linux Filesystem Hierarchy is used to help determine the file structure in the Linux Operating System. It defines the Directory structure and directory contents.


What does drwxrw-r-- in Linux mean?

This is a display of file permissions. In particular, it means:drwxrw-r-- - The specified object is a directory, not a filedrwxrw-r-- - The file / directory can be read by its ownerdrwxrw-r-- - The file / directory can be modified by its ownerdrwxrw-r-- - The file / directory can be executed as a binary by its ownerdrwxrw-r-- - The file / directory can be read by members of the specified groupdrwxrw-r-- - The file / directory can be modified by members of the specified group.drwxrw-r-- - The file / directory cannot be executed by members of the specified group.drwxrw-r-- - The file / directory can be read by others not in the group.drwxrw-r-- - The file / directory cannot be modified by others not in the group.drwxrw-r-- - The file / directory cannot be executed by others not in the group.


What are hardlinks and softlinks used for in Linux?

Alternate references to a file/directory.


How do you delete a file or directory in Linux?

rm filenameorrm -r directoryname


What does a dot preceding a file name in Linux mean?

It means that the file or directory is used for application settings.


Which Linux folder is the default location for the Apache file directory?

/etc/apache2


How deep should a file directory be on a Computer?

There's no particular requirements on how deep a directory needs to be or should be. The directory can be any depth, subject to file system limitations.


How do you serch 10 biggest file in specific directory on Linux system?

If the directory you're interested is my_dir, then do: du -sk my_dir/* | sort -nr | head