linux学习笔记(二)

这篇博客是Linux学习笔记的第二部分,主要介绍了如何使用各种常用命令,包括帮助命令man,如查看不同section、浏览帮助手册等。此外,还详细讲解了压缩与解压缩命令,如.zip, .gz, .bz2格式的压缩与解压,以及.tar打包和.tar.gz, .tar.bz2格式的压缩与解压缩操作。" 102466274,9085426,栈和队列的基本操作与回文判断应用,"['数据结构', '栈', '队列', '算法', '编程基础']
摘要由CSDN通过智能技术生成

本篇继续学习linux的常用命令,上接linux学习笔记(一).
学习视频为Linux达人养成计划 I,十分感谢tony老师的无私奉献。

二、常用命令

16、帮助命令man

man [命令名称]
获取指定命令的帮助,man是manual的缩写,手册
只能查询非shell内部命令

arururururu@ubuntu:~/Desktop/linuxCommand$ man ls

LS(1)//这里的1是指所在section                  User Commands                           LS(1)

NAME //作用
       ls - list directory contents

SYNOPSIS //用法
       ls [OPTION]... [FILE]...

DESCRIPTION //选项说明
       List  information  about  the FILEs (the current directory by default).
       Sort entries alphabetically if none of -cftuvSUX nor --sort  is  speci‐
       fied.

       Mandatory  arguments  to  long  options are mandatory for short options
       too.

       -a, --all
              do not ignore entries starting with .

       -A, --almost-all
              do not list implied . and ..

       --author
	...
 Manual page ls(1) line 1 (press h for help or q to quit)

1、执行man man时可以看到man分为不同section

The table below shows the section numbers of the manual followed by the
       types of pages they contain.

       1   Executable programs or shell commands
       2   System calls (functions provided by the kernel)
       3   Library calls (functions within program libraries)
       4   Special files (usually found in /dev)
       5   File formats and conventions eg /etc/passwd
       6   Games
       7   Miscellaneous  (including  macro  packages  and  conventions), e.g.
           man(7), groff(7)
       8   System administration commands (usually only for root)
       9   Kernel routines [Non standard]

2、查看某个命令有哪些section

//ls只有一个section
arururururu@ubuntu:~/Desktop/linuxCommand$ man -f ls
ls (1)               - list directory contents

//passwd命令有多个section
arururururu@ubuntu:~/Desktop/linuxCommand$ man -f passwd
passwd (1ssl)        - compute password hashes
passwd (1)           - change user password
passwd (5)           - the password file

//也可以用whatis [命令]查看
arururururu@ubuntu:~/Desktop/linuxCommand$ whatis ls
ls (1)               - list directory contents
arururururu@ubuntu:~/Desktop/linuxCommand$ whatis passwd
passwd (1ssl)        - compute password hashes
passwd (1)           - change user password
passwd (5)           - the password file

//还可以用whereis [命令]查看
//.1.gz、.1ssl.gz、.1ssl.gz后缀就显示了所拥有的section
// /etc/passwd为配置文件,可用man 5 passwd查看相关说明
arururururu@ubuntu:~/Desktop/linuxCommand$ whereis passwd
passwd: /usr/bin/passwd /etc/passwd /usr/bin/X11/passwd /usr/share/man/man1/passwd.1.gz /usr/share/man/man1/passwd.1ssl.gz /usr/share/man/man5/passwd.1ssl.gz

3、浏览指定section的帮助手册

arururururu@ubuntu:~/Desktop/linuxCommand$ man 5 passwd

PASSWD(5)                File Formats and Conversions                PASSWD(5)

NAME
       passwd - the password file

DESCRIPTION
       /etc/passwd contains one line for each user account, with seven fields
       delimited by colons (“:”). These fields are:

       ·   login name

       ·   optional encrypted password

       ·   numerical user ID

       ·   numerical group ID

       ·   user name or comment field

       ·   user home directory

       ·   optional user command interpreter

...

4、查看和命令相关的所有帮助

//列出所有含有passwd字串的帮助文档
arururururu@ubuntu:~$ man -k passwd
chgpasswd (8)        - update group passwords in batch mode
chpasswd (8)         - update passwords in batch mode
Crypt::PasswdMD5 (3pm) - Provides interoperable MD5-based crypt() functions
fgetpwent_r (3)      - get passwd file entry reentrantly
getpwent_r (3)       - get passwd file entry reentrantly
gpasswd (1)          - administer /etc/group and /etc/gshadow
grub-mkpasswd-pbkdf2 (1) - generate hashed password for GRUB
lppasswd (1)         - add, change, or delete digest passwords.
pam_localuser (8)    - require users to be listed in /etc/passwd
passwd (1)           - change user password
passwd (1ssl)        - compute password hashes
passwd (5)           - the password file
passwd2des (3)       - RFS password encryption
smbpasswd (5)        - The Samba 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值