Difference between revisions of "Command Line Basics"

From docwiki
Jump to: navigation, search
Line 29: Line 29:
 
* [[Working with Filenames and Path and Globing]]
 
* [[Working with Filenames and Path and Globing]]
 
* [[Using a Text Editor]]
 
* [[Using a Text Editor]]
  +
* [[Changing to a different user sudo and su]]
 
* [[Package management with apt and yum]]
 
* [[Package management with apt and yum]]
   

Revision as of 10:41, 22 March 2020


Motivation

Advantages of CLI

If you install a typical Linux distribution you can use it completely with your GUI. Of course you can also do this in your server or on the raspberry-pi that you use in your weather station but for servers and small devices it is much better to use the command-line-interface (CLI).

Here is a list of advantages of the CLI on a terminal over graphical user interfaces (GUI), most of which are specially relevant on servers that sit in a server room at the other end of town:

  • Less bandwidth: You can use terminal connection on slow and lines
  • You do not need to install GUI components so the size of your OS images is drastically reduced.
  • Typing commands on a good CLI is much faster and more expressive then clicking around
  • Stable for a longer time. While the fashion of GUIs changes you would still feel comfortable on a modern Linux with the knowledge of using Unix some 40 years ago.
  • Easy to document. While it is hard to describe which button in which tab you need to click and often you need screenshots for that, it is easy to write documentation on which command you need to enter.
  • Easy to automate. Once you know which command to use you can put that in a script to automate longer taks. You can run them automatically a certain times or intervals or let them be triggered by external conditions.


Disadvantages of CLI

  • Sometimes it is a bit harder to learn. But a good GUI will also assist you with command-completion and help text.
  • Not so suitable for handling data that is inherently graphical: E.g. a drawing. Counterexample: [1]

Units


References and Footnotes

  1. While there is a good counterexample: openscad is a program to generate 3D objects (nice for 3D printing) where you describe your geometry with a kind of programming language. While you have direct feedback how your graphic looks, the fact that you describe it with a language makes it then easy to later change something. So it is easy to create parametric object where you can change certain aspects by editing a number, etc.. In the end this is often more time saving than using a GUI-only program.