moving a file to a folder with root privileges in CentOS 7
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.
Related videos on Youtube
RabT
Updated on September 18, 2022Comments
-
RabT over 1 year
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 thescript.sh
file in that directory, thegedit
tool gives me an error stating that I do not have privileges to save in that folder. So I savedscript.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 typingsu - root
, but what do I type to either move thescript.sh
file from the desktop to/etc/profile.d/script.sh
or to opengedit
in a way that lets me save it to/etc/profile.d/script.sh
?-
eyoung100 over 9 yearsIf you have the sudo package try
gksudo nautilus
, otherwise usesudo mv -v /home/username/Desktop/script.sh /etc/profile.d/script.sh
For more, tryman mv
-