-1

I usually work with administrator access privileges on my Ubuntu workstations. On a new machine, I've recently been offered only a normal user account; and asked to provide a list of admin-level commands which I would like to use.

As such requests take a long time, I would like to get this right first-time. Is there a command which can analyse my command-line history, and report on which would normally have required admin access? Currently, I can only think of apt-get.

2 Answers2

2

If you do not use root, but a regular user with sudo privilidges, you can run

history | grep sudo
1

I just found out there is another way to find the recent sudo commands using the system logs.

sudo journalctl -e /usr/bin/sudo | grep COMMAND

The last grep can be removed but I included it so that the part where the command is, is highlighted.

Anyway, I thought this belonged here.