Basic linux operations (1): Basic linux operations

Source: Internet
Author: User

Basic linux operations (1): Basic linux operations

Easy to write

1. Basic commands.

(1) ls (list directory content)

Ls. Current Directory;

Ls... directory on the upper layer;

Ls-l is listed as a list;

Ls-a lists all objects-all;

Ls-h has the unit-human-readable;

Ls-t is arranged in chronological order-time;

Ls-R recursively lists all information in all directories, including subdirectories;

(2) touch

If the file does not exist, create the file. If the file exists, update the file time without changing the file content;

(3) create a directory using mkdir

Mkdir directorys you can create multiple single-level directories;
Mkdir directory1/directory2 if 1 does not exist,-p creates a multi-level directory;

(4) cd change working directory

Cd home directory;
Cd ~ Home Directory;
Cd-to the last hop directory (from where to where );
Cd/to the root directory;

(5) rm remove files or directorys

Rm-r deletes a directory;
When rm-f is deleted, the system does not prompt force deletion;

(6) cp copy file or directory

Cp file1 file2 copy file1 to file2;

Cp file1 directory copies the file to the directory;

Cp file1 file2 directory3 file... n directory copies the file or directory to a directory, but the last one must be a directory;

Cp *. c AAA copies all files ending with. c to the AAA directory;

\ Cp overwrite mode does not prompt whether to overwrite;

Cp directory1 directory2-r if directory2 does not exist, copy it to the next level directory of directory2 if directory2 exists;

(7) cut or rename mv move
Mv file1 file2
Mv directory1 directory2 rename if directory2 does not exist. If directory2 exists, it is cut to the directory2 directory;

 

(10) shutdown command
Shutdown
Halt
Halt-p-f direct power switch
Init 0
Restart
Reboot

 

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.