Is there a way to list the contents of a directory without having to type 'sudo ls' then the password every time? I just want to be able to type ls like a root user but using a non-root account.
Printable View
Is there a way to list the contents of a directory without having to type 'sudo ls' then the password every time? I just want to be able to type ls like a root user but using a non-root account.
You just need to enter the password once to authenticate yourself and then you can "sudo ls" without the prompt after.
In your .bashrc, you can just add an alias: alias ls="sudo ls"