Linux basic commands

Source: Internet
Author: User
Tags readable

CD(change direction): Changing the Directory
{
CD/: Go to the root directory
CD Directory Name: Enter the directory
Cd.. : Go to the previous level directory
Cd. : Enter the current directory
CD ~: Enter the host (home) directory (cd ~ Directory Name: Return to the host directory for the directory name) of the current user (normal user or superuser (su root))
CD-: Get to the last catalog
}

chmod Modify permissions 755 (3 digits must be given at the same time) (0-7 eight states) (Binary 111 101 101) (Rwxr-xr-x readable writable executable readable non-writable executable readable executable) text.c Change the TEXT.C permission to 755
{
chmod u-w test.c The owner privilege of the test.c file minus the readable permission rwx-->r-x
U (owner) G (Group) O (Other) a (all)

      • =
        chmod u/g/o/a +/-/= r/w/x file name
        chmod u+rwx test.c
        }
        chown (Modify owner) (chown 51cc test.c Change the owner of the test.c file to 51cc)
        (Modify the group while modifying the owner) (chown root.root or root:root test.c 51cc test.c to change the owner and group of the test.c file to root)

chgrp (Modify group) (Chgrp 51cc test.c the group of test.c files to 51cc)

File Management commands:
ls: Show directory contents (show file name)
{
Ls-a: Do not hide any files that begin with a dot (.)
Ls-l: Listing information using longer formats
such as
LS display: Blue for the directory, green for the executable, red for compressed files, light blue for linked files, bold black for symbolic links, gray for other usage files
}
cat: Output [file] or standard input combination to standard output (display text file contents)
RM: Delete the specified file (delete file)
{
Rm-f file name: Force Delete, ignore non-existent files, do not prompt to confirm
Rm-i file name: Confirm before deleting
Rm-r file name: Recursively delete a directory and its contents
By default, RM does not delete the directory
}

Less: Display files by page (split screen display file) Less [options] File

cp : Copy file (copy of file or directory)
{
CP [OPTION] [-t] source file destination file
CP [Options] source file directory
CP [option]-T directory source file
[Options]:
-r copy directory, including all subdirectories and files in this directory
}

Linux basic commands

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.