I'm trying to get a handle on Linux, but it's been a bit of a challenge. I often need to run applications as an admin (you know, with 'sudo'). The problem I'm facing is that when I run 'sudo -i', it kicks me out of the current directory and I have to manually 'cd' back to where I was, which feels really tedious. Is there an easier way to use 'sudo' without losing my place in the file system? It seems like a small thing, but it makes using Linux feel more cumbersome compared to Windows. Any tips or tricks to streamline this would be greatly appreciated!
2 Answers
You can try using 'sudo su' instead of 'sudo -i'. This command will log you in as the root user while keeping you in the same directory. It makes the process a lot smoother since you won’t have to re-navigate to your previous folder every time. Give it a shot!
Just a heads up, not everything on Linux needs to be run as admin. It might feel that way because a lot of tutorials emphasize using 'sudo' for everything. You could check your permissions and see if you really need to escalate privileges for what you're doing. Sometimes, you can run things as a regular user, which avoids the hassle altogether!
Thank you! I appreciate the simple solution.