command line

Deleting files with "illegal characters"

In the cross-platform environment of our university, at least three different OS connect to the smb shared group directories. Apparently Macs are able to save files with characters that are not allowed on other platforms and which cannot be easily deleted. Recently we had several files which ended with a '.' (dot) or a ' ' (space), and we were not able to remove them via the GUI. In Windows 7, I managed via the command line with:
delete "file." or
delete "file "

Batch renaming files on the command line

The default command line application for batch renaming files in Ubuntu 16.04 is called "rename":
rename 's/tk98i_/wt_tk98_/' *.tif
It uses Perl regular expressions with and the s/old/new/ syntax. The example above renames all files with the .tif extensions and replaces the th98i_ expression with wt_tk98_.
Here are some more examples: http://tips.webdesign10.com/how-to-bulk-rename-files-in-linux-in-the-ter...

Pages