Skip to content

Commit 6c4c11b

Browse files
committed
feat: add a section introducing CTRL+A and CTRL+E shortcuts
1 parent abe09c2 commit 6c4c11b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

episodes/01-introduction.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,38 @@ pwck pwconv pwd pwdx pwunconv
365365

366366
Displays the name of every program that starts with `pw`.
367367

368+
### Shortcut: Moving to the start or end of a command
369+
370+
Editing a long command can be time consuming. The shell has shortcut keys for moving to the start
371+
or end of a command that you are typing.
372+
373+
Try typing this command, but don't hit enter yet.
374+
375+
```bash
376+
ls home/dcuser/shell_data
377+
```
378+
379+
Notice that there is an error: there should be a `/` at the start of the path.
380+
381+
Use CTRL+A (hold down the control (CTRL) key and press the A key) to move to the start of the command.
382+
383+
Edit the command to add the missing `/`, but don't hit enter yet.
384+
385+
```bash
386+
ls /home/dcuser/shell_data
387+
```
388+
389+
Now you decide actually you wanted to see the contents one level down in `sra_metadata`.
390+
391+
Use CTRL+E to move to the end of the command.
392+
393+
Edit the command to add `/sra_metadata` and now hit enter.
394+
395+
```bash
396+
ls /home/dcuser/shell_data/sra_metadata
397+
```
398+
399+
368400
## Summary
369401

370402
We now know how to move around our file system using the command line.

0 commit comments

Comments
 (0)