Command line

A command-line user interface (CLI), also known as a console user interface and character user interface (CUI), is a means of interacting with a computer program where the user (or client) issues commands to the program in the form of successive lines of text (command lines). A program which handles the interface is called a command language interpreter or shell.

Command-line interfaces to computer operating systems are less widely used by casual computer users, who favor graphical user interfaces or menu-driven interaction.

Command-line interfaces are often preferred by more advanced computer users, as they often provide a more concise and powerful means to control a program or operating system.

Programs with command-line interfaces are generally easier to automate via scripting.

Command line interfaces for software other than operating systems include a number of programming languages such as Tcl/Tk, PHP, and others, as well as utilities such as the compression utilities WinZip and UltimateZip, and some FTP and ssh/telnet clients.

Advantages

  • Requires fewer resources
  • Concise access to options
  • Expert-friendly
  • Easier to automate via scripting or batch files
  • Commands can be logged to review or repeat
  • Easy to add special sub-options
  • Shorter to show multi-step actions

Disadvantages

  • Requires help guide for commands
  • Commands can foster complex options
  • Not visually rich, results might scroll off-screen
  • Beginner-unfriendly

Command line is one of the many strengths of Linux based systems. When you open a terminal emulator, by default you are in the home directory of the logged in user. You will see the name of the logged in user followed by the hostname. $ means you are logged in as a regular user, whereas # means you are logged in as root.

Unless you are performing administrative tasks or working inside root directories never work as root as it will change the permissions of all directories and files you worked on, making root the user of those directories and their content.

~/.BASH_PROFILE

~/.bash_profile is the name of the file used to store environment settings. It is commonly called the “bash profile”. When a session starts, it will load the contents of the bash profile before executing commands.

 

Advertisements