2018-11-15 16:24:49 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
category-page: intermediate
|
2018-11-16 12:47:48 +00:00
|
|
|
category-title: Intermediate commands
|
2018-11-15 16:24:49 +00:00
|
|
|
tags: bash shell terminal
|
|
|
|
author: Marco Farace
|
|
|
|
title: bash
|
2018-11-18 20:38:56 +00:00
|
|
|
previous-page: pages/cmd/interm/basename.html
|
|
|
|
next-page: pages/cmd/interm/cat.html
|
2018-11-15 16:24:49 +00:00
|
|
|
---
|
|
|
|
|
2018-11-16 19:47:01 +00:00
|
|
|
Bash is an sh-compatible command language interpreter that executes commands
|
|
|
|
read from the standard input or from a file. Bash also incorporates useful
|
|
|
|
features from the Korn and C shells (ksh and csh).<br>
|
2018-11-15 16:24:49 +00:00
|
|
|
|
2018-11-16 19:47:01 +00:00
|
|
|
<h3>Flags</h3>
|
|
|
|
<ul>
|
|
|
|
<li>-c: If this option is present, then commands are read from
|
|
|
|
string. If there are arguments after the string, they are
|
|
|
|
assigned to the positional parameters, starting with $0.
|
|
|
|
</li>
|
|
|
|
<li>-i: If this option is present, the shell is interactive.</li>
|
|
|
|
<li>-l: Make bash act as if it had been invoked as a login shell.</li>
|
|
|
|
<li>-r: If this option is present, the shell becomes restricted.</li>
|
|
|
|
<li>-s: If this option is present, or if no arguments remain after
|
|
|
|
option processing, then commands are read from the standard
|
|
|
|
input. This option allows the positional parameters to be
|
|
|
|
set when invoking an interactive shell.
|
|
|
|
</li>
|
|
|
|
<li>-s: List only the name, line and time fields. This is the default.</li>
|
|
|
|
<li>-T: Print a character after the user name indicating the state of the
|
|
|
|
terminal line: `+' if the terminal is writable; `-' if it is not;
|
|
|
|
and `?' if a bad line is encountered.
|
|
|
|
</li>
|
|
|
|
<li>-u: Print the idle time for each user, and the associated process ID.</li>
|
|
|
|
<li>am I: Returns the invoker's real user name.</li>
|
|
|
|
<li>file: By default, who gathers information from the file /var/run/utmpx.
|
|
|
|
An alternative file may be specified.
|
|
|
|
</li>
|
|
|
|
</ul>
|