Yum: How to show "Command Line" column in "Yum history list all" output?

When I use yum history list command on my CentOS-7 remote server it shows a list of yum history in below format:

ID     | Command line             | Date and time    | Action(s)      | Altered
--------------------------------------------------------------------------------

but if I call it this way: yum history list 1..3 or yum history list all it outputs:

ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------

And skips showing Command Line column which is more preferred for me to be visible. How can I tell yum to show Command Line column rather than Login username?


You can control this with the history_list_view option

For example (for a one-shot command) ...

sudo yum --setopt=history_list_view=commands history list all

Relevant bits of the yum and yum.conf man pages are ...

yum

In "history list" you can change the behaviour of the 2nd column via the configuration option history_list_view.

yum.conf

history_list_view Which column of information to display in the "yum history list" command. There are currently three options: users, cmds (or commands), auto.

Older versions of yum acted like "users", which always outputs the user who initiated the yum transaction. You can now specify "commands" which will instead always output the command line of the transaction. You can also specify "single-user-commands" which will display the users if there are more than one, otherwise it will display the command line.