Linux Common Command Practice.

Source: Internet
Author: User

Ls-la: Gives a long list of all files in the current directory, including a "hidden" file that begins with a period

ls -a.  ..  1  online_tools  online_tools_0803

LL: Display all files in a vertical column

ll

PWD: View current path

 pwd/home/bae/huangqinjian/online_tools

CD: Switch directories

 cd online_tools pwd/home/bae/huangqinjian/online_tools

Cat: Display file contents

 cat upload.py

Top: View CPU, Memory

 top

Man: View Help for a command

Man LS display Help content for LS command

Diff: Compare File contents

Diff Dir1 Dir2 compares the file list of directory 1 with directory 2, but does not compare the actual contents of the file, but lists

 diff ci dataOnly in ci: ActionUserFeedback.class.phpOnly in data: island

Vim: Enter vim edit file

For example:vim index.html

Press and hold the i key to enter edit mode, after editing press and hold ESC cancel edit, enter :wq save, :q is not saved.

Do not save Exit method: Many times open the file, or modify some places, only to find the wrong, very need not to save the exit.

Press First, ESC then enter a colon, enter the command directly when you enter itq!

RM: Delete File command

[[email protected] html]$ rm index_demo.html

Format: RM file Delete file, the system will first ask whether to delete.

Format: rm-f file forcibly delete file, the system no longer prompts.

Format: Rm-rf dir forcibly deletes all files and directories under directory dir, subdirectories, and deletes dir itself.

CP: Copying files

cp -rp /home/d001 /home/Documents

Copy/home under d001 to/home under documents

-R is traversing the directory, that is, copying the entire directory-P is preserving the original property

CP afile Afile.bak Copy the file as a new file Afile.bak

CP afile/home/bible/Copy the file Afile from the current directory to the/home/bible/directory

SZ filename: Download a file

**sz filename1 filename2:** downloading multiple files

Download all files in the Dir directory, without the folder under dir: Sz dir/*

[email protected]om html]$ sz index.html

RZ: Uploading Files

After entering RZ Enter, the file selection dialog will appear, select the file you want to upload, you can specify more than one file at a time, and upload the path to the server as the directory of the currently executing RZ command.

SU: Switching users

Su–root Switch to root user

VI below how to do carriage return line?

ESC + I + Enter

Start process

Go into the directory of the process to execute./+进程名字

[[email protected] ~]$ ./start.sh

The above command run is likely to have the problem of insufficient permissions, and finally tell you an authorization command, if we want to give this file under all the. sh file authorization, we can write chmod u+x *.sh to SH file authorization, of course we can also replace * with the specific file name, depending on the need to decide.

Linux Common Command Practice.

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.