LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How the file is listed in Ubuntu Terminal (https://www.linuxquestions.org/questions/linux-newbie-8/how-the-file-is-listed-in-ubuntu-terminal-4175497539/)

AlexBB 03-08-2014 06:40 PM

How the file is listed in Ubuntu Terminal
 
1 Attachment(s)
Hi there. I do have a question. I created a file Commands 1 and placed it in the Documents directory. When I try "dir" command it shows the file as "Commands\ 1" That backslash is not a part of the file's name. Why is it so? You can see the thumbnail at the end of the text.

Also you can see in the terminal snapshot that I tried to use scrot command, took an image (png) but could not figure out how to use it (post it here, etc.). I ended up using my own software. Thanks, - AlexBB

chrism01 03-08-2014 06:47 PM

In *nix generally, a space between args to a cmd indicate separate arguments, so the space is (needs to be) 'escaped' using a '\' immediately before it, in order to indicate its a continuation instead.
In some cases, using single or double quotes around the whole thing works as well.

Long story short: although a space char is a syntactically valid part of a filename or cmd name or an argument, in reality it results in a lot of awkwardness; don't do it.
You'll thank me later ;)

See the many threads that end up talking about this.

AlexBB 03-08-2014 06:51 PM

Thanks for the post. You've answered my curiosity fully. -AlexBB


All times are GMT -5. The time now is 06:45 PM.