Being with linux you definetly cannot escape typing commands , i mean linux hasnt become that easy to use that you can skip using the terminal.To make things easier and minimize the use of the terminal a bit, you could use this hack(If i may call it).In linux many files are protected such that only root has access to it or has write access to it so incase you need to do some editing or view that file you need to go to the terminal and browse to that directory and use the gedit command or whatever , all this requires a lot of time and effort.So an easy way around is using the right click open as root hack(im just calling it one :D).So here's how you do it


Step 1: Open the terminal(Applications->Accessories->Terminal) and type
sudo su and enter the sudo password
Step 2: Then type the following in the terminal
gedit .gnome2/nautilus-scripts/Open\ as\ root
Step 3: Now Text Editor should open , add the following lines to the open file and save it
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do

gksudo "gnome-open $uri" &

done

Step 4: Then again in the terminal , type
sudo chmod +x .gnome2/nautilus-scripts/Open\ as\ root
Step 5: Its better to reboot now

So the next time you want to open a file as root. just right click and click on open as root and your file should open as root!!!

0 comments

Post a Comment