Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested restructure of 'Using History' section of lc-shell/03-working-with-files-and-folders #213

Open
mandyphippsgreen opened this issue Oct 30, 2022 · 0 comments
Labels
type:clarification Suggest change for make lesson clearer

Comments

@mandyphippsgreen
Copy link

mandyphippsgreen commented Oct 30, 2022

https://librarycarpentry.org/lc-shell/03-working-with-files-and-folders.html#using-history

For me, the 'Using history' section in Episode 3 Working with Files and Directories is text heavy and in one large paragraph chunk, that jumped between 'history' actions and 'Ctrl + r' actions. I found it somewhat confusing to follow and think it could be re-structured to improve readability and clarity for learners. Therefore, I suggest amending the structure as follows (including line breaks to break up the text), and some minor changes for clarity:

Use the history command to see a list of all the commands you’ve entered during the current session.
Type 'history' into the shell.
If you want to save your history, maybe to extract some commands from which to build a script later on, you can do that with:

[In Bash purple box]
history > history.txt

This will output all history to a text file called history.txt in your working directory that you can later edit.

To recall a command from history, type history. Note the command number of the relevant command, e.g. 2045. Recall the command by entering !2045. This will execute the command.

You can also use Ctrl + r to do a reverse lookup of a command. Press Ctrl + r, then start typing any part of the command you’re looking for, e.g. head ... The past command will autocomplete.
Press enter to run the command you have selected again, or press the arrow keys to start editing the command.
If multiple past commands contain the text you input, you can Ctrl + r repeatedly to cycle through them to find the one you want.
If you can’t find what you’re looking for in the reverse lookup, use Ctrl + c to return to the prompt.

@kaitlinnewson kaitlinnewson added the type:clarification Suggest change for make lesson clearer label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:clarification Suggest change for make lesson clearer
Projects
None yet
Development

No branches or pull requests

2 participants