Hey everyone, I'm pretty new to Linux and I've been running into a bit of a hassle. I often need to run applications as an admin using sudo, but whenever I use 'sudo -i', it takes me out of my current directory. This means I have to manually type in the directory path to get back each time, and that's starting to feel very tedious. Is there an easier way to run sudo commands without losing my current directory? Or is there a workaround that can help make this less annoying? I'd appreciate any tips!
2 Answers
Actually, not everything in Linux requires admin permissions. You might find that many tasks can be done without sudo. It might help to look into those to make your workflow smoother and avoid using sudo as often as possible.
You can try using `sudo su`. It switches you to the root user while keeping your current directory, so you won’t have to type the path again each time you need sudo access. It’s pretty straightforward!
Thank you! Glad it was something so simple!