3

Lesson 3: Basic Commands and Getting Help

Lesson 3 of 4
10 min

Lesson 3: Basic Commands and Getting Help

Basic Commands

Linux uses a command-line interface (CLI) instead of a graphical user interface (GUI). In Linux, commands are typically structured like this:

(prompt)(command)-(option/flag)(argument)

  • Prompt: - usually represented by a dollar sign($), but can be represented by other symbols. It signifies that a user can type a command.
  • Command: - a keyword inputted by the user telling Linux what to do.
  • Option: - also known as flag. An option provides additional details to the command.
  • Argument: - often passed into an option. Arguments allow the user to reference specific information such as users or files

Here are some command examples:

  • whoami - returns the name of the logged-in user
  • ls: short for "list". Will list all avalible files and directories in the current directory.
  • cd: short for change directory". Allows the users to navigate through the filesystem.
  • cat: short for concatenate". Will show contents of a file.
  • head: will show the first 10 lines of a file.

Getting Help

There are so many commands in Linux that no one is expected to know them all, and it will definitely be difficult for us to teach you everything. That is why there are many helpful resources that have been created for people to navigate Linux.

Commands:

  • man: short for "manual". Using "man" before any Linux command will return a description and options that can be used with the command.
  • --help: typing this as an option after a command will also return more options and information on how to use a command. Note: most applications on Linux also have their own
Use arrow keys to navigate between lessons