Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In the Windows operating system I can use unusual characters in the file name by typing the decimal code of the character in the number pad. This way I can access all of the characters in the character set, even if the character doesn't have a corresponding keyboard key.

Is there a way to do something similar using Linux?

share|improve this question
1  
Perhaps you're referring to unicode input ?. Here's how you do it on most desktop systems: en.wikipedia.org/wiki/Unicode_input –  nos Oct 1 '11 at 1:38
add comment

migrated from stackoverflow.com Oct 1 '11 at 4:05

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 0 down vote accepted

Probably not the ideal solution, but you can simply use printf to embed the characters. For example, to create a file named 'A' (octal 101), you can do:

$ touch "$(printf '\101')"
share|improve this answer
    
Or, touch $'\101' in bash. –  grawity Oct 1 '11 at 10:21
add comment

ASCII only covers a certain set of characters, starting at ASCII 0 to ASCII 127. Those numbers above 127 are in heavy conflict, depending on which non-ASCII extension was used.

The general "best" solution to go with for maximum portability these days is one of the Unicode encodings. There are a number of them, but UTF-8 is very popular. When I say there are a number of Unicode encodings, realize that unlike different character sets, all Unicode encodings encode the same characters, they just do it with a different number of bits. UTF-8 attempts to save a lot of disk space / memory if your stuff is mostly ASCII.

In Linux, Gnome offers a "character picker" application, called gnome-character-map, which will allow you to find all of the glyphs in a font for all of the Unicode characters. Note that while it is possible to write a Unicode character, depending on the font you use, there might not be a glyph (or symbol) embedded in the font to display that Unicode character. When you don't have something to display a particular character, sometimes a square will be drawn in the unavailable glyph's place.

I typically cut and paste characters from the character map when I need to do something special; however, there is a sequence to directly type the character in (similar to windows). Do a Shift-Control and then type in the hexadecimal character value (which you can look up in the character map, if necessary).

share|improve this answer
    
Do a Shift-Control and then type in the hexadecimal character value where? I've tried VI, nautilus, gedit but nothing.. –  Frederico Schardong Oct 1 '11 at 3:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.