diff --git a/Days/day15.md b/Days/day15.md index c74e559..3b0180d 100644 --- a/Days/day15.md +++ b/Days/day15.md @@ -87,6 +87,27 @@ If you have a long complex configuration file and you want or need to find somet If you are like me and you use that `clear` command a lot then you might miss some of the commands previously ran, we can use `history` to find out all those commands we have run prior. `history -c` will remove the history. +When you run `history` and you would like to pick a specific command you can use `!3` to choose the 3rd command in the list. + +You are also able to use `history | grep "Command` to search for something specific. + +On servers to trace back when was a command executed, it can be useful to append the date and time to each command in the history file. + +The following system variable controls this behaviour: +``` +HISTTIMEFORMAT="%d-%m-%Y %T " +``` +You can easily add to your bash_profile: +``` +echo 'export HISTTIMEFORMAT="%d-%m-%Y %T "' >> ~/.bash_profile +``` +So as useful to allow the history file grow bigger: + +``` +echo 'export HISTSIZE=100000' >> ~/.bash_profile +echo 'export HISTFILESIZE=10000000' >> ~/.bash_profile +``` + ![](Images/Day15_Linux21.png) Need to change your password? `passwd` is going allow us to change our password. Note that when you add your password in like this when it is hidden it will not be shown in `history` however if your command has `-p PASSWORD` then this will be visible in your `history`. diff --git a/README.md b/README.md index 1923e49..b1518f8 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ This will not cover all things DevOps but it will cover the areas that I feel wi ### Understand Networking - [✔️] 🌐 21 > [The Big Picture - DevOps and Networking](Days/day21.md) -- [🚧] 🌐 22 > [](Days/day22.md) -- [] 🌐 23 > [](Days/day23.md) +- [✔️] 🌐 22 > [The OSI Model - The 7 Layers](Days/day22.md) +- [🚧] 🌐 23 > [](Days/day23.md) - [] 🌐 24 > [](Days/day24.md) - [] 🌐 25 > [](Days/day25.md) - [] 🌐 26 > [](Days/day26.md)