Terminal Shortcuts 3.
James Jiang, a computer.

Terminal Shortcuts 3.

For history:

  1. Ctrl + R ---> Incremental reverse search in the command history. (Results are shown as you enter search characters).
  2. Ctrl + J --> Stop searching in the history and select the current command.
  3. Ctrl + G ---> Stop the search mode in the command history.
  4. Alt + P --> Non-incremental reverse search in the command history. (Does not show the result until you press Enter).
  5. Ctrl + _ --> Undo the last change made to the command line (e.g., to delete the last typed word or character).
  6. Ctrl + P / up arrow key --> Show the previous command.
  7. Ctrl + N / down arrow key ---> Show the next command.
  8. Ctrl + O ---> Execute the previous command in the history and move the cursor to the input line of the next command.
  9. !! ---> Execute the last entered command again.
  10. !* ---> It's used to reference all the arguments of the previous command. (It can be useful if you need to use the same arguments in several successive commands.)
  11. !*:p --> In general, in Bash, :p causes the result of the previous command to be printed instead of executed; in this case, it would print the arguments represented by !*.
  12. !x ---> Execute the most recent command in the history that starts with the letter x.
  13. !x:p ---> Print on the screen the most recent command in the history that starts with the letter x.
  14. !$ ---> It's used to reference the last argument of the last executed command. (For example, creating a folder and moving into it: mkdir house/door ---> cd !$)
  15. !^ ---> It's used to reference the first argument of the last executed command.
  16. !$:p ---> Print on the screen the value that !$ refers to.
  17. ^123^abc ---> Replace the last occurrence of "123" in the last executed command with "abc" and execute the resulting command.
  18. !n:m ---> Execute the command number "n" from the "m"-th argument.
  19. !fi ---> Execute the last command that matches the search pattern "fi".
  20. !n ---> Execute the nth command in the command history.
  21. !n:p ---> Print the nth command in the command history, without executing it.
  22. !n:$ ----> It's used to obtain the last argument of the nth command in the command history.


Note: If you're using Git Bash for Windows, most of these shortcuts also work.

要查看或添加评论,请登录

Franco Iba?ez的更多文章

  • Mi salto a Linux.

    Mi salto a Linux.

    No conocía otra cosa que no fuera Windows, desde aquella máquina con Windows 98 que consiguió mi viejo, pasando por…

    1 条评论
  • Why should you learn touch typing in 2024?

    Why should you learn touch typing in 2024?

    I've always wanted to type on the keyboard as fast as possible. I used to do it with just 2, maybe 3 fingers on each…

  • Save Time on LinkedIn Searches: Keyboard Shortcuts Guide

    Save Time on LinkedIn Searches: Keyboard Shortcuts Guide

    Surely you're wondering, "How could this guide be useful to me?" Well, in short, when I search on LinkedIn, I really…

  • Terminal Shortcuts 5.

    Terminal Shortcuts 5.

    For process control: Ctrl + L ----> Similar to the clear command, clears the terminal screen. Ctrl + S ----> It's used…

  • Terminal Shortcuts 2.

    Terminal Shortcuts 2.

    For editing; Ctrl + U ---> Delete all text that is behind the cursor. Ctrl + K ---> Delete all text that is in front of…

  • Terminal Shortcuts 4.

    Terminal Shortcuts 4.

    For obtaining information: TAB ---> Automatically complete the command or file path being typed. ~TAB TAB ---> Print a…

  • Terminal Shortcuts 1.

    Terminal Shortcuts 1.

    For navigation: Ctrl + A -----> Move the cursor to the beginning of the line. Ctrl + E -----> Move the cursor to the…

  • ?Porqué deberías aprender mecanografía este 2023?

    ?Porqué deberías aprender mecanografía este 2023?

    Siempre quise escribir en el teclado lo más rápido posible. Lo hacía con 2, máximo 3 dedos de cada mano.

    22 条评论
  • ?Te gustaría ahorrar tiempo en tus búsquedas en LinkedIn? Aprende a crear atajos de teclado para filtros personalizados

    ?Te gustaría ahorrar tiempo en tus búsquedas en LinkedIn? Aprende a crear atajos de teclado para filtros personalizados

    Seguro te estás preguntando: "?Para qué me sería útil esta guía?" Bueno, en pocas palabras, cuando busco algo en…

  • Shortcuts de Terminal 5.

    Shortcuts de Terminal 5.

    Para el control de procesos: Ctrl + L ----> Similar al comando clear , limpia la pantalla de la terminal. Ctrl + S…

社区洞察

其他会员也浏览了