Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Identifying files in the terminal UNIX
Ever visited one of those sites that downloads a file with a Javascript or some other active method, and you wind up with a file named "download.asp" or "file.asp"? Ever wonder how to figure out what it is, without trying to drag-and-drop it on everything?

In the terminal, it's quite simple - you can use the file command, like this:
[xperiment:~/Documents/downloads] berto% file download.php
download.php: gzip compressed data, deflated,
last modified: Fri Feb 23 18:17:34 2001, os: Unix
(Line break added to shorten the line width!) The file command looks at the file, and compares it to a database of types, and then gives you its best guess at the filetype.

In this real-world example, I couldn't figure out how to expand the file ... the file output lets me know I need to use gzip! For full information on file, make sure you check out the manual pages by typing man file in the terminal window.
  Post a comment  •  Comments (1)  
  • Currently 3.00 / 5
  You rated: 2 / 5 (4 votes cast)
[5,572 views]  View Printable Version
Spaces in file and directory names UNIX
bullroarer asks:

"How do I perform Terminal commands on any items on my Mac that have spaces in their pathnames? Because Finder allows spaces in file and directory names, I'm often creating such with spaces but then if I try to cd to one in the Terminal the space kills the command. How is this done?"

There are three ways that I know of to handle this. They are:
  1. Drag-and-drop the file or directory onto the terminal; this will preserve the spaces.

  2. Enclose the path name in single quotes, like this:
    cd '/Users/username/temp/directory with spaces'
  3. Quote the space character with a backslash, like this:
    cd /Users/username/temp/directory\ with\ spaces
Any of these will allow you to easily navigate files and directories with spaces in their names.
  Post a comment  •  Comments (4)  
  • Currently 2.33 / 5
  You rated: 5 / 5 (3 votes cast)
[47,268 views]  View Printable Version
Desktop picture in PB? Desktop
Here's a weird one. Tonight I tried (for the first time) to change the desktop picture. In the Dock & Desktop Prefences panel, I see a blank square under the "Desktop Picture:" header. It doesn't show the current, default one. I really want to change it to a basic pattern to try and accelerate the graphic speed of the old G3 machine OS X PB is on. Is this possible or do I have to select an image, and why don't I see the current image? Also, where is that image?
  Post a comment  •  Comments (2)  
  • Currently 3.25 / 5
  You rated: 4 / 5 (4 votes cast)
[2,715 views]  View Printable Version
Change your boot screen System
The boot image (the picture you see at startup) is held in /System/Library/Core Services/Resources/BootPanel.pdf. To replace it, simply create your own 640x480 PDF file, name it BootPanel.pdf, and save it to that same directory. You may want to make a copy of the existing screen first, of course!
  Post a comment  •  Comments (7)  
  • Currently 2.10 / 5
  You rated: 1 / 5 (10 votes cast)
[100,404 views]  View Printable Version
Drag and drop paths in the terminal System
If you want to 'cd' into some folder that's buried sixteen levels deep on your hard drive in the terminal, there are two ways to do it.

The hard way is to type:
cd path/to/very/deeply/buried/folder/on/your/drive
Of course, you could also do this one line at a time. Either way, you'll end up typing quite a bit.

The easy way is to navigate to the folder in the finder with point-and-click. Type 'cd [space]' into your terminal window, and then drag and drop the folder from the finder into the terminal window. The full path will be displayed, and you can then just hit 'return' and the command will be executed.

You can also use this trick for files; if you want to compress something with 'tar,' just type 'tar [options-you-want] [space]' and then drag the file to compress into the terminal window and hit return. Very nifty, and very Mac-like!
  Post a comment  •  Comments (1)  
  • Currently 2.14 / 5
  You rated: 3 / 5 (7 votes cast)
[6,089 views]  View Printable Version
Changing the system font (Cocoa only) System
"Oneota" posted instructions on how to change the system font in this MacNN forum. It requires a copy of PrefEdit (findable on macosxapps), and a couple of easy edits. If you mess up, the font change is simply ignored, so you won't cause any real trouble with your system.

This hack only works in Cocoa apps, so it won't help at all with the Finder or Explorer. Things like OmniWeb and TextEdit, though, should work just fine with your new font.
  Post a comment  •  Comments (0)  
  • Currently 2.86 / 5
  You rated: 2 / 5 (7 votes cast)
[7,415 views]  View Printable Version
Drag Thing for OS X Apps
DragThing was my favorite launcher utility for OS 9. The author's been working on a new version to support OS X, and posted a screenshot back in December. A week or so ago, he posted some more shots (taken in OS 9) of the latest builds. Based on the screenshots, he's added some very nice features. He's also commented that he hopes to release the new version very close to March 24th's release of OS X 1.0.

This is great news (for me, at least) as the dock and DragThing together will make a great team to make OS X even more usable!
  Post a comment  •  Comments (3)  
  • Currently 2.14 / 5
  You rated: 3 / 5 (7 votes cast)
[2,949 views]  View Printable Version
UNIX MP3 encoder UNIX
Vasantha Crabb has compiled the LAME MP3 encoder for OS X. This is a command-line program which will (duh) encode an audio file into the MP3 format. Here's what Vasantha had to say about it:

"Although not fast, LAME is a high quality MP3 encoder, using the GPSYCHO psycho-acoustics/noise shaping model. The quality of the encoded files is much better than that of SoundJam and iTunes."

You can find LAME on Vasantha's download page, where you'll also find the latest version of the Links text browser, and EasyLookup, which does quick whois, finger, and DNS lookups.
  Post a comment  •  Comments (0)  
  • Currently 2.00 / 5
  You rated: 1 / 5 (4 votes cast)
[8,107 views]  View Printable Version
Quick restart when logging out Desktop
I find myself frequently rebooting to play games, and the process can be made quicker with our old friend, the option key. When you quit the Desktop, you are presented with the Shutdown/Cancel/Log Out panel. Hold down the option key when it appears and Shutdown becomes Restart. Nifty.
  Post a comment  •  Comments (3)  
  • Currently 2.50 / 5
  You rated: 5 / 5 (4 votes cast)
[3,237 views]  View Printable Version
PB ONLY - Using the OS 9 app switcher Desktop
[Editor's note: This was probably one of the first hints I published, but it was lost in my database crash back in November, so I'm repepating it now ... -rob.]

If you like the OS 9 application switcher, you can still use it in OS X. Simply launch a Classic application, and tear off the application switcher menu. Even after you quit the Classic app (you need to leave the environment running, but you can kill the app), you'll have a fully functional application switcher in OS X - new programs get added, quit programs go away, etc.

I'm not sure if this will survive the transition to OS X final or not - I don't see why not, but we won't know for sure for another 33 days or so!
  Post a comment  •  Comments (2)  
  • Currently 2.20 / 5
  You rated: 5 / 5 (5 votes cast)
[3,366 views]  View Printable Version