It can be used to pinpoint the path(s) where the largest number of files resides when running out of free i-nodes Show Sample Output
This is similar to standard `pv`, but it retains the rate history instead of only showing the current rate. This is useful for spotting changes. To do this, -f is used to force pv to output, and stderr is redirected to stdout so that `tr` can swap the carriage returns for new lines. (doesn't work correctly is in zsh for some reason. Tail's output isn't redirected to /dev/null like it is in bash. anyone know why? ???????) Show Sample Output
Tails a log and replaces it line-by-line according to whatever you want to replace. Useful if the file writing to the log can't be modified, so you need to modify its output instead. Show Sample Output
Run a command as soon as another long-running command finishes. E.g. suspend the machine after performing apt upgrade. The process is selected interactively via fzf.
This command opens the latest, most current rotating apache access log for visual analysis and inspection. Run this command from the apache log directory. For error logs, replace access_log with error_log.
While they are few config options and even fewer useful details regarding what actually is being sent by the time machine 'backupd' process, this can at least tell you its doing something, how much it's doing, and exactly how often. Via macosxhints, http://xrl.us/begrwa, which in turn was via comments Show Sample Output
It displays, last 15 yum operations (in last operation as first row order) with its dates. Change 15 to any number of operations you need to display or remove "| tac" to see it in reverse order (last operation as last row)
This is really fast :)
time find . -name \*.c | xargs wc -l | tail -1 | awk '{print $1}'
204753
real 0m0.191s
user 0m0.068s
sys 0m0.116s
Show Sample Output
Change open-command and type to suit your needs. One example would be to open the last .jpg file with Eye Of Gnome: eog $(ls -rt *.jpg | tail -n 1)
Can anyone make a shorter one?
This doesn't work:
git log --reverse -1 --format=%H
Show Sample Output
this adds a random color to your prompt and the external ip. useful if you are using multiple mashines with the same hostname. Show Sample Output
Your version works fine except for someone who's interested in commands 'sudo' was prefixed to i.e. in your command, use of sudo appears as number of times sudo was used. Slight variation in my command peeks into what commands sudo was used for and counts the command (ignores 'sudo')
Changed wget to curl and it doesn't create a file anymore. Show Sample Output
You can actually do the same thing with a combination of head and tail. For example, in a file of four lines, if you just want the middle two lines:
head -n3 sample.txt | tail -n2
Line 1 --\
Line 2 } These three lines are selected by head -n3,
Line 3 --/ this feeds the following filtered list to tail:
Line 4
Line 1
Line 2 \___ These two lines are filtered by tail -n2,
Line 3 / This results in:
Line 2
Line 3
being printed to screen (or wherever you redirect it).
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: