RSS feed [root] /unix /weblog



title search:


Wed Feb 03 22:00:00 HKT 2016


Sum time in script -[..]-summing-the-total-time-from-a-log-file/

Special bash parameters -[..]ial-bash-parameters-in-script-linux.html

ls sort by file size -[..]ns-answers/6518-sorting-ls-filesize.html

How to use "~" -

use rlwrap to enable BASH like editing in SQLplus, and use screen to presist terminal sessions -[..]miracle-utilities-rlwrap-and-screen.html

Ctrl+r searches through history
Use the history command plus !# to run old commands
Shell expansion using {} , e.g. cp{,.old} == cp
zsh have good auto complete

mkdir -p creates nested directories
Use less instead of tail
lsof shows open files
ps will show process trees with the f flag

!! is the previous command in the shell history
Use vim -b to show nonprintable characters
** is a recursive wildcard in zsh
cd – will return to the previous folder
Use ctrl+z and kill %1 to kill a process that will not die
pwdx shows the working directory of a process
Use sh -x to debug shell scripts
sysctl replaces /proc on macs

ps -eo pcpu,pid,args | sort -n => check CPU%
grep -sq "" /etc/lsb-release && lsb_release -rd => run command if file exist

More about ps and free -

HTML tools for commandline -

Bash history -

Tips of using shell, like saving all history -

Standard Shell completion:

Variablename completion
Username completion
Executable completion
Filename and directory completion
Hostname completion

cp long_and_complex_file_name long_and_complex_file_name.backup
with this:
cp long_and_complex_file_name{,.backup}[..]/2013/12/unix-trick-brace-expansion.html

Use the history -

How to use xargs -

Nice presentation of man page -

Parallel shell -

(google search) (amazon search)
download zip of files only