List usernames & their assigned shell. If their home directory is in /home and excepting those account that have their login shell set to: noshell, false, nologin Show Sample Output
Unmounts all CIFS-based network drives. Very nice for shutting down network mounts on a Linux laptop just prior to going to sleep. Show Sample Output
You could avoid xargs and sed in this case (shorter command and less forking): At least bash and zsh have some mighty string modifiers. I would also suggest using find with exec option to get more flexibility. You may leave out or include "special" file for example.
use python as calculator, press ctrl+d to exit reminder: when doing factions add atleast one decimal number like so 22.0/7 or 22/7.0 Show Sample Output
Takes effect immediately.
Gets the current system user running a process with the specified pid Show Sample Output
Just an other solution :)
Remove the dashes from a UUID using bash search and replace. Show Sample Output
Demos figlet/toilet fonts in a configurable dir. Show Sample Output
Remove ANSI colors from stream or file
Search in decimal rather than hex. od dumps the character list, cut to remove offsets, sort -u gives the used characters. seq gives the comparison list, but we need this sorted alphabetically for comm, which does the filtering. I drop to perl to convert back to characters (is there a better way?) and then use od to dump them in a print-safe format. Show Sample Output
Delete range of lines. Ex: Line 6 through 66 in .
or add this line to your ~/.vimrc if using vim
regenerateCSR original.crt new.key new.csr
Show Sample Output
works the same, but uses festival instead of espeak
Says time every 5 seconds in hours, minutes and seconds using festival.
Take a file and ,."()?!;: give a list of all the words in order of increasing length. First of all use tr to map all alphabetic characters to lower case and also strip out any puntuation. A-Z become a-z ,."()?!;: all become \n (newline) I've ignored - (hyphen) and ' (apostrophe) because they occur in words. Next use bash to print the length ${#w} and the word Finally sort the list numerically (sort -n) and remove any duplicates (sort -u). Note: sort -nu performs strangely on this list. It outputs one word per length. Show Sample Output
Simpler and without all of the coloring gimmicks. This just returns a list of branches with the most recent first. This should be useful for cleaning your remotes. Show Sample Output
(This may be specific to bash only.) This transforms the current working directory to all uppercase characters and replaces forward slashes with backslashes, prepending the string with "C:" and appending a single ">". It serves no practical purpose, but may serve as a great practical joke if you can insert it to some victim's .bashrc :-) Show Sample Output
Choosing your year and month. You only need the gnu date command and bash. desiredDay of the week is (1..7); 1 is Monday.
If you want desiredDay of week (0..6); 0 is Sunday
desiredDay=6; year=2012; month=5; n=0; while [ $(date -d "$year-$((month+1))-1 - $n day" "+%w") -ne $desiredDay ]; do n=$((n+1)); done; date -d "$year-$((month+1))-1 - $n day" "+%x"
Show Sample Output
Handles spaces in file names and directories. Optionally change directories as well by pipe to tr from dirname.
Enable tracing and print a timestamp before the command to be invoked. Original author: Peter Eisentraut http://petereisentraut.blogspot.com/2012/07/tracing-shell-scripts-with-time-stamps.html Show Sample Output
Depending on your Apache access log configuration you may have to change the sum+=$11 to previous or next awk token. Beware, usually in access log last token is time of response in microseconds, penultimate token is size of response in bytes. You may use this command line to calculate sum and average of responses sizes. You can also refine the egrep regexp to match specific HTTP requests. 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: