We will provide you with some useful commands in Unix where you can get information about your system.
- date: It returns the current datetime.
date
Mon Oct 25 19:54:48 EEST 2021
- uptime: It returns how much time your system is up.
uptime
19:57:02 up 2 days, 30 min, 0 users, load average: 0.52, 0.58, 0.59
- users: It returns all the users who are logged into the system.
- who: It returns the users that are logged-in and gives us a listing for each one of those log-ins
- whoami: It returns the username of the current user when this command is invoked
whoami
g_pipis
- uname: It returns the name of the operating system.
uname
Linux
If you want more details, you can add the -a
option.
uname -a
- df: It returns the amount of the free space on the disk
df -h
- du: It returns the size of a file or directory
du -h /path
Or, if you want to see the size per file within the directory.
du -ha /path