码迷,mamicode.com
首页 > 系统相关 > 详细

Linux操作系统及常见命令

时间:2016-02-24 19:35:39      阅读:392      评论:0      收藏:0      [点我收藏+]

标签:linux操作系统及常见命令

ls:List information about the FILEs (the current directory by default).

    -l:use a long listing format

        [root@master1 ~]# ls -l
        total 104
        -rw-------. 1 root root  1557 Feb 19 19:09 anaconda-ks.cfg
        drwxr-xr-x. 2 root root  4096 Feb 20 07:50 Desktop

        文件类型:

            -:普通文件

            d:目录文件

            b:块设备文件

            c:字符设备文件

            l:符号链接文件(symbolic link file)

            p:管道文件(pipe)

            s:套接字文件(socket)

        文件权限:mode,9位,每三位一组,分别为owner,group,others,rwx(读、写、执行),如果该位没有权限用-表示

        引用计数:文件被硬链接的次数

        文件属主:owner

        文件属组:group

        文件大小:默认单位为字节

        文件最近修改时间:最近访问时间、最近修改时间(修改文件内容)、最近改变时间(改变文件属性)

        文件名:

    -h, --human-readable
              with -l, print sizes in human readable format (e.g., 1K 234M 2G)

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

                linux中以.号开头的文件为隐藏文件

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

                .表示当前目录;

                ..表示当前目录的父目录;

    -d, --directory

        list directory entries instead of contents, and do not dereference symbolic links

        显示目录自身的属性,而非目录下所有文件的属性

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

    -r, --reverse
              reverse order while sorting

    -R, --recursive
              list subdirectories recursively

    -S     sort by file size

    -t     sort by modification time

    -X     sort alphabetically by entry extension


cd:Change the shell working directory.

        -L    force symbolic links to be followed
        -P    use the physical directory structure without following symbolic links
   

    The default is to follow symbolic links, as if `-L‘ were specified.

    cd:切换到当前用户的家目录($HOME)

    cd ~:切换到当前用户的家目录

    cd ~USER:切换到USER用户的家目录(仅限root用户)

    cd -:在当前目录和上一个目录间来回切换


pwd:Print the name of the current working directory.

    Options:
      -L    print the value of $PWD if it names the current working directory
      -P    print the physical directory, without any symbolic links
    
    By default, `pwd‘ behaves as if `-L‘ were specified.


type:Display information about command type.

    shell内置命令:shell builtin

    外部命令:文件系统中有与命令同名的二进制可执行程序或者脚本

    环境变量:命名的内存空间

        $PATH

env:env - run a program in a modified environment


printenv:printenv - print all or part of environment


hash:Remember or display program locations. 搜索时间:o(1)

    -d        forget the remembered location of each NAME


date:date - print or set the system date and time

    晶体振荡器,由主板上的纽扣电池供电

    rtc:real time clock

    ntp:network time protocol

    硬件时钟:clock、hwclock

    系统时钟:date

    linux开机启动后通过rtc读取硬件时钟到系统时钟,此后由内核负责维护系统时钟,当CPU任务繁忙时,系统时钟与硬件时钟会出现不同步的情况

    date [OPTION]... [+FORMAT]
    date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]


如何获取命令的使用帮助?

    Linux命令分为内置命令和外部命令

    内置命令:

        #help COMMAND

    外部命令:

        # COMMAND --help

        # man COMMAND

        # info COMMAND

    man:

        The standard sections of the manual include:
           1      User Commands(/bin:/usr/bin:/usr/local/bin)
           2      System Calls
           3      C Library Functions
           4      Devices and Special Files
           5      File Formats and Conventions
           6      Games et. Al.
           7      Miscellanea
           8      System Administration tools and Deamons(/sbin:/usr/sbin:/usr/local/sbin)

   <>:必选

    []:可选

    ...:可以出现多次

    |:多选一

    {}:分组

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

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

    DESCRIPTION:命令功能的详细说明,包括选项的意义

    OPTIONS:选项的意义

    FILES:与命令相关的文件

    EXAMPLES:样例

    SEE ALSO:另见


    通过whatis可以查看命令出现在哪些章节

    which

    whereis

    whatis

    apropos

            

            

Linux操作系统及常见命令

标签:linux操作系统及常见命令

原文地址:http://xbruce.blog.51cto.com/8957944/1744727

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!