0

I fail to change to the desktop via command line. I tried it like this.

cd ~/Desktop

But then I get "File or Path not found"

Black
  • 2,079
  • 1
    Amend question to, show what you get if you type ls -l ~? – ctrl-alt-delor Jul 19 '16 at 08:26
  • Thanks for the hint! Now i found a folder called "Schreibtisch" which means "Desktop". After executing cd ~/Schreibtisch it worked! :) – Black Jul 19 '16 at 08:35
  • 1
    If you like you can do ln -sT Schreibtisch Desktop. – ctrl-alt-delor Jul 19 '16 at 08:45
  • The symlink does not work, if i execute cd ~/Desktop then i still get "File or Path not found" – Black Jul 19 '16 at 08:56
  • 1
    Sorry, you must be in ~ when you create the symlink. This may be better if you have gnu ln ln -sTr ~/Schreibtisch ~/Desktop else pushd ~; ln -sT Schreibtisch Desktop; popd if you have bash, or cd ~; ln -sT Schreibtisch Desktop; cd - – ctrl-alt-delor Jul 19 '16 at 09:07

1 Answers1

2

The problem you're running into is a one where the name of the directory can change depending on the user's selected language.

In the general case you should be able to run

xdg-user-dir DESKTOP

to get the path to the current user's Desktop directory. e.g.

% xdg-user-dir DESKTOP
/home/sweh/Desktop

Scripts should take this into account when looking for the Desktop folder (e.g. to install shortcut icons).

(If xdg-user-dir isn't found then it's possible the user doesn't have a GUI desktop; default to "$HOME/Desktop" in that case).

Spec's for the different user-dirs can be found at https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

In your specific case, you found manually (as per your comments) that "Schreibtisch" is the name used for your login.