vie myscript will find where myscript is, and then use vi to edit that file. Not much trick, but saves typing if you use it a lot.
Lauching an app including jars in an adjacent lib folder to its classpath
Using the gcalcli interface to google calendar, print the calendar for the next 2 weeks according to the width of the terminal being used.
* Remove "--mon" to start week on sunday,
* Change 2 for more or less weeks
gcalcli --mon --width $((COLUMNS/8)) calm
for whole month
Show Sample Output
Choose the /var/log/sa/saXX log based on what day you want to view. You can use ifconfig to find the name of the interface. You can use the -s flag to specify a certain time period, e.g. -s 12:00:00 -e 14:00:00 Show Sample Output
Mac OSX friendly version of google function Show Sample Output
Replace the credentials to psql if necessary, and the my-query part with your query. Show Sample Output
minimal oneliner to keep track of time Show Sample Output
If you want to change it to find other ebook format change the find extension and the output extensions for whatever that is.
after this command, only needs press ESC to edit command line.
Tests to see if stdin (0) is NOT a terminal. Tests to see if stdout (1) IS a terminal. Copies stdout (opened for write) to stdin (open for read). Show Sample Output
As a user, deletes all your posts from a MyBB board (provided you have the search page listings of all your posts saved into the same directory this command is run from). Full command: for i in *; do cat $i | grep pid | sed -e 's/;/\ /g' -e 's/#/\ /g' -e 's/pid=/\ /g' | awk -F ' ' '{print $2}' >> posts.txt; done; for c in `cat posts.txt`; do curl --cookie name= --data-urlencode name=my_post_key=\&delete=1\&submit=Delete+Now\&action=deletepost\&pid=$c --user-agent Firefox\ 3.5 --url http://url/editpost.php?my_post_key=\&delete=1\&submit=Delete+Now\&action=deletepost\&pid=$c; sleep 2s; done; echo
Creates the .ssh directory on the remote host with proper permissions, if it doesnt exist. Appends your public key to authorized_keys, and verifies it has proper permissions. (if it didnt exist it may have been created with undesireable permissions). *Korn shell syntax, may or may not work with bash
exiftool can also extract the 'comment' into a file :) Show Sample Output
Just added maxdepth
Assuming a convention looking group file, this command will eject oldspiderman from the leagueofsuperfriends group and add newspiderman: oldspiderman:x:551: aquaman:x:552: superman:x:553: newspiderman:x:554: leagueofsuperfriends:x:1000:superman,oldspiderman,superman,aquaman
sometimes this helps, when eject button fails
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: