Shell libraries
Constantine Shulyupin
const at makelinux.co.il
Sat Jan 11 17:36:47 IST 2014
Hi,
I use extensively shell and shell script for more than ten years. I've
collected many helper functions and aliases in my bashrc. Finally I
published possible most interesting stuff in reusable form here:
https://github.com/makelinux/lib
It is easy to use single file script of 300 SLOC. It contains 40
functions and aliases with short description.
Most interesting functions are:
ps-cpu - lists most CPU consuming processes
ps-mem - lists most memory consuming processes
ps-wchan - shows what processes are waiting for, used in debugging
blocked processes
mem_avail_kb - Returns available for allocation RAM, which is sum of
MemFree, Buffers and Cached memory
readline-bindings - shows current readline bindings, used as shell
keyboard shortcuts, in more readable format, see also man readline
duplicates - finds duplicate files
for_each - applies an operation to set of arguments one by one
fs_usage - show biggest directories and optionally files on a
filesystem, for example on root: fs_usage -a /
system_status_short - shows short summary of system resources (RAM,CPU) usage
git_fixup - interactive fixup of specified number of last git commits
tcpdump-text - tcpdump of payload in text
git_ign_add - add files' names with path to appropriate .gitignore list
Also I found and expanded list of existed shell libraries and
published in wiki: http://elinux.org/Scripting
Reuse, reviews, fixes, updates and discussions are highly appreciated.
Thanks
--
Constantine Shulyupin
http://www.MakeLinux.co.il/
Embedded Linux Systems
Tel Aviv
More information about the Linux-il
mailing list