Skip to Main Content
Linux Pocket Guide
book

Linux Pocket Guide

by Daniel J. Barrett
February 2004
Beginner content levelBeginner
200 pages
5h 40m
English
O'Reilly Media, Inc.
Content preview from Linux Pocket Guide

Command history

You can recall previous commands you’ve run—that is, the shell’s history—and then edit and re-execute them. Some useful history-related commands are listed below.

Command

Meaning

 

history

Print your history

 

history N

Print the most recent N commands in your history

 

history -c

Clear (delete) your history

 

!!

Previous command

 

!N

Command number N in your history

 

!-N

The command you typed N commands ago

 

!$

The last parameter from the previous command; great for checking that files are present before removing them:

$ ls a*
$ rm !$
 

!*

All parameters from the previous command

 
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Pocket Guide, 2nd Edition

Linux Pocket Guide, 2nd Edition

Daniel J. Barrett
Linux in a Nutshell, 6th Edition

Linux in a Nutshell, 6th Edition

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins

Publisher Resources

ISBN: 9780596806347Errata Page