prints a random line
Takes a directory name as an argument (defaults to current directory if no arguments are given). Prints the newest file in the directory. Show Sample Output
(follow with next command) tail -f from.log | colorize.pl +l20:".*" & Use with http://www.commandlinefu.com/commands/view/10031/intercept-monitor-and-manipulate-a-tcp-connection. - can use to view output of tees that send traffic to files - output will be interwoven with red for sent traffic and green for received. get colorize.pl from http://www.flinkmann.de/71-1-Colorizepl.html
Watches for file modifications in the current directory and tails the file.
this command shows the space used in postgres directory. Show Sample Output
Silly approach, but easy to remember... Show Sample Output
Tail is much faster than sed, awk because it doesn't check for regular expressions. Show Sample Output
Debian-specific but very useful as cron files are prone to very subtle gotchas
tail -n X | head -n 1 prints a specific line, where X is the line number
I know how hard it is to find an old command running through all the files because you couldn't remember for your life what it was. Heres the solution!! Grep the history for it. depending on how old the command you can head or tail or if you wanted to search all because you cannot think how long ago it was then miss out the middle part of the command. This is a very easy and effective way to find that command you are looking for.
In cases when the user is following a log file that rotates then it is advisable to use the -F option as it keeps following the log even when it is recreated, renamed, or removed as part of log rotation. To interrupt tail while it is monitoring, break-in with Ctrl+C.
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: