Netcat 101: Using Netcat to Transfer Files HakTip
Linux Terminal 101: How to Use Netcat To Chat HakTip
Linux Terminal 101: Netcat HakTip
Linux Terminal 101: Viewer Tips Part 2! HakTip
Linux Terminal 101: Viewer Tips! PID, History, and More! HakTip
Linux Terminal 101: Controlling Processes HakTip
Linux Terminal 101: How to View Processes HakTip
Linux Terminal 101: How to Change Your Identity HakTip
Update All of Your Programs at Once with AppUpdater! HakTip
Network Monitoring in Linux with lsof HakTip
How to Use Problems Step Recorder for Windows HakTip
How to Move Steam Games from Your C Drive HakTip
Chrome Grease Monkey Script for Late Night Coding HakTip
Bash Substitution Without Sed HakTip
How to Safely and Securely Delete and Restore Your Files HakTip
Bash Basics: Keep History Free from Passwords HakTip
Today we're learning and using the history command.
All of your old commands are stored in this file called .bash_history, which you can search via the terminal. We're going to use lots of tools we've learned up til now to really get into the history.
First off, check out that file with: history | less
This will store the last 500 commands. If you want to check a specific listing, you can change this with grep: history | grep /usr/bin
In this example, the number at the beginning is where it falls in the history list. To shorten this line, you can type !thenumber. Bash expands this line item for you.
To search incrementally, which kind of reminds me of a Google search, you can hit CTRL-R, then type in your search query. For /usr/bin we get a result. You can use this result by pressing enter, or copy with CTRL-J. You can also search farther back in history with CTRL-R. To quit, use CTRL-G or C.
Here are some handy shortcuts for History: CTRL-P, N move to the previous or next entry. ALT->, < move to the beginning or end of the list. CTRL-O can run the current command then move on to the next one.
We're back with history! There are some expansion commands that you can use for history, and they start with a !. Some include: !! to repeat the last command, !number to run that listing item number, !string to repeat a list starting with string, and !?string to repeat a list containing string. Don't use the last two unless you are sure you know what you're doing. Check out the bash man page for history expansion for more!
How do you use the history command? Make sure to email me firstname.lastname@example.org with your thoughts. And be sure to check out our sister show, Hak5 for more great stuff just like this. Dont forget to check out our new show Threat Wire, for internet privacy and security news at youtube.com/techfeed. I'll be there, reminding you to trust your technolust.
Whether you're a beginner or a pro, HakTip is essential viewing for current and aspiring hackers, computer enthusiasts, and IT professionals. With a how-to approach to all things Information Technology, HakTip breaks down the core concepts, tools, and techniques of Linux, Wireless Networks, Systems Administration, and more
Want the most recent episode of this show on your website? Use this self-updating embed code!