Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

部分 I. System Administrator

目錄

3. 獲取系統信息
3.1. Distribution information
3.2. System Infomation
3.2.1. Cpu Bit
3.3. shutdown
3.4. Profile
3.4.1. shell
3.5. 環境預設值
3.5.1. 顯示所有配置項
3.5.2. 切換版本
3.5.3. 使用 alternatives 管理自己的軟件版本
4. Kernel
4.1. 編譯安裝內核
4.2. sysctl - configure kernel parameters at runtime
4.2.1. sysctl.d
4.2.2. vm.overcommit_memory
4.2.3. TCP 擁塞控制算法
4.3. /sys
4.3.1. /sys/class/net/
4.4. /proc
4.4.1. 查看系統版本
4.4.2. 進程內存監控
4.4.3. ulimit 狀態
5. Kernel modules
5.1. modprobe - program to add and remove modules from the Linux Kernel
6. Package Management
6.1. APT 包管理
6.1.1. apt-cache
6.1.1.1. search
6.1.1.2. depends
6.1.1.3. policy
6.1.1.4. 查看所屬鏡像
6.1.2. Apt-Get
6.1.2.1. Search
6.1.2.2. Installation
6.1.2.3. Update
6.1.2.4. Remove
6.1.2.5. purge
6.1.3. aptitude
6.1.4. Automatic Updates
6.1.4.1. 升級過程中連結中斷怎麼辦?
6.1.5. 更換 api 源鏡像
6.1.5.1. Ubuntu 18.04
6.1.6. dpkg
6.1.6.1. -i|--install 安裝.deb包
6.1.6.2. -r|--remove 卸載.deb包
6.1.6.3. -L|--listfiles <package> ... List files `owned' by package(s). 列出包中的檔案
6.1.6.4. -l|--list [<pattern> ...] List packages concisely. 列出.deb包
6.1.6.5. Status
6.1.6.6. dpkg-deb - Debian package archive (.deb) manipulation tool
6.1.6.6.1. -X, --vextract archive directory Extract and display the filenames contained by a package
6.1.6.6.2. -e, --control archive [directory] Extracts the control information files from a package archive into the specified directory.
6.1.6.6.3. -b, --build directory [archive|directory]
6.1.6.7. dpkg-reconfigure
6.1.7. Upgrading
6.1.7.1. GUI
6.1.7.2. CLI
6.1.7.3. CDROM
6.1.8. 製作.deb安裝包
6.1.8.1. checkinstall — Track installation of local software, and produce a binary manageable with your package management software.
6.1.8.2. dh_make - prepare Debian packaging for an original source archive
6.1.8.3. control
6.2. snap - Tool to interact with snaps
6.2.1. 安裝 snap
6.2.2. 列出已經安裝的snap包
6.2.3. 搜索要安裝的snap包
6.2.4. 安裝snap包
6.2.5. 更新snap包
6.2.6. 把一個包還原到以前安裝的版本
6.2.7. 刪除snap包
6.2.8. 查詢最近做的操作日誌
6.3. DNF 包管理
6.3.1. 安裝 epel-release 包
6.3.2. DNF 軟件庫管理
6.3.3. 顯示系統中可用的 DNF 軟件庫
6.3.3.1. 查看系統中所有的 DNF 軟件庫(包括禁用狀態)
6.3.4. 列出所有 RPM 包
6.3.4.1. 查看已經安裝包
6.3.4.2. 列出可用的軟件包
6.3.4.3. 顯示重複內容
6.3.5. 搜索軟件庫中的包
6.3.6. 查看軟件包詳情
6.3.7. 查找某一檔案的提供者
6.3.8. 刪除軟件包
6.4. yum - Yellowdog Updater Modified 包管理
6.4.1. Yum Resource & Yum Mirror
6.4.1.1. fastestmirror
6.4.1.2. Fedora resource
6.4.1.2.1. Fedora 5.4
6.4.1.2.2. Fedora 6.x
6.4.1.2.3. Fedora 7.x
6.4.1.3. rpmforge-release
6.4.1.3.1. CentOS 5.x
6.4.1.3.2. CentOS 6.x
6.4.1.3.3. CentALT
6.4.1.4. atomic
6.4.1.5. famillecollet
6.4.1.6. rpmfind.net
6.4.1.7. pkgs.org
6.4.1.8. China Resource
6.4.1.9. 製作本地共享源
6.4.2. yum - Yellowdog Updater Modified
6.4.2.1. YUM 源管理
6.4.2.2. install
6.4.2.3. localinstall
6.4.2.4. list
6.4.2.5. search
6.4.2.6. update / upgrade
6.4.2.7. remove
6.4.2.8. installed
6.4.2.9. group
6.4.2.9.1. grouplist
6.4.2.9.2. groupinfo
6.4.2.9.3. groupinstall
6.4.2.9.4. groupremove
6.4.2.10. 查看包的依賴關係
6.4.2.11. provides / whatprovides
6.4.3. rpm - RPM Package Manager
6.4.3.1. install/upgrade/remove
6.4.3.1.1. --prefix
6.4.3.2. query
6.4.3.2.1. changelog 查看變更日誌
6.4.4. rpmbuild - Build RPM Package(s)
6.4.4.1. RPM_directory_macros
6.4.4.2. --define 專遞模板變數
6.4.4.3. defattr
6.4.4.4. GPG 簽名
6.4.4.5. 使用 CMake3 編譯並創建RPM包
6.4.4.6. FAQ
6.5. Homebrew
6.6. 清理安裝包
7. Device information 設備信息
7.1. dmesg - print or control the kernel ring buffer
7.2. smartctl - Control and Monitor Utility for SMART Disks
7.3. CPU 資源管理
7.3.1. lscpu - display information about the CPU architecture
7.3.2. chcpu - configure CPUs
7.4. lspci - list all PCI devices
7.5. lshw - list hardware
7.5.1. only show a certain class of hardware
7.6. hwinfo - Hardware Information
7.7. dmidecode - DMI table decoder
7.8. ethtool - Display or change ethernet card settings
7.9. usb device
7.10. lsscsi - list SCSI devices (or hosts) and their attributes
7.11. HBA
7.12. lsblk - list block devices
7.13. kudzu - detects and configures new and/or changed hardware on a system
7.14. numactl - Control NUMA policy for processes or shared memory
7.15. udev - Linux dynamic device management
8. 區域/語言/時間
8.1. Ubuntu
8.1.1. time zone
8.1.2. to change system date/time
8.1.2.1. NTP Server
8.1.3. Language
8.2. CentOS 區域設置
8.2.1. 時區設置 CentOS 6
8.2.1.1. 查看當前時區 /etc/sysconfig/clock
8.2.1.2. tzselect - select a timezone
8.2.1.3. 修改時區並立即生效
8.2.2. 時區設置 CentOS 7
8.2.3. 日期、時間
8.2.3.1. rdate - get the time via the network
8.2.4. 語言
9. console / terminal 控制台與終端
9.1. serial console
9.2. console timeout
9.3. TUI (Text User Interface)
9.4. framebuffer
10. Harddisk 磁碟管理
10.1. 查看分區分區 UUID
10.2. 通過 UUID 或 標籤 查詢設備檔案
10.3. Label
10.3.1. Ext2
10.3.1.1. 查看卷標
10.3.1.2. 更改卷標
10.4. swap 交換分區
10.4.1. swapon failed: Invalid argument
10.5. Show partition
10.6. Create partition
10.7. Clone partition
10.8. estimate disk / directory / file space usage
10.9. Convert from ext3 to ext4 File system
10.10. GPT
10.10.1. 設置GTP磁碟
10.10.2. 查看分區
10.10.3. 創建分區
10.10.4. 刪除分區
10.10.5. 退出
10.10.6. mount
10.11. loop devices
10.11.1. losetup - set up and control loop devices
10.12. Linux磁碟分區加密
11. Removable Storage
11.1. usb flash
11.2. CD / DVD
11.2.1. Mount an ISO file
11.2.2. create iso file from CD
11.2.3. burner
11.2.4. ISO Mirror
12. File System 檔案系統
12.1. /etc/fstab
12.1.1. /etc/fstab 例子
12.2. Mount partition
12.2.1. Mount
12.2.2. Umount
12.2.3. bind directory
12.3. ext2
12.4. ext3
12.5. ReiserFS
12.6. EXT4
12.6.1. install
12.6.2. format
12.6.3. label
12.6.4. mount/umount
12.6.5. LVM 卷
12.7. LVM
12.8. Btrfs
12.8.1. /etc/fstab
12.8.2. btrfs
12.8.3. Mount Btrfs
12.8.3.1. Mount Snap
12.8.3.2. fstab
12.8.3.2.1. btrfs-show
12.8.3.2.2. /etc/fstab
12.8.4. subvolumes
12.8.5. snapshot
12.8.6. btrfsctl
12.8.6.1. Resizes the filesystem
12.8.6.2. Snapshot
12.8.7. btrfs-vol
12.8.8. btrfs-convert
12.8.9. btrfsck
12.8.10. btrfs-debug-tree
12.9. zfs
12.10. iSCSI
12.10.1. GFS
12.11. GFS - Cluster Storage
12.12. glusterfs
12.13. RAM FS
12.14. tmpfs
12.15. ftp fs
12.16. SSHFS (sshfs - filesystem client based on SSH File Transfer Protocol)
12.17. davfs2 - mount a WebDAV resource as a regular file system
12.18. redisfs
12.19. File system test
12.19.1. ext4 vs btrfs
12.19.2. xfs vs jfs vs reiserfs
12.19.3. RAID10 (146G*8) vs EMC VNX 5300 (8G Fibre Channel)
12.19.4. Dell 2950(RAID5 500G SATA * 6) vs MD1200
12.20. 磁碟占用100%刪除檔案後不是放的解決方法
13. Networking 網絡管理
13.1. hosts
13.1.1. /etc/hostname
13.1.2. hostnamectl - Control the system hostname
13.1.3. /etc/host.conf
13.1.4. /etc/hosts
13.1.5. hosts.allow / hosts.deny
13.1.6. /etc/resolv.conf
13.2. Network adapter 網絡適配器
13.2.1. 介面名稱
13.3. Ethernet Interfaces 乙太網介面
13.3.1. ifquery
13.3.2. DHCP
13.3.3. CentOS
13.3.4. Ubuntu
13.4. Gateway 設置預設網關
13.4.1. CentOS
13.5. 配置 DNS
13.5.1. 常規 DNS 配置 /etc/resolv.conf
13.5.2. 安全 DNS 配置
13.5.2.1. 啟用 DNS over TLS
13.5.2.2. 啟用 DNSSEC
13.5.2.3. 同時啟用 DNS over TLS 和 DNSSEC
13.5.2.4. 配置 NetworkManager
13.6. IP forwarding(IP轉發)
13.7. bonding
13.7.1. bonding
13.7.2. Ubuntu
13.8. brctl
13.9. Wireless - WiFi 配置
13.9.1. rfkill - tool for enabling and disabling wireless devices
13.9.2. iwlist - Get more detailed wireless information from a wireless interface
13.9.3. iwconfig - configure a wireless network interface
13.9.4. /proc/net/wireless
13.10. CentOS 8
13.10.1. nmtui - Text User Interface for controlling NetworkManager
13.10.2. nmcli - command-line tool for controlling NetworkManager
13.10.2.1. 查看連接狀態
13.10.2.2. 查看介面狀態
13.10.2.3. 添加介面
13.10.2.4.
13.10.2.5. 停止介面
13.10.2.6.
13.10.2.7. 顯示設備信息
13.11. 網絡檢查命令
13.11.1. ping
13.11.2. Finding optimal MTU
13.11.3. ss - another utility to investigate sockets
13.12. Ubuntu netplan (Ubuntu 18.04 之後才用 netplan 管理網絡)
13.13. Linux IP And Router
13.13.1. netmask
13.13.1.1. iptab
13.13.1.2. netmask - a netmask generation and conversion program
13.13.2. arp - manipulate the system ARP cache
13.13.2.1. display hosts
13.13.2.2. delete a specified entry
13.13.2.3. /proc/net/arp
13.13.2.4. /etc/ethers
13.13.3. iproute2
13.13.3.1.
13.13.3.2. 添加路由
13.13.3.3. 刪除路由
13.13.3.4. 變更路由
13.13.3.5. 替換已有的路由
13.13.3.6. 增加預設路由
13.13.3.7. cache
13.13.4. 策略路由
13.13.5. 負載均衡
13.13.6. MASQUERADE
13.13.7. ip tunnel
13.13.8. VLAN
13.13.9. Zebra
14. Logging 日誌
14.1. rsyslog
14.1.1. rsyslog.conf
14.2. logrotate - rotates, compresses, and mails system logs
14.2.1. /etc/logrotate.conf
14.2.2. /etc/logrotate.d/
14.2.2.1. 日誌配置
14.2.2.2. create 創建日誌檔案,指定用於與訪問權限
14.2.2.3. postrotate
14.3. syslog-ng
14.4. syslog, klogctl - read and/or clear kernel message ring buffer; set console_loglevel
14.4.1. /etc/sysconfig/syslog
14.4.2. /etc/syslog.conf
14.4.3. logger
14.4.4. To Log Messages Over UDP Network
14.5. 掛載日誌卷
14.5.1. 子卷掛載
14.5.2. 使用過個子卷
14.5.3. /etc/fstab配置
15. 服務管理
15.1. systemd, init - systemd system and service manager
15.1.1. 電源管理
15.1.2. rc.local
15.1.3. is-enabled 查看當前服務的啟用狀態
15.1.4. 重載 systemd
15.1.5. 列出啟動失敗的服務
15.1.6. list-units
15.2. 定時器單元
15.3. Debian/Ubuntu
15.3.1. update-rc.d - install and remove System-V style init script links
15.3.2. invoke-rc.d - executes System-V style init script actions
15.3.3. runlevel
15.3.4. sysv-rc-conf
15.3.5. xinetd - replacement for inetd with many enhancements
15.3.5.1. tftpd
15.3.6. Scheduled Tasks
15.3.6.1. crontab - maintain crontab files for individual users
15.3.6.2. at, batch, atq, atrm - queue, examine or delete jobs for later execution
15.3.7. sv - control and manage services monitored by runsv
15.3.7.1. runsv
15.3.7.2. runsvdir
15.4. CentOS 6
15.4.1. service
15.4.1.1. chkconfig
15.4.2. xinetd.d
15.4.2.1. tftpd
15.4.2.1.1. atftp-server
15.4.2.2. rsync
15.4.2.3. rshd
15.4.3. rpcinfo
15.4.4. SELINUX
16. Process 進程管理
16.1. top - display Linux tasks
16.1.1. 查找內存消耗最大的進程
16.2. ps - report a snapshot of the current processes
16.2.1. 完整的顯示命令參數
16.2.2. 顯示進程之間的關係
16.2.3. ps axef
16.2.4. ps -eo pid,cmd
16.2.5. ps jax
16.2.6. 殭屍進程
16.2.7. 查找內存消耗最大的進程
16.2.8. 指定輸出項
16.3. mpstat
16.4. pid
16.4.1. pgrep, pkill - look up or signal processes based on name and other attributes
16.4.2. pidof -- find the process ID of a running program.
16.5. jobs
16.5.1. &
16.5.2. Ctrl + Z
16.5.3. jobs
16.5.4. fg / bg
16.5.5. nohup - run a command immune to hangups, with output to a non-tty
16.5.6. wait 等待後台任務運行結束
16.6. ionice - get/set program io scheduling class and priority
16.7. Utilities for managing processes on your system
16.7.1. pstree - display a tree of processes
16.7.2. fuser - identify processes using files or sockets
16.8. /proc 目錄與進程的關係
16.8.1. /proc/進程ID
16.8.2. /proc/*/fd/ 進程所打開的檔案
17. Permission 權限管理
17.1. User 用戶管理
17.1.1. 添加用戶
17.1.2. 刪除用戶
17.1.3. 修改用戶組
17.1.4. 賬號加鎖與解鎖
17.1.4.1. /etc/passwd
17.2. Group
17.2.1. Add a new group
17.2.2. Add a user to the group
17.2.3. /etc/group
17.2.4. gpasswd - administer /etc/group and /etc/gshadow
17.3. umask
17.4. Access Permissions
17.4.1. chown - change file owner and group
17.4.2. chgrp - change group ownership
17.4.3. chmod - change file access permissions
17.5. chattr - change file attributes on a Linux second extended file system
17.6. su - run a shell with substitute user and group IDs
17.7. runuser - run a command with substitute user and group ID
17.8. sudo, sudoedit - execute a command as another user
17.8.1. /etc/sudoers
17.8.2. /etc/sudoers
17.8.3. 設置示例
17.8.4. NOPASSWD
17.8.5. 允許或禁止命令
17.8.6. Cmnd_Alias 用法
17.8.7. wheel 組
17.8.8. 注意事項
17.9. ACL - Access Control List
17.9.1. getfacl - get file access control lists
17.9.2. setfacl - set file access control lists
17.9.2.1. set
17.9.2.2. default
17.9.2.3. remove
17.9.2.4. backup and restore
18. /etc
18.1. getent 用來察看系統的資料庫中的相關記錄
18.1.1. 主機名
18.1.2. 用戶組
18.1.3. 查看連接埠
18.1.4. shadow 密碼
18.2. /etc/inputrc
18.3. /etc/shells
19. kickstart
19.1. install kickstart
19.2. ks.cfg
19.3. boot 參數
20. System Utilities 配置工具
20.1. CentOS 6
20.1.1. system-config-date
20.1.2. system-config-firewall
20.1.3. system-config-securitylevel
20.1.4. system-config-language
20.1.5. system-config-keyboard
20.1.6. system-config-network
20.1.7. ntsysv
20.1.8. lokkit
20.1.9. system-config-kdump
20.1.10. system-config-services
20.1.11. authconfig-tui
21. crontab 定時任務
21.1. /etc/crontab