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
This is a handy command to put into ~/.bash_logout to automatically un-mount windows shares whenever the user logs out. If you use this on as a non-root account then you'll need to append sudo before umount and the user will need to have the appropriate sudoer rights to run the /bin/umount command.
Sample input:
kde-open -v
Qt: 4.7.4
KDE Development Platform: 4.7.3 (4.7.3)
KIO Client: 2.0
Show Sample Output
Overwrite all sectors with zeros in one pass with ETA and speed status. If you wish to do more passes, encapsulate the line in a for loop (7 pass example): for f in `seq 1 7`; do pv -s `fdisk -l /dev/sdX|grep "Disk /"|cut -d' ' -f5` /dev/zero >/dev/sdX ; done Note: Substitute /dev/sdX with the correct drive you wish to erase. Also, you may have to be root to execute the command. Show Sample Output
Use the excellent sensiblepasswords.com to a generate random (yet easy-to-remember) password every second, and copy it to the clipboard. Useful for generating a list of passwords and pasting them into a spreadsheet.
This script uses "madebynathan"'s "cb" function (http://madebynathan.com/2011/10/04/a-nicer-way-to-use-xclip/); you could also replace "cb" with
xclip -selection c
Remove "while true; do" and "; done" to generate and copy only 1 password.
Show Sample Output
See who is using a specific port. Especially when you're using AIX. In Ubuntu, for example, this can easily be seen with the netstat command. Show Sample Output
useful to count events in logs Show Sample Output
useful to count events in logs @see: http://www.commandlinefu.com/commands/view/10327/report-summary-of-string-occurrence-by-time-period-hour#comment Show Sample Output
depends on date format locale ... Show Sample Output
I can't find the lid command on my system, there is also another complied program: http://xyne.archlinux.ca/projects/lsgrp/
When I do a major change in my entities, I want to find a way to find all my Entities names and create the commande for me. So instead of doing ls src/Your/OwnBundle... and then do it manually, this helps a lot. Show Sample Output
printf reapeats the format as longer as it has arguments. Then the idea is to make cut retain as much fields as we have elements in the array. As usual with such join/split string manipulation, you have to make sure you don't have conflicts between your separator and your array content.
"nl -ba" numbers all lines in the file (including empty lines), "sort -nr" sorts the lines in descending order, and the "cut" command finally removes the line numbers again.
cut -f1,2 - IP range 16 cut -f1,2,3 - IP range 24 cut -f1,2,3,4 - IP range 24 Show Sample Output
Display the 1st field (employee name) from a colon delimited file Show Sample Output
added echo "### Crontabs for $user ####"; to make clear whose crontab is listed.
You can substitute 10.10.10.* by your own network. Or whatever nmap accepts, inlcluding submask. Show Sample Output
me
This is the closest you can get to "reset printing system" from the command line. Giving credit back to J D McIninch from an apple forum back in 2009.
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: