I'm having a little trouble putting this all together...
I want to make a simple shell script to organize and sort around 60 GB worth of music and movie files that are spread out over 3 or for 4 directories.
I need to separate the .mp3
, .wma
, Video, etc. files from the erroneonus files and junk don't need. I want to send these straight into a new directory with the audio and video files separated. I'm moving them too a new psychical device, a SD card I bought. I want to accomplish all this from the terminal.
My question is this.. what is the best way to chain all these commands together?
Do I use grep to search for files that end with a suffix str
like .mp3
and then pipe the results of that >> to anewfile.txt
?
Or would find
be better for that task? Or neither?
I've read documentation for countless hours before asking, because I don't want to waste anyone's time but nothing I try works. I can't seem to get a comprehensive result on my own. When I try and put all of this into a comprehensive practical script to do some simple file manipulation, it fails. I get lost in the man pages.. I need dialogue with folks who I have experience.
This is what my stuff looks like:
cd Volumes/../music/*filesIwant* ; grep -i `'.mp3, .wma'` >> '*new.dir/\Music \Movies*
And frankly a lot of variations of stuff like that can't get it flow...
Any help would be greatly appreciated.
This is what my scripts look like
cd ../hdd_music/ ; cp
My question: Is this the best way?
bash
andzsh
? These are two largely different shells.