A nice terminal emulator can make your life (while working on your computer) far more pleasant. On OSX, like many others, I have found iTerm to be a big improvement over the standard terminal emulator that comes with standard with OSX.

When I switched back to my Linux machine, I was disappointed by not having the split windows anymore, but found Terminator to be very similar.

Below are a few commands which are useful for using iTerm and Terminator.

Update: in fact, it does not really matter which terminal emulator you use. I now prefer to use tmux, a terminal multiplexer which is is discussed in the next posts, starting with this one. It can be used on OSX and Linux.

iTerm basics (Mac OSX)

Command+D Split current window vertically
Command+Shift+D Split current window horizontally
Ctrl+Alt+Left/Right/Up/Down Move between window (panes)
Ctrl+D Close window (pane). Could also type exit
Command+Alt+2/3/4 Switch to iTerm window number 2 (or 3, 4, etc)
Command+T New window in new tab
Command+Left/Right Move between tabs

Terminator basics (Linux)

Ctrl+Shift+E Split current window vertically
Ctrl+Shift+O Split current window horizontally
Alt+Left/Right/Up/Down Move between window panes
Ctrl+D Close window (pane)

Terminal emulators on Windows

While there are several options for terminal emulators on Windows, there are some posts, e.g. this post, which suggest that it is possible to install Terminator on Windows. Sadly, this does not seem to be the case. To confuse matters further, there is another terminal emulator, also called Terminator, which can be installed on Windows. In any event, it may be better to look for alternatives, such as ConEmu. However, I have not personally tried these.

My solution would be either: (a) switch to Linux, or (b) if I really HAD to have Windows, install Linux Mint on a virtual machine, such as VirtualBox. A really good tutorial can be found here.

Some useful terminal commands

Below are some useful commands (almost all of them related to ls).

ls list the names of all files in current folder
ls /xyz list all files in folder xyz
ls -l list more details of the files (one column)
ls -l -t list by date (newest first)
ls -l -tr list by date (oldest first)
ls -l -S list by size (largest first), source
ls -l -S -r list by size (smallest first)
du -hs see the size of current directory
ls -d */ list only directories in current folder
ls -a list all files (including hidden files)
ls -A same as ls -a, but excludes . and .. folders
ls -ld .[!.]* list ONLY the hidden files, source
ls -1 | wc -l count number of files/folders inside a folder. Note it is: ls -ONE | wc -L

Note that often the flags can be combined, i.e. ls -l -S -r could simply be ls -lSr. The are usually written separately above, in order to show what each flag does.

In order to find/replace a string in a group of files in a directory, the following works on OSX:

grep -rl searchstring /path/to/folder/ | xargs sed -i "" 's/string1/string2/g'

This will search through all the files in the folder /path/to/folder/ that contain the string searchstring, and in those files replace string1 with string2. This post provided this solution (note the additional "" after sed -i provided in the comments is necessary for OSX).