Searching and sorting folders

Asked by Nickinasia on 2012-05-31

I have a folder which has within it a huge amount of folders, some which contain music files and some which do not. I want to be able to separate the folders that contain music from the ones that don't so I can delete all the folders that don't contain music. The music is in various formats. I want to keep the music files in their respective folders too. When I use the search function it identifies all the music files in the main folder I am searching in but it does not allow me to perform actions on their parent folders just on the files themselves. I want to be able to sort the folders that contain music from the ones that don't and perform actions on the folders, not the music files inside the folders.

If you aren't clear on what I am trying to achieve please say so and I'll do my best to clarify for you.

I also want to do exactly the same things but with ebook files rather than music files. My guess is that the process will be similar but open to suggestions and ideas.

Cheers and thanks for any help or advice,

NN

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu unity Edit question
Assignee:
No assignee Edit question
Last query:
2012-05-31
Last reply:
2012-06-01

if you run:

are there subfolders of music files etc, or are the files in one flat folder?

Nickinasia (nickrollings-asia) said : #2

I'm not sure what you meant when you wrote "If you run:"

From my initial question,"I have a folder which has within it a huge amount of folders, some which contain music files and some which do not."

The folder is like say "Music Folder" and then inside this folder there are many sub-folders for every album of music I have. There are hundreds maybe thousands of these sub-folders, but only some of them contain music. I want a way of separating the folders that contain music from the ones which do not so I can delete the empty folders and re-add the folders that contain the rest of the music to my collection.

Thanks

NN

Wyatt Smith (wyatt-smith) said : #3

You can easily write a simple shell script to handle this task. Since this is really not a question about ubuntu, I suggest you pose your question on another forum.

One of the following StackExchange Q&A forums can help you if you are not familiar with shell scripting. There are lots of experts that can help and it is a more appropriate forum.

http://stackoverflow.com/
http://superuser.com/

Can you help with this problem?

Provide an answer of your own, or ask Nickinasia for more information if necessary.

To post a message you must log in.