User avatar
sand man
Posts: 70
Joined: Sun Dec 30, 2012 7:18 pm
Location: Western Australia

Having trouble negotiating directories

Wed May 29, 2013 10:04 pm

I am trying to do something quite simple but seem to be
having trouble negotiating various directories in Rasbian.

For example I open an Lx Terminal window
and try to change directories
from /home/pi to /home/pi/Desktop/abc radio national
( yes all these folders/directories exist )

I get the following :

[email protected] ~ $ pwd
/home/pi

[email protected] ~ $ cd Desktop
[email protected] ~/Desktop $ ls
abc radio national bootmsgs.txt extra mp3s getlucky.mp4 idle3.desktop midori.desktop omxplayer.old.log scratch.desktop youtube-dl
america debian-reference-common.desktop funny mp3s goldfish.jpg idle.desktop music python-games.desktop video
audio einstein.jpg general hub back powering lxterminal.desktop omxplayer.log rpi~ wpa_gui.desktop

[email protected] ~/Desktop $ cd abc radio national Note: ( shows up in blue in ls above )
bash: cd: abc: No such file or directory

What am I doing wrong ? Doesn't it like the length of "abc radio national"
directory ? Rasbian lets me create a dir name of that length
( as you can see above ) but I can't seem to change to it ?

The idea is that I have another folder
inside "abc radio national" named "awaye"
( which contains a radio program pod cast mp3 I want to play with omxplayer ).

This path exists : /home/pi/Desktop/abc radio national/awaye ( with away1.mp3 I want to play ).
How do I change to this directory ?

If I can't change to "awaye" then omxplayer may not be able to access the mp3 I want to play.

User avatar
joan
Posts: 14020
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Having trouble negotiating directories

Wed May 29, 2013 10:26 pm

The spaces in the file name are causing the problem. Either escape the spaces are enclose the directory name in quotes.

i.e. if you have a directory called my name is peter use either

cd my\ name\ is\ peter

or

cd "my name is peter"

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Having trouble negotiating directories

Wed May 29, 2013 10:42 pm

Sometimes you can use the "tab" keep to auto-complete files and folder names.

Richard S.

box
Posts: 19
Joined: Thu Nov 22, 2012 8:08 pm

Re: Having trouble negotiating directories

Thu May 30, 2013 5:53 pm

Use :

Code: Select all

cd "/home/pi/Desktop/abc radio national"
If it is not working please provide output :

Code: Select all

id;
ls -la /home/pi/Desktop/
I think that "abc", "radio" and "national" are three different directories, but not one ;)

Return to “Beginners”