开发者

Why can't I move a file from ~/process.desktop to ~/.config/autostart/?

开发者 https://www.devze.com 2023-03-29 04:42 出处:网络
I have a script that simply downloads a package, installs it, then it shoots the \"process.desktop\" to ~/.config/autostart to add it to XFCE\'s startup processes.

I have a script that simply downloads a package, installs it, then it shoots the "process.desktop" to ~/.config/autostart to add it to XFCE's startup processes.

Everything works but开发者_JAVA百科 moving the process.desktop to ~/.config/autostart/

Here is my code:

mv ~/process.desktop ~/.config/autostart/

It returns this error:

mv: cannot stat '/username/process.desktop' : No such file or directory

Note, the download goes to /home/username/ and it is installed [successfully] there. process.desktop is also in /home/username/

Thanks for any insight, this is the last component of my script I have to fix!


Weird - you would certainly expect ~ to expand to /home/username.

If one thing doesn't work, try another:

mv $HOME/process.desktop $HOME/.config/autostart

Question:

  • Are you sure you want to replace the existing autostart with the new file, rather than, say, adding the new file to the end of the existing autostart file?


The tilde path component expands to the current value of $HOME. An example under bash:

$ echo $HOME
/home/user
$ echo ~
/home/user
$ HOME=/tmp
$ echo ~
/tmp

Have you edited the value of $HOME? Is it possible that you created this account with the wrong home directory path? You can check that by:

grep username /etc/passwd

or

finger username

If that is the case, you can fix it with the usermod command or just edit /etc/passwd directly.

sudo usermod -d /home/username username
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号