We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [special-characters]

If it has a meaning beyond its literal meaning, a meta-meaning, then we refer to it as a special character.

Filter by
Sorted by
Tagged with
137
votes
11answers
190k views

What is `^M` and how do I get rid of it?

When I open the file in Vim, I see strange ^M characters. Unfortunately, the world's favorite search engine does not do well with special characters in queries, so I'm asking here: What is this ^M ...
8
votes
2answers
1k views

Difference between ' and " on command line (bash)? [duplicate]

I used to use '' and "" (single and double-quotes) interchangeably on the command line, but I recently noticed that '$HOME/some/dir' is not expanded, while "$HOME/some/dir" is. I searched around a ...
46
votes
16answers
26k views

How can I delete a file which filename has non-printing characters

I somehow managed to create a file that doesn't seem to have a filename. I found some information regarding how to get more details of the file in the following thread. However, I tried some of the ...
13
votes
2answers
61k views

How to use a special character as a normal one?

Many questions like 'How to type the double-quote char (")?' are being asked, and we don't want to clutter our community with the same answer (Type it as \" if not enclosed in 's, " if enclosed in 's.)...
25
votes
3answers
11k views

Understanding Unix file name encoding

I have a hard time understanding how the file name encoding works. On unix.SE I find contradicting explanations. File names are stored as characters To quote another answer: Several questions about ...
19
votes
2answers
1k views

Grep: unexpected results when searching for words in heading from man page

I'm running into weird behavior when trying to grep a man page on macOS. For example, the Bash man page clearly has an occurrence of the string NAME: $ man bash | head -5 | tail -1 NAME And if I ...
5
votes
5answers
2k views

How do I remove a file I accidentally created named $file?

I was working on a shell script and I accidentally created a file with the variable as its name. Now I have $file in my ls output, and cannot remove it. What can I do?
24
votes
2answers
35k views

What does the tilde (~) mean at the end of a filename? [duplicate]

What is the file with the ~ at the end of the filename for? $ ls # aliased to add flags -rwxrwxr-x 1 durrantm 2741 May 16 09:28 strip_out_rspec_prep_cmds.sh~* drwxrwxr-x 13 durrantm 4096 May 16 14:...
87
votes
7answers
92k views

Can't use exclamation mark (!) in bash?

I'm trying to use the curl command to access a http url with a exclamation mark (!) in its path. e.g: curl -v "http://example.org/!287s87asdjh2/somepath/someresource" the console replies with bash: ....
13
votes
2answers
8k views

How to display control characters (^C, ^D, ^[, …) differently in the shell

When you type control characters in the shell they get displayed using what is called "caret notation". Escape for example gets written as ^[ in caret notation. I like to customize my bash shell to ...
21
votes
2answers
9k views

What does CTRL+4 (and CTRL+\) do in bash?

I just found out by accident that CTRL + 4 closes programs reading stdin input from the command-line. This is how it looks when I type CTRL + 4 or CTRL + / into programs reading stdin $ cat ...
112
votes
2answers
10k views

Is Vim immune to copy-paste attack?

You should never paste from web to your terminal. Instead, you should paste to your text editor, check the command and then paste to the terminal. That's OK, but what if Vim is my text editor? Could ...
28
votes
3answers
13k views

What is the Mode_switch modifier for?

Playing with xmodmap I encountered a modifier key I hadn't heard of: Mode_switch. It seems to have something to do with inserting special characters. I assigned it to a key but it seems to have no ...
21
votes
5answers
1k views

How can I find the common name for a particular glyph?

Sometimes, I'd like to know the name of a glyph. For example, if I see −, I may want to know if it's a hyphen -, an en-dash –, an em-dash —, or a minus symbol −. Is there a way that I can copy-paste ...
29
votes
2answers
7k views

How to avoid escape sequence attacks in terminals?

Reading the details of CVE-2009-4487 (which is about the danger of escape sequences in log files) I am a bit surprised. To quote CVE-2009-4487: nginx 0.7.64 writes data to a log file without ...
10
votes
3answers
28k views

BASH and Carriage Return Behavior

I have one quick question. Is it normal that bash (i am using 4.4.11) is not displaying lines/text that is separated / end with plain \r ? I was a bit surprised to see this behavior: $ a=$(printf "...
6
votes
2answers
3k views

Is there a way to find files containing only non-printing characters?

I've got a program that's behaving badly and has created a number of files with only a few non-printing characters. If I were to cat the files, I see nothing (since they are non-printing chars). ...
11
votes
2answers
3k views

Match with grep when pattern contains hyphen “-”

I wrote the following command in order to match $a with $b, but when the value includes "-", then I get an error. How can I avoid that? # a="-Xmx5324m" # b="-Xmx5324m" # # # echo "$a" | grep -Fxc "$...
6
votes
1answer
2k views

Representing/quoting NUL on the command line

Can \0 be used on the command line? Background For testing corner cases in GNU Parallel I was curious whether all characters were correctly quoted on the command line. Most of them are: perl -e '...
3
votes
2answers
2k views

Makefile shell ignoring sed regexp end of line

I have a folder for various testing of C code, containing many files named *.c. My aim is to have a Makefile search for any filename ending in .c and add the root of that filename to the targets. ...
2
votes
2answers
3k views

How do I print 'block' letters in the terminal?

How do I echo/print block lettering in the terminal like: ? figlet and toilet don't help. Neither do U+25A0 or U+2588 unicode characters. This is not a duplicate. As I said, figlet, banner and ...
2
votes
2answers
1k views

Strange characters when the output of `ls` is redirected to a file

I want to list the components of the current working directory in a text file ls -1 > textfile Output looks fine with more. 1010661085645 1010729039145 1010747080245 1010849051345 1010859053445 ...
14
votes
3answers
61k views

Search and replace control characters (^@, ^M, ^I…) in vi

I copied this line from /proc/some_proc_id/cmdline in my ubuntu machine, java^@-jar^@/usr/lib/selenium/selenium-server-standalone.jar^@-port^@4444^@-trustAllSSLCertificates^@ Somehow, the space ...
14
votes
3answers
38k views

How do I put a hat on 'e' (ê)?

Since I've migrated to linux a few years ago, one issue still remains. The ê character features a lot in my "moeder taal" (home language). In Windows making the character was easy, I simply had to ...
10
votes
2answers
4k views

Is the “tick” or “acute accent” character ´ (not `) used for anything in Linux shell?

We know that the backtick character is used for command substitution: chown `id -u` /mydir Which made me wonder: is the tick character ´ used for anything in the Linux shell? Note: incidentally, ...
5
votes
6answers
2k views

Rename folder with odd characters

I have a folder on my Mac called "␀␀␀␀HFS+ Private Data". I'm trying to delete it but it contains a bunch of odd characters that are choking unlink, rm and mv, making it difficult to remove it and ...
3
votes
2answers
564 views

What are these rectangular characters and where is this notation defined

Using Linux (Fedora, specifically) as my primary workstation, I noticed, at times, strange non-printable characters like in the following screenshots (bottom-left in the first image and upper-left in ...
1
vote
3answers
2k views

How to create a directory with '/' in unix?

I want to create a directory with name as below A3456/90876/IN AS%90876 JI KOL
1
vote
2answers
15k views

Are periods (“.”) valid characters in file or folder names? [closed]

I would like to name my files and folders according to a specific date, e.g. 03.04.2016. I see I can use them but are there any disadvantages to using periods in files or folder names?
4
votes
1answer
2k views

Problems with umlauts (can't type in terminal + can't open files)

On my laptop I have Linux Mint 18.3 installed and right now I am experiencing the following problem: As a German I happen to have some files (or directories) that contain umlauts in their names (which ...
3
votes
3answers
28k views

Sed command with ' special character [closed]

I am trying to execute the following command from bash shell: sed -i "s/\(update.*\)where /\1 where primary_id = '$primary_id', /" *.php As you see, there is a variable which I am inserting using ...
3
votes
0answers
39 views

How to avoid bash from accepting non-printable characters at the prompt?

I recently ran a command at my shell: # yum whatprovides xdotool Error: No Matches found However, my package manager actually has this package: # yum whatprovides xdotool xdotool-1:3.20150503.1-7....
3
votes
2answers
1k views

Hash symbol on a teletype

My issue is a bit unusual, so I want to provide a short background. I was looking at old winners of the International Obfucated C Code Contest, and came across an entry written for the PDP-11 (the ...
2
votes
1answer
349 views

Modifying a set of binary files

I have several binary files with the character 0x04 in them, and I'd like to add an escape \ character before each. Is there a script I can use to do this without needing to manually edit each one?
2
votes
1answer
360 views

“render” textfile with carriage returns (^M) and save output to file

I have a Python CLI program that runs for a long time and has a sort of progressbar, which basically prints some text in the loop without "\n" at the end, at the next iteration it prints "\r" to erase ...
1
vote
2answers
1k views

How to escape special characters in long sed string

I have this string that I want to include at line 115 of a file, using sed. However, it always complains on some unknown command. I have followed other solutions in other questions, but haven't ...
1
vote
2answers
1k views

Shell eating `?` characters

This is such a simple question that I'm sure it's been asked somewhere, but I can't find it. My shell, which I have not intentionally set up to do so, seems to eat any words involving question marks: ...
1
vote
5answers
577 views

keep out line break

I have some files with this structure: 2015-03-25 17:08:17 sysUpTimeInstance 93474;^M 1.ValueforState=2500 I want to replace the line break, and leave the third line with the second line, I mean, ...