Linux commands demystified pt.1

You’ve watched vloggers and read blog posts on this new kid on the block in the Linux community called EndeavourOS. You’ve downloaded the ISO image and had a successful install. After extensively trying the likes as Ubuntu, Linux Mint, ZorinOS or any other non-Arch-based distro out there, you’re ready to take the plunge.

At first glance, the OS seems to greet you very friendly with an attractive looking Xfce desktop, it has no GUI package for Pacman but you’ve read and viewed the reviews, so in this stage, it doesn’t bother you because you’re ready to learn this, quite intimidating looking OS.

You might have consulted the wiki, various internet searches and asked the help from the community. These helplines all give the same solution, run certain command lines… You simply copy or preferably type them over in the terminal and… HURRAH, IT WORKS!!!!!!…. But what have you actually typed in the terminal?

A powerful tool

As you might have experienced, these commands aren’t magic but very powerful tools to maintain and to stay on top of your system. You can compare them with what the steering wheel, the transmission box and the foot pedals are for a car. Use those commands in a wrong balance, just like a car, you will lose control and your system is directing your machine towards a crash.

In this series, I’m going to give a little more background on those most used mysterious-looking code words called commands.

Adduser/Addgroup

This command doesn’t actually beat around the bush what it’s doing, it simply adds a new user or a group to the system.

First, make sure you have root privileges and the easiest way is by entering:

$ sudo su (I’ll explain that one later in the series) then type in your password and then type:

# adduser [username}

This is an example of the screen you’ll see:

adduser johnd
Adding user 'johnd' ...
Adding new group 'johnd' (1001)...
Adding new user 'johnd' (1001) with group 'johnd' ...
Creating home directory '/home/johnd' ...
Copying files from '/etc/skel' ... 
Enter new UNIX password:
Retype new UNIX password:
passwd: Password updated successfully
Changing the user information for johnd
Enter the new value, or press ENTER for the default
        Full name: []
        Room number: []
        Work phone: []
        Home phone: []
        Other: []
Is the information correct? (Y/N): Y

As you can see you can add extra info in the dialogue box and when you hit ENTER the new user is added.

Apropos

The apropos command searches manual page names and descriptions for a user-supplied keyword. Following is its syntax:

apropos [OPTIONS] keyword ...

And here’s what the tool’s man page says about it:

       Each manual page has a short description available within it.   apropos       searches the descriptions for instances of keyword.       keyword  is  usually  a regular expression, as if (-r) was used, or may       contain wildcards (-w), or match the exact keyword (-e).   Using  these       options,  it  may  be  necessary to quote the keyword or escape (\) the       special characters to stop the shell from interpreting them.       The standard matching rules allow matches to be made against  the  page       name and word boundaries in the description.       The  database  searched  by  apropos  is  updated by the mandb program.       Depending on your installation, this may be run by a periodic cron job,       or  may  need  to  be  run  manually  after  new manual pages have been       installed.

Basic usage

Basic usage is simple. Just pass the keyword you want to search as input to the apropos command.

For example:

apropos dmesg

produced the following result:

dmesg (1)            - print or control the kernel ring buffer

Of course, you can pass multiple keywords as well.

For example:

apropos dmesg whereis

Following is the output in this case:

dmesg (1)            - print or control the kernel ring bufferwhereis (1)          - locate the binary, source, and manual page files for a...

Search for exact keywords

By default, the input you pass to the apropos command isn’t searched exactly. For example, if you pass ‘who’ as an input, like this:

$ apropos who

You’ll also see the tool producing results containing words like ‘whoami and this isn’t an exact search. However, you can force apropos to search for exact keywords by using the -e or –exact command-line options.

$ apropos --exact who

In this case, the results are cleaner and the system prompts you with the exact keyword search.

More on Linux commands come to you in part 2.

Follow us:

2 thoughts on “Linux commands demystified pt.1

  • November 10, 2019 at 19:04
    Permalink

    Good tutorial, apropos, for example, is a long forgotten command.

    Reply
  • November 11, 2019 at 21:32
    Permalink

    Thank you.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: