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