Operations 42 min read

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.

Raymond Ops
Raymond Ops
Raymond Ops
Master Linux System Basics: Time, Hostname, Users, Network & Process Commands

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:

<code>date</code>

Set the system time:

<code>date -s "2016-02-09 15:15:00"</code>

Synchronize network time using NTP:

<code>ntpdate -u ntp.api.bz</code>

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:

<code>hostname</code>

To permanently change the hostname, edit

/etc/hostname

and

/etc/sysconfig/network

, then reboot.

Show kernel and OS details with

uname

:

<code>uname -a</code>

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:

<code>root:x:0:0:root:/root:/bin/bash</code>

Fields: username, password placeholder, UID, GID, description, home directory, login shell.

Example of a

/etc/shadow

line:

<code>root:$6$zVDR2oO1Yg7alTbs$.70PPMYxg70k9BvLtjHdm94CDA1YWDRDI5NFzSfcmZF5WMESgIbLUdnqRjuVycg481Ny9rl//YzAFnXhurQi//::0:99999:7:::</code>

Fields include encrypted password, last password change date, minimum days before change, maximum days before expiration, warning period, etc.

Adding a user:

<code>useradd zhanglonghao</code>

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:

<code>usermod -u 1005 zhanglonghao</code>

Deleting a user (optionally remove home files):

<code>userdel -rf zhanglonghao2</code>

Basic Network Operations

Fetch a web page with

curl

:

<code>curl www.baidu.com</code>

Download a file with

wget

:

<code>wget http://download.redis.io/releases/redis-3.0.6.tar.gz</code>

Text‑based browsers:

<code>w3m www.baidu.com</code>
<code>links www.baidu.com</code>

Check connectivity with

ping

:

<code>ping www.baidu.com</code>

Trace network paths with

mtr

(example options shown):

<code>mtr -r -c 30 www.baidu.com</code>

DNS lookup with

host

:

<code>host www.baidu.com</code>

Network Interface Configuration

Display interfaces with

ifconfig

:

<code>ifconfig</code>

Modern

ip

commands:

<code>ip link show</code>
<code>ip -s link show</code>
<code>ip addr show</code>

Network Monitoring Tools

Show active connections with

netstat

(common options):

<code>netstat -a</code>
<code>netstat -at</code>
<code>netstat -au</code>
<code>netstat -ant</code>
<code>netstat -tnl</code>
<code>netstat -nlpt</code>

Real‑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:

<code>df -h</code>

Show directory sizes:

<code>du --max-depth=1 -h</code>

Tree view of directories (example):

<code>tree -L 3 src</code>

Process 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):

<code>ps -aux</code>

Tree view of processes:

<code>pstree -p</code>

Memory Information

Show memory summary:

<code>free -h</code>

Detailed memory info from

/proc/meminfo

:

<code>cat /proc/meminfo</code>
Linuxcommand lineSystem AdministrationProcess MonitoringNetwork Utilities
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.