bash
Quick Reference
Command Name:
bash
Category:
shells
Platform:
linux
Basic Usage:
Common Use Cases
Syntax
bash [options] [file [arguments]] bash [options] -c command_string [arguments]
Options
Option | Description |
---|---|
-c string | Execute commands from string |
-i | Force shell to be interactive |
-l | Make bash act as if invoked as a login shell |
-r | Start a restricted shell |
-s | Read commands from standard input |
-v | Print shell input lines as they are read |
-x | Print commands and their arguments as they are executed |
--norc | Do not read startup files (the .bashrc file) |
--noprofile | Do not read the startup files /etc/profile or ~/.profile |
--rcfile file | Execute commands from file instead of ~/.bashrc |
--posix | Change the behavior of bash to follow the POSIX standard |
--version | Display version information and exit |
--help | Display a usage message and exit |
Examples
How to Use These Examples
The examples below show common ways to use the bash
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
# Start a new interactive bash shell bash
Advanced Examples:
# Execute bash with debugging output bash -x myscript.sh