Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia |
linux:bash:start [21/02/2019 00:48] – [shortcuts] mate | linux:bash:start [12/04/2023 05:59] (actual) – [BASH] mate |
---|
~~NOTOC~~ | ~~NOTOC~~ |
= /bin/bash | = BASH |
{{tag>linux bash pendiente wiki}} | {{tag>linux pendiente wiki}} |
| |
== related | == related |
{{topic>linux +bash}} | {{topic>linux +bash}} |
| |
| == cheatsheet |
| * {{ :linux:bash:cli-cheat-sheet.pdf |}} |
| |
== shell | == shell |
* ''/etc/shells'' | * ''/etc/shells'' |
* [[linux:bash:historyexpansion|]] | * [[linux:bash:historyexpansion|]] |
* [[linux:bash:shellvariables|]] | * [[linux:bash:shellvariables|]] |
<callout type="warning" icon="true" title="Brace expansion">[[http://wiki.bash-hackers.org/syntax/expansion/brace]]</callout> | * [[linux:bash:ficherosinicio|]] |
| * [[linux:bash:update-alternatives]] |
| |
| <callout type="info" title="Bash scripting cheatsheet" icon="true">https://devhints.io/bash</callout> |
| <callout type="info" title="The Bash Hackers Wiki" icon="true">https://wiki.bash-hackers.org/start</callout> |
<callout type="warning" icon="true" title="Bash variables and command substitution">[[http://www.compciv.org/topics/bash/variables-and-substitution/]]</callout> | <callout type="warning" icon="true" title="Bash variables and command substitution">[[http://www.compciv.org/topics/bash/variables-and-substitution/]]</callout> |
<callout type="warning" icon="true" title="Parameter expansion">[[http://wiki.bash-hackers.org/syntax/pe?rev=1529675381]]</callout> | <callout type="warning" icon="true" title="Parameter expansion">[[http://wiki.bash-hackers.org/syntax/pe?rev=1529675381]]</callout> |
<callout type="info" title="Glob" icon="true">https://en.m.wikipedia.org/wiki/Glob_(programming)</callout> | <callout type="info" title="Glob" icon="true">[[https://en.m.wikipedia.org/wiki/Glob_(programming)]]</callout> |
| <callout type="warning" icon="true" title="list of Unix binaries that can be exploited by an attacker to bypass local security restrictions">[[https://gtfobins.github.io/]]</callout> |
| <callout type="info" title="Settings Shell Options" icon="true">https://bash.cyberciti.biz/guide/Setting_shell_options</callout> |
| |
=== comandos CLI | === comandos CLI |
== scripting | == scripting |
<callout type="info" icon="true" title="Guía rápida para principiantes">[[http://es.tldp.org/COMO-INSFLUG/COMOs/Bash-Prog-Intro-COMO/Bash-Prog-Intro-COMO.html]]</callout> | <callout type="info" icon="true" title="Guía rápida para principiantes">[[http://es.tldp.org/COMO-INSFLUG/COMOs/Bash-Prog-Intro-COMO/Bash-Prog-Intro-COMO.html]]</callout> |
| <callout type="info" icon="true" title="Diferencia entre brackets y dobles brackets">https://www.baeldung.com/linux/bash-single-vs-double-brackets#:~:text=In%20this%20article%2C%20we%20discussed,we%20should%20prefer%20single%20brackets.</callout> |
| |
* [[linux:bash:estructurasdecontrol|]] | * [[linux:bash:estructurasdecontrol|]] |
* [[https://www.cyberciti.biz/programming/improve-your-bashsh-shell-script-with-shellcheck-lint-script-analysis-tool/]] | * [[https://www.cyberciti.biz/programming/improve-your-bashsh-shell-script-with-shellcheck-lint-script-analysis-tool/]] |
* herramienta chequeo scripts: ''shellcheck'' | * herramienta chequeo scripts: ''shellcheck'' |
| * Diferencia entre **[** y **%%[[%%** : [[https://www.baeldung.com/linux/bash-single-vs-double-brackets#:~:text=In%20this%20article%2C%20we%20discussed,we%20should%20prefer%20single%20brackets.]] |
| |
| |
^ shorcut ^ descripción ^ | ^ shorcut ^ descripción ^ |
^ navegación ^^ | ^ navegación ^^ |
| | CTRL + A | principio línea | |
| | CTRL + E | final de línea | |
| | CTRL + XX | conmuta entre la posición actual del cursor y el principio de línea ? | |
| | ALT + B | atrasa una palabra el cursor | |
| | ALT + F | adelanta una palabra el cursor | |
^ edición ^^ | ^ edición ^^ |
| | ALT + U | uppercase caracter cursor | |
| | ALT + L | lowercase caracter cursor | |
| | ALT + C | capitalize caracter cursor y va al final de palabra | |
| | ALT + D | borra palabra desde cursor hasta el final de la misma | |
| | ALT + Del | borra palabra desde cursor hasta el principio de la misma | |
| | ALT + T | intercambio palabra con la anterior | |
| | CTRL + _ | undo | |
^ historia ^^ | ^ historia ^^ |
^ control del procesos ^^ | ^ control del procesos ^^ |
^ CTRL + C ^ interrumpe/mata ^ | | CTRL + C | interrumpe/mata | |
| | CTRL + L | limpia pantalla | |
| | CTRL + S | para salida por pantalla | |
| | CTRL + Q | permitir salida por pantalla | |
| | CTRL + D | marca EOF | |
| | CTRL + Z | interrumpe/mata | |
| |
| |
[[https://shortcutworld.com/Bash/linux/Bash_Shortcuts]] | |
| /via: [[https://shortcutworld.com/Bash/linux/Bash_Shortcuts]] |
== Variables de entorno | == Variables de entorno |
* ''HISTFILE'': Fichero donde se almacena el historial de comandos tecleados | * ''HISTFILE'': Fichero donde se almacena el historial de comandos tecleados |
https://www.cyberciti.biz/faq/linux-unix-bash-shell-list-all-builtin-commands/ | https://www.cyberciti.biz/faq/linux-unix-bash-shell-list-all-builtin-commands/ |
| |
== scripts de inicio | |
=== orden de ejecución al iniciar sesión | |
==== proceso de login | |
^ # ^ Login Shell ^ Interactive Shell ^ | |
| 1 | /etc/profile | | | |
| 2 | ~/.bash_profile | | | |
| 3 | ~/.bashrc | ~/.bashrc | | |
| 4 | /etc/bashrc | /etc/bashrc | | |
| |
al salir: | |
- ~/.bash_history | |
- ~/.bash_logout | |
- /etc/bash_logout | |
| |
=== macintosh | |
- /etc/profile -> <home>/.bash_profile | |
- /etc/bashrc -> <home>/.bashrc | |
| |
- variables de entorno | |
- variables shell | |
| |
añadir en /etc/profile: ''source /etc/bashrc''\\ | |
añadir en <home>/.bash_profile: ''source <home>/.bashrc'' | |
| |
| |