7 Methods to Get Command Line Assistance on Linux

Learning new things can be overwhelming and the Linux terminal is no exception. If you want to master the command line terminal, you need to understand the underlying concepts rather than memorizing commands.

Most of the commands on Linux are well documented. To really understand them, all you need is the command terminal itself.

This guide introduces some of the most important Linux commands that you can use to get help with Linux commands from the command line and improve your learning on your way to mastering Linux commands.

Why use the command line?

If you're used to using graphical user interfaces (GUI), you may be wondering, why should I use the command line when I can access everything in the GUI? The truth is, the command line gives you more control and flexibility in changing or managing your system.

Take, for example, the task of adding a new user to the system. This is the GUI that is made available to you.

When performing the same task from the command line, you can use the following command.

sudo useradd muo -p Azb3tDEM, aH8

A very simple command that can be easily automated. You can also add other options when creating the user, such as: E.g. set the expiration date for the password, add the user group or set the default home directory for the user, etc.

The other benefit is that you can use the same command on any Linux distribution and even on other operating systems like Mac OS and Unix. Meanwhile, the GUI implementation differs between different Linux distributions or operating systems.

1. Speaking of which

Linux commands are many and you may not be able to get all of them. If you don't know which command to use for a particular task, the speaking of Command is your friend.

Let's say you want to copy a file but don't know which command to use. Just use the speaking of Command followed by the task you want to perform.

Use to check the copy commands

Speaking of copy

Speaking of which, it lists several commands that match the keyword you are using. The list contains a brief description of how the command works. In the following output, the highlighted command is exactly what you are looking for to copy files or directories.

The word apropos is derived from the French word "à suggest", which means "approximately".

The apropos command searches the entire description sections of the man pages for the appropriate keyword that you specify with the apropos command.

2nd man

Now you can find a command that can be used for a specific task. See the man pages for more information about the command and its options.

The manual pager utility displays the manual pages for the program you are looking for. Man pages are comprehensive and well organized. They are the first port of call when it comes to understanding and learning more about commands and their options or arguments.

Man pages are divided into sections.

The sections may vary depending on the author of the man pages. However, here are some of the most common sections you will come across.

  • Surname: The name of the command whose manual documents you are viewing.
  • Summary: Provide a brief description of some of the options for that command.
  • Description: A more detailed description of the command, including how it works and how it works.
  • Options: This section details any arguments or options that you can use with the command.
  • Examples (tips): This section shows you some use cases and how the command can be used.

The man pages for the see Command looks like this.

The man pages can be quite long. You can use the to easily navigate the man pages without leaving the keyboard f Keys to go forward and the b Key to go backwards.

You can also search for keywords within the man pages using the /(Keyword) followed by the Enter key.

For example, to search for the word recursive You can use the following in the man pages of the cp command.

/ recursive

Use the n Key on your keyboard to navigate forward in search and the Shift + n Button to search backwards.

3. Whatis

Another important command to learn more about a particular command is the What is Command. The command contains a short one-line description of a command.

For example, to find out what the rsync Command is used for:

whatis rsync

4. Info

Like the man pages, the info pages contain a detailed description of a specific command. In some cases, the info pages contain more detail than the man pages.

The info utility allows you to read the documentation in info format.

info info

Use the n Key on your keyboard to navigate forward through the info pages and through the page p Button to navigate backwards.

Another unique feature of the info pages is that they contain hyperlinks to other sections for easy navigation, as shown in the following issue.

5. Which

Most Linux commands are in the / usr / bin / Directory.

However, if you want to find out where a particular command's executable is, you can use that Which Command. The command searches all paths for executable files that match the command keyword it is looking for. For example, to find out where the SSH utility is, you can run the following command.

which ssh

6. Help

Another useful utility for getting help on the command line is this HelpCommand. Use this option for a brief description of a specific built-in command.

Here is sample output from the help command. Note : Only built-in commands can be used with the help command.

The help command only works with the bash shell.

The help argument

Most Linux commands have the –Help Command argument or option. You can use it to display helpful information about using a command and its arguments in a simplified manner.

Get more help on that for example see Command you can use.

cp –help

7. Get commands

The Linux terminal allows you to list commands that you ran previously. Use the history Command to view a list of previously executed commands.

history

It lists all commands in chronological order from oldest to newest with a corresponding number.

To rerun a command from the history list, just enter ! followed by the number of the command. For example, to rerun command number 9 in the list.

! 9

Another way to get commands is to use Ctrl + R. In the terminal window, enter a keyboard shortcut and enter the keyword you are looking for. You can then use that CTRL + R.to iterate through any previously executed commands that contain the keyword you specified.

Learn more about Linux

The command line is not only a great utility to get your job done, but it is also a great utility for getting help with the various commands available on Linux. Aside from the command line terminal, you can always use online resources to learn more about Linux.

9 things to do after installing Ubuntu Linux in VirtualBox

Install Ubuntu in VirtualBox to run Linux on your PC? Here are the 9 things you need to do next.

Continue reading

About the author

Mwiza Kumwenda
(3 articles published)

Mwiza is a professional developer of software and writes extensively on Linux and front-end programming. Some of his interests include history, economics, politics, and enterprise architecture.

More
By Mwiza Kumwenda

Subscribe to our newsletter

Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive deals!

One more step …!

Please confirm your email address in the email we just sent you.

Leave a Reply

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