fstools - Frams' Shell Tools

All programs are open source freeware under the Perl Artistic Licence

abspathshow absolute path of a file
addcradd CR (ASCII 13) to end of line (LF → CRLF)
example: addcr fordos.txt
delcrdelete CR (ASCII 13) at end of line (CRLF → LF)
example: delcr forunix.txt
axlist and (save) extract .tar .tar.gz .tgz .tar.bz2 .zip archives
bconvertconversion between binary, octal, decimal, hex and ASCII values
example: h2d 7FEA A0
aw2remail-filter to convert irregular AW-subjects to RFC-conform RE-subjects.
example: cat mail | aw2re
calcsimple CLI calculator
example: calc 4*1024+512
catzgzip-aware cat: concatinates normal and compressed files to STDOUT
example: catz syslog* > syslog_complete
cdb / cdbmcd with bookmarks
cloneclone a file (for filesystem with snapshot support)
clpcommand line perl: "Perl shell" for one-line scripting, testing and development
codecountcount lines and bytes of code, but ignore leading spaces and empty lines
example: codecount *.pl
colsumsum up columns
example: ls -l | colsum -v 5
countcount numbers or characters from..to (up or down)
example: for i in $(count 1 20); do echo $i; done
cpalcopy or move files recursivly using hard links, optionally overwriting existing files
d3d3 decimal numbers format filter
example: df . | d3
delsave file (un)delete
delinkconvert hard or symbolic link to regular file
delumlautconvert Umlauts to Duden vocale-transcription
example: delumlaut *.txt
df3better df with d3 decimal numbers format
dnsdomainnameprint the DNS domain name
domainsortsort lines with domain names or e-mail addresses for domain names
du3du with d3 decimal numbers format
epochprint UNIX epoch seconds or convert ISO date-string to epoch
example: epoch 2008-10-15 18:04:52
exargsread argument lines from STDIN (pipe) and execute program with it (extended xargs)
example: ls x* | exargs xmessage %a
extractextract lines from..to line number
example: extract 5-11 /etc/passwd
fhexdumphex and ASCII dump
example: fhexdump /etc/issue
findsamefind files with identical content or same inode on same filesystem
example: findsame /etc
fpgFrams' Perl grep: grep with Perl regular expressions, highlight output, paragraph mode, mbox, binary and gzip support
example: fpg '\d+ BLOCKED' syslog*.gz
frenamefrename files with regexp-syntax
example: frename '.tar.gz/.tgz' *tar.gz
fs, fs3(*)file sizes: a "best of" du, wc and d3
example: fs -3 /usr/src
fstatFrams' stat: print file status information
example: fstat -file -inode *
gdbm_dumpdump content of gdbm file
example: gdbm_dump mailman.db
httpgetdo a HTTP GET with optional download
example: httpget -d fex.belwue.de/fstools/bin/fpg
hmsumsum of date in hour:minute format
example: hmsum 2:15 11:50 0:13
hostlookupshow host ip address with respect of /etc/nsswitch.conf
example: hostlookup www
howmanycount regexp matches per line
example: echo $PATH | howmany :
httpgetmakes one http(s) request and prints header and/or body of the reply or downloads the file
example: httpget http://fex.rus.uni-stuttgart.de:8080/lxc
ipsortsort lines with ip as sorting criteria
example: route -n | ipsort
jpg2psconvert JPEG to Postscript
example: jpg2ps map.jpg
jpgreducereduce JPEG file size (same resolution, lower quality)
example: jpgreduce big*.jpg
jpgrotrotate loseless JPEG files
example: jpgrot -n *.jpg
jpgscalescale down JPEG files
example: jpgscale -800 *.jpg
l, ll, lll, ff(*)better ls: more consistent output, better configuration, more options
example: l -R
lflist files
example: lf -af
lanscansearch subnet for hosts
mail2htmlconvert mail (or any other text) to HTML and displays it with firefox
example: cat mail | mail2html
mailextractextract any text parts of a MIME mail or mbox (with Content-Type decoding)
modmailmodify e-mail headers and/or body
(a filter extension for procmail/formail)
mmencode, mmdecode(*)encode and decode MIME base64 and quoted-printable
example: mmencode -b vt100_sequences.txt
movemove files recursivly
mp4encodeconvert files of nearly any video format into MP4 H.264
example: mp4encode video.avi
mxvextract attachments out of mail-stream and display it with firefox
example: cat mail | mxv
notinprint lines which are not in exclude_file
example: notin exclude.list *.txt
nvtnetwork virtual terminal: RFC-conform command line tcp connect, a better telnet for scripting
example: nvt fex.rus.uni-stuttgart.de:80 'GET / HTTP/1.0' ''
openpathset read+execute permission on all parent directories
example: openpath .
pawkawk-like scripting with Perl syntax
example: ls -la /tmp | pawk '/2010/{$s+=$_5}END{print $s}'
pedmodify files (or STDIN) with perl command(s) in place and in one chunk, for multiline editing
(does not break symbolic or hard links!)
example: ped 's/ /_/g' *.txt
perlmodhistshow release date for a Perl module
example: perlmodhist Digest::MD5
plgprocmail log grep: better procmail log format and grepping
example: plg root@fex
portwatchopen tcp port in server mode and wait for client to connect
example: portwatch -v 8888
premperl regular expression match: show regular expression match inside (parenthesis)
example: ls | prem '(.*xxx.*).jpg'
perlmodhistshow release date for a Perl module
example: perlmodhist Digest::MD5
psdoexecute program if a process is found which matches pattern
example: psdo inetd xmessage 'inetd is running'
psgps (process status) with grep
example: psg ssh.*fex
pskps (process status) with grep and kill
example: psk firefox
puniqlike uniq, but records may not be adjacent or have other delimiter than newline
example: PATH=$(echo $PATH | puniq -d :)
rcountrecord count
example: echo $PATH | rcount -d :
repeatrepeat command with curses-interface
example: repeat ll download
reversereverse lines or words
example: cal | reverse
sdrsimple date reminder (daemon+client)
selselect files from current working directory from..to
example: xv $(sel p20080815 - p20080819)
showlinkshow symbolic link recursivly (link to link to ...)
showpidshow parent PID or PIDs recursivly upto init
shuffleshuffle arguments and optionally run program
example: shuffle -e xv *jpg
smtpsendsmtpsend injects a RFC822 e-mail into a smtp (TLS) server
example: smtpsend -s mailrelay framstag@belwue.de <mail.txt
ljoinjoin lines with delimiter (inverse of ssplit)
example: cal | ljoin -d :
ssplitsplit strings at delimiter into lines (inverse of ljoin)
example: echo $PATH | ssplit -d :
sshessh with commands and environment variables passing (default SSH_USER EDITOR LANG LC_*)
example: sshe otheruser@nexthost
tailftail -f with much less memory consumption and recognition of inode change (e.g. log rotation)
example: tailf /var/log/mail.log
tailpPrint the last lines of file beginning with pattern to standard output.
example: tailp fex.*.uni-stuttgart.de /var/log/mail.log
tcpbmtcp benchmark : measure sending and receiving speed between two hosts
tcpddtcp data dump : a faster alternative to nc
tscpscp with tar : copy files to or from remote host in tar format
example: tscp src blubb:/tmp/
urldecode, urlencode(*)RFC 2396 escaped encoding of URLs
example: echo 'http://localhost/testcgi?space=x y' | urlencode
utf7decodedecode UTF7 to ISO-Latin-1
example: utf7decode utf7.html > latin1.html
utf7encodeencode UTF7 from ISO-Latin-1
example: utf7encode latin1.html > utf7.html
utf8decodedecode UTF8 to ISO-Latin-1
example: utf8decode utf8.html > latin1.html
utf8encodeencode UTF8 from ISO-Latin-1
example: utf8encode latin1.html > utf8.html
vvmanipulate file versions
wgetdldownload (with resuming) and use filename suggested by server
example: wgetdl http://www.flupp.org/video?kjdhkjkj473kj35 # ==> jump.avi
witheasy command loop for files
example: with *.jpg : jpegtran -rotate 90 %f
wwterminal based interactive file selection
example: ww *.jpg
woosweb offer one stream
example: tar cvf - /opt | woos
xzzX selection (mouse buffer text) clip board history
zzgeneric CLI clip board
example: locate mp3 | zz

(*) You have to create symlinks to obtain the other programs

To install all programs in one go:
wget -O- http://fex.belwue.de/sw/share/fstools-0.0.tar | tar xvf -

Shell related tools

bashrcsome usefull bash aliases, functions and directory tricks
spamblockprocmail based spam filter

Other Linux tools

Author: Ulli Horlacher