LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-24-2019, 09:05 PM   #1
zavmat
Member
 
Registered: Oct 2018
Posts: 184

Rep: Reputation: Disabled
Why does terminal say "no such file or directory" when I try to cd/ to it?


Here's what I've got:

[matt@localhost ~]$ cd/home/matt/downloads
bash: cd/home/matt/downloads: No such file or directory
 
Old 01-24-2019, 09:12 PM   #2
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: Pop!_OS
Posts: 945

Rep: Reputation: 297Reputation: 297Reputation: 297
Okay, where it shows [matt@localhost ~]$ that means you are signed in as matt the little ~ means you are in home already. The $ means you are signed in as a user and not as root. From this if you type: cd downloads it should go there since you are already in your home. Check though, sometimes downloads is spelled with a capital D and Downloads and downloads are not the same in Linux, case matters.

Open a terminal and type ls (lower case L and s) and you should see your folders.
 
1 members found this post helpful.
Old 01-24-2019, 09:15 PM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Also, you have not included a space between "cd" and "/home", this is why it cannot find it.

Code:
[james@jamespc ~]$ cd/home
bash: cd/home: No such file or directory
[james@jamespc ~]$ cd /home
[james@jamespc home]$ pwd
/home
[james@jamespc home]$
 
1 members found this post helpful.
Old 01-24-2019, 09:21 PM   #4
zavmat
Member
 
Registered: Oct 2018
Posts: 184

Original Poster
Rep: Reputation: Disabled
Thanks to both of you, I tried it with a space before I posted the question with no luck, but I wasn't sure if it needed it or not.
[matt@localhost ~]$ cd /Downloads still couldn't find the directory, but cd Downloads did. I thought you needed the / but I guess you don't?

Thanks again!
 
Old 01-24-2019, 10:26 PM   #5
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by zavmat View Post
...
[matt@localhost ~]$ cd /Downloads still couldn't find the directory, but cd Downloads did. I thought you needed the / but I guess you don't?
...
Look up "absolute paths" and "relative paths", there in lies the answer to that question.
 
2 members found this post helpful.
Old 01-25-2019, 12:25 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by zavmat View Post
Thanks to both of you, I tried it with a space before I posted the question with no luck, but I wasn't sure if it needed it or not.
[matt@localhost ~]$ cd /Downloads still couldn't find the directory, but cd Downloads did. I thought you needed the / but I guess you don't?

Thanks again!
The ~ (highlighted above) means that you are in your home directory. Downloads is in your home directory, so cd Downloads will change you to that sub-directory, and your prompt will then show
Code:
[matt@localhost Downloads]$
As stated use ls -l to see what's in the directory you're in...and pwd (print working directory) to see what directory you're actually in.
As always, use man ls and man pwd to find out what those commands actually do.

Also take a look at
Code:
ls -l /
to see what's in the root (/) directory. You'll see that there's no Downloads directory there...so "No such file or directory"

Last edited by scasey; 01-25-2019 at 12:27 PM.
 
1 members found this post helpful.
Old 01-25-2019, 12:41 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Code:
cd /home/matt/Downloads
"Downloads" is usually capitalized.
 
Old 01-25-2019, 12:49 PM   #8
zavmat
Member
 
Registered: Oct 2018
Posts: 184

Original Poster
Rep: Reputation: Disabled
Thanks again everyone. I'm working on Fedora 22 but want to upgrade it to the most recent and stable version, can I ask for your help here or should I start a new thread?
 
Old 01-25-2019, 12:53 PM   #9
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
I know it's kind of cheating
have a look at midnight commander the command to bring it up is "mc"
it's the easiest way to deal with files that have spaces in the file names and other odd ball file names
 
1 members found this post helpful.
Old 01-25-2019, 02:08 PM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by zavmat View Post
Thanks again everyone. I'm working on Fedora 22 but want to upgrade it to the most recent and stable version, can I ask for your help here or should I start a new thread?
It would probably work better to start a new thread, either here or in the Fedora distro forum.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"bash: /usr/bin/git: No such file or directory " - why does bash look in /usr/bin babu198649 Linux - Newbie 9 04-24-2023 01:32 PM
"No such file or directory" when I try to run executable Erentigionation Programming 11 10-10-2018 08:01 AM
[SOLVED] Almost commands say "command not found" or "No such file or directory" iorih0304 Linux - Newbie 9 03-04-2018 09:32 PM
[SOLVED] executable file error: "No such file of directory" when file does exist dalgrim Slackware 8 11-03-2014 11:28 AM
[SOLVED] I say "realloc", you say "SIGABRT" - And I don't understand it. derchris Programming 3 03-25-2011 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration