File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,40 @@ pwck pwconv pwd pwdx pwunconv
365365
366366Displays 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 this command.
374+
375+ ``` bash
376+ ls home/dcuser/shell_data
377+ ```
378+
379+ You will get an error ` ls: cannot access 'home/dcuser/shell_data': No such file or directory ` .
380+ There should be a ` / ` at the start of the path.
381+
382+ Use the up arrow to get the previous command again.
383+ Use CTRL+A (hold down the control (CTRL) key and press the A key) to move to the start of the command.
384+ Edit the command to add the missing ` / ` and hit enter.
385+
386+ ``` bash
387+ ls /home/dcuser/shell_data
388+ ```
389+
390+ Now you decide actually you wanted to see the contents one level down in ` sra_metadata ` .
391+
392+ Use the up arrow to get the previous command again.
393+ Your cursor will be at the end of the command.
394+ Use CTRL+A to move to the beginning of the command, then CTRL+E to move to the end of the command.
395+ Edit the command to add ` /sra_metadata ` and now hit enter.
396+
397+ ``` bash
398+ ls /home/dcuser/shell_data/sra_metadata
399+ ```
400+
401+
368402## Summary
369403
370404We now know how to move around our file system using the command line.
You can’t perform that action at this time.
0 commit comments