January 30, 2023

Start using the command-line interface (cli)

Read Introduction to the command line

You can start by reading the book Introduction to the command line published under a copyleft license1. You can find a pdf copy of this book hosted on this website: https://yctct.com/command-line-gnu.pdf

At times, I have kept a printed copy on my desk for everyday usage; I find that consulting this book provides me with more reliable and in-depth answers than searching the web.

Use man

You can also use man. man is short for system’s manual pager. Most programmes available on the command-line have a man page.

You can display a man page in your terminal by running:

$ man name_of_the_programme

for example:

$ man ls 

will display the man page of the command ls.

When the man page is displayed, you can:

  • navigate a man page using the keys j and k to go down and up, respectively.
  • search a man page for a keyword by typing /keyword.
  • quit a man page by pressing the key q.

Man pages are a bit dry to read at first, but one gets use to it. It is worth it; most of what you need will be in there. Look at the Example section of man pages (usually at the bottom of a man page). Over time, I have found that it is more efficient and reliable to consult man pages than searching the web.

You do not need to download man pages. Man pages are already on your operating system.

What if you are seeking to do a task from the command line but don’t know which programme to use or even whether a programme exists to do such a task? Use the programme named apropos to find programmes you need.

Use apropos

Use apropos to find programmes you need on your computer.

There are already many programmes installed on your computer. You can find the ones you need by running:

$ apropos keyword

for example, if you are looking for a programme to list all the USB devices mounted on your computer you can run:

$ apropos usb

It should list the name of all programmes which keyword usb is in the description of the man page. In the list, you should lsusb. This utility can list all USB devices mounted.

That is it.

You can see some of the programmes I use on the command line there: https://yctct.com/log#programmes

  1. GNU Free Documentation License, see page 163 of the book.↩︎

command-line interface (cli) learn gnu linux personal computing start using wiki office applications shell literacy offline

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88