Sometimes one need to send an email from Linux (automated messages, warnings and so on). The problem is that the content looks strange when received by the email clients. The issue could be related to character encoding and UTF8. Here is a php script I used to send an email with the correct character encoding.

The unix ‘mutt’ command can be used to send an email with attachment: mutt -s “Test message” name@something -a files.tar < message.txt where files.tar is the attached file, and message.txt is the file containing the message. Subject to the email is added with the -s option. In this case: -s “Test message” name@something is the

Create a tar file of files located in a folder: tar -cvf filname.tar foldername/ where: c = create v = verbose f = file filname.tar = the created file ———- To show the content of a tar’ed file: tar -tvf filname.tar ———- extract a file with tar: tar -xvf filname.tar where x = extract v

We needed to collect “Place” information per user from our LDAP server. The problem was that the description of the “Place” came out strangely encoded whenever it contained one of the norwegian characters æ,ø or å. The ldap command: ldapsearch -x -H ldap://ourldapserver.uib.no x121Address=XXXXXX where XXXXXX is the “place” code, gave a place description that