Professional Documents
Culture Documents
com/questions/14683/how-to-cd-to-a-directory-
with-a-name-containing-spaces-in-bash
CHANGING DIRECTORY WITH SPACES:
You can use the Tab key after pressing the first few characters (this will then
"fill in" the rest of the folder for you e.g. type cd ~/LTab fills in cd ~/Library/
then type ApTab and it will fill in the rest for you.
If there is a space between words and you don't want to use the methods above, put
a \ (backslash) before the space, e.g. cd ~/Library/Application\ Support.
OR
Use double quote to change directory with spaces
cd "c programming 2018"
You can use bind 'set completion-ignore-case on' to make completion case
insensitive:
SOURCE:
https://www3.ntu.edu.sg/home/ehchua/programming/howto/Unix_SurvivalGuide.html
An absolute path begins with a "/" (root directory) or "~" (home directory);
whereas a relative path is relative to the current working directory and does NOT
begin with "/" or "~". For example,
$ cd / // Change directory (absolute) to the root
$ cd /usr/local // Change directory (absolute) to "/usr/local"
$ cd mysql // Change directory (relative) to mysql of the current
directory
$ cd myproject/bin // Change directory (relative) to myproject/bin of the
current directory
You can cd in multiple stages (e.g., one cd for each sub-directory - recommended),
or cd in a single stage with the full pathname.
$ cd / // "/"
$ cd usr // "/usr"
$ cd local // "/usr/local"
$ cd mysql // "/usr/local/mysql"
$ cd bin // "/usr/local/mysql/bin"
// Same As
$ cd /usr/local/mysql/bin
You can use "/" to denote the root; "~" to refer to your home directory; ".."
(double-dot) to refer to the parent directory; "." (single-dot) to refer to the
current directory; and "-" (dash) to refer to the previous directory. For example,
Wildcard *
You can list selected files using wildcard *, which matches 0 or more (any)
characters. For examples,
Previous Commands in Command History: You can use the up/down arrow keys to
retrieve the previous/next command in the command history.
Auto-Complete: You can type the first few characters for the pathname or filename,
and press TAB key to auto-complete.