Pages

Showing posts with label bash script. Show all posts
Showing posts with label bash script. Show all posts

Extract only the number from a file name

Some times you may want to extract only the number from a file name, especially when you are working with a huge number of files to do some calculation or to run jobs.

This can be done by (for foo_bar_xyz_file_01_input.in)
echo $f|cut -d_ -f5
Here, $f is the file name.
-d is the delimeter
-f5 is the field where the number is present.

You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...