IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> Linux入门8.6 -> 正文阅读

[系统运维]Linux入门8.6

记录自己的学习过程


一、Linux中的文件类型

Linux中万物皆文件

在使用ls -l时,展示出来文件的详细信息时,第一个字符所表示的含义:

[root@my-rhel ~]# ls -l
total 4
-rw-------. 1 root root 1766 Aug  4 13:34 anaconda-ks.cfg
drwxr-xr-x. 2 root root   51 Aug  5 11:55 myMp4
[root@my-rhel ~]# cd /
[root@my-rhel /]# cd dev
[root@my-rhel dev]# ll
total 0
crw-r--r--. 1 root root     10, 235 Aug  6 17:20 autofs
drwxr-xr-x. 2 root root         160 Aug  6 17:20 block
drwxr-xr-x. 2 root root          60 Aug  6 17:20 bsg
drwxr-xr-x. 3 root root          60 Aug  6 17:20 bus
lrwxrwxrwx. 1 root root           3 Aug  6 17:20 cdrom -> sr0
drwxr-xr-x. 2 root root        2900 Aug  6 17:20 char
crw-------. 1 root root      5,   1 Aug  6 17:20 console
lrwxrwxrwx. 1 root root          11 Aug  6 17:20 core -> /proc/kcore
drwxr-xr-x. 4 root root          80 Aug  6 17:20 cpu
crw-------. 1 root root     10,  62 Aug  6 17:20 cpu_dma_latency
drwxr-xr-x. 7 root root         140 Aug  6 17:20 disk
brw-rw----. 1 root disk    253,   0 Aug  6 17:20 dm-0
brw-rw----. 1 root disk    253,   1 Aug  6 17:20 dm-1
crw-rw----. 1 root audio    14,   9 Aug  6 17:20 dmmidi
drwxr-xr-x. 3 root root         100 Aug  6 17:20 dri
  1. - 或者 f,表示的是普通文件
  2. d 是directory,表示的是目录文件
  3. l 是link,表示的是连接文件,类似于Windows中的快捷方式,当这个连接文件所指向的具体的文件被删除时,这个连接文件也随之消失
  4. b 是block,表示的是块设备文件 ------ 硬盘
  5. c 是character,表示的是字符设备文件 ------ 终端和键盘
  6. p 是pipe,表示的是管道文件
  7. s 是socket,表示的是套接字文件

二、查看指令的类型

使用type 命令 查看该命令的类型

[root@my-rhel bin]# type cd
cd is a shell builtin
[root@my-rhel bin]# type date
date is /usr/bin/date
[root@my-rhel bin]# type yum
yum is /usr/bin/yum

cd is a shell builtin 出现这个意思就是 该指令是内部指令

date is /usr/bin/date 出现这个意思就是 该指令是内部指令

有时候只使用type时会出现例外情况:

[root@my-rhel ~]# type rm
rm is aliased to `rm -i'

这里只打印出来rm is aliased to 'rm -i'
alias 的意思是 别名

我们在type 后面加上 -a 可以查看详细一点

[root@my-rhel ~]# type -a rm
rm is aliased to `rm -i'
rm is /usr/bin/rm

三、man 和 help

man
使用方法:man 命令
你可以使用man man来查看man怎么用 哈哈哈哈哈

NAME						命令名称及功能简要说明

SYNOPSIS					用法说明,包括可用的选项

DESCRIPTION					命令功能的详细说明,可能包括每一个选项的意义

OPTIONS						说明每一项的意义

FILES						此命令相关的配置文件       

EXAMPLES					使用示例

SEE ALSO					另外参照   

操作方法:

例如:man ls

查看时需要翻屏:

向后翻一屏:space(空格键)       向前翻一屏:b

向后翻一行:Enter(回车键)       向前翻一行:k

查看时需要查找:

/关键词      向后查找    n:下一个

?关键词      向前查找    N:前一个
[root@my-rhel ~]# man ls





LS(1)                          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 specified.

       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
              with -l, print the author of each file

       -b, --escape
              print C-style escapes for nongraphic characters

       --block-size=SIZE
              with -l, scale sizes  by  SIZE  when  printing  them;  e.g.,
              '--block-size=M'; see SIZE format below

       -B, --ignore-backups
              do not list implied entries ending with ~

       -c     with  -lt:  sort by, and show, ctime (time of last modifica‐
              tion of file status information); with -l:  show  ctime  and
              sort by name; otherwise: sort by ctime, newest first

       -C     list entries by columns

       --color[=WHEN]
              colorize  the output; WHEN can be 'always' (default if omit‐
              ted), 'auto', or 'never'; more info below

       -d, --directory
              list directories themselves, not their contents

       -D, --dired
              generate output designed for Emacs' dired mode

       -f     do not sort, enable -aU, disable -ls --color

       -F, --classify
              append indicator (one of */=>@|) to entries

       --file-type
              likewise, except do not append '*'

       --format=WORD
              across -x, commas -m, horizontal -x, long -l,  single-column
              -1, verbose -l, vertical -C

       --full-time
              like -l --time-style=full-iso

       -g     like -l, but do not list owner

       --group-directories-first
              group directories before files;

              can  be  augmented  with  a  --sort  option,  but any use of
              --sort=none (-U) disables grouping

       -G, --no-group
              in a long listing, don't print group names

       -h, --human-readable
              with -l and -s, print sizes like 1K 234M 2G etc.

       --si   likewise, but use powers of 1000 not 1024

       -H, --dereference-command-line
              follow symbolic links listed on the command line

       --dereference-command-line-symlink-to-dir
              follow each command line symbolic link

              that points to a directory

       --hide=PATTERN
              do not list implied entries matching shell PATTERN (overrid‐
              den by -a or -A)

       --hyperlink[=WHEN]
              hyperlink file names; WHEN can be 'always' (default if omit‐
              ted), 'auto', or 'never'

       --indicator-style=WORD
              append indicator  with  style  WORD  to  entry  names:  none
              (default),  slash  (-p),  file-type  (--file-type), classify
              (-F)

       -i, --inode
              print the index number of each file

       -I, --ignore=PATTERN
              do not list implied entries matching shell PATTERN

       -k, --kibibytes
              default to 1024-byte blocks for disk usage; used  only  with
              -s and per directory totals

       -l     use a long listing format

       -L, --dereference
              when  showing  file  information  for  a symbolic link, show
              information for the file the link references rather than for
              the link itself

       -m     fill width with a comma separated list of entries

       -n, --numeric-uid-gid
              like -l, but list numeric user and group IDs

       -N, --literal
              print entry names without quoting

       -o     like -l, but do not list group information

       -p, --indicator-style=slash
              append / indicator to directories

       -q, --hide-control-chars
              print ? instead of nongraphic characters

       --show-control-chars
              show  nongraphic  characters as-is (the default, unless pro‐
              gram is 'ls' and output is a terminal)

       -Q, --quote-name
              enclose entry names in double quotes

       --quoting-style=WORD
              use quoting style WORD for  entry  names:  literal,  locale,
              shell,  shell-always,  shell-escape, shell-escape-always, c,
              escape (overrides QUOTING_STYLE environment variable)

       -r, --reverse
              reverse order while sorting

       -R, --recursive
              list subdirectories recursively

       -s, --size
              print the allocated size of each file, in blocks

       -S     sort by file size, largest first

       --sort=WORD
              sort by WORD instead of name: none  (-U),  size  (-S),  time
              (-t), version (-v), extension (-X)

       --time=WORD
              with  -l,  show time as WORD instead of default modification
              time: atime or access or use (-u);  ctime  or  status  (-c);
              also  use  specified time as sort key if --sort=time (newest
              first)

       --time-style=TIME_STYLE
              time/date format with -l; see TIME_STYLE below

       -t     sort by modification time, newest first

       -T, --tabsize=COLS
              assume tab stops at each COLS instead of 8

       -u     with -lt: sort by, and show,  access  time;  with  -l:  show
              access  time  and  sort  by  name; otherwise: sort by access
              time, newest first

       -U     do not sort; list entries in directory order

       -v     natural sort of (version) numbers within text

       -w, --width=COLS
              set output width to COLS.  0 means no limit

       -x     list entries by lines instead of by columns

       -X     sort alphabetically by entry extension

       -Z, --context
              print any security context of each file

       -1     list one file per line.  Avoid '\n' with -q or -b

       --help display this help and exit

       --version
              output version information and exit

       The SIZE argument is an integer and optional unit (example: 10K  is
       10*1024).   Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,...
       (powers of 1000).

       The TIME_STYLE argument can be full-iso, long-iso, iso, locale,  or
       +FORMAT.  FORMAT is interpreted like in date(1).  If FORMAT is FOR‐
       MAT1<newline>FORMAT2, then FORMAT1 applies to non-recent files  and
       FORMAT2  to  recent files.  TIME_STYLE prefixed with 'posix-' takes
       effect only outside the POSIX locale.  Also the TIME_STYLE environ‐
       ment variable sets the default style to use.

       Using  color  to distinguish file types is disabled both by default
       and with --color=never.  With --color=auto, ls  emits  color  codes
       only  when standard output is connected to a terminal.  The LS_COL‐
       ORS environment variable can change the settings.  Use the  dircol‐
       ors command to set it.

   Exit status:
       0      if OK,

       1      if minor problems (e.g., cannot access subdirectory),

       2      if  serious  trouble (e.g., cannot access command-line argu‐
              ment).

AUTHOR
       Written by Richard M. Stallman and David MacKenzie.

REPORTING BUGS
       GNU  coreutils  online  help:   <https://www.gnu.org/software/core‐
       utils/>
       Report    ls    translation    bugs   to   <https://translationpro‐
       ject.org/team/>

COPYRIGHT
       Copyright ? 2018 Free Software Foundation,  Inc.   License  GPLv3+:
       GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
       This  is free software: you are free to change and redistribute it.
       There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       Full documentation at: <https://www.gnu.org/software/coreutils/ls>
       or available locally via: info '(coreutils) ls invocation'

help
当我们遇到某个命令,不知道怎么用时,就可以使用这个help,用法:命令 --help

[root@my-rhel ~]# type --help

type: type [-afptP] name [name ...]
    Display information about command type.
    
    For each NAME, indicate how it would be interpreted if used as a
    command name.
    
    Options:
      -a	display all locations containing an executable named NAME;
    		includes aliases, builtins, and functions, if and only if
    		the `-p' option is not also used
      -f	suppress shell function lookup
      -P	force a PATH search for each NAME, even if it is an alias,
    		builtin, or function, and returns the name of the disk file
    		that would be executed
      -p	returns either the name of the disk file that would be executed,
    		or nothing if `type -t NAME' would not return `file'
      -t	output a single word which is one of `alias', `keyword',
    		`function', `builtin', `file' or `', if NAME is an alias,
    		shell reserved word, shell function, shell builtin, disk file,
    		or not found, respectively
    
    Arguments:
      NAME	Command name to be interpreted.
    
    Exit Status:
    Returns success if all of the NAMEs are found; fails if any are not found.


总结

man 和 help 里面全是英文,需要一定的词汇量,遇到不会的词,积极去查,多积累

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2021-08-07 12:29:14  更:2021-08-07 12:31:05 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年12日历 -2024/12/28 3:42:46-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码
数据统计