0

Put simply, I have a file on my desktop that I'm attempting to access using cd /file name and I'm returned with:

No such file or directory. I resorted to copying and pasting the directory (being mindful of current directory)

I get as far as /home and /desktop before it tells me that none of the folders in that file tree exist...

I felt silly troubleshooting something this basic, but I even went so far as to elevate to root to no success.

Cmon linux.. it's hard enough on new people.. this is extremely discouraging.

Edit (Tiggers edit suggestion was declined? .. interesting, here it is. Learned something new, thanks Tig!): Command run is:

    ~/Desktop $ cd /Desktop_Launchables 
    bash: cd: /Desktop_Launchables: No such file or directory ...

Also, note that I've tried many other folders within the 2 previously mentioned directories.

  • Please include the commands, in order and complete that you are running. – Tigger Apr 25 '17 at 05:02
  • ~/Desktop $ cd /Desktop_Launchables bash: cd: /Desktop_Launchables: No such file or directory ... When I'm staring at the folder (that's on the DESKTOP!) with caps, the underscore, etc. It's right in front of me. I even go so far as to copy/paste.. I've used CD before and did a quick search. Apparently this isn't an ordinary issue. I just want to change directories!! D: . . . – Lusus Naturae Apr 25 '17 at 05:03

1 Answers1

4

The problem is the / at the start of the command. Let me try to explain.

A / at the beginning of a file path means from the root of the system.

For example:

cd /Desktop_Launchables

This command is looking for the directory Desktop_Launchables in the root /. On a Windows system, this would be a similar command:

cd C:\Desktop_Launchables

On the other hand you can use a ~ for a home directory path shortcut from any location on the file system.

For example, if Desktop_Launchables is in your users home directory.

cd ~/Desktop_Launchables

And you can expand on the ~ if the Desktop_Launchables is in a different users home. For example, the root users home (and you have permission to access it).

cd ~root/Desktop_Launchables

The expanded, non-shortcut version of this would be (most likely):

cd /home/<user>/Desktop_Launchables

Where <user> is your login.

My guess is you really wanted:

cd Desktop_Launchables

or

cd Desktop/Desktop_Launchables

But to be on the safe side, you can always place the ~ in front like so:

cd ~/Desktop_Launchables

or

cd ~/Desktop/Desktop_Launchables
Tigger
  • 3,647