Why does `cd downloads` fail with "No such file or directory"?
27,810
Solution 1
Linux file and directory names are case-sensitive. The default name of the downloads directory in Ubuntu is Downloads
not downloads
.
Solution 2
To make Bash behave case-insensitively, edit your ~/.inputrc
(create it if it doesn't exist) and add
set completion-ignore-case on
start a new shell (type bash
or close the terminal and open a new one) or source ~/.inputrc
, and then try
cd dowTab
and watch it complete to
cd Downloads/
Solution 3
You need to observe two things:
- Spelling of the word i.e. you should type Downloads not downloads.
- Downloads folder must be in Home directory
Related videos on Youtube
Author by
Rich Dell
Updated on September 18, 2022Comments
-
Rich Dell over 1 year
Running Ubuntu 12.04, while in a terminal, I type
ls
and see list of folders, including the downloads folder. I then typecd downloads
, press Enter. I get:bash: cd: downloads: No such file or directory
I tried each folder, on two computers. What am I missing?
-
Thomas Ward almost 12 yearsProbably a misunderstanding, rather than a blatant typo.
-
Rich Dell almost 12 yearsI just knew it would be something dumb! Many thanks
-
SergioAraujo almost 12 yearsThe answer seems perfect but we can also let the system indifferent to CASE setting the inputrc file, see answer below
-
Nanne over 11 yearsWhile making tab-completion case-sensitive is a great thing, It doesn not answer the question why the
ls
command in this case didn't work?