Skip to main content

Linux Basic Usage

1. Auxiliary Operations in the Linux Command Line

$ Backslash “\”: Force line break
$ Shortcut Ctrl+u: Clear to the beginning of the line
$ Shortcut Ctrl+k: Clear to the end of the line
$ Shortcut Ctrl+L or clear: Clear screen
$ Shortcut Ctrl+c: Cancel current command editing
$ Shortcut Ctrl+d: Equivalent to entering exit, to quit
$ Shortcut Ctrl+a: Move to beginning of line
$ Shortcut Ctrl+e: Move to end of line

2. Linux File Types

-: regular file
d: directory file
b: block device file
c: character device file
l: symbolic link file
p: named pipe file
s: socket file

3. Linux Basic Commands (1)

$ ls: list files and directories in the current directory
-l=ll long format
-t sort by time
-h human-readable size units
-a show hidden files
-A similar to -a, show all files except "." and ".."
-ld show directory attributes only
-R recursive display
-S sort by file size
-l list only files and directories
$ du: calculate disk usage of files and directories in the current path
-S calculate total size of files in the current directory
-h display sizes in human-readable units
$ touch: create file (primary function is to update file timestamps)
-c do not create files, update all attribute times
-a update last access time
-m update last modification time
$ stat: display detailed file information (last access, modification, and change times)
$ mkdir: create directory
-P create parent directories as needed
-V show creation process
$ cp: copy
Example: cp SOURCE DESTINATION
-r recursive copy (can copy directories)
-f force copy
-p preserve original file attributes (requires root privileges)
-P preserve symbolic links
-a archive mode, preserve all attributes of files, directories, and links (for backup)
-v show copy process
$ rm: delete files
-f force deletion without prompt
-r recursive deletion
$ mv: move/rename files
-f Force move
-v Show process
$ which: To view the specific path of an executable command
# For Linux, the path separator is /
# Absolute path: A path starting from the top-level / (root)
# Relative path: A path starting from a non-root location

4. Directories in the Linux System

/bin: Executable programs for all users
/sbin: Executable programs for administrators
/usr/bin
/usr/sbin
/boot: Storage for system boot files; kernel, ramfs files, bootloader (grub)
/dev: Directory for device files
/etc: Directory for configuration files
/etc/sysconfig System network configuration directory
/etc/init.d System service scripts
/home: Regular users; by default, a directory with the same name as the user exists under /home, serving as the user's home directory
/root: Administrator's home directory
/lib, /lib64: Library files
/media: Dedicated mount point, typically used for mounting portable devices
/mnt: Dedicated mount point for mounting additional storage devices
/opt: Alternative directory, but typically used for installing third-party software
/proc: Pseudo-filesystem, mapping of system kernel parameters
/proc/loadavg: Load average
/sys: Pseudo-filesystem, system-level parameters for configuring peripheral devices
/srv: Data storage location for services
/tmp: Temporary file system storage
/usr: Default software, user tools and applications, shared, read-only
/usr/local: Default software installation directory
/usr/include: Header files
/usr/src: Source code installation directory
/var: Files that change frequently
/var/log: Directory for log files
/var/log/messages
/var/log/secure System user login logs
authentication failure Login failure
/var/lib Variable state information
/var/lock Lock files
/var/run Data generated by some processes during runtime
/var/cache Cache

5. Linux Basic Commands (2)

$ gzip: .gz (files only)
gzip FILE_NAME: Compress (original file is deleted after compression)
-d Decompress
gunzip:
gunzip COMPRESSED_FILE: Original file is deleted after decompression
zcat ARCHIVE_NAME: View archive contents without extracting
$ bzip2: .bz2 (files only)
Compression tool with higher ratio than gzip, similar usage format
bzip2 FILE_NAME
-d Decompress
bunzip2 ARCHIVE_NAME: Used for decompression
-k Keep original file during compression
bzcat View archive contents without extracting
$ zip: Tool for both archiving and compression (for files or directories)
Automatically compress all files in directory: zip name.zip a/*
zip ARCHIVE_NAME.zip: Directory or file to compress (original files not deleted)
unzip ARCHIVE_NAME.zip: Decompress
zcat ARCHIVE_NAME: View archive contents without extracting
$ XZ: .xz (files only, requires yum installation of XZ package)
XZ /PATH/FILE
-d Decompress
-k Keep original file during compression
unxz: Used for decompression
xzcat: View archive contents without extracting
$ tar OPTIONS ARCHIVE_NAME.tar (must be .tar) FILES_OR_DIRECTORIES
-f FILE_NAME.tar: Archive file to operate on
-p Preserve file and directory permissions during packing/unpacking
-v Show process
-cf Create archive {tar -cf ARCHIVE_NAME.tar DIRECTORY_OR_FILE}
-tf View archive contents
-rf Add files to existing tar archive {tar tf backup.tar /root/a.txt}
-xf Extract archive {tar -xf ARCHIVE_NAME.tar} (can use -zxf, -jxf, -Jxf)
# Extract specific files
-C Destination directory {tar xf a.tar -C /user/}
-tpf List archived files without extracting (can use -ztf, -jtf)
--xattrs Preserve extended attributes during archiving
# -zcpf Archive and compress with gzip or zip (.tar.gz, .tar.z, or .tar.zip)
tar -zcf name.tar.gz NAME or tar -zcf name.tar.z NAME
-zxpf: Decompress with gzip/zip and extract archive, -z option optional
# -jcpf Archive and compress with bzip2 (.tar.bz2 or .tar.bz)
tar -jcf name.tar.bzip2 NAME or tar -jcf name.tar.bz NAME
-jxpf Decompress .tar.bz2 or .tar.bz and extract archive
# -Jcpf Archive and compress with XZ {tar Jcf xx.tar.xz FILE_NAME/DIRECTORY}
-Jxpf Extract .tar.xz archives (for RHEL 6)
# If 'tar: Removing leading '/' from member names' error occurs but compression succeeds, it is due to absolute vs relative paths. Use relative paths or -P flag to resolve
$ rar x ARCHIVE_FILE
# Download link: https://www.rarlab.com/download.htm

6. Using the Linux vim Editor

$ vim is enhanced vi editor: Text editor
# Three modes: Command-line, Insert, Edit
# Command-line -> Command: ESC
# Command -> Command-line: : key # English:
# Command -> Insert: i
# Insert -> Command: Esc
$ - Move to the beginning of the previous line of the cursor
$ i Enter insert mode before the character at the current cursor position
$ I Enter insert mode at the beginning of the current cursor line
$ a Enter insert mode after the character at the current cursor position
$ A Enter insert mode at the end of the current cursor line
$ o Create a new line below the current cursor line and enter insert mode
$ O Create a new line above the current cursor line and enter insert mode
$ R Replace the single character at the cursor
# Commands executable in command-line mode:
:nd :n represents a number, d represents delete, combined to delete line n
:n,2nd Represents deleting all lines between line n and line 2n {format..$d}
:X Encrypt or decrypt
:!ls/root Can view the contents of the root directory
:q/q! Exit #! means force exit
:wq/x/wq! Save and exit
:e! Undo all operations
# Search for characters containing PATTERN
/PATTERN : Search from the beginning to the end of the file
?PATTERN : Search from the end to the beginning of the file
n: Search for the next one from top to bottom
N: Search for the next one from bottom to top
# Search and replace
Use the s command in command-line mode
Single-line replacement: s/content to replace/replacement content/g
Full-text replacement: %s/content to replace/replacement content/g
# Show or hide line numbers
:set number
:set nu
:set nonu
# Commands executable in edit mode:
# Intra-line navigation
shift+i, 0, ^, home: Beginning of line
shift+a, $, end: End of line
# Inter-line navigation
G: Last line
nG: Jump to line n
1G, gg Jump to the first line
dG: Delete all lines from the current line to the end of the file
d1G: Delete all lines from the current line to the beginning of the file
# Page scrolling
Ctrl+f: Scroll down one screen
Ctrl+b: Scroll up one screen
Ctrl+d: Scroll down half a screen
Ctrl+u: Scroll up half a screen
# Delete single character
x: Delete the single character at the cursor position (delete forward)
#x: Delete # characters starting from the cursor position (delete forward)
# Delete command: d
dd: Delete the current line where the cursor is located
# Paste command: p
# Copy command: y (usage is similar to the d command)
yy: Copy the entire line content
# Replace: R (replace single character)
R: Enter replace mode; input characters replace characters after the cursor. Press Esc to exit replace mode.
# Undo edit operation: u
u: Undo the previous edit operation
Consecutive u commands can undo the previous n edit operations
# After editing file content, you can directly save and exit in edit mode with ZZ
vim +n: Open file and position cursor at line n {Format: vim +2 FILE_NAME}
vim +: Open file and position cursor at the last line {Format: vim + FILE_NAME}

7. Linux Basic Commands (3)

$ reset: Reinitialize the screen
$ tty: Display the terminal device file corresponding to the current terminal
$ uname -r/-a: View Linux kernel version number
$ cat /etc/redhat-release: View system version
Linux version number: X.YY.ZZ
X: Major version, YY: Minor version, ZZ: Patch version. YY: Odd numbers indicate development versions with new features; even numbers indicate stable versions with bug fixes.
$ hostname/uname -n: View hostname
$ file FILE_NAME: View file type
$ cd: Change directory. cd ../: Go to parent directory. cd -: Return to previous directory.
$ pwd: View current path
$ cal: Display calendar. cal YEAR, cal MONTH YEAR
$ bc: Calculator
$ exit: Exit current login session
$ watch: Periodically execute specified command and display results in full screen
-n # 'COMMAND'
$ cat /proc/meminfo # View system memory information
$ cat /proc/cpuinfo # View CPU information
$ history: View command history
-c Clear command history
$ echo : Print input characters
$ tree : View directory tree
$ shutdown -r now
# Restart
$ shutdown -h now
# Shutdown
Shutdown: init 0, halt, poweroff
Restart: init 6, reboot

8. Linux Basic Commands (4)

# Rebuild database
rpm --rebuilddb : Rebuild database; always recreates it
rpm --initdb : Initialize database; creates only if missing
# rpm options/paths/rpm package names
-i Install package
-h Display progress with #, each # represents 2%
-v Display detailed process
-e PACKAGE_NAME # Uninstall package
--nodeps Ignore dependencies (software may not run if dependencies are missing)
--force Force installation, allows reinstall or downgrade
# Upgrade (do not upgrade the kernel)
rpm -Uvh /PATH/NEW_RPM_PACKAGE: Upgrade if old version exists; otherwise install
rpm -Fvh /PATH/NEW_RPM_PACKAGE: Upgrade if old version exists; otherwise exit
# Query installed rpm packages
-qa Query all installed packages
-qi Query description info of specified package
-ql Query file list generated by specified package
-qc Query config files installed by specified package
-qd Query help files installed by specified package
-qf /PATH/FILE_NAME Query package owning the file
# Query uninstalled rpm packages
rpm -qpi /PATH/RPM_PACKAGE: Display description info
rpm -qpl /PATH/RPM_PACKAGE: List files generated after installation
# Examples:
rpm -ivh /media/Packages/lynx-2.8.8-0.3.dev15.el7.x86_ 64.rpm
# When installing multiple packages with dependencies, install dependencies first; specify multiple .rpm files simultaneously
# When uninstalling multiple packages with dependencies, uninstall dependent packages first; specify multiple package names simultaneously

9. Linux yum

# Mount CD/DVD image
mount /dev/sr0 /media/
mount: /dev/sr0 is write-protected, mounted read-only
# Move other yum repositories to a directory to prevent system from loading them
cd /etc/yum.repos.d/
mkdir a
mv * a
# Configure new local yum repository
vim yum.repo

[base]
name= base
baseurl=file:///media
enabled= 1
gpgcheck=0
# Clear local yum cache
yum clean all
# Build local yum cache
yum makecache

10. Linux Basic Commands (5)

# User account
Administrator user (UID=0)
Regular user
Service user
# UID: UID (User Identifier)
id USERNAME: View user UID
# User account file (username, home directory, login shell, etc.) /etc/passwd
# System user and password file /etc/shadow
Field 1: Username
Field 2: Encrypted password
Field 3: Days since January 1, 1970
Field 4: Minimum password age
Field 5: Password expiration date (99999 means never)
Field 6: Warning period before password expiration
Field 7: Inactive period after password expiration
Field 8: Account expiration date (days since January 1, 1970)
useradd=adduser: Create user
$ useradd OPTIONS USERNAME
Options
-U: Specify user UID during creation
-e: Specify account expiration date (YYYY-MM-DD)
-d: Specify home directory
-g: Specify primary group
-G: Specify supplementary groups
-M: Do not create home directory
-s: Specify login shell
# .bash_logout: Script executed on logout
# .bash_profile: Script executed on login
# .bashrc: Script executed on new bash session
$ passwd OPTIONS USERNAME # Set/change user password
Options
-d: Delete user password
-l: Lock user account
-S: Check password status (locked/unlocked)
-u: Unlock user account
-x: Maximum password age (days)
-n: Minimum password age (days)
-W: Warning period before expiration (days)
-i: Inactive period after expiration (days)
$ usermod OPTIONS USERNAME # Modify user account attributes
Options
-I: Change username {usermod -I NEW_USERNAME USERNAME}
-L: Lock user account
-U: Unlock user account
-s: Change shell environment
$ userdel [options] USERNAME # Delete user account
-r: Remove home directory along with the account
$ finger: Query detailed information about a user account
Usage
finger USERNAME
users, w, who, whoami: Query information about users logged into the host
# Group Categories Admin Group Primary Group (Private Group) Supplementary Group (Shared Group)
GID: GID (Group Identifier)
# Group Account File
/etc/group: Stores basic group account information
/etc/gshadow: Stores group account password information
$ groupadd: Create a group
-g: Specify GID
$ gpasswd: Add or remove group members
-a USERNAME GROUPNAME: Add a user to a specified group
-d USERNAME GROUPNAME: Remove a user from a specified group
$ groupdel: Delete a group
groupdel GROUPNAME
$ groups: Query groups a user belongs to
groups USERNAME
# File Permission Ownership Management
File Permissions
Read permission r=4: Allows viewing file contents and listing directory contents
Write permission w=2: Allows modifying file contents, creating, moving, or deleting files/subdirectories in a directory
Execute permission x=1: Allows running programs and changing directories
Ownership
Owner: The user account that owns the file or directory
Group: The group account that owns the file or directory
# Set File and Directory Permissions
chmod 777 FILE/DIRECTORY
Or
chmod u+/-/=[rwx] FILE/DIRECTORY
-R: Recursively modify permissions of the specified directory and all its contents
u: Represents the owner
g: Represents the group
o: Represents others
# Set File and Directory Ownership
chown OWNER FILE/DIRECTORY
chown :group file_or_directory
chown owner:group file_or_directory
-R: Recursively modify ownership of all files and subdirectories in the specified directory
# Permission mask umask function: Controls permissions for newly created files or directories. Default permissions minus umask permissions equal the permissions of the newly created file or directory. Full permissions - umask = created file permissions
View umask
umask
Set umask value
umask 020

11. Linux Basic Commands (6)

$ cut -d delimiter -f columns_to_print FILE_NAME
# sort sorting
$ sort options FILE
-n Sort by numeric value
-r Reverse sort
-t Specify field separator for sorting (default is space)
-k Specify the field range for sorting (used with -t and -k)
-u Display identical lines only once after sorting
$ uniq
-d Display only duplicate lines
-D Display all characters of duplicate lines
-c Display duplicate lines and indicate the number of repetitions
-u Display only unique lines
$ date: Display system time
+%F, +%Y-%m-%d: Year, month, day
+%T, +%H:%M:%S: Hour, minute, second
%Y Four-digit year
%m Month
%d Day
%H Hour
%M Minute
%S Second
-s "YYYY-MM-DD HH:MM:SS"
$ ln options SOURCE_FILE TARGET_FILE
-s: Create a symbolic link
-V: Show the creation process
# Hard links:
1. Can only be created for files, not directories
2. Cannot span across file systems
3. Creating a hard link increases the link count of the file
4. The hard link remains after deleting the source file
# Symbolic links (soft links): ln -sv SOURCE_FILE ABSOLUTE_PATH TARGET_FILE_ABSOLUTE_PATH
1. Can be applied to directories and files
2. Can span across file systems
3. Does not increase the link count of the linked file
4. The soft link file no longer exists after deleting the source file
5. Its size is the number of characters in the specified path
$ find search_path search_criteria FILE_NAME
Search criteria:
-name 'FILE_NAME': Exact match on filename
find /etc -name FILE_NAME
-user USERNAME: Search by owner
-group GROUP_NAME: Search by group
find /root -user root
-uid UID: Search by UID
-gid GID: Search by GID
find /root -uid 500
-type: Search by file type
find /etc -type d
f Regular file
d Directory
c Character device
b Block device
l Symbolic link
p Pipe
s Socket
-size [+ means greater than, - means less than, no +/- means equal] Common units: k, M, G
find /etc - -size 10k
Combined conditions:
-a -and: AND, both conditions must be met
-o -or: OR, at least one condition must be met
find /tmp -user root -a -type d
$ grep "KEYWORD" FILE_NAME # Filter KEYWORD in a file
I/O Redirection:
<: Redirect input
>: Redirect output (overwrite)
>>: Append to output
<<: Here-document input
1>: Redirect stdout echo "www" 1>1.txt 2>2.txt # Redirects stdout to 1.txt and stderr to 2.txt
1>>: Append stdout
2>: Redirect stderr (overwrite)
2>>: Append stderr
&>: Redirect both stdout and stderr to a file
&>>: Append both stdout and stderr to a file
command || command: Execute the second command only if the first fails
command && command: Execute the second command only if the first succeeds
command; command: Execute the second command regardless of the first's result
|: Pipe, pass the output of the previous command as input to the next

12. Linux Basic Commands (7)

$ mount: Mount filesystems, ISO images
mount View current mounts
mount [-t TYPE] STORAGE_DEVICE MOUNT_POINT_DIRECTORY
mount -o -loop ISO_IMAGE_FILE MOUNT_POINT_DIRECTORY
mount -a Mount all mounts recorded in /etc/fstab
$ umount: Unmount a mounted filesystem
umount STORAGE_DEVICE_LOCATION
umount MOUNT_POINT_DIRECTORY
umount -a Unmount all mounts recorded in /etc/fstab # If unmount fails, use the following command: umount -lf MOUNT_POINT
$ df: View filesystem partition status and blocks
df OPTIONS FILE
-h Display disk space size in human-readable format
-i Display disk inode usage
-T Display filesystem type

13. Linux RAID

# RAID 0: Can be configured with one or more hard drives
Advantages: Fastest data read/write speeds; maximizes storage capacity. For example, three 80GB drives in RAID 0 yield a total usable capacity of 240GB with consistent speed.
Disadvantages: No redundancy; failure of a single drive results in total data loss.
# RAID 1: Requires at least two hard drives
Advantages: Mirroring provides strong data security. In a two-drive RAID 1 setup, one drive operates normally while the other mirrors the data, ensuring safety. If one drive fails, the other retains complete data, ensuring continued operation.
Disadvantages: Performance improvement is negligible; disk utilization is 50% after configuring RAID 1.
# RAID 5: Requires at least three hard drives
Advantages: Combines previous benefits. Any N-1 drives contain complete data.
Disadvantages: Allows only single-drive failure; a failed drive must be addressed promptly. With a failed drive, RAID 5 I/O and CPU performance degrade significantly, resulting in extremely poor performance.
# RAID 6: Requires at least four hard drives
Advantages: Designed to enhance data protection over RAID 5. Allows failure of up to two drives.
Usable Capacity: C=(N-2)×D, where C=Usable Capacity, N=Number of Disks, D=Single Disk Capacity
For example, four 1TB drives in RAID 6 yield a usable capacity of: (4-2)×1000GB=2000GB=2TB
Disadvantages: Performance improvement is negligible.
# RAID 10: Requires at least four hard drives. RAID 10 consists of two drives forming RAID 1, and two RAID 1 sets forming RAID 0, thus requiring four drives.
Advantages: Balances security and speed. With a base of four drives, RAID 10 allows failure of two drives. As the number of drives increases, fault tolerance increases correspondingly, which RAID 5 cannot achieve.
Disadvantages: Requires a higher number of drives; disk utilization is 50%.

14. Linux Network Services

$ ifconfig command information:
ens32: flags=Flag bits <UP, BROADCAST, RUNNING, MULTICAST> mtu Maximum Transmission Unit
inet4 IPv4 Address netmask Subnet Mask broadcast Broadcast Address
inet6 IPv6 Address prefixlen Prefix Length scopeid 0x20<link>
ether MAC Address txqueuelen Transmission Buffer Size (Ethernet)
RX packets Received Packets bytes Size (Unit Statistics)
RX errors Errors dropped Dropped overruns Overruns frame Frames
TX packets Transmitted Packets bytes Size (Unit Statistics)
TX errors Errors dropped Dropped overruns Overruns carrier Carrier collisions Collisions
$ netstat Print network connection information
-r View routing table
-n Do not perform DNS reverse lookup; display IP addresses in numeric form
-a Display all active network connection information for the current host
-t Display TCP protocol-related information
-u Display UDP protocol-related information
-p Display process ID and process name information
-l View listening status
$ ping Test network connectivity
Common options
-c Specify the number of packets to send
-i When ping is successful, specify the interval in seconds before sending the next packet
-W When ping fails, specify the timeout in seconds for each sent packet
-s Specify packet size
# Configure temporary IP
ifconfig NETWORK_INTERFACE IP_ADDRESS
ifconfig ens32 IP
ifconfig ens32 IP/24
ifconfig ens32 IP netmask 255.255.255.0
# Temporarily modify network interface status
ifconfig ens32 down
ifconfig ens32 up
# Reload network configuration file
systemctl restart network
ifdown ens32;ifup ens32
# Modify hostname (temporary effect)
hostname name
# Modify permanent hostname
hostnamectl set-hostname name
vim /etc/hostname
name

15. Linux Basic Commands (8)

# Use ps to view process information
Options:
a: All processes associated with terminals
u: User who started the process
x: All processes not associated with terminals
-e: Display all process information in the system
-l: Display process information in long format
-f: Display process information in full format
ps: Display only processes opened in the current user session
ps aux: Display process information in a simple list format
Explanation of each column in the displayed information:
# USER|PID|CPU%|MEM%|VIRTUAL_MEMORY|RESIDENT_MEMORY|TERMINAL|STATUS|START_TIME|CPU_TIME|COMMAND (commands in brackets are kernel threads)
Process states
D: Uninterruptible sleep
R: Running or ready
S: Interruptible sleep
T: Stopped
Z: Zombie
<: High-priority process
N: Low-priority process
+: Process in the foreground process group
l: Multi-threaded process
s: Session process leader
ps -elf: Display process information in long format with additional details
View detailed information for a specific process: ps aux|grep "PROCESS_NAME" or ps -elf|grep "PROCESS_NAME"
# top: Dynamically view process statistics
The top command displays process rankings in a full-screen interactive interface in the current terminal, tracking system resource usage such as CPU and memory in real-time. It refreshes every three seconds by default and sorts by CPU usage by default.
Options:
-d: Specify the refresh interval in seconds
-b: Operate in batch mode, typically used with -n
-n: Specify the number of iterations
-u: Specify the username
-p: Specify the process ID
Common interactive commands
P: Sort by CPU usage percentage (default sort upon entry)
M: Sort by resident memory size
T: Sort by cumulative time
k: Terminate a process
q: Exit the program
When CPU usage is excessively high, avoid running top directly; instead, save the output to a file to prevent crashes due to high CPU load. Example: top -b -n1 > /topinfo.txt
cat /topinfo.txt
View process information
pgrep: Query PID information based on specific conditions
-l: Display process name
-U: Specify a particular user
-t: Specify the terminal
pstree: List process information in a tree structure
-a: Display full information
-u: List the corresponding username
-p: List the corresponding PID
$ kill, killall commands:
kill: Used to terminate a process with a specified PID
killall: Used to terminate all processes with a specified name
-9: Used to force termination
$ pkill: Terminate corresponding processes based on specific conditions
-U: Terminate processes owned by a specific user
-t: Terminate processes running on a specific terminal

16. Linux tmux

# Tmux (abbreviation for "Terminal Multiplexer") is an excellent terminal multiplexer software, similar to GNU screen but superior. Tmux originates from OpenBSD and is licensed under the BSD license. Its most intuitive benefit is that after logging into a remote host via a terminal and running tmux, you can open multiple consoles without wasting additional terminal connections to the remote host. Another benefit is that tasks running in a shell are interrupted when the terminal closes; tmux easily solves this problem, preventing running processes from being interrupted due to network disconnections or accidental operations.
$ tmux # Run tmux
$ tmux ls # View created sessions
$ tmux attach -t 1 # Enter a known session
$ tmux detach # Temporarily leave the current session
$ tmux kill-session -t 1 # Delete session with index 1
# Split-screen operations
ctrl + b, release, then shift + 5 (%) # Split screen vertically
ctrl + b, release, then shift + " # Split screen horizontally
ctrl + b, release, then ↑↓←→ # Switch between panes after splitting
ctrl + ↑↓←→ # Adjust pane size
ctrl + b, release, then s # Switch tmux terminal