zoukankan      html  css  js  c++  java
  • 03_directory-related commands

    1. Category of directory
        The shell working directory.
        The current directory which refers to the shell working directory.
        HOME directory:
            root : /root
            Average user : /home/USERNAME
    2. The cd command
        Change the shell working directory / Change the current directory to DIR.
        e.g :
            cd or cd~ : Switch to the current user's home directory.
            cd ~USERNAME :     Switch to the home directory of the specified user.
            cd - : Switch back and forth between the previous directory and the current directory.
            . : The current directory.
            .. : The parent directory of the current directory.
        Environment variables related to the cd command:
            PWD : Used to save the current directory.
                The pwd command is used to read the value of the PWD environment variable. 
            OLDPWD : Used to save the previous directory.
                That's why you can switch back and forth between the previous directory and the current directory.
                cd- is equivalent to cd $OLDPWD.

    3. The ls command : List contents of the specified directory.
        Execution result of ls command with the option of -l : 
            -rw-r--r-- 1 root root 44800 Aug 14 14:32 install.log
                The leftmost one : refers to the file type.
                The next nine : refers to the file access authority.
                The next digital 1 :  The number of a file is hard linked.
                the first root : The owner of the file.
                the second root : The group of the file.
                44800 : The size of the file.
                Aug 14 14:32 : The last time the file was modified.
                install.log : the file name.

    1. mkdir
        1.1 mkdir用来创建目录的:在这里目录和文件是一回是
        [root@bogon tmp]# mkdir test/abc  
            如果test存在:创建成功
            如果abc存在,则不会创建新的替换,且会报错。
            如果test不存在:创建失败
        -p, --parents : no error if existing, make parent directories as needed
            [root@bogon tmp]# mkdir test/abc
            如果test不存在,先创建test,后创建abc
                如果abc存在,则不会创建新的替换,且不会报错。
        -v, --verbose : print a message for each created directory
    2. rmdir : remove empty directories
    3. tree : list contents of directories in a tree-like format.  

  • 相关阅读:
    我的javascript学习路线图
    Javascript 严格模式
    犀牛书学习笔记(10):模块和命名空间
    犀牛书学习笔记(9):继承
    犀牛书学习笔记(7):定义和使用类或对象
    犀牛书学习笔记(6):理解作用域和作用域链
    犀牛书学习笔记(5):javascript中的对象
    犀牛书学习笔记(4):面向对象(OOP)之回顾JAVA
    犀牛书学习笔记(3):函数
    bug
  • 原文地址:https://www.cnblogs.com/liujun5319/p/9600765.html
Copyright © 2011-2022 走看看