Terminal tips

productivity, terminal, tips Updated

The terminal is a great tool, as long as you know how to use it effectively. Here are some tips and tricks I've found useful.

iTerm2 shortcuts #

  • Toggle display of timestamps on the right side of the terminal indicating the time each line was modified.

    + + E

  • Autocomplete any text in a tab or its scrollback buffer.

    + ;

Who's running what? #

who shows who is logged in:

$ who
alan console 2020-12-18 17:44
alan ttys009 2021-05-08 17:12
alan ttys072 2021-04-15 20:46
alan ttys078 2021-05-08 13:54

w shows who is logged in and what they are doing:

$ w
23:37 up 143 days, 4:53, 4 users, load averages: 2.17 2.35 2.41
USER TTY FROM LOGIN@ IDLE WHAT
alan console - 18Dec20 143days -
alan s009 - Sat17 - w
alan s072 - 15Apr21 1:21 /usr/local/opt/bash/bin/bash -l
alan s078 - Sat13 5 node index.js

NOTE: w is a useful command but not one I use very often. I have an alias w that I use daily to navigate to my code workspaces, so to access the original w command it must be run as \w, see alias command and backslash escape character for details.

-