This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

You can use open for everything: URLs, images, documents. I use it everyday.
–
oltJul 6 '10 at 14:48

5

As an extension to that: open -a Mail filetosend.ext Creates a new Email with the file attached.
–
SkadeJul 6 '10 at 16:11

1

@Nick Bedford: It's very useful. For example, I use the command line to scp a bunch of files down from the server. Then, I use "open ." to open the current folder up in the finder, where I can easily right-click on a file and say "open in excel".
–
khedronJul 12 '10 at 18:44

1

@Nick Bedford: If you have the folder open in Terminal, open . opens it Finder. It's useful if you want to do something graphical.
–
ShreevatsaRJul 26 '10 at 4:40

Better: mkdir -p $1, since this allows creating nested new directories. And putting a && between the commands will only execute cd if the folder was successfully created.
–
Konrad RudolphJul 25 '10 at 18:02

I have longed to get terminal to open in the last visited folder, and ended up making a small bash command that accomplishes that. It furthermore allows one to "cd" to a file, which is very helpful when you want to change your directory to that of a given finder file. Simply write cd, and drag the file to the terminal and your are there.

In terminal:settings:shell - make the shell complete the following command:

source ~/.todir; clear

Next time you start your terminal - you will automatically be redirected to your last opened directory - the terminal title will change title when you use the cd alias, and your prompt will show the full directory path.

As of Mac OS X Lion 10.7, Terminal supports a few "less"-compatible pager commands when there are no processes running in a terminal. This is useful for paging through and reading text after commands have completed/exited. Supported keys are:

space: Page Down⇧+Space: Page Up⏎: Scroll down one line↑/↓: Scroll up/down one lineF: Page down ("forward")B: Page up ("back")<: Home (scroll to top)>: End (scroll to end)

Terminal has commands that will lookup and display man pages, which these keys are indispensable for viewing. See the Help menu and contextual menus. It also supports Services for opening man pages from other applications (enable them in System Preferences > Keyboard > Keyboard Shortcuts > Services).

Make All Links In Safari Open As New Tabs

New windows, baaad. New tabs, gooood.
In general, Safari’s tab controls are wonderful, but one failing drives us crazy: Certain links are allowed to override your preference for opening new webpages in tabs, essentially forcing the application to open a new window. To prevent this in the future, execute this command: defaults write com.apple.Safari TargetedClicksCreateTabs -bool TRUE.

Show Hidden Files in The Finder

The names of hidden files always begin with a period--keep that in mind before you delete or edit a file that doesn’t look familiar.
Believe it or not, the files you see listed on your Desktop in the Finder do not represent all of the files contained in your Desktop folder. In almost every folder, the OS hides system files that Apple considers too important for the likes of us to mess with (or too mundane for us to be bothered with). Now and again, though, it’s useful to view these files. To see the full contents of all folders in the Finder, execute : defaults write com.apple.finder AppleShowAllFiles TRUE.

Disable the Dashboard

When the Dashboard appears on our Desktop, it’s usually because we missed the delete key and hit F12 instead.
We’ve always liked the Dashboard in theory--on occasion, we’ve even downloaded widgets for it. Unfortunately, we never get around to using them, and our aging Mac laptop could use the extra RAM to run real apps. If you’re in the same boat, free up some system memory by terminating the Dashboard with two quick Terminal commands. First, set its default to Off by executing : defaults write com.apple.dashboard mcx-disabled -boolean YES. Second, kill and restart the Dashboard and Dock with this command: killall Dock.

pg with no arguments ping the IP 8.8.8.8 (usefull for basic internet connection test), otherwise ping the given IP. If the IP is incomplete, it is concat with the default prefix 192.168.1 allowing easy local ping (eg ping 3.12 => 192.168.3.12)

You can use esc key as replacement for alt. >ou have to tap it first and then enter the other instead of holding it. It's a standard feature, but more important as the ⌥ key on macs works different as on "windows/Linux" keyboards.

You can set the behavior of alt key in preferences to behave like on "windows" keyboards. Though you then will be unable to type important characters as @, \, {, ...

Very important if you use emacs in terminal. But suppose there are many commands that require it - eg you can also copy-paste in bash with emacs bindings.

I find it useful to copy text to the clipboard from Terminal.app without using the mouse to make a selection.

This seems to only works with the older Terminal.app from Tiger. I just renamed it to Tiger Terminal.app, and it still runs fine on Leopard. Haven't tried it on Snow Leopard.

So, with Tiger Terminal, you can do mouse-free copy by typing ⌘+⌥+⌫, then using the arrow keys to move to the start of the area you want to copy. Next, type ⌘+⌥+⌫ again to anchor the selection point. Use the arrow keys (some emacs-like commands also work for navigation like ctrl+E) to move to the end of the region you want to copy. Finally, type ⌘+⌥+⌫ again to copy selection to the clipboard.