DEV Community 👩‍💻👨‍💻

Cover image for Linux History Commands
Ankit Mahajan
Ankit Mahajan

Posted on

Linux History Commands

Hello Folks 👋 , Ankit here so now let's have a quick look at the most used and favourite command among linux users i.e the history command.

In your shell, there is a history of the commands that you previously entered, you can actually look through these commands. This is quite useful when you want to find and run a command you used previously without actually typing it again.

$ history

Some Shortcut tricks and Wow factors of history Command

---> we can also use the upper arrow key to run the previous commands

!! ---> if you want to run the command that you used earlier without writing the whole command you can just type in this !!
and it will run the last command you ran .

Next in the list is ctrl - R

ctrl - R ---> this is the reverse search command . so how it works is simple you have to press ctrl r and then you can write some parts of the command for e.g :- you write ls and then you pressed ctrl - R again so what it will do is it will show you the matches and you can just navigate through them by pressing ctrl -r again
and if you find a suitable match for the command for e.g :- ls -a
you can press the enter key to use it again

our terminal is getting a little cluttered so to clear up the display we can use the below command 👇👇👇


So now if we are talking about so much useful features of the linux without tab completion how can my article be completed 😅😅
The most useful feature in any command-line environment is our all time-favourite 😁😁

Tab-Completion ---> So how it works is if you type chr or firef and then press tab it will autocomplete the command like if u typed chr it will autocomplete the command with chrome

Image description

So that was all from my side . Have a great day ahead ✌✌

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.