You might want to check what file and directory names would be renamed or chopped if you create iso 9660 level 2 image out of them. Use this command to check first. Show Sample Output
'ac' is included in the package 'acct', which is described as "The GNU Accounting utilities for process and login accounting". Other interesting flags are:
* print statistics for a specified user
ac -d username
* print statistics for all the users
ac -p
With my command, the output is also printed in a sexagesimal, more readable, style.
Show Sample Output
Curl is not installed by default on many common distros anymore. wget always is :)
wget -qO- ifconfig.me/ip
This ran on a ubuntu box using espeak for speaking text with the bash shell. On a mac you should use 'say'. Also you can change your alarm interval and your snooze interval which are currently 8 hours and 1 minute. I would run this via cron yet it's easier to disable if you run it as a command like this :P Show Sample Output
Validate a file using xmllint. If there are parser errors, edit the file in vim at the line of the first error.
This function counts the opening and closing braces in a string. This is useful if you have eg long boolean expressions with many braces and you simply want to check if you didn't forget to close one. Show Sample Output
Personally, I save this in a one line script called ~/bin/sci: #!/bin/bash for pid in `screen -ls | grep -v $STY | grep tached | awk '{print $1;}' | perl -nle '$_ =~ /^(\d+)/; print $1;'`; do screen -x $pid; done I also use: alias scx='screen -x' alias scl='screen -ls | grep -v $STY'
This is helpful if you connect to several networks with different subnets such as 192 networks, 10 networks, etc. Cuts first three octets of ip from ifconfig command and runs nmap ping scan on that subnet. Replace wlan0 with your interface. Assumes class c network, if class b use: cut -d "." -f 1-2 and change nmap command accordingly.
It really disables all ICMP responses not only the ping one.
If you want to enable it you can use:
sudo -s "echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all"
The improvement is that you can re-attach to the screen at a later point.
Requires figlet. Other than that, this should be portable enough across all the Bourne-compatible shells (sh, bash, ksh, zsh, etc).
Produces a massive number using figlet that counts down the number of seconds for any given minute interval. For example, here's a 4-minute timer:
i=$((4*60)); while [ $i -gt 0 ]; do clear; echo $i | figlet; sleep 1; i=$(($i-1)); done;
And a 1-minute timer:
i=$((1*60)); while [ $i -gt 0 ]; do clear; echo $i | figlet; sleep 1; i=$(($i-1)); done;
Show Sample Output
This is an easy way to quickly get a status for a device in multipath on SLES systems, as long as the server is configured based on Novell's standards, where multipathed disks are referred to by /dev/disk/by-... tree. Make sure to replace name_of_vg with your Volume Group name.
Figlet is easy to find for download on the internet, and works for any text. Quite cool. Show Sample Output
On-the-fly conversion of Unix Time to human-readable in Squid's access.log Show Sample Output
Usage:
get-ipsw device-name generation-string firmware-version
For example:
get-ipsw iPod 2,1 4.0
Different generation strings:
iPhone 3G: iPhone 1,2
iPhone 3GS: iPhone 2,1
iPod touch 2G: iPod 2,1
iPod touch 3G: iPod 3,1
This can be used with idevicerestore (I haven't tried it though).
http://github.com/posixninja/idevicerestore
Based on:
http://www.tuaw.com/2010/06/21/ios-4-0-firmware-release-expected-momentarily-quick-terminal-ti/
Show Sample Output
Google just released a new commend line tool offering all sorts of new services from the commend line. One of them is uploading a youtube video but there are plenty more google services to interact with. Download it here: http://code.google.com/p/googlecl/ Manual: http://code.google.com/p/googlecl/wiki/Manual This specific command courtesy of lifehacker:http://lifehacker.com/5568817/ Though all can be found in manual page linked above. Show Sample Output
This command can be used to revert a particular changeset in the local copy. I find this useful because I frequently import files into the wrong directory. After the import it says "Committed revision 123" or similar. to revert this change in the working copy do: svn merge -c -123 . (don't forget the .) and then commit. Show Sample Output
Simple countdown clock that should be quite portable across any Bourne-compatible shell. I used to teach for a living, and I would run this code when it was time for a break. Usually, I would set "MIN" to 15 for a 15-minute break. The computer would be connected to a projector, so this would be projected on screen, front and center, for all to see. Show Sample Output
This uses PV to monitor the progress of the MySQL import and displays it though Zenity. You could also do this pv ~/database.sql | mysql -u root -pPASSWORD -D database_name and get a display in the CLI that looks like this 2.19MB 0:00:06 [ 160kB/s] [> ] 5% ETA 0:01:40 My Nautalus script using this command is here http://www.daniweb.com/forums/post1253285.html#post1253285
I use zgrep because it also parses non gzip files. With ls -tr, we parse logs in time order. Greping the empty string just concatenates all logs, but you can also grep an IP, an URL...
This command allows you to stream your log files, including gziped files, into one stream which can be piped to awk or some other command for analysis.
Note: if your version of 'find' supports it, use:
find /var/log/apache2 -name 'access.log*gz' -exec zcat {} + -or -name 'access.log*' -exec cat {} +
No need for grep, let awk do the match. This will not behave properly if the filenames contains whitespace, which is awk's default field separator.
Using -f treats the process name as a pattern so you don't have to include the full path in the command. Thus 'pkill -f firefox' works, even with iceweasel.
Same as http://www.commandlinefu.com/commands/view/5876, but for bash. This will show a numerical value for each of the 256 colors in bash. Everything in the command is a bash builtin, so it should run on any platform where bash is installed. Prints one color per line. If someone is interested in formatting the output, paste the alternative.
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
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: