![]() Using tab-completion not only saves keystrokes, and time, but also reduces the potential for typos and errors. When there are multiple options to complete, bash will play an alarm sound, if you then press tab for the second time, it will list all options: $ cd ~/D⇥⇥ There does not seem to be a keystroke that just clears the entire current line, but most of the time your cursor will be at the end of the line, so ctrl-U will do the trick.Īnd finally, you can option-click with the mouse pointer on a character in the command line to move the cursor there. If you recalled a wrong command, then you can clear the entire part left of the cursor with ctrl-U and the part right of the cursor with ctrl-K. You can use ctrl-A to jump to the beginning of the line and ctrl-E to jump to the end.Ĭtrl-XX (hold ctrl and press ‘x’ twice) will jump to the beginning of the line and then back to the current position the second time you use it. You can use (option) ⌥-left (or right) to move word by word. The left and right arrows move the cursor left and right. Once you have recalled (or typed) a command and want to edit it, you will have to move the cursor. When you get ‘stuck’ in the search mode you can leave it with ctrl-G. So ctrl-R and then typing cd will recall the last cd command you typed. This will search through the history backwards and recall the latest command you used starting with what you typed. Instead of hitting the up arrow several times, you can also hit ctrl-R and start typing a command you used before. ![]() You can also hit the down arrow to move forward again. You can hit the up arrow multiple times to go back further in your command history. Hitting the up arrow will recall the previous command, leaving the cursor at the end of the line, so you can either hit return to execute the command or edit it. ![]() Often you want to retry or re-use a previous command. These key commands are for the default Terminal configuration with the bash shell. Sometimes you have to move the cursor around the prompt line and there are more efficient ways of doing this than hitting the left arrow multiple times. One the most basic elements of a command shell is the prompt line, where you enter the command. I have talked a lot about the Terminal recently.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |