Quick links: C-Tricks HR Interview Que. Code Snippets C Programs C++ Programs Java Programs PHP Examples

Home » Linux

Linux Terminal Commands - System Information related commands

Here, you will find the set of linux terminal commands, with the help of them, you can work with linux.


Sponsored Links



Working with system information

command description
date Shows the current system's date & time.
ih@linux:~$ date
Mon, Apr  6, 2015  9:47:34 PM
                        
whatis This command shows the short description (definition) of a command.
ih@linux:~$ mkdir --help
CMD --help This command shows the command’s help with the description and their options.
ih@linux:~$ mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.
  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask
  -p, --parents     no error if existing, make parent directories as needed
  -v, --verbose     print a message for each created directory
  -Z                   set SELinux security context of each created directory
                         to the default type
      --context[=CTX]  like -Z, or if CTX is specified then set the SELinux
                         or SMACK security context to CTX
      --help     display this help and exit
man CMD This command shows the manual of command or function.
ih@linux:~$ man mkdir
MKDIR(1)                         User Commands                        MKDIR(1)

NAME
       mkdir - make directories

SYNOPSIS
       mkdir [OPTION]... DIRECTORY...

DESCRIPTION
       Create the DIRECTORY(ies), if they do not already exist.

       Mandatory  arguments  to  long  options are mandatory for short options
       too.

       -m, --mode=MODE
              set file mode (as in chmod), not a=rwx - umask
              ........
whoami This command displays the name of the current user (who is logged on).
ih@linux:~$ whoami
ih
who am i This command displays the name of the logged on users with terminal name and logged on time.
ih@linux:~$ who am i
ih  pts/1       2015-04-06 22:17
..
..
who This command displays the information about all logged in users with terminal, time etc.
ih@linux:~$ who
ih      pts/1       2015-04-06 22:17
mike    pts/2       2015-04-06 22:19
uptime This command tells how long system has been running.
ih@linux:~$ uptime
19:20:35    up  1:09, 2 users, load average: 0.05, 0.12, 0.10
here,
19:20:35 - is current system time.
1:09 - system running time.
pwd Stands for "print working directory", is used to display current working direcotry, inwhich you are.
ih@linux:~$ pwd
/home/ih
w Shows the login name os the user, who is online
logout Logouts from the current login.
cat /proc/cpuinfo Displays the cpu information.
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Core(TM)2 Duo CPU     T6600  @ 2.20GHz
stepping        : 10
cpu MHz         : 2195.000
cache size      : 2048 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae ...
TLB size        : 0 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Core(TM)2 Duo CPU     T6600  @ 2.20GHz
stepping        : 10
cpu MHz         : 2195.000
cache size      : 2048 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8...
TLB size        : 0 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:
cat /proc/meminfo Displays the memory information.
$ cat /proc/meminfo
MemTotal:        3105660 kB
MemFree:         1520568 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:        3105660 kB
LowFree:         1520568 kB
SwapTotal:       1245184 kB
SwapFree:         961652 kB
lscpu This commands shows the CPU process unit related information such as architecture, cpu mode, Byte Order, CPU(s) core, Vednor Id etc.
lshw Stands for "list hardware". This command lists the detailed and brief information about the multiple hardware such as cpu, memory, usb controllers, disks etc. It displays the information from the different /proc files.
hwinfo Another utility that shows the detailed and brief information about the multiple hardwares, it displays the more & detailed information than lshw command.
lsusb Stands for “list USB”. It shows the detailed & brief information about the USB controllers and connected USB(s) devices.
lsblk Stands for “list Block”. It shows the detailed & brief information about the installed block device drivers.
df It shows the disk space of the file system.
free It shows the total, used and free RAM size of the system.
mount It shows the mounted file systems.


Solved programs


Sponsored Links


Most viewed pages


Featured posts
C Tips and Tricks