Command line

More to think about

  • The commands that your computer knows about when you first switch it on depends on the operating system it ships with. Who chose them?
  • Some commands are “built-ins” because they are part of the operating system’s kernel… others are programs that come pre-installed. How can you tell which is which?
  • You can save command line instructions into a file… and then tell your computer to read the commands from that file (instead of typing them again). This is shell scripting!
  • You can run different command line interpreters: choose the one that works best for you, and learn its shortcuts.
  • On Windows, if you install the version control software Git, it ships with a tool called git-bash that behaves more like a Unix bash command line than a Windows one — remember which one you’re using!
  • The well-known problem with spaces in filenames is why you’ll see underscores in filenames where normal people put spaces. Normal people don’t care about spaces because they usually interact with files by clicking on pictures of them (GUI) not typing their names as arguments on the command line.
  • Your command line is a process which has a command-line window attached to it, and you use & to launch new processes. But in fact most of the processes on your computer are running without windows: the number of processes that are running with effects you can see on the interface (windows) are the minority. How can you see which processes are running?
  • The command line output accepts your input (keyboard): this is called STDIN (“standard input”). When it puts text back to the screen this looks like one output, but actually there are usually two: STDOUT and STDERR. How can you manipulate these? Why might you want to?