Master Linux System Basics: Time, Hostname, Users, Network & Process Commands
This guide provides a comprehensive overview of essential Linux system administration tasks, covering how to view and set system time, manage hostnames, inspect kernel information, handle user and group files, use common network utilities, monitor disk usage, and track processes with tools like top and ps.
Introduction
The purpose of this article is to give readers a complete basic understanding of Linux systems, covering common information and configuration tasks for network, system, CPU, memory, disks, and processes.
Linux System Time
View the current system time: date Set the system time: date -s "2016-02-09 15:15:00" Synchronize network time using NTP: ntpdate -u ntp.api.bz Note: NTP synchronizes the local clock with remote servers such as 210.72.145.44, ntp.api.bz, time.nist.gov, etc. Only the root user can change the system time, and after setting it you should run clock -w to write the time to CMOS.
Hostname and OS Information
Display the system hostname: hostname To permanently change the hostname, edit /etc/hostname and /etc/sysconfig/network, then reboot.
Show kernel and OS details with uname: uname -a Key fields: kernel name, hostname, kernel version, hardware name, processor type, hardware platform, OS name.
Common uname options: -m or --machine: hardware (CPU) name -n or --nodename: network node name -r or --release: kernel release -s or --sysname: kernel name -v: kernel version -p: processor type -i: hardware platform -o: operating system
User and Group Management
User and group classification includes local accounts, remote (domain) accounts, LDAP, NIS, and system vs. regular users. Configuration files: /etc/passwd: user account information /etc/shadow: encrypted passwords /etc/group: group information /etc/gshadow: group passwords
Example of a /etc/passwd line: root:x:0:0:root:/root:/bin/bash Fields: username, password placeholder, UID, GID, description, home directory, login shell.
Example of a /etc/shadow line:
root:$6$zVDR2oO1Yg7alTbs$.70PPMYxg70k9BvLtjHdm94CDA1YWDRDI5NFzSfcmZF5WMESgIbLUdnqRjuVycg481Ny9rl//YzAFnXhurQi//::0:99999:7:::Fields include encrypted password, last password change date, minimum days before change, maximum days before expiration, warning period, etc.
Adding a user: useradd zhanglonghao Common useradd options: -c comment -d home directory -e account expiration date -f days after expiration before disabling -g primary group -G supplementary groups -m create home directory -r create system account -s login shell -u UID
Modifying a user: usermod -u 1005 zhanglonghao Deleting a user (optionally remove home files):
userdel -rf zhanglonghao2Basic Network Operations
Fetch a web page with curl: curl www.baidu.com Download a file with wget:
wget http://download.redis.io/releases/redis-3.0.6.tar.gzText‑based browsers:
w3m www.baidu.com links www.baidu.comCheck connectivity with ping: ping www.baidu.com Trace network paths with mtr (example options shown): mtr -r -c 30 www.baidu.com DNS lookup with host:
host www.baidu.comNetwork Interface Configuration
Display interfaces with ifconfig: ifconfig Modern ip commands:
ip link show ip -s link show ip addr showNetwork Monitoring Tools
Show active connections with netstat (common options):
netstat -a netstat -at netstat -au netstat -ant netstat -tnl netstat -nlptReal‑time traffic monitoring with iftop (install first). Common options include -i to select interface, -B for bytes, -n to show IPs, -N to show ports, etc.
Disk Usage and Tree View
Show filesystem usage: df -h Show directory sizes: du --max-depth=1 -h Tree view of directories (example):
tree -L 3 srcProcess Monitoring
Interactive process viewer top (default refresh 3 s). Common keys: Space refresh, q quit, M sort by memory, P sort by CPU.
List processes with ps (BSD style): ps -aux Tree view of processes:
pstree -pMemory Information
Show memory summary: free -h Detailed memory info from /proc/meminfo:
cat /proc/meminfoSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
