RSS feed [root] /unix /weblog




login:

password:

title search:




 


Fri May 19 13:22:08 GMT 2023

shell



Sum time in script - http://www.markhneedham.com[..]-summing-the-total-time-from-a-log-file/

Special bash parameters - http://javarevisited.blogspot.com[..]ial-bash-parameters-in-script-linux.html

ls sort by file size - http://www.unix.com[..]ns-answers/6518-sorting-ls-filesize.html

How to use "~" - http://www.thegeekstuff.com/2010/06/bash-tilde-expansion

use rlwrap to enable BASH like editing in SQLplus, and use screen to presist terminal sessions - http://binkley.blogspot.com[..]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 foo.sh{,.old} == cp foo.sh foo.sh.old
zsh have good auto complete

http://www.pgrs.net/2007/9/6/useful-unix-tricks

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

http://www.pgrs.net/2007/10/8/useful-unix-tricks-part-2

!! 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

http://pgrs.net/2009/2/20/useful-unix-tricks-part-3

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 - http://www.thegeekstuff.com/2010/07/3-shell-scripts/

HTML tools for commandline - http://www.macdevcenter.com/lpt/a/6343

Bash history - http://www.talug.org/events/20030709/cmdline_history.html

Tips of using shell, like saving all history - http://blog.andrewhays.net/love-your-terminal

Standard Shell completion:

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

http://www.thegeekstuff.com/2013/11/bash-standard-completion/

replace
cp long_and_complex_file_name long_and_complex_file_name.backup
with this:
cp long_and_complex_file_name{,.backup}

http://www.jacopretorius.net[..]/2013/12/unix-trick-brace-expansion.html

Use the history - http://www.jacopretorius.net/2013/12/my-favorite-unix-trick.html

How to use xargs - http://www.thegeekstuff.com/2013/12/xargs-examples/

Nice presentation of man page - http://explainshell.com/explain?cmd=+ls+-ltr

Parallel shell - http://www.ubuntugeek.com/pssh-parallel-ssh-tools.html

A Beginner’s Guide to tmux - https://medium.com[..]s/a-beginners-guide-to-tmux-7e6daa5c0154


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