0

I am reading a tutorial that wants me to place a script file called script.sh into a folder called /etc/profile.d/. However, when I try to save the script.sh file in that directory, the gedit tool gives me an error stating that I do not have privileges to save in that folder. So I saved script.sh on the desktop temporarily. I cannot even view the contents of the /etc/ folder through the GUI. (Unless it is empty and I am seeing truly empty contents.) I can run the terminal as root by typing su - root, but what do I type to either move the script.sh file from the desktop to /etc/profile.d/script.sh or to open gedit in a way that lets me save it to /etc/profile.d/script.sh?

  • If you have the sudo package try gksudo nautilus, otherwise use sudo mv -v /home/username/Desktop/script.sh /etc/profile.d/script.sh For more, try man mv – eyoung100 Nov 25 '14 at 21:17
1

If you have the sudo package try gksudo nautilus, otherwise use sudo mv -v /home/username/Desktop/script.sh /etc/profile.d/script.sh For more, try man mv

sudo elevates the command following it temporarily to perform tasks like you describred.

0

You will need root privileges to save a file in that directory. Use the command 'sudo' if you have sudo privileges will let you achieve that.(sudo mv fileName /location/of/dir) Yes you can use 'su -' change to root user and mv the script.sh to /etc/profile.d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.