Linux learning path-1, file directory operation commands

1、

  log in

    [root@localhost]  root

    password 123 (the default seems to be 123456)

  User rights

    The root authority is the highest, equivalent to the administrator in Windows

    In the Linux system, the user authority is distinguished by UID, UID = 0, which means that the user has the highest authority

2. Basic commands

  cd command: switch directory

    cd / switch to the root directory

    cd .. return to the previous directory (relative to the current directory, this path is also a relative path)

    cd. Return to the current directory

    cd tmp switch to tmp directory (switch absolute path)

  pwd command:

    pwd view the current directory location

  ls command:

    ls view all folders in the root directory

  clear command: clear screen

  mkdir command: create directory

    mkdir directory name creates an empty directory

    mkdir -p directory name / directory name (directory file) Create a parent-child directory and a directory (or file) under the directory at the same time

    mkdir -v directory name creates an empty directory and displays the successful creation information

    mkdir -vp directory name / directory name (directory file)

      Example:

             

  mkdir creates a directory:

    

     

  rmdir command: 

    rmdir directory name (only directory can be deleted-empty directory)

      

    rmdir -p directory name / sub directory name (if the sub directory is deleted, the parent directory is empty, then delete it together)

       

  rm command: used to delete a directory and all directories and files under this directory

    rm file name (not forced to delete, need to delete confirmation)

      

    rm -f file name (force delete file, no need to confirm)

      

    rm -r directory name (delete a directory and all directories and files under this directory, need to confirm)

    rm -rf directory name (force to delete a directory and all directories and files under this directory)

      

    rm -i * .xxx (delete the file with the suffix xxx)

      

  cp command: used to copy files or directories

  mv command: move or modify a file name (directory)

    mv file name 1 directory name / file name 2 (if file 2 exists, file 1 asks whether to overwrite file 2; if it does not exist, file 1 name is changed to file 2, or file 1 moves to this directory)

      

     mv file name 1 -b directory name (the backup file is the file to be overwritten by file name 1 under the path behind -b)

          

  touch command: create file

    touch file name

  

    touch file name file name 2 file name 3 (create multiple files at the same time separated by spaces)

      

  vi command: can write text content

    vi file name   

       

     After you press Enter to enter, you will enter the editing interface. Enter i to edit the content. After editing, click the esc button to exit the editing. Press shift +: enter wq at the bottom of the input interface to save the edit and exit.

  cat command: you can view the contents of the file

    cat file name

      Example:

      

  echo command: You can directly print out the content, or you can directly modify the content of the file

    echo “xxxxxx” will directly output xxxxxx after pressing Enter

    echo xxxxxx> The file name will directly replace the file content with xxxxxx 

    echo xxxxxx >> The file name will append xxxxxx after the file content 

    Example:

      

3. Learning skills

  Practice to know, practice more-practice more-practice more


4. Make up for problems in installing Linux

  During installation, when selecting Chinese, the Linux installation interface of the Rad Hat version shifted to the right and there was no complete display

    Red Hat Enterprise Linux (slow start? Maybe it's my computer)

    CentOS version of Linux (normal boot speed)

  

  During installation, disk partitions need to be divided

    At least two disk partitions:

      Root partition:

        Mount point: /

        File type: ext4

      Swap partition:

        Mount point: None

        File system type: swap

        Size: twice the physical memory

 

  There is another way to divide the disk, which is to follow the installation prompt directly.

 

Guess you like

Origin www.cnblogs.com/ygn6666/p/12725936.html