System and users cheat sheet
The most useful system and users commands on one printable page, every line checked by running it.
cal Print a calendar for a month, a few months, or a whole year.
date Print the current date and time in any format, or convert and calculate dates.
date '+%Y-%m-%d %H:%M:%S'- Print a date in a custom format output
date +%s- Get the current Unix timestamp output
date -u -d @1700000000 date -u -d @1700000000 +%F- Convert a Unix timestamp to a date output
date -d '2026-03-14 08:00:01 UTC' +%s- Convert a date to a Unix timestamp output
date -d '2026-03-14 +3 days' +%F date -d '2026-03-14 -2 weeks' +%F date -d '2026-01-31 +1 month' +%F date -d '2026-03-14 08:00 UTC +90 minutes' '+%F %H:%M'- Calculate relative dates output
env Print the environment, or run a command with a modified environment.
env GREETING=hello bash -c 'echo "$GREETING from a child"' echo "parent sees: ${GREETING:-nothing}"- Run a command with an extra variable output
env -u EDITOR printenv EDITOR; echo "exit: $?"- Remove a variable for one command output
env -i bash -c 'env'- Run a command with an empty environment output
chmod +x strict.sh; ./strict.sh- Pass options in a shebang with env -S output
free Show how much RAM and swap is in use, free, and available to new programs.
groups Print the groups the current user, or each named user, belongs to.
id Print the user and group IDs of the current user or of a named user.
journalctl Read and filter the systemd journal, the log store for services, the kernel and the boot process.
journalctl -u nginx- Show the logs of one service output
journalctl -u nginx -f- Follow a service's log live output
journalctl -b journalctl -b -1 -e journalctl --list-boots- Show messages from the current or previous boot output
journalctl -u nginx --since '2026-03-14 08:00' --until '2026-03-14 09:00' journalctl --since '1 hour ago' journalctl --since today- Show a time window output
printenv Print all environment variables, or the values of the ones you name.
systemctl Start, stop, enable and inspect services and other units managed by systemd.
systemctl status nginx- Check whether a service is running output
sudo systemctl enable --now nginx- Start a service now and at every boot output
if systemctl is-active --quiet nginx; then echo "nginx is up" else echo "nginx is down" >&2 fi- Test a service's state in a script output
systemctl list-units --failed- List units that have failed output
uname Print the kernel name, release and version, the hostname, and the machine hardware type.
uptime Show how long the system has been running, how many users are logged in, and the load averages.
vmstat Report processes, memory, swap, I/O and CPU activity, once or at a regular interval.
whoami Print the user name of the effective user ID the current process runs as.
From https://opscape.vip/cheatsheets/system/ · checked 2026-10-31