From the course: Unix Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Command history shortcuts - Unix Tutorial
From the course: Unix Essential Training
Command history shortcuts
- [Instructor] In this movie, we'll learn to use some handy shortcuts to run commands that are in the Unix command history. There are some other useful shortcuts that make use of the history. Let me clear my screen again. They all start with the exclamation point. So let's just do history so I can see just the last few. If you're on bash, you might want to do something like history 15, and let's pick one of these commands that we want to run. Let's just run 340, because that's nice and simple. It's just going to show me the current working directory. So if I were to type in the dollar sign followed by that number, 340, with no space after it, it'll execute that command. It tells me what command it's running, and then it does it. That's very handy. We can look back through the history, pick the command that we want, find its reference number, and just put an exclamation point in front of it to execute that command again.…
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.