tldr/pages/common/bash.md

29 lines
463 B
Markdown
Raw Normal View History

2016-01-04 22:55:14 +03:00
# bash
> Bourne-Again SHell.
2016-01-04 22:55:14 +03:00
> `sh`-compatible command line interpreter.
2016-02-23 04:14:41 +03:00
- Start interactive shell:
2016-01-04 22:55:14 +03:00
`bash`
2016-02-23 04:14:41 +03:00
- Execute a command:
2016-01-04 22:55:14 +03:00
2016-09-04 22:59:10 +03:00
`bash -c "{{command}}"`
2016-01-04 22:55:14 +03:00
2016-02-23 04:14:41 +03:00
- Run commands from a file:
2016-01-04 22:55:14 +03:00
2016-02-23 04:14:41 +03:00
`bash {{file.sh}}`
2016-01-04 22:55:14 +03:00
2017-09-21 10:35:20 +03:00
- Run commands from a file, logging all commands executed to the terminal:
`bash -x {{file.sh}}`
2016-02-23 04:14:41 +03:00
- Run commands from STDIN:
2016-01-04 22:55:14 +03:00
2016-02-23 04:14:41 +03:00
`bash -s`
2016-09-01 16:31:38 +03:00
- Print the version information of bash (use `echo $BASH_VERSION` to show just the version string):
`bash --version`