Answer» These are some of the general-purpose system information commands that are important to know and easy to remember.
| COMMAND | MEANING | EXAMPLE & SYNTAX |
|---|
| history | This command displays the list of all the typed commands in the current terminal session. | Syntax: $ history
|
|---|
| clear | Clears the terminal i.e. no previous command will be visible on the screen now. | Syntax: $ clear
|
|---|
| hostname | Shows the name of the system host. | Syntax: $ hostname
|
|---|
| hostid | Displays the id of the host of the system. | Syntax: $ hostid
|
|---|
| sudo | Allows a regular user to run the programs with the security privileges of a superuser or root. | Syntax: $ sudo
|
|---|
| apt-get | This command is used to install and add new packages. | Syntax: $ apt-get
|
|---|
| date | This command is used to show the current date and time. |
Example: The command and its output are shown on the right.
Syntax: $ date Fri Feb 25 14:58:08 IST 2022
|
|---|
| cal | Shows the calendar of the current month. |
Example: The command cal and its output is shown on the right.
Syntax: $ cal
|
|---|
| whoami | This command displays the name with which you are logged in. |
Example: The command is typed in and it shows the username with which the user has logged in.
Syntax: $ whoami Guneet Malhotra
|
|---|
| whereis [options] fileName | This command is used to find the location of source/binary file of a command and manuals sections for a specified file in Linux System. This command is similar to the find command but this command is faster as it produces more accurate results by taking less time compared to the find command. There are again a number of options available. |
Example: The command to locate apropos command in Linux System is given on the right.
Syntax: $ whereis apropos
|
|---|
|