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.
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'
or
cat "abc def"
If you use tab autocompletion, the first method will automatically be used.
I hope this answers your question.
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.
Try this
cat abc\ def
Normally, to make Ubuntu understand the space you need to use "\" before space.
ls -l
. Edit your question to include these details.