Mac-terminal.com

Mac-Terminal.com

An introduction of the Terminal for Mac OS X

Useful functions and commands in the Terminal for Mac OS X


clear

Syntax: clear

Usage: Clears the Terminal screen.

Ctrl + L is an alias for clear and will do the same thing for you.


!!

Syntax: !!

Usage: Run the latest executed command in the Terminal once again.

Example Write the following in the Terminal window, then push "Enter".

echo "Hello there"

You should now see the text "Hello there" on the line below where you wrote it.
Now, write "!!" and the push "Enter" once again.
This should repeat the last command, namely the one who printed "Hello there" on your Terminal screen. If this works the text "Hello there" should appear once again on the row below "!!".

computer:/ user $ echo "Hello there"
Hello there
datornamn:/ user$ !!
echo "Hello there"
Hello there

Options Instead of two exclamation marks you can write one exclamation mark followed by a letter, for instance "e":

!e

When you now push "Enter", the Terminal will perform the last executed command that started with the letter "e".