4.Linux 中获取帮助(从零开始学) 1.Man 手册1.1 man 简介manmanual 简称。man使用不同 section 区分手册类别。SECTION内容类型1用户命令可执行命令和shell程序2系统调用从用户空间调用的内核例程3库函数由程序库提供4特殊文件如设备文件5文件格式用于许多配置文件和结构6游戏过去的有趣程序章节7惯例、标准和其他协议、文件系统8系统管理和特权命令维护任务9Linux内核API(内核调用)1.2 man 命令[fengkaicentos7 ~ 19:02:45]$ man --help Usage: man [OPTION...] [章节] 手册页... # man命令将会调用less打开/usr/share/man/相关文件 # passwd(1)描述passwd命令更改密码 [laomaCentOS7 ~]$ man 1 passwd # passwd(5)解释/etc/passwd文件格式 [laomaCentOS7 ~]$ man 5 passwd # 查看英文的帮助手册指定LANG变量 [laomacentos7 ~]$ LANGen_US.utf8 man gedit # 或者 [laomacentos7 ~]$ LANGen_US.utf8 [laomacentos7 ~]$ man geditman手册页面交互操作指令less程序命令结果PageDown或者空格键向前向下滚动一个屏幕PageUp向后向上滚动一个屏幕向下箭头向前向下滚动一行向上箭头向后向上滚动一行d向前向下滚动半个屏幕u向后向上滚动半个屏幕/string在man page中向前向下搜索stringn在man page中重复之前的向前向下搜索N在man page中重复之前的向后向上搜索g转到man page的第一行。G转到man page的最后一行。q退出man 并返回到shell命令提示符# 使用root用户更新man page库 [rootcentos7 ~]# mandb 正在删除 /usr/share/man 里的旧数据库条目... mandb: 警告/usr/share/man/man8/fsck.fat.8.manpage-fix.gz忽略错误的文件名 ... ... 正在处理 /usr/share/man/en 下的手册页... 正在删除 /usr/local/share/man 里的旧数据库条目... 正在处理 /usr/local/share/man 下的手册页... 0 man subdirectories contained newer manual pages. 0 manual pages were added. 0 stray cats were added. 17 old database entries were purged. # 使用 -k 选线搜索关键字 [laomacentos7 ~]$ man -k passwd chgpasswd (8) - 批量更新组密码 chpasswd (8) - 批量更新密码 gpasswd (1) - administer /etc/group and /etc/gshadow mkpasswd (1) - 为用户产生新口令 passwd (5) - (未知的主题) ... ... [laomacentos7 ~]$ man -k ext4 ..... resize2fs (8) - ext2/ext3/ext4 file system resizer ...... [laomacentos7 ~]$ man resize2fs补充命令的来源安装软件包之后获得shell 自带的工具1.3 查看 shell 自带命令# 不建议使用man查询 [laomacentos7 ~]$ man history # 使用 help command [laomacentos7 ~]$ help history history: history [-c] [-d 偏移量] [n] 或 history -anrw [文件名] 或 history -ps 参数 [参数...] 显示或操纵历史列表。 带行号显示历史列表将每个被修改的条目加上前缀 *。 参数 N 会仅列出最后的 N 个条目。 ......重要通用选项--help也用于查看命令帮助。1.4 /usr/share/doc可以通过file:///usr/share/doc浏览。一些包还含拓展示例配置文件模板脚本使用说明或用户指导手册。例如/usr/share/doc/dhclient-*。[laomacentos7 ~]$ cat /usr/share/doc/dhclient-4.2.5/dhclient.conf.example1.5 which 和 whereis 命令# 查看vi命令代表什么 [laomacentos7 ~]$ which vi alias vivim /usr/bin/vim # whereis 查看关键字对应的程序位置帮助文档源码 [laomacentos7 ~]$ whereis man man: /usr/bin/man /usr/share/man /usr/share/man/man1/man.1.gz /usr/share/man/man1p/man.1p.gz /usr/share/man/man7/man.7.gz [laomacentos7 ~]$ whereis passwd passwd: /usr/bin/passwd /etc/passwd /usr/share/man/man1/passwd.1.gz /usr/share/man/man5/passwd.5.gz1.6 综合测试查找并查看以下 man 手册并举例验证。1.查看 man 命令使用方法。#man直接查询 [fengkaicentos7 ~ 09:33:17]$ man su #man直接查询不到的用-k查询 [fengkaicentos7 ~ 13:28:59]$ man -K kernel #man用-k查询太多使用|符号进行匹配 [fengkaicentos7 ~ 11:16:11]$ man -k kernel | grep boot2.查看 gedit 命令使用方法如何使用gedit打开文件、打开文件的时候如何定位到特定行和列。在虚拟机界面使用终端打开/etc/hosts文件打开之后当前终端会卡住需要在新终端中打开/etc/hosts文件的第一行第五列3.查看 su 命令使用方法不带参数作用和带-作用。[fengkaicentos7 ~ 11:10:41]$ man su SU(1) User Commands SU(1) NAME su - run a command with substitute user and group ID SYNOPSIS su [options...] [-] [user [args...]] DESCRIPTION su allows to run commands with substitute user and group ID. When called without arguments su defaults to running an interactive shell as root. For backward compatibility su defaults to not change the current directory and to only set the environment variables HOME and SHELL (plus USER and LOGNAME if the target user is not root). It is recommended to always use the --login option (instead its shortcut -) to avoid side effects caused by mixing environments. This version of su uses PAM for authentication, account and session management. Some configuration options found in other su implementations such as e.g. support of a wheel group have to be configured via PAM. ······· -, -l, --login Starts the shell as login shell with an environment similar to a real login: o clears all environment variables except for TERM o initializes the environment variables HOME, SHELL, USER, LOG- NAME, PATH o changes to the target users home directory o sets argv[0] of the shell to - in order to make the shell a login shell ···········4.查找 调整内核kernel启动boot参数 手册。#用man -k查找kernel通过 | 匹配boot。其中bootparam应该是说明启动参数的 [fengkaicentos7 ~ 10:47:23]$ man -k kernel | grep boot bootparam (7) - introduction to boot time parameters of the Linux kernel kernel-install (8) - Add and remove kernel and initramfs images to and from /boot kexec (8) - directly boot into a new kernel modules-load.d (5) - Configure kernel modules to load at boot sysctl.d (5) - Configure kernel parameters at boot systemd-modules-load (8) - Load kernel modules at boot systemd-modules-load.service (8) - Load kernel modules at boot systemd-sysctl (8) - Configure kernel parameters at boot systemd-sysctl.service (8) - Configure kernel parameters at boot #打开bootparam查看里面的相关参数达到要求 [fengkaicentos7 ~ 10:48:09]$ man bootparam BOOTPARAM(7) Linux Programmers Manual BOOTPARAM(7) NAME bootparam - introduction to boot time parameters of the Linux kernel DESCRIPTION The Linux kernel accepts certain command-line options or boot time parameters at the moment it is started. In general this is used to supply the kernel with information about hardware parameters that the kernel would not be able to deter- mine on its own, or to avoid/override the values that the kernel would otherwise detect. When the kernel is booted directly by the BIOS (say from a floppy to which you copied a kernel using cp zImage /dev/fd0), you have no opportunity to specify any parameters. So, in order to take advantage of this possibility you have to use a boot loader that is able to pass parameters, such as GRUB. ·············5.查找 创建 archive 工具 手册并使用对应工具创建archive文件和提取archive文件。不允许使用 zip和unzip。[fengkaicentos7 ~ 11:09:27]$ man -k archive ar (1) - create, modify, and extract from archives ar (1p) - create and maintain library archives cpio (1) - copy files to and from archives cpio (5) - format of cpio archive files cpio.h (0p) - cpio archive values db_archive (1) - Find unused log files for archival funzip (1) - filter for extracting from a ZIP archive in a pipe gpg-zip (1) - Encrypt or sign files into an archive osinfo-db-export (1) - Export to a osinfo database archive osinfo-db-import (1) - Import an osinfo database archive pax (1p) - portable archive interchange ranlib (1) - generate index to archive. rpm2cpio (8) - Extract cpio archive from RPM Package Manager (RPM) package. tar (5) - format of tape archive files unzip (1) - list, test and extract compressed files in a ZIP archive unzipsfx (1) - self-extracting stub for prepending to ZIP archives zip (1) - package and compress (archive) files zipgrep (1) - search files in a ZIP archive for lines matching a pattern zipinfo (1) - list detailed information about a ZIP archive [fengkaicentos7 ~ 17:31:10]$ man tar TAR(1) User Commands TAR(1) NAME tar - manual page for tar 1.26 SYNOPSIS tar [OPTION...] [FILE]... DESCRIPTION GNU tar saves many files together into a single tape or disk ar- chive, and can restore individual files from the archive. Note that this manual page contains just very brief description (or more like a list of possible functionality) originally generated by the help2man utility. The full documentation for tar is maintained as a Texinfo manual. If the info and tar programs are properly installed at your site, the command info tar should give you access to the complete manual. EXAMPLES tar -cf archive.tar foo bar # Create archive.tar from files foo and bar. tar -tvf archive.tar # List all files in archive.tar verbosely. tar -xf archive.tar # Extract all files from archive.tar. ····· #根据说明用tar -cf将file-1 file-2 file-3打包为file.tar [fengkaicentos7 ~ 17:34:03]$ tar cf file.tar file-1 file-2 file-3 [fengkaicentos7 ~ 17:35:06]$ ls allinone file-1 file.tar passwd.list profile 公共 图片 音乐 dhcpd.conf file-2 passwd2.list passwd.man profile.sh 模板 文档 桌面 ext4.man file-3 passwd.all passwd.stdout testfile 视频 下载 #删除file-1 file-2 file-3后根据说明用tar -xf将file.tar解压出来 [fengkaicentos7 ~ 17:37:09]$ rm file-[1-3] [fengkaicentos7 ~ 17:55:59]$ ls allinone file.tar passwd.list profile 公共 图片 音乐 dhcpd.conf passwd2.list passwd.man profile.sh 模板 文档 桌面 ext4.man passwd.all passwd.stdout testfile 视频 下载 [fengkaicentos7 ~ 17:56:00]$ tar -xf file.tar [fengkaicentos7 ~ 17:56:15]$ ls allinone file-1 file.tar passwd.list profile 公共 图片 音乐 dhcpd.conf file-2 passwd2.list passwd.man profile.sh 模板 文档 桌面 ext4.man file-3 passwd.all passwd.stdout testfile 视频 下载 [fengkaicentos7 ~ 17:56:16]$

相关新闻

最新新闻

智能无人机(UAV)影像单株树木健康评估检测数据集无人机航拍树木数据集、YOLOv11树木检测数据集、树木折断识别、枯死树木检测、多季节林地数据、智慧林业AI数据集树木健康检测、林业巡检

智能无人机(UAV)影像单株树木健康评估检测数据集无人机航拍树木数据集、YOLOv11树木检测数据集、树木折断识别、枯死树木检测、多季节林地数据、智慧林业AI数据集树木健康检测、林业巡检

智能航拍无人机(UAV)影像单株树木健康评估检测数据集 无人机拍摄的高分辨率影像数据,涵盖了不同季节和天气条件下的森林区域,700余张高分辨率无人机图像(1293*1293左右),采用yolo格式标注&#…

2026/7/17 22:19:18
智能农产品茶叶嫩芽检测、茶叶等级分类、茶叶品质检测、嫩芽分级、茶叶AI检测茶叶分拣数据集、茶园智能检测、PyQt5茶叶检测界面、智能农产品目标检测数据集

智能农产品茶叶嫩芽检测、茶叶等级分类、茶叶品质检测、嫩芽分级、茶叶AI检测茶叶分拣数据集、茶园智能检测、PyQt5茶叶检测界面、智能农产品目标检测数据集

智能农产品茶叶嫩芽检测数据集,5740张,yolo和voc两种标注方式 4类,标注数量: T1最好: 1533 T2次好: 1733 T3较差: 1252 T4最差: 1223 image num: 5740 模型代码 采用 YOLOv11n 网络训练 训练轮次:30 个 epoch 提供全部…

2026/7/17 22:19:18
智能医学检测皮肤疾病分类数据集、皮肤病识别、皮肤影像数据集、AI皮肤诊断、皮肤病症筛查光化性角化病检测、湿疹识别、色素痣分类、银屑病数据集、皮肤癣菌病识别、白癜风检测、正常皮肤区分

智能医学检测皮肤疾病分类数据集、皮肤病识别、皮肤影像数据集、AI皮肤诊断、皮肤病症筛查光化性角化病检测、湿疹识别、色素痣分类、银屑病数据集、皮肤癣菌病识别、白癜风检测、正常皮肤区分

智能医学检测皮肤疾病分类数据集, 数据集统计汇总 数据集总类别数量:7 数据集全部图片总数量:10528 数据集包含所有图像尺寸:[(640, 640)]各类别明细(类别名称 - 图像数量): Actinic_Keratosis …

2026/7/17 22:19:18
LabVIEW图像控件拖拽缩放实现与优化技巧

LabVIEW图像控件拖拽缩放实现与优化技巧

1. 项目背景与核心功能 这个LabVIEW Demo项目主要解决了一个常见的图像交互需求:如何在二维图片控件上实现平滑的拖拽和缩放操作。在实际的测试测量、工业检测等场景中,工程师经常需要查看高分辨率图片的细节部分,或者对比不同区域的图像特征…

2026/7/17 22:19:18
RISC-V开发板昉·星光2的Docker与OpenWrt部署实战

RISC-V开发板昉·星光2的Docker与OpenWrt部署实战

1. 昉星光 2与RISC-V生态现状解析昉星光 2(VisionFive 2)作为全球首款集成3D GPU的高性能量产RISC-V单板计算机,其硬件配置在开源硬件领域堪称豪华。搭载的JH7110 SoC采用64位四核RISC-V架构,主频可达1.5GHz,配合Imagi…

2026/7/17 22:19:18
WordPress图像优化实战:WebP Express插件原理、配置与性能提升指南

WordPress图像优化实战:WebP Express插件原理、配置与性能提升指南

1. 项目概述:为什么你的WordPress网站需要一个图像管家如果你正在运营一个WordPress网站,无论它是个人博客、企业官网还是电商平台,图片加载速度慢、页面体积臃肿的问题,你一定不陌生。一张未经优化的高清图片,动辄几兆…

2026/7/17 22:14:18

月新闻