Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose my file name is äbc def

When I type in the terminal like cat ¨abc def¨ it shows error. Can anybody tell me how to print this file that has spaces in between the name.

share|improve this question
What is the error you're seeing? And include the exact command. Use copy&paste and also include the directory listing... ls -l. Edit your question to include these details. – gertvdijk Aug 27 '13 at 19:12

By ¨abc def¨ do you mean "abc def"?

You can do two things. You can either put a \ in front of the space to tell bash that the next character is a literal space in the file name, like this,

cat abc\ def

Or, you can place the file name in single-quote (') or double quote (") characters:

cat 'abc def'


cat "abc def"

If you use tab autocompletion, the first method will automatically be used.

I hope this answers your question.

share|improve this answer
double quotes work as well and the auto-completion should work too. – Symin Aug 27 '13 at 20:04
Ok, I will edit that in. – Richard Aug 27 '13 at 20:44
Also you can use cat or any other command and then drag (a) file/s directly into terminal. Terminal will then plot the path/dir of this file, also considering the space within the files name. – v2r Aug 27 '13 at 21:08

Try this

cat abc\ def

Normally, to make Ubuntu understand the space you need to use "\" before space.

share|improve this answer

Your Answer


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.