Use the following command in a terminal:
$ cat /proc/version
20 Wednesday Oct 2010
10 Saturday Apr 2010
13 Saturday Feb 2010
Safari (4.0.4) shows PDFs in the browser window by default when you click on a hyperlink to a PDF file. What is happening here is that when you click on the link, Safari downloads the file in the /tmp directory and opens it by itself. I don’t want that — I want to open it in a stand-alone PDF viewer, say Skim, which will allow me to do other PDF-related stuff (e.g. annotation). A command line trick will do the job (enter the following command after the prompt, indicated by $ here, in the terminal):
$ defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES
If you want to go back to the default behavior use the same command but change ‘YES’ to ‘NO’.
NOTE: You may run across a totally different issue which will force you to view a PDF file in the browser window if you have Adobe reader plugin installed. In that case just remove that plugin from the following directories:
/Library/"Internet Plug-Ins"
~/Library/"Internet Plug-Ins"
I have tested this on Mac OSX – Leopard (10.5.8).
Credit: Mac Rumors forum.
10 Wednesday Feb 2010
Some badly formatted command may lead to a filename with a leading dash in its name, e.g. -bad_file. To delete this file in the command line either of the following commands should be enough:
$ rm -- -bad_file
OR
$ rm ./-bad_file
But if the filename is just a dash (-), things may get a little tricky. Follow the steps 1–3 to delete a file named as “ – ”:
[you may use this method to delete the first file, -bad_file as well]
1. Find the inode numbers first. The following command will print the file serial number (inode number) for each file in the working directory:
$ ls -li
2. Then check to see if the inode number (say, 12345) of the culprit, viz. “ – ”, corresponds to it correctly (optional step):
$ find . -inum 12345
3. If it finds the name of the `culprit’ correctly, which it should if the number is correct, proceed to remove it:
$ find . -inum 12345 -exec rm {} \;
That’s it!
Credit: here.
28 Thursday Jan 2010