For example, I am using Spotify for linux.
Wouldn't I need to run it in sudo so that it can write its song cache to my file system?
Also, if you run a program from the launcher, does it get sudo by default?
For example, I am using Spotify for linux.
Wouldn't I need to run it in sudo so that it can write its song cache to my file system?
Also, if you run a program from the launcher, does it get sudo by default?
You need to understand what sudo
does. Quoting the Wikipedia page :
sudo (/ˈsuːduː/ or /ˈsuːdoʊ/) is a program for Unix-like computer operating systems
that allows users to run programs with the security privileges of another user (normally the superuser, or root
To explain further, it gives your program access to the core, sensitive files of your computer. Let me give you an example.
Try running touch /etc/abc.txt
and you will be thrown an Access Denied
error message, because the first "/ " in the path says that it is in the root directory and hence normal users cannot access it. To make the above command work, you will need to elevate your privileges and that is exactly what sudo
does. Try running the above command with sudo
and you can see the file will be successfully created.
Using sudo for everything is NOT a good practice. You should elevate the permission level of any program only if absolutely necessary. If you keep adding sudo
to all the programs, there is a high chance that you'll mess up with the core files of your computer. And yes, No programs get root permission by default.