Category: CLI
-
PSmisc – small utilities that use the /proc filesystem
I failed compiling the PSmisc package on OS X 10.10 AKA Yosemite. Maybe I wasn’t patient enough.
If I had a running Fink system these days, I wouldn’t even bother installing PSmisc resp. pstree myself. But my Fink system broke little after upgrading to Yosemite.
-
Ross Moffatt’s “logtail-v3” – logging files by tracking and only outputing the log from last time logtail was run
- http://sourceforge.net/projects/logtail-v3/
- this logtail can handle large files and log rolls
-
displaying files (on a UNIX command line), each file together with its names
displays each file with its name before its content:
$ head -999 file-a file-b file-cdisplays each file with its name before each line of its content:
$ pipegrep ” cat file-a file-b file-cSearch the web for pipegrep, if you are interested in it! It is written in one word.
-
how to easily display a base64 encoded file
I wondered, how I could achieve that on various Unix platforms, and I ran the following command on my Linux box:
$ man -k base64
base64 (1) – base64 encode/decode data and print to standard output
MIME::Base64 (3pm) – Encoding and decoding of base64 stringsRight the utility base64 (beloning to GNU coreutils) would do it, if it were broadly available; on AIX you can’t expect GNU coreutils to be installed.The MIME::Base64 man page shows a nice perl one-liner making use of a perl module, which is rather likely to be installed:$ perl -MMIME::Base64 -ne ‘print decode_base64($_)’ -
how to sort files by content
Same content, different names of 2 or more files –– how to identify the duplicates?
Use check sum utilities (like chksum, md5sum, sha1sum, …) for this, and sort on their output! -
linux – how to ‘grep’ a continuous stream
- http://stackoverflow.com/questions/7161821/how-to-grep-a-continuous-stream
- I had never heard of “stdbuf” before
- AIX grep has -u
- GNU grep has –line-buffered, its -u is not the same as AIX grep’s
-
logcheck – scans your logfiles and warns you
- www.logcheck.org
- sourceforge.net/projects/logcheck/
- linuxaria.com/pills/logcheck-scan-your-logs-and-warns-you – this is the nicest overview page
Dependencies and restrictions:- logcheck depends on logtail
- logtail runs on exactly one file …
- … and only once on that file, as it keeps a sister file called logfile.offset
- improving this should actually be “easy”, e.g. keeping a sister file called logfile.offset.user
Pros:- abstracting resp. filtering log files like /var/log/messages
- this happens “realtime” i.e. instantly
- …
Cons:- the results get to you resp. a whole crowd via e-mail – isn’t that a little excessive regarding the resources necessary to look at the output?
- if you already have a utilty in place, that filters daily chunks of log files, this is …
- …
Ideas / inspirations taken from here:- the output could actually go to another log file, that you may want to “logtail” or “tail -f” as to your needs
- …