How can I get the list of only filenames and remove directory and subdirectories using find, sed, awk, cut or any.
For e.g : I get list of all media files using find as such:
find /var/warehouse/* -type f \( -name "*.avi" -o -name "*.mkv" -o -name "*.flv" -o -name "*.mp4" \) -exec ls {} +
Output:
/var/warehouse/movies/Blade/The.Bucket.List[2007]DvDrip-aXXo.avi
/var/warehouse/movies/Blade/The Lion King (1994).mkv
/var/warehouse/movies/Blade/The.Pursuit.of.Happyness.2006.DVD5.720p.BluRay.x264-REVEiLLE.en.mkv
/var/warehouse/movies/Blade/The Secret [Dual Audio] Upscaled 720p Ripped by FÅM€.mkv
/var/warehouse/movies/Blade/Yes.Man.2008.DvDRip-FxM.avi
/var/warehouse/movies/Bollywood/Bhaag Milkha Bhaag - DVDScr - XviD - 1CDRip - [DDR].avi
I wanted output as:
The.Bucket.List[2007]DvDrip-aXXo.avi
The Lion King (1994).mkv
The.Pursuit.of.Happyness.2006.DVD5.720p.BluRay.x264-REVEiLLE.en.mkv
The Secret [Dual Audio] Upscaled 720p Ripped by FÅM€.mkv
Yes.Man.2008.DvDRip-FxM.avi
Bhaag Milkha Bhaag - DVDScr - XviD - 1CDRip - [DDR].avi