Saturday, May 31, 2008

element to bash shell 1

To get a sorted listing of all users on the system, type:

$ cut -d: -f1 < /etc/passwd | sort

nice: change job's priortity

Special Characters Character Meaning
~Home directory1
`Command substitution (archaic)4
$Variable expression3
&Background job1
*String wildcard1
(Start subshell8
)End subshell8
\Quote next character1
[Start character-set wildcard1
]End character-set wildcard1
{Start command block7
}End command block7
;Shell command separator3
'Strong quote1
<">Weak quote1
<Input redirect1
>Output redirect1
/Pathname directory separator1
?Single-character wildcard1
!Pipeline logical NOT5

quoting and backslash escaping

$ echo '2 * 3 > 5' is a valid inequality
$ echo 2 \* 3 \> 5 is a valid inequality.
$ echo The Caterpillar and Alice looked at each other for some \ > time in silence: at last Caterpillar took the hookah out of its \> mouth, and addressed her in a languid, sleepy voice.

Basic shell command
erase  kill   werase rprnt  flush  lnext  susp   intr   quit   stop   eof
^?     ^U     ^W     ^R     ^O     ^V     ^Z/^Y  ^C     ^\     ^S/^Q  ^D

Control Keystty NameFunction Description
CTRL-C   intr      Stop current command
 CTRL-D  eof       End of input
CTRL-\    quit      Stop current command, if CTRL-C doesn't work
CTRL-S   stop      Halt output to screen
CTRL-Q  Restart output to screen
DEL or   CTRL-?  eraseErase last character
CTRL-U  kill         Erase entire command line
CTRL-Z   susp     Suspend current command
CTRL-A  head   head of current command line
CTRL-H  backspace
CTRL-S and CTRL-Q are basically a nuisanc

The resulting output will include this information:
intr = ^c; quit = ^|; erase = DEL; kill = ^u; eof = ^d; eol = ^`;swtch = ^`; susp = ^z; dsusp <undef>;

No comments: