If you use HISTTIMEFORMAT environment e.g. timestamping typed commands, $(echo "1 2 $HISTTIMEFORMAT" | wc -w) gives the number of columns that containing non-command parts per lines. It should universify this command. Show Sample Output
If you have lots of subversion working copies in one directory and want to see in which repositories they are stored, this will do the trick. Can be convenient if you need to move to a new subversion server. Show Sample Output
Here's a super simple one liner that could have gotten our team 300 points! #facepalm! Show Sample Output
This renames a pattern matched bunch of files by their last modified time. rename by timestamp rename by time created rename by time modified Show Sample Output
This is a simple solution to running a remote program on a remote computer on the remote display through ssh. 1. Create an empty 'commander' file in the directory where you intend on running these commands. 2. Run the command 3. Hop on another computer and ssh in to the PC where you ran the command 4. cd to the directory where the 'commander' file is. 5. Test it by doing the following: echo "xeyes" > commander 6. If it worked properly, then xeyes will popup on the remote computer. Combined with my other one liner, you can place those in some start-up scripts and be able to screw with your wife/daughter/siblings, w/e by either launching programs or sending notifications(my other one liner). Also, creates a log file named comm_log in working directory that logs all commands ran.
This command will automate the creation of ESSIDs and batch processing in pyrit. Give it a list of WPA/WPA2 access points you're targeting and it'll import those ESSIDs and pre-compute the potential password hashes for you, assuming you've got a list of passwords already imported using:
pyrit -i dictionary import_passwords
Once the command finishes, point pyrit to your packet capture containing a handshake with the attack_db module. Game over.
Show Sample Output
Same as another one I saw, just with a cleaner sed command Edit: updated the sed command to use the [[:xdigit:]] character class - more portable between locales Note that it will have a newline inserted after every 32 characters of input, due to the output of xxd Show Sample Output
Thanks th John_W for suggesting the fix allowing ~/ to be used when saving a directory. directions: Type in a url, it will show a preview of what the file will look like when saved, then asks if you want to save the preview and where you want to save it. Great for grabbing the latest commandlinefu commands without a full web browser or even a GUI. Requires: w3m Show Sample Output
first off, if you just want a random UUID, here's the actual command to use:
uuidgen
Your chances of finding a duplicate after running this nonstop for a year are about the same as being hit by a meteorite before finishing this sentence
The reason for the command I have is that it's more provably unique than the one that uuidgen creates. uuidgen creates a random one by default, or an unencrypted one based on time and network address if you give it the -t option.
Mine uses the mac address of the ethernet interface, the process id of the caller, and the system time down to nanosecond resolution, which is provably unique over all computers past, present, and future, subject to collisions in the cryptographic hash used, and the uniqueness of your mac address.
Warning: feel free to experiment, but be warned that the stdin of the hash is binary data at that point, which may mess up your terminal if you don't pipe it into something. If it does mess up though, just type
reset
Show Sample Output
Just use "od" and it can also dump in decimal or octal. (use -t x1 and not just -x or it confuses the byte order) There is a load of other formatting options, I'm not sure if you can turn off the address at the start of the line. Show Sample Output
Replace the echo command with whatever commands you want. 'read' reads a line from stdin and places the text in the variable, the stdin of the while loop comes from the find command. Note that with simple commands, an easier way is using the '-exec' option of find. My command is useful if you want to execute multiple commands in the loop. Show Sample Output
Another way to do it with slightly fewer characters. It doesn't work on Russian characters; please don't vote down because of that. :p It's very handy for those of us working in ascii :) Show Sample Output
Simple way of having random mrxvt backgrounds. Add this to your bashrc and change the path names for the pictures.
the comm utility (opposite of diff) show commonalities in files (in this case strings) Show Sample Output
command was too long... this is the complete command: fname=$1; f=$( ls -la $fname ); if [ -n "$f" ]; then fsz=$( echo $f | awk '{ print $5 }' ); if [ "$fsz" -ne "0" ]; then nrrec=$( wc -l $fname | awk '{ print $1 }' ); recsz=$( expr $fsz / $nrrec ); echo "$recsz"; else echo "0"; fi else echo "file $fname does not exist" >&2; fi First the input is stored in var $fname The file is checked for existance using "ls -lart". If the output of "ls -lart" is empty, the error message is given on stderr Otherwise the filelength is taken from the output of "ls -lart" (5th field) With "wc -l" the number of records (or lines) is taken. The record size is filelength devided by the number of records. please note: this method does not take into account any headers, variable length records and only works on ascii files where the records are sperated by 0x0A (or 0x0A/0x0D on MS-DOS/Windows). Show Sample Output
Get the hour and greet the user! Make sure you add this to your bashrc, for a pleasant hacking experience! Show Sample Output
Saves all the "cut" hacks
Useful for creating MAC addresses for virtual machines on a subnet. 00:16:3e is a standard Xen OID, change as needed. Show Sample Output
Shows a zenity progressbar for each file in a script, see the samble output. Works with any number, less, equal or greater than 100. x is not initially defined. If used twice in the script, set it: x=0 (for FILE in $@; do echo $[100*++x/$#]; command... "$FILE"; done)|zenity --progress --auto-close Show Sample Output
Article mentions what each part of the command is responsible for. http://raymondcrandall.com/post/1360780719/easily-renaming-lots-of-files 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: