This is not exhaustive but after checking /etc/cron* is a good way to see if there are any other jobs any users may have set. Note: this is a repost from a comment "flatcap" made on http://www.commandlinefu.com/commands/view/3726/print-crontab-entries-for-all-the-users-that-actually-have-a-crontab#comment, for which I am grateful and I take no credit.
Count how many times a pattern is present into a stream. It can be one or more lines. No overlapping. It means searching for aa on aaa will output 1 not 2.
I still don't know why mutt (or offlineimap or whatever in between), is borking the encoding of my files, but this fixes it. Show Sample Output
Tells you where's left and right. Handy if you can't ever remember them. Show Sample Output
It will list your machine's ethernet ports speed Show Sample Output
Given a list of filenames, one per line, in /tmp/filelist, calculate the total sum disk usage.
Appends 4 configuration lines to your ~/.inputrc which allow you to seach history taking into account the characters you have typed so far. It is taken straight form https://help.ubuntu.com/community/UsingTheTerminal Go there for a complete description (grep for "Incremental history searching"). Not sure about the limits of this (which OS's/terminals), but probably anything unix/linux like will do. Changed my life :) Show Sample Output
Just 253 chars of pure UNIX magic, with curl. I created this contrived bash one-liner while building a command-line bash game : www.rubegoldbash.com. Show Sample Output
This provides better, but not perfect, distribution, and it works for 2^32 ≤ X ≤ 2^64. (A robust distribution requires iteration/recursion and an indeterminate amount of randomness.)
One liner that basically duplicates ssh-copy-id functionality by taking care of most common issues of SSH password-less ssh logins: - missing key on the remote server - braindead permissions *cough* RHEL *cough* Show Sample Output
This helps me determine which repo I want to use for downloading ISO files Show Sample Output
usage = crontest "/path/to/bin" This version of this function will echo back the entire command so it can be copied/pasted to crontab. Should be able to be automagically appended to crontab with a bit more work. Tested on bash and zsh on linux,freebsd,aix Show Sample Output
If you want to create new user accounts in OS X from the command line use this fragment to find the next free user id. In OS X CLI you have to assign the user id yourself Show Sample Output
that's how I do it in ubuntu
The leading plus sign is removed - Minus sign is left intact Show Sample Output
You may use another wordlist generator as regldg or whatever ./regldg '--debug-code=1' '--universe-set=7' '--universe-checking=3' '--max-length=8' '--readable-output' '--num-words-output=100' "(B|b)(n|N)(g|G)(4|a|A)(l|L)"
s/espeak/say/ on a mac
perl version of "Wait for file to stop changing" When "FileName" has not been changed for last 10 seconds, then print "DONE" "10" in "(stat)[10]" means ctime. One have other options like atime, mtime and others. http://perldoc.perl.org/functions/stat.html
Quick OneLiner to sniff for ICMP traffic, proof of concept socket code. Needs root privs to run. Show Sample Output
Keep retrying YOURCOMMAND until it succeeds. Add sleep between retries so that +c works. (Though you can always use +z and kill %1). Source: http://stackoverflow.com/a/5274386/2175968
grep -v '\(/dev/\|pipe:\|socket:\)' seemingly looks a bit complicated. This can, of course, be replaced by head -1. However, it is not sure whether the filename line will be first on all systems, so I chose the safer way by filtering out what is not needed here. Show Sample Output
tr ' ' '\n' isn't needed, it's just there to make the output prettier. Show Sample Output
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: