1.

System Information Commands

Answer»

These are some of the general-purpose system information commands that are important to know and easy to remember.

COMMANDMEANINGEXAMPLE & SYNTAX
historyThis command displays the list of all the typed commands in the current terminal session.Syntax: $ history
clearClears 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
hostidDisplays the id of the host of the system.Syntax: $ hostid
sudoAllows a regular user to run the programs with the security privileges of a superuser or root.Syntax: $ sudo
apt-getThis command is used to install and add new packages.Syntax: $ apt-get
dateThis 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


calShows the calendar of the current month.

Example: The command cal and its output is shown on the right.


Syntax: $ cal


whoamiThis 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] fileNameThis 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





Discussion

No Comment Found