Survival command line

DEC VT100 terminal
DEC VT100 terminal at the Living Computer Museum (apparently connected to the museum’s DEC PDP- 11/70). Introduced in August 1978 by Digital Equipment Corporation (DEC)
Jason Scott – Flickr: IMG_9976 CC BY 2.0

The built-in Terminal in MacOS and Linux and in Windows with added software provides access to the core of the computer. They are simply a software version (an emulation) of what used to be a hardware terminal (as the one shown above) user to connect to a computer when these were the size of multiple washing machines!

While it can be intimidating and even daunting to think about typing commands, there are just a handful of them that can let you navigate the computer and provide access to simple tools that are very powerful.

Just a handful of commands are all you need to start. I have written a new, very short tutorial that I called Survival Command line that is available on the BCRF web site: nix-tutorials-survival-command-line 

Here are the most useful once you start Terminal (On a Mac it is inside the Applications/Utilities directory. All commands are given after the $ symbol:

Commands to navigate and create directories:

  • pwd: print working directory – will print out on screen the name and path of the directory where Terminal is looking
  • cd: change directory – provide the name of a directory and Terminal will change its focus to that location
  • mkdir: make a new directory – just provide a name
  • ls: list files and directories. Add -a to see all files included hidden files. Add -F to mark directories with a trailing symbol /
  • rm: remove a file
  • mv: move / rename a file or directory
  • cp: copy a file (duplicate)

Commands to create text files:

  • nano: small, full screen easy to use text editor.

Commands to check the content of text files:

  • head: show the first 10 lines of a text file
  • tail: show the last 10 lines of a text file
  • more: show one screenful at a time. (q to quit, space bar to see the next screen.)
  • cat: type complete text file on the screen (not useful for long files)
  • wc: word count – prints you the number of lines and words in a text file

This about dozen of commands is all you need for most tasks! They are easy to remember as they are close enough to shortened English words.

Of course there are a few more explanations and ideas in the tutorial… I encourage you to take a peek… you may be surprised at what you can actually do!