Lesson6--linux command Explanation

Source: Internet
Author: User
Tags create directory

First group: User management

    1. Add user Useradd [] User name

      After adding a user, the user folder is automatically generated at/home

    2. Delete User Useradl [-r] User name

      When the user is deleted, the/home user folder is automatically deleted through the [-r] Option

    3. Modify user password passwd [] User name

    4. Add user group Groupadd [] User group

    5. Switch User Su-user name

      If the [-] option is selected, switch the environment variables together

    6. Delete user group Groupdel user group name


Second group: File and Directory class commands

  1. View Catalog ls or ls/home/

    Show hidden files Ls-a/home/

    Show more info ll or ll-la/home/

  2. Change the working directory CD directory name

    Cd..

    Cd.. /..

    Return to previous catalog CD-

  3. Copy files/directories CP [] source file Destination file

    Cp[-r] Original Folder destination folder

  4. Move/Rename Mv/home/test/home/test_01

    Mv/home/test/temp

  5. Delete File/directory RM [] File name

    RM [-R] Folder

    Force delete RM [-f] File name

  6. Change file access permissions such as:

    chmod u+w hello.c

    chmod g+r test.c

    chmod 777 TEST.c

  7. Create directory mkdir [] directory name

    For example, with the [-p] option, Mkdir-p/home/dir1/dir2/dir3. () if Dir1 and dir2 do not exist, they will be created automatically.

  8. View Directory Size Du/tmp

  9. View current path pwd


Group Three: Compressed packaging class commands

    1. Compress extract gzip [] File name

      Example: gzip/home/test.c compressed, the source file hours

      gzip-d/home/test.c Extract a file

    2. Compression decompression bZIP [] File name

      Example: bzip/home/test.c compression

      bzip-d/home/test.c Decompression

    3. tar [] Directory/File

      For example: Tar cvf temp.tar/tmp

      Tar xvf Temp.tar

      Tar cvzf temp.tar.gz/temp @temp as source file

      Tar xvzf temp.tar.gz


Group Fourth: Disk Management class Commands

    1. Loading the disc mount/dev/cdrom/mnt

    2. Unmount the disc umount/mnt

    3. View Disk DF []

    4. Create a file Touch file name

    5. File Link ln file name

      For example: Create a soft connection ln-s/home/old_file/slink

      Wear a hard link ln/home/old_file/hlink


Group Fifth: Find class commands

    1. Find files/directories find [] files/directories

      Example: find/root/-name Install.log

    2. Find string grep "string" path []

      For example: grep "Hello"./-rn @ list Results

      grep "xml"/root-rn


Group Sixth: Process commands

    1. View process: PS aux

    2. Kill process: Kill [Process number]

    3. View Memory: Free

    4. CPU Share: Top


Group Seventh: Other Commands

    1. Software management rpm [IVH] File name

      (RPM packages are generally included in the package directory of the system CD-ROM)

      View installed software: RPM-QA

      Uninstalling installed software: RPM-E package name

    2. Pipeline Operations Command 1 | Command 2

      Example: Rmp-qa | grep tar

    3. View Help man [command name]

      Example: Man find

    4. Shut down the system shutdown now

This article is from the "Home Life" blog, please be sure to keep this source http://fdliang.blog.51cto.com/9889796/1698454

Lesson6--linux command Explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.