file

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 "

How to determine and convert text file encoding (file, enca, iconv)

To determine the file type of the file "sample.txt" you just type:
file sample.txt
Usually it'll tell you only that it is a text file. To get to know more about the encoding type:
enca -L none sample.text
The -L switch tells the program what language is used in the file. If you don't know, just use none.
To convert the encoding from ISO-8859-1 (latin1) to UTF-8:
iconv --from-code=ISO-8859-1 --to-code=UTF-8 sample_iso8859-1.txt > sample_utf-8.txt