Skip to main content
Commonmark migration
Source Link

#A bit about directories

A bit about directories

#Paths with spaces in them

Paths with spaces in them

#A bit about directories

#Paths with spaces in them

A bit about directories

Paths with spaces in them

replaced http://superuser.com/ with https://superuser.com/
Source Link

If you are on a Unix-based system (I've not yet tested thisnot yet tested this on Windows), you can also escape the space and leave out the quotes. This is the default behavior for tab auto-completion on a Mac, while the quotes are default for Windows.

If you are on a Unix-based system (I've not yet tested this on Windows), you can also escape the space and leave out the quotes. This is the default behavior for tab auto-completion on a Mac, while the quotes are default for Windows.

If you are on a Unix-based system (I've not yet tested this on Windows), you can also escape the space and leave out the quotes. This is the default behavior for tab auto-completion on a Mac, while the quotes are default for Windows.

added 1260 characters in body
Source Link
Jake Dube
  • 8.6k
  • 2
  • 33
  • 74

#Paths with spaces in them

One problem that you may encounter as Delagone mentioned in the comments is something like trying to navigate to:

/Users/Freddy/My Folder/

...where My Folder/ has a space in it. Because the command line separates arguments by spaces, you'll need to put double quotes around that argument to tell the command line to treat it all as one argument. For example, you could do something like the following.

cd "/Users/Freddy/My Folder"

This is one reason why most programmers tend to name folders without spaces; it makes it easier when working from the command line to navigate. Instead you can always name folders with camel-case MyFolder or with underscores my_folder.

If you are on a Unix-based system (I've not yet tested this on Windows), you can also escape the space and leave out the quotes. This is the default behavior for tab auto-completion on a Mac, while the quotes are default for Windows.

cd /Users/Freddy/My\ Folder/

The \ is the escape character and tells the command line to not interpret the next character in the usual way. In this case, it makes it treat it as a regular space character without separating them as arguments.


#Paths with spaces in them

One problem that you may encounter as Delagone mentioned in the comments is something like trying to navigate to:

/Users/Freddy/My Folder/

...where My Folder/ has a space in it. Because the command line separates arguments by spaces, you'll need to put double quotes around that argument to tell the command line to treat it all as one argument. For example, you could do something like the following.

cd "/Users/Freddy/My Folder"

This is one reason why most programmers tend to name folders without spaces; it makes it easier when working from the command line to navigate. Instead you can always name folders with camel-case MyFolder or with underscores my_folder.

If you are on a Unix-based system (I've not yet tested this on Windows), you can also escape the space and leave out the quotes. This is the default behavior for tab auto-completion on a Mac, while the quotes are default for Windows.

cd /Users/Freddy/My\ Folder/

The \ is the escape character and tells the command line to not interpret the next character in the usual way. In this case, it makes it treat it as a regular space character without separating them as arguments.

added 1913 characters in body
Source Link
Jake Dube
  • 8.6k
  • 2
  • 33
  • 74
Loading
Source Link
Jake Dube
  • 8.6k
  • 2
  • 33
  • 74
Loading