Of bash, history and you
The command line — where you type commands and do other funky stuff is sometimes a seemingly different area altogether. It takes time getting used to but it’s worth it. There are a lot of things you can do on the command line. You could do them with some tool with graphical user interface but there are nifty things about it like the history for instance. I like the fact that I could go back to the commands I typed. This is especially when I try following a tutorial and I am afraid I skipped something.
For most of the distros I’ve tried there’s bash or the Bourne again shell. There are actually a lot of guides online that discuss the commands and scripting you could do in bash. There are even tips on keyboard shortcuts in bash. So yeah, as a way for you to communicate with the operating system you need to be familiar with how to talk with the shell.
Anyhow so via bash, you could fiddle around with the bash history file. How? Here are some tips:
history | grep -i <first-few-letters-of-command>will help you recall a command you used(from a a Linux.com article on bash history- Editing your .bashrc file so that you could keep your commands appended to the history instead of overwriting the history. What to write in .bashrc? This:
- shopt -s histappend
- PROMPT_COMMAND=’history -a’
- You could secure your bash history. It could be on a per user basis or for all users.
It depends on your needs of course. Keep in mind that the bash history is a good thing and a bad thing, depending on the security level you prefer. I am not really very paranoid about my own laptop so I haven’t disabled bash history nor have thought about it. How about you? And I do hope that the links have helped you in dealing with bash history.
Tags: bashRelated Stories
POSTED IN: Geeky Fun
0 opinions for Of bash, history and you
No one has left a comment yet. You know what this means, right? You could be first!
Have an opinion? Leave a comment: