Easily Finding Granted Linux Command In Sudo List
For those who are familiar with Runas features in Windows, sudo is the Runas equivalent in Linux OS. In brief, sudo is a Linux program that used to run or execute another Linux command under the root or others Linux user privilege.
Once the sudo package installed, each of the non-root users will have to be granted Linux commands that are intended to run on root or other users privilege. The
Next, the Linux user can run
The Linux administrators who have usually granted few tens or hundreds of Linux command will definitely find this default sudo -l listing being difficult to read, especially to find out or confirm that he/she is granted the correct Linux command in the right command path.
Here are at least two ways to reformat or modify the sudo -l report listing:
Isn’t this trick makes the formatted sudo -l command output easier to read or locate the granted command in sudo access list?

visudo is used to maintain the list of granted Linux commands for Linux users in /etc/sudoers file.Next, the Linux user can run
sudo -l to list or display all the Linux commands granted for him/her. By default, this sudo -l report comma-delimited Linux commands in a single long line!The Linux administrators who have usually granted few tens or hundreds of Linux command will definitely find this default sudo -l listing being difficult to read, especially to find out or confirm that he/she is granted the correct Linux command in the right command path.
Here are at least two ways to reformat or modify the sudo -l report listing:
- This Linux command
sudo -l | grep --color=auto Linux-Command-Here
will highlight the targeted Linux command if you’re running GNU grep 2.5.1 (typegrep --versionto check the GNU grep version).
For example, to check is the GNU tar command granted to you, type
sudo -l | grep --color=auto tar
- Download the wsudo shell scripts, which is used to break the comma-delimited Linux commands in the long line to one record per line.
For examplewsudo | grep tarwill only display the GNU tar command if it is found in the sudo -l report (means that the GNU tar is granted in sudo access list).
You may also simply typewsudoto get a modified, reformatted sudo -l report listing, in the form of one granted Linux command per line.
Isn’t this trick makes the formatted sudo -l command output easier to read or locate the granted command in sudo access list?
Custom Search







2010 •
[...] that have caused you to lost a Linux root password, as most of the time you’re forced to use sudo command for daily admin [...]
[...] is another 3-minutes Linux guide for newbie on How to create or add new Linux EXT3 file system in Logical Volume Manager (LVM) with [...]
[...] Thereafter, the man sudoers will looks normal – render the proper characters instead of weird characters in the Linux man pages. (sudoers is the sudo configuration file – see also how to format the sudo –l output in more readable format) [...]
[...] to setup or configure SSH REMOTE Port Forwarding in Linux (Walker-A) with OpenSSH [...]
[...] set gsudo as the Linux command shortcut to highlight a given command in sudo -l report, i.e. gsudo tar to highlight the tar so that a user could easily confirm that the command is [...]
[...] Execute db2 list tablespaces show detail for existing databases govern by the DB2 instance account (the scripts will have to run under the same account, otherwise use a sudo command), [...]