System Information

Posted on Sunday March 13, 2016 / by Eric Potvin

System Information

List the users logged in on the machine.

who

List all users logged in on your network. The rwho service must be enabled for this command to work.

rwho -a

System info about a user. Try: finger root last. This lists the users last logged-in on your system.

finger user_name

Show the last (1000 or so) commands executed from the command line on the current account. The | more causes the display to stop after each screen fill.

history | more

Print working directory, i.e. display the name of your current directory on the screen.

pwd

Print the name of the local host (the machine on which you are working).

hostname

Print your login name.

whoami

Print user id (uid) and his/her group id (gid), effective id (if different than the real id) and the supplementary groups.

id username

Print or change the operating system date and time. E.g., change the date and time to 2000-12-31 23:57 using this command

date

To set the hardware clock from the system clock, use the command (as root) setclock

date 123123572000

Determine the amount of time that it takes for a process to complete+ other info. Don't confuse it with date command. For e.g. we can find out how long it takes to display a directory content using time ls

time

Amount of time since the last reboot

uptime

List the processes that are have been run by the current user.

ps

List all the processes currently running, even those without the controlling terminal, together with the name of the user that owns each process.

ps aux | more

Keep listing the currently running processes, sorted by cpu usage (top users first).

top

Info on your server.

uname -a

Memory info (in kilobytes).

free

Print disk info about all the file systems in a human-readable form.

df -h

Print detailed disk usage for each subdirectory starting at root (in a human readable form).

du / -bh | more

(as root. Use /sbin/lsmod to execute this command when you are a non-root user.) Show the kernel modules currently loaded.

lsmod

Show the current user environment.

set|more

Show the content of the environment variable PATH. This command can be used to show other environment variables as well. Use set to see the full environment.

echo $PATH

Print kernel messages (the current content of the so-called kernel ring buffer). Press q to quit less. Use less /var/log/dmesg to see what dmesg dumped into the file right after bootup. - only works on dedciated systems

dmesg | less