buymeasoda RefDocs
  • Overview
  • General
    • Android
    • Apache
    • Fish
    • Git
    • Github
    • Gmail
    • Homebrew
    • iOS
    • iTerm
    • MacOS
    • MacPorts
    • Mamp
    • Media
    • Mercurial
    • MySQL
    • Node
    • npm
    • nvm
    • Obsidian
    • PHP
    • React Native
    • Rust
    • Server
    • Slack
    • Sourcegraph
    • Tools
    • Vim
    • VS Code
    • Yarn
  • Unix
    • Checksum and hash utilities
    • Command line history
    • Command line keyboard shortcuts
    • Compress files and folders
    • Crontab
    • Diff files and folders
    • Disk usage and file sizes
    • Find and search files
    • Firewall configuration
    • Help and manual pages
    • HostName and Local HostName for Mac OSX
    • Navigating the file system
    • Network, domains and routing
    • Run and manage background tasks
    • Secure FTP SFTP and Secure Copy SCP
    • Secure Shell SSH
    • Sync files and folders
    • System and process management
    • System and user information
    • Useful characters
    • Useful commands
    • User, file and group permissions
    • Working with cURL
    • Working with files and directories
    • Working with text
Powered by GitBook
On this page
  • User
  • Operating System
  • Command Info
  • Uptime
  • Hostname
  • Processes
  • Memory
  • Network
  • Terminal
  • Log Files
  • System Mail
  1. Unix

System and user information

User

Display current username (or user when using sudo)

whoami
sudo whoami

Show currently logged in user

who

Permission details for current user

id

List users for system

users

Display information about system user

finger <username>

Show login history for system (or system reboot history)

last
last reboot

Operating System

Display the Unix system type being used

uname -a

Display the processor architecture (-p) or machine hardware (-m). (Examples: Processor arm, i386 / Hardware arm64, x86_64)

uname -p
uname -m

Display system OS information (Linux)

cat /etc/os-release

Show distribution specific version information (Linux)

cat /etc/lsb-release

Display basic system OS information or more detailed system config (macOS)

sw_vers
system_profiler SPSoftwareDataType

Command Info

Search system commands and display short description

whatis <command>

Show location of command for current user path config

which <command>

Show all locations for command

whereis <command>

Uptime

Display system uptime, memory, who is logged in and what they are doing

w

System uptime statistics

uptime

Hostname

Display the machine short hostname

hostname

Display the machine fully qualified hostname

hostname -f

Processes

Display real time information about process

top

Display detailed real time information about the system

htop

Show list of running processes

ps aux | less

Memory

Show memory usage (in megabytes)

free -m

Network

Network settings including computer IP

ifconfig

Local machine IP

ipconfig getifaddr en0

Show smb info for network volumes

smbutil statshares -a

Terminal

Output key / value pairs of current environment variables

env

Output current terminal settings

stty -a

Log Files

Log files location

/var/log

System Mail

System mail messages for users

/var/mail/<username>

Show mail messages

cat /var/mail/<username>

Empty mail messages (via truncate operator >)

> /var/mail/<username>

Empty mail messages (alternative command)

cat /dev/null > /var/mail/<username>
PreviousSystem and process managementNextUseful characters

Last updated 1 year ago