cat ~/.bash_logout
# ~/.bash_logout: executed by bash(1) when
# login shell exits. When leaving the console
# clear the screen to increase privacy.
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] &&
/usr/bin/clear_console -q
fi
set -o
allexport off
braceexpand on
emacs on
set +o
set +o allexport
set -o braceexpand
set -o emacs
shopt
autocd off
cdspell off
cmdhist on
shopt -p
shopt -u autocd
shopt -u cdspell
shopt -s cmdhist
foo=bar
declare -p foo
declare -x foo="bar"/tmp
sleep 1000 &
[1] 20107
kill %1
[1]+ Terminated sleep 1000
foo
[shell exits]
echo /*
/*
a=1 bash -c 'declare -p a b' b=2
declare -x a="1"
declare -x b="2"
echo {01..20..2}
01 03 05 07 09 11 13 15 17 19
!!
echo {01..20..2}
01 03 05 07 09 11 13 15 17 19
> foo
> foo
bash: foo: cannot overwrite existing file
IGNOREEOF=2
Ctrl + d
Use "exit" to leave the shell.
Use "exit" to leave the shell.
: $a $b $c; foo
bash: a: unbound variable
pwd; sleep 5
/tmp
[shell exits after 5 seconds]
ln -s ~ /tmp/h
cd /tmp/h/.. ; pwd
/home
grep :/var/ruuun/ /etc/passwd | wc -l
0
echo $?
1
echo $(( $(echo $(( $(date +%s) + 3600)) \
| wc -c ) - 1))
++ wc -c
+++ date +%s
++ echo 1488498282
+ echo 10
10
/tmp
cd -- /tmp
foo=/var/tmp
cd foo
/var/tmp
cd /tpm
/tmp
sleep 100 &
[1] 27819
exit
There are running jobs.
[1]+ Running sleep 100 &
while sleep 1; do
date
done
while sleep 1; do date; done
foo=/var/tmp
ls $foo tab ls /var/tmp
cd /tpm/ tab cd /tmp/
echo *
.aptitude .bash_history .bash_logout
.bashrc .blender ...
rm img+([0-9]).jpg
rm img!(+([0-9]).jpg
rm img*.@(jpg|png|gif)
echo fi*le
bash: no match: fi*le
FIGNORE=.swp:.tmp:~
ls tab
touch {a..z} {A..Z}
echo [a-z]
a b c d ...
mkdir -p /var/tmp/a/b/c
file /var/tmp/a/**
/var/tmp/a/: directory
/var/tmp/a/b: directory
/var/tmp/a/b/c: directory
echo .v*
.vim .viminfo .viminfz.tmp .vimrc .VirtualBox
mkdir tmp
echo tmp/*
echo 'a\nb'
a
b
BASH_CMDS+=([d]=/usr/bin/date)
BASH_CMDS[grep]=/usr/xpg4/bin/grep
hash
hits command
2 /usr/xpg4/bin/grep
0 /usr/bin/date
1 /usr/bin/man
exec 3>/dev/pts/4
BASH_XTRACEFD=3
set -x
CDPATH=~/Project:/var/www/vhosts
cd if17
/home/barinkl/Project/if17
EXECIGNORE=*/bz*:*grep*
FCEDIT=vim
fc
FIGNORE='~:.bak:.tmp'
GLOBIGNORE=*.bak:*.tmp
HISTCONTROL=ignorespace:ignoredups:erasedups
# /dev/null disables saving history
HISTFILE=~/.bash_history
HISTSIZE=500
HISTFILESIZE=$HISTSIZE
HISTIGNORE="&:ls:[bf]g:exit:[ \t]*"
HISTTIMEFORMAT='%Y-%m-%d %T'
IFS=:
while read user:pass:uid:gid:comm:home:shell
do ...
done < /etc/passwd
IFS=$' \t\n'
touch {a..z} {A..Z} é ch
export LC_ALL=en_US.utf8
ls [a-z]* | tr -d '\n'
aAbBcCchdDeEéfFg...yYz
export LC_ALL=C
ls [a-z]* | tr -d '\n'
abcchdefghijklmnopqrstuvwxyz
export LC_COLLATE=cs_CZ.utf8 LC_CTYPE=cs_CZ.utf8
ls [[:lower:]]* | tr -d '\n'
abcdeéfghchijklmnopqrstuvwxyz
PS0='\e[01;40;33m\
$(printf "%${COLUMNS}s" \!)\e[0m\n'
export PROMPT_COMMAND='history -a; history -n'
PS1='\[\033]0;\u@\h:\w\007\]\u@\h:\w\$ '
PROMPT_DIRTRIM=1; cd /var/log/apache2
user@host:.../apache2 >
BASH_ALIASES+=([sl]=ls [..]='cd ..')
alias c='cd '
alias p='~/Documents/Work/Projects'
c p
cd ~/Documents/Work/Projects
For almost every purpose,
aliases are superseded by shell functions.
function command_not_found_handle {
if [ -x /usr/lib/command-not-found ]
then
/usr/lib/command-not-found -- "$1"
return $?
elif [ -x /usr/share/command-not-found/command-not-found ]
then
/usr/share/command-not-found/command-not-found -- "$1"
return $?
else
printf "%s: command not found\n" "$1" >&2
return 127
fi
}
function cd {
echo "From: $PWD" >&2
builtin cd "$@"
echo "To: $PWD" >&2
}
function du {
command du -sh "$@" \
| egrep '^([0-9.]+G|([5]|1[0-9])[0-9][0-9]M)'
}
stty -a | sed -n 2,4p
intr = ^C; quit = ^\; erase = ^?; kill = ^U;
eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; ...
stty intr ^T
xclock &
[1] 21157
jobs
[1]+ Running xclock &
disown %1
jobs
trap 'echo DEBUG' DEBUG
PS0=$'PS0\n'
pwd; echo .
PS0
DEBUG
/home/barinkl
DEBUG
.
DEBUG
showkey -a F2
Press any keys - Ctrl-D will terminate this ...
^[OQ 27 0033 0x1b
79 0117 0x4f
81 0121 0x51
Ctrl+V F2
^[OQ
bind "\"\eOQ\":\"git commit -am ''\e[D\""
bind -x '"\ez":"date"'
set blink-matching-paren on
set expand-tilde on
set keyseq-timeout 500
"\C-t": forward-search-history
"##": insert-comment
"\C-o": "> /dev/null"
"\ez": "date\n"
"\eOQ": "git commit -am ''\e[D"
time for ((i=0;i<1000;i++))
do
finfo -m . stat -c %Y .
done >/dev/null
real 0m0,005s real 0m0,768s
user 0m0,004s user 0m0,020s
sys 0m0,000s sys 0m0,164s