Page 1 of 1

Cannot change directories from Terminal

Posted: Fri Jan 20, 2017 10:07 pm
by goodson
Formated 32gb sd card with SDFormatter and installed NOOBS_v2_0_0. Booted to GUI. From terminal, I updated to NOOBS_v2_1_0. Set Pi configuration locale, timezone, keyboard and WiFi Country. Opened terminal executed ls. It displayed 9 directories. Tried to change directories with cd /directoryname. But it returned bash: cd: /directoryname: No such file or directory. I can view and move around the file structure with the GUI File Manager.
Anyone know what is going on? Thanks!

Re: Cannot change directories from Terminal

Posted: Sat Jan 21, 2017 9:28 am
by mfa298
goodson wrote:Formated 32gb sd card with SDFormatter and installed NOOBS_v2_0_0. Booted to GUI. From terminal, I updated to NOOBS_v2_1_0. Set Pi configuration locale, timezone, keyboard and WiFi Country. Opened terminal executed ls. It displayed 9 directories. Tried to change directories with cd /directoryname. But it returned bash: cd: /directoryname: No such file or directory. I can view and move around the file structure with the GUI File Manager.
Anyone know what is going on? Thanks!
Don't include the / in the Directory name.

Typing ls will show the contents of the current directory (probably your home directory), to change into those folders use cd FOLDER (e.g. cd Pictures). The / is a directory seperator so if your Pictures folder had a child folder 2016 you could use cd Pictures/2016 to change to it directly from your home folder. Having a leading / (so /tmp or /bin) means start at the root of the filesystem. You can also supply a path to ls (so ls /tmp or ls Pictures/2016).

As well as / there are a few other special options for directories . (a single full stop) means the current directory (this is normally only of use when running programs), .. (two full stops) means the parent directory (so if you'd done cd Pictures, running cd .. will take you back up to your home directory). ~ means my home directory (so you could use cd ~/Pictures to get to your Pictures folder from anywhere) ~user means user's home directory (so cd ~root/Pictures will take you to roots home Pictures directory if it exists and you had permissions to change to it)

Re: Cannot change directories from Terminal

Posted: Sat Jan 21, 2017 3:08 pm
by goodson
Thank you for the lesson. Much appreciated.

Re: Cannot change directories from Terminal

Posted: Mon Jun 19, 2017 9:19 pm
by tig124
Hi I am having the same issues

but I am at the root of the pi, I do CD <folder>, but get the message returned as previously stated.
i can change to another directory no problems.

So I have done a LS -la to look at all the contents, and the directory I can change to is the following

drwxrwxrwx lcd-show

The directory that I would like to go to in terminal, but can't is

drwxr-xr-x adafruit_python_max31855

Now I am thinking it has something to do with read/write permissions? i.e the drwxr-xr-x? but how do I change the permissions? i.e. what does each part mean?

Am I on the right path to sorting this?

Thanks
Tom

Re: Cannot change directories from Terminal

Posted: Mon Jun 19, 2017 11:43 pm
by drgeoff
tig124 wrote:Hi I am having the same issues

but I am at the root of the pi, I do CD <folder>, but get the message returned as previously stated.
i can change to another directory no problems.

So I have done a LS -la to look at all the contents, and the directory I can change to is the following

drwxrwxrwx lcd-show

The directory that I would like to go to in terminal, but can't is

drwxr-xr-x adafruit_python_max31855

Now I am thinking it has something to do with read/write permissions? i.e the drwxr-xr-x? but how do I change the permissions? i.e. what does each part mean?

Am I on the right path to sorting this?

Thanks
Tom
The first thing you need to learn is that, unlike a well known family of Operating Systems, Linux is case sensitive. CD and LS will not work. (Unless you have made aliases.)