for files in `ls`;do newfile=`echo $files | sed "s|^reports_||g"`;mv $files $newfile;done

it's unproved code at the moment, but it gives an idea how to do it.



Phusion wrote:
I need help figuring out how to rename multple files. The files are
named like reports_abcdef_YYYYMMDD.dat, reports_hijklm_YYYYMMDD.dat,
and reports_nopqrs_YYYYMMDD.dat. Here is an example.

Original Filename: reports_abcdef_YYYYMMDD.dat
New Filename: abcdef_YYYYMMDD.dat

Let me know how I can do this. Thanks.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


_______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to