, : -
ls {ab*,xyz*}.* | sed '/.jpg/d;/.gif/d'
: -
ls {ab*,xyz*}.* | sed '/.jpg/d;/.gif/d' > shortedFile.txt
How will it work? The command ls {ab*,xyz*}.*will list all files starting with aband xyz, and redirect the output to the command sedusing the command |(pipe) and sed, will delete the file name ending with .jpgand gif.
Hope this helps your
source
share