Linked Questions

43
votes
7answers
27k views

Why does [A-Z] match lowercase letters in bash?

In all shells I am aware of, rm [A-Z]* removes all files that start with an uppercase letter, but with bash this removes all files that start with a letter. As this problem exists on Linux and ...
20
votes
1answer
11k views

What should I set my locale to and what are the implications of doing so?

This question was stimulated by asking the question Chromium browser does not allow setting the default paper size for "Print to File", and also by a conversation with @Gilles on chat. As ...
14
votes
2answers
12k views

set LC_* but not LC_ALL

I'd like to have a German (Austria) locale (A4 paper size, 24 hour time, yyyy-mm-dd), but an English-language user interface (I don't like poor translations). I figured that the correct way to achieve ...
10
votes
2answers
1k views

Strange behaviour of tr using ranges

I have one particular server that is exhibiting strange behaviour when using tr. Here is an example from a working server: -bash-3.2$ echo "abcdefghijklmnopqrstuvwxyz1234567890"|tr -d [a-z] ...
7
votes
4answers
6k views

In grep command, can I change [:digit:] to [0-9]?

Will grep [0-9] work in the same way as grep [:digit:]?
15
votes
3answers
8k views

Match word containing characters beyond a-zA-Z

To match a word one can use \v(\w+) From the vim help :h \w: \w word character: [0-9A-Za-z_] This works exactly as described in the manual. However, I want to match words that contain characters ...
8
votes
2answers
17k views

terminal: non-english characters

I used to be able to copy&paste (or type if I load respective keyboard layout) any kind of characters (eg. é ö ñ ß و 好) in my console/terminal. Now I bought a new computer and it does not work ...
5
votes
2answers
2k views

Sort behaves strangely on case sensitive sorting

Sort is sorting differently than I would expect. I have this file, call it text.txt: a 1 A 1 a 11 (the space is always one \t) I want to sort them alphabetically by the first column. However, ...
7
votes
1answer
1k views

Why are capital letters included in a range of lower-case letters in an awk regex?

$ echo ABC | awk '$0 ~ /^[a-b]/' ABC $ echo ABC | awk '$0 ~ /^[a-a]/' $ echo ABC | awk '$0 ~ /^a/' $ You see. /[a-b]/ captures A, but /[a-a]/ or /a/ doesn't. Why?
5
votes
3answers
842 views

Why should 'Character Classes' be preferred over 'Character Ranges' In Shell (Bash)?

The Linux Command Line (Book - page count 47) says: ... you have to be very careful with them [character ranges] because they will not produce the expected results unless properly configured. For ...
2
votes
5answers
1k views

How to find out if PWD contains spaces or non-English letters?

I created an environment variable: WD=`pwd` How can I check if it contains spaces or non-English letters?
1
vote
3answers
2k views

Debian thinks my file system is encoded as ISO-8859-1

This may not be the appropriate site for this question, because it's more a complaint than a question, but here goes. Today I updated my computer from Mint 15 to Debian 7.6. And after I'd done that, ...
6
votes
1answer
497 views

Alphabetizing names in `ls` alias with .files not intermingled

I am currently using the following ls alias: alias ls='ls -alhGkpsq --color=auto'. This results in following directory listing. [03:35] bryson@brys ~ :$ ls total 48K 4.0K drwx------ 4 bryson 4.0K ...
5
votes
2answers
366 views

Meaning of “[--0]” in a glob pattern

I was reading about "Glob" and "Globbing Pathnames", and I found this strange (to me) part in man pages: "[--0]" matches the three characters '-', '.', '0', since '/' cannot be matched. I am ...
1
vote
2answers
611 views

Konsole displays ?? instead of ↑ and ↓ in midnight commander

In midnight commander, changing the appearance via menu, selecting the skin sand256.ini etc. on many Linux setups gives nice colors. After reversing the sort order of file listing, ideally this is ...

15 30 50 per page