Tip #34 A gziped tarball, when the z in "tar czf" is not available
CREATE THE TARBALLRead more »
- TAGS:
- tar
Tip #42 Count total number of occurances of a string in all files in the
#!/bin/ksh#KSH only.
# Author: simonvc
# Purpose: Count the total number of occurances of a pattern in all files in the cwd.
# Alt: you could also do "$(grep $pattern * | wc -l) but where's the fun in that ;-)
pattern="WHATEVER"
$ echo $(($(grep -hc $pattern *| tr "\n" "+")"0"))
Read more »
- TAGS:
- ksh
Tip #43 Using Perl instead of Sed
Prefer Perl over Sed? No problem! To use Perl as a Sed-like program:Read more »
- TAGS:
- sed
Tip #44 Using tar with other compression formats
GNU tar comes with native support for gzip, bzip2, and compress (adaptive LZ, LZW). However, many other useful compression algorithms exist, but most implementations of them don't support all the file system metadata that tar does. There are two general methods to using tar with arbitrary compression programs: via an option in tar itself and via piping. The first:Read more »
Tip #45
multiple command output into a single program:diff -u <(ls -c1 dir_1) <(ls -c1 dir_2)
Will show you a diff of files in the root of dir_1 and dir_2 Read more »
Tip #46
Using expansion to move a file aside without having to type the file name twiceRead more »
- TAGS:
- bash
Tip #47 Changing file extensions
Rename replaces string X in a set of file names with string Y.Read more »
- TAGS:
- bash
Tip #49 Put text into the input buffer of a virtual terminal
writevt --term=/dev/pts/1 --text=foo Read more »- TAGS:
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs