Linux History Command
Sunday, February 16th, 2020 04:13 pmPlenty of online articles explain how to use the Linux history command, but I'm noting it to myself here for easy reference.
To see a list of commands you've run in the terminal, enter:
history
To narrow down the results and find something specific (for example, to list all the rsync commands you've used), combine the history command with grep:
history | grep rsync
Each command in the history list has a number associated with it. To run a command again without having to retype the whole thing, enter ! followed by the command's associated number. For example:
!201
Entering !201 is less painful than re-typing something like rsync -artvu --delete "/run/media/username/data-drive/" "/run/media/username/backup-drive/".
(no subject)
Date: February 16th, 2020 09:55 pm (UTC)(no subject)
Date: February 16th, 2020 11:40 pm (UTC)