• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

history

History Without Line Numbers

September 8, 2022

Here’s how to display history without the line numbers.

history -w /dev/stdout

history -w /dev/stdout

Result

cd /etc/httpd/conf
view httpd.conf 
vim wiki.conf 
vim ssl.conf

cd /etc/httpd/conf view httpd.conf vim wiki.conf vim ssl.conf

Filed Under: Linux Tagged With: history, lines, list, without

Checking Yum Transaction Logs

February 1, 2021

Check if package is on the system.

rpm -q httpd
httpd-2.4.6-97.el7.centos.x86_64

rpm -q httpd httpd-2.4.6-97.el7.centos.x86_64

Check the history logs.

yum history list
Loaded plugins: fastestmirror
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   115 | System <unset>           | 2021-02-01 03:40 | Update         |    1
   114 | System <unset>           | 2021-02-01 02:03 | I, U           |   10
   113 | System <unset>           | 2021-01-29 19:54 | Update         |    1
   112 | System <unset>           | 2021-01-21 14:41 | Update         |    1

yum history list Loaded plugins: fastestmirror ID | Login user | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 115 | System <unset> | 2021-02-01 03:40 | Update | 1 114 | System <unset> | 2021-02-01 02:03 | I, U | 10 113 | System <unset> | 2021-01-29 19:54 | Update | 1 112 | System <unset> | 2021-01-21 14:41 | Update | 1

Check detail transaction id.

yum history info 114 | grep python 
    Updated python-perf-3.10.0-1160.6.1.el7.x86_64          @updates
    Updated python-sss-1.16.5-10.el7_9.5.x86_64             @your-repo
    Updated python-sssdconfig-1.16.5-10.el7_9.5.noarch      @your-repo

yum history info 114 | grep python Updated python-perf-3.10.0-1160.6.1.el7.x86_64 @updates Updated python-sss-1.16.5-10.el7_9.5.x86_64 @your-repo Updated python-sssdconfig-1.16.5-10.el7_9.5.noarch @your-repo

It looks like python was updated in transaction id #114.

Filed Under: Linux Tagged With: history, logs, rpm, yum

Get-Hotfix

December 10, 2019

How to find out if a Windows Server was last patched.

From Powershell, run this command.

get-hotfix

get-hotfix

From the command line, run this command.

C:\> systeminfo.exe

C:\> systeminfo.exe

Or from the menu, follow these steps.

Open the Windows Settings UI.
Click on Update & security.
Click on the "Update history" link located under the Windows Update tab.

Open the Windows Settings UI. Click on Update & security. Click on the "Update history" link located under the Windows Update tab.

Filed Under: Windows Tagged With: get-hotfix, history, info, patch, systeminfo, update

Bash History With Timestamps

October 31, 2019

If you need to see Bash history with timestamps, use this command.

HISTTIMEFORMAT="%d/%m/%y %T "

HISTTIMEFORMAT="%d/%m/%y %T "

To make it permanent, add it to your .bashrc.

echo 'HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc
source ~/.bashrc

echo 'HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc source ~/.bashrc

Timestamps accuracy is retroactively, meaning it will not be accurate for commands performed prior to the history time format being set.

Filed Under: Linux Tagged With: bash, bashrc, history, timestamps

  • Home
  • About
  • Archives

Copyright © 2023