From the course: Linux: Shells and Processes
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Configure shell history - Linux Tutorial
From the course: Linux: Shells and Processes
Configure shell history
- [Instructor] There may be times that you do not want commands recorded in your command history. For instance, if you type ls or pwd a lot, your history will become polluted with these two commands, making it harder to see the commands you really want to recall. In this case, you can set a shell variable called HISTCONTROL. To change the value of this variable, type into a terminal, HISTCONTROL="ignorespace" and hit Enter. Now, when you want to run a command and do not want it to be recorded in the command history, prepend the command with a space. Let's test this by placing a space before the history command and see if it gets recorded. Type in " history" and hit Enter. And we can see that it did not. This is a simple way of keeping your history clean if you can remember to type the space. Another value for this option is ignoredups. Ignoredups option does not allow recording duplicate entries. Bring a line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
About Linux shells6m 21s
-
About Linux terminals1m 50s
-
(Locked)
Shell pathname tricks7m 7s
-
(Locked)
Shell history tricks3m 29s
-
(Locked)
Configure shell history6m 59s
-
(Locked)
Variables and shell environment5m 33s
-
(Locked)
Make shell variables persistent6m 48s
-
(Locked)
Pattern matching with globs5m 9s
-
(Locked)
Globs exercise6m 42s
-
(Locked)
Pattern matching with extended globs6m 25s
-
(Locked)
Extended glob exercise4m 22s
-
-
-
-
-