To learn more about Google Ngram Viewer: http://ngrams.googlelabs.com/info
No need for further filedes or substitution for splitting. Simply use read a b
Center the output text in max line length of buffered output pipe; Show Sample Output
This is a simple bash function and a key binding that uses commandlinefu's simple and easy search API. It prompts for a search term, then it uses curl to search commandline fu, and highlights the search results with less.
POSIX requires this "string truncating" functionality. might as well use it, at least for very small tasks where invoking sed and using RE is overkill.
Watch the temperatures of your CPU cores in real time at the command line. Press CONTROL+C to end. GORY DETAILS: Your computer needs to support sensors (many laptops, for example, do not). You'll need to install the lm-sensors package if it isn't already installed. And it helps to run the `sensors-detect` command to set up your sensor kernel modules first. At the very end of the sensors-detect interactive shell prompt, answer YES to add the new lines to the list of kernel modules loaded at boot. Show Sample Output
It willl popup a message for each new entry in /var/log/messages found on the notify-send howto page on ubuntuforums.org. Posted here only because it is one of the favourites of mine.
Handle any bad named file which contains ",',\n,\b,\t,` etc
Store the file name as null character separated list
find . -print0 >name.lst
and retrieve it using
read -r -d ""
Eg:
find . -print0 >name.lst;
cat name.lst| while IFS="" read -r -d "" file;
do
ls -l "$file";
done
Show Sample Output
This variation can handle file paths containing spaces.
I have used single packet, and in a silent mode with no display of ping stats. This is with color and UI improvement to the http://www.commandlinefu.com/commands/view/10220/check-if-a-machine-is-online. It is as per the enhancements suggested. Show Sample Output
create and md5 sum of your password without it showing up in your terminal or history. Afterwards we overwrite the $p variable (thx to bazzargh) Show Sample Output
Nothing too magical here, just uses pngcrush to losslessly compress all your pngs!
Sometimes I would like to see hidden files, prefix with a period, but some files or folders I never want to see (and really wish I could just remove all together). Show Sample Output
Counts the files present in the different directories recursively. One only has to change maxdepth to have further insight in the directory hierarchy. Found at unix.stackexchange.com: http://unix.stackexchange.com/questions/4105/how-do-i-count-all-the-files-recursively-through-directories Show Sample Output
Find all .gz files and recompress them to bz2 on the fly. No temp files. edit: forgot the double quotes! jeez!
Some computers these days don't have an HDD activity light, but they still have a useless caps-lock, so why not re-purpose that light to show HDD activity? Requires setleds and dstat and probably needs to run as root.
Alternative to mnikhil's ls/awk solution
Problem: I wanted to backup user data individually. In this example, all user data is located in "/mnt/storage/profiles", and about 25 folders inside, each with a username ( /mnt/storage/profiles/mike; /mnt/storage/profiles/lucy ...) I need each individual folder backed up, not the whole "/mnt/storage/profiles". So, using find while excluding directories depth and creating two variables (tarfile=username & desdir=destination), tar will create a .tgz file for each folder, resulting in a "mike_full.tgz" and "lucy_full.tgz".
Problem: I wanted to backup user data individually, using and incremental method. In this example, all user data is located in "/mnt/storage/profiles", and about 25 folders inside, each with a username ( /mnt/storage/profiles/mike; /mnt/storage/profiles/lucy ...) I need each individual folder backed up, not the whole "/mnt/storage/profiles". So, using find while excluding directories depth and creating two variables (tarfile=username & desdir=destination), tar will create a .tgz file for each folder, resulting in a "mike_2013-12-05.tgz" and "lucy_2013-12-05.tgz".
Checks for syntax errors in PHP files modified in current working copy of a Git repository. Show Sample Output
Very quick! Based only on the content sizes and the character counts of filenames. If both numbers are equal then two (or more) directories seem to be most likely identical.
if in doubt apply:
diff -rq path_to_dir1 path_to_dir2
AWK function taken from here:
http://stackoverflow.com/questions/2912224/find-duplicates-lines-based-on-some-delimited-fileds-on-line
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: