How do you go to a directory with a space in Linux? To cd to a directory with spaces in the name, in Bash, you need to add a backslash ( ) before the space. In other words, you need to escape the space.
Can Linux directories have spaces? Files and directories in Linux can have different names, and some names can have “spaces” in them.
How do you cd into a directory that has a space?
The Drag-and-Drop Shortcut
- Type cd followed by a space.
- Drag and drop the folder on to the Command Prompt.
- Hit Return.
Can Linux filename have spaces? It’s not very common in Linux to handle filename with spaces but sometimes files copied or mounted from windows would end up with spaces. While it is not recommended to have file names with spaces, let’s discuss how to manage filename with spaces in a Linux system.