This command is more robust because it handles spaces, newlines and control characters in filenames. It uses printf, not ls, to determine file size.
Writes out the shebang line (#!/bin/bash) to the script.
This function uses xmllint to evaluate xpaths. Usage: xpath /path/to/element XMLfile
Usage: upper [STRING]... Show Sample Output
Usage: lower [STRING]... Show Sample Output
Usage: mailme message
This is a useful function if you want to get notified about process completion or failure. e.g.
mailme "process X completed"
Diffs two xml files by formatting them first using xmllint and then invoking diff. Usage: diffxml XMLFile1 XMLFile2
Usage: upto directory Show Sample Output
Usage: jd dir
Requires globstar. To set globstar use:
shopt -s globstar
This function uses xmllint to evaluate xpaths. Usage: xpath /some/xpath XMLfile Show Sample Output
using perl
My old Solaris server does not have lsof, so I have to use pfiles.
Depending on your installation, when you run ps you will only get the first 40 or so characters displayed. In order to view the entire string, use /usr/ucb/ps on Solaris.
Instead of using: 0,15,30,45 * * * * /path/to/command
The important thing to note in this command, is the "-n" flag.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: