info:bash

Ceci est une ancienne révision du document !


Bash / Terminal

(acronyme de Bourne-Again shell) est un interpréteur en ligne de commande de type script. C'est le shell Unix du projet GNU

voir aussi: *nix (linux/unix)

note Fred: all the linux's magic is in bash!

Doc

Moving the cursor:

Ctrl + a   Go to the beginning of the line (Home)
Ctrl + e   Go to the End of the line (End)
Ctrl + p   Previous command (Up arrow)
Ctrl + n   Next command (Down arrow)
 Alt + b   Back (left) one word
 Alt + f   Forward (right) one word
Ctrl + f   Forward one character
Ctrl + b   Backward one character
Ctrl + xx  Toggle between the start of line and current cursor position

Editing:

Ctrl + L Clear the Screen, similar to the clear command

Alt + Del Delete the Word before the cursor.
Alt + d   Delete the Word after the cursor.

Ctrl + d Delete character under the cursor Ctrl + h Delete character before the cursor (Backspace)

Ctrl + w Cut the Word before the cursor to the clipboard. Ctrl + k Cut the Line after the cursor to the clipboard. Ctrl + u Cut/delete the Line before the cursor to the clipboard.

Alt + t   Swap current word with previous

Ctrl + t Swap the last two characters before the cursor (typo). Esc + t Swap the last two words before the cursor.

ctrl + y Paste the last thing to be cut (yank)

Alt + u   UPPER capitalize every character from the cursor to the end of the current word.
Alt + l   Lower the case of every character from the cursor to the end of the current word.
Alt + c   Capitalize the character under the cursor and move to the end of the word.
Alt + r   Cancel

Tips

* [[bash_gnome-terminal|force a bash script on a localhost to remain open]]
* [[bash_loop]] Script to automatically backup files using simple FTP
* [[image_delete.sh]]remove image from download, tmp and desktop directories with a bash loop / array
* [[info:lowercase|bash: convertir une chaîne de caratères en minuscules (lowercase)]]
* [[info:uppercase|bash: convertir une chaîne de caratères en majuscules (uppercase)]]
* [[bash loop]]

Softs

shellcheck : Vérifier ses scripts shell (suggestions d'améliorations, corrections sécurité etc)

  apt install shellcheck

https://www.linuxtricks.fr/wiki/shellcheck-verifier-ses-scripts-shell

Terminator est un terminal virtuel qui a la particularité de permettre de partager la fenêtre selon vos envies et ainsi organiser plus simplement vos différentes fenêtres.

https://doc.ubuntu-fr.org/terminator

  • info/bash.1659853013.txt.gz
  • Dernière modification : 2022/08/07 08:16
  • de radeff