Commands used for System Information
Command(s) |
Sample Output |
DATE The simple “date” command displays the current date and time (including the day of the week, month, time, time zone, year).
Date TZ By default, “date” command uses the time zone defined in path “/etc/localtime”. Linux user can change the time zone via Terminal by using command “TZ”.
Date --set Linux allows its user to set the current date and time of the system manually.
Example
This would set the system date to May 18, 2023 10:10 PM |
$ date
Thu Mar 2 07:23:38 PM EST 2023
$ TZ=GMT date
Fri Mar 3 12:03:59 AM GMT 2023
$ TZ=America/New_York date
Thu Mar 2 07:04:12 PM EST 2023 |
DF The command “df” shows the amount of disk space used and disk space available on every file system containing each filesystem’s name and its path.
The command “df -h” shows the same result as the command “df” but now the data is in a more human-readable form that can be easily comprehended by a new user.
|
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1623284 3612 1619672 1% /run
/dev/nvme0n1p3 491343600 18123184 452739188 4% /
tmpfs 8116400 104604 8011796 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8116400 0 8116400 0% /run/qemu
/dev/nvme0n1p2 456036 182424 239424 44% /boot
/dev/nvme0n1p1 98304 57271 41033 59% /boot/efi
/dev/sda1 47744748 57156 45229840 1% /tmp
/dev/sda3 2787016696 1123163768 1531975216 43% /home
/dev/sda2 47745772 31301948 13986020 70% /var |
Command Name & Description
|
Command(s)
|
Notes / Sample Output |
|
|
|
|
|
|
FREE The command “free” displays the amount of free and used memory in the complete system.
|
|
|
PS The command “ps” which is also known as the process status command is used to provide information about the processes currently running on the system, including their respective process identification numbers (PIDs).
PS AUX & PS -EF Both list all processes of all users. In that aspect Where they differ is output format specifier,
|
|
|
UPTIME The command “uptime” provides information about how long the system has been running in one line. The result for this command includes the current time, the time duration system has been running, the number of users who are currently logged on, and the system load averages for the past 1, 5, and 15 minutes respectively. |
|
|
W The command “w” displays detailed information about the users who are logged into the system currently. |
|
|
PASSWD The command “passwd” stands for password and it is used to change the password of the user. |
|
|
EXIT The command “exit” as the name says it is used to exit from the system and log out from the current user. |
|
|
SS The ss command is a modern replacement for the classic netstat command. You can use it on Linux to get statistics about your network connections.
|
Use the -ltn flags to list all listening ports on your system.
Use the following to see if a specific port is listening on your system. In this case, the source port (sport) and destination port (dport) is 80 or you can use the protocol name, http, instead.
|
|
SHUTDOWN The command “shutdown” is used to shut down the system. |
|
|