Blog Archives

Speed Up Terminal by Clearing ASL Logs [Terminal Tip]

Mac OS X: If Terminal is loading slowly on your Mac (for me, slow loading in Terminal is more than five seconds), try clearing out the ASL logs. More »







Brush Up on Your Mac Terminal Kung-Fu [Terminal]

The Super User forums has a collection of tips and paste-able commands for Mac OS X’s Terminal that are, by turns, brilliant, funny, and obscure but great. Suggestions include quickly checking what apps are eating your memory (top -o vsize), run a Spotlight-style search from the command line (mdfind), and a clever little script that one user put together to trick his wife into thinking a MacBook has overheated and needs to be shut down—so he can grab it back. [Super User via Daring Fireball] More »







Five Really Handy Google Command Line Tricks [Command Line]

With the right commands, you can turn your favorite command-line text editor into a distraction-free Google Docs app, add new events to Google Calendar, upload images to Picasa or video to YouTube, backup your Google data, and more. Here’s how it works. More »









GoogleGoogleCLPicasaCommand-line interfaceGoogle Docs

Use a Different Color for the Root Shell Prompt [Terminal Tip]

Linux only: Reader Chris writes in with an excellent tip that changes the prompt to red when using the root account from the terminal—as a reminder to be more careful.

Using the tip is relatively simple—just edit the /root/.bashrc file and add in the following, preferably commenting out the existing lines that set the color, though you can simply add this line to the end of the file.

PS1='${debian_chroot:+($debian_chroot)}[33[01;31m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '

Once you’ve added this line, anytime you switch to using the root shell you will see the prompt in red with white text for the command line. Chris takes it further, with a line that turns the prompt green for regular users, which you can enable by adding the following to your ~/.bashrc file:

PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '

This tip can really come in handy if you have a bunch of terminal windows open at once, so you can tell at a glance which ones are using root mode and which aren’t. Thanks, Chris!

For more tips on powering up your terminal, check out how to display your public IP address, show a list of only subdirectories, or make any directory into an ISO file.





Cut the Bash Prompt Down to Size [Terminal Tip]

The LinDesk weblog runs down the process of customizing the shell prompt to trim the current path down to a reasonable character limit—making typing long commands much simpler while under deeply nested folders.

The guide includes a number of options for customizing your prompt to include more information about the current path without overloading your screen with characters—one of the more interesting tweaks is this script that removes characters from the middle of the path, which will cut down the size while clearly identifying the current folder. To test it out, you can simply paste the following text into the terminal prompt:

PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
PS1="[$CurDir] $ "

Hit the link for the walk-through and alternate prompt options, or you can customize your terminal greeting and reduce your terminal clutter with screen.





WP Like Button Plugin by Free WordPress Templates