Basic Command Daquan 1

Source: Internet
Author: User

CD///Switch directory,

To the root directory/: root CD ~

Quickly go back to the current user's home directory

CD-//return to the directory you visited last time

Cd.. Return to the top level directory

pwd//printing the current directory path

LS//Lists the information in the current directory

-A all include hidden

-L Show Detailed information

-H humanized Display size

-T sorts the path in time:

Relative path: Only valid for directories or files in the current directory

Absolute path: Must start with root

CAT//View file contents

Vim Editor Command mode, edit mode (insert mode), End mode Command mode-------> Edit mode

In command mode I i o a a a can enter edit mode edit mode-------> Command mode ESC,

Return Command mode command mode from edit mode-------> End mode: (colon)

, enter end mode from command mode

: w//Save:

q//exit

: q!//do not save and force exit:

wq//Save and exit:

wq!//Force Save Exit

Method of modifying IP address 1.ifconfig eth0 IP address//modify eth0 The IP address of this network card (effective immediately but not permanently) restart the network service or the machine will restore

2. Modify the configuration file, the network card configuration file location:/etc/sysconfig/network-scripts/(permanent but not immediately effective) need to restart the network service or machine to take effect

3.setup Modify using the Setup tool (using this tool is equivalent to modifying the configuration file)

4. Using the graphical interface (using the Web service as NetworkManager)

View File Contents

View Small file CAT//Positive order view

tac//Reverse View

View large Files More

less//support for finding features

head//View File header default View 10 rows

tail//view file end By default view 10 rows

-f//Live View

-n3//Specify to view 3-line examples

: Head-n5/var/log/messages//View first 5 lines of file messages

Line filter grep content file//filter out the file containing the contents of the line grep ^ content file

Filter out the line grep content that starts with that content $ file/

Filter out the example of the line ending with that content: grep root/etc/passwd

View/etc/passwd the line that contains root in this file

|: Pipe character used to link between commands the output of the previous command is the last command input

Column Intercept cut

-D delimiter

-F Column Number file

Example: cut-d:-f2/etc/passwd//intercepts/etc/passwd in this file: the 2nd column of data

wc//count rows, words, bytes (size)

-l//count rows only

-w//only count the number of words

-c//Only Statistics size

Vim has the ability to create files (this file needs to be saved)

echo//output String > redirect >> Chase-weighted Redirect//

Redirection and append redirection have the ability to create files

touch//creating a file 1 creating a file 2

Modify file timestamp stat file name//view file properties and time

----------------------------------------------

rm//Deleting files

-r//Deleting a directory

-i//Interactive Delete

-f//do not prompt for forced deletion

-rf//with CAUTION!!!

----------------------------------------------

mkdir//Create a directory

-p//recursive creation of directory examples:

Mkdir-p A/B/C/D

rmdir//Delete Empty Directory

CP source File destination//Copy a file

-r//Copy Directory

-p//Preserve property permissions for source files

SCP source file destination//Remote copy File

SCP User name @ip Address:/path destination//remote file copied to local

-------------------------------------

-SSH User name @ip address or host name//remote link sshd service

Service sshd start//Open Sshd Services

------------------------------------------

MV1 Moving files

2 renaming MV source files destination MV old name New name

-------------------------------------------

Wildcard characters * All

? Match one character

This article from "11601463" blog, declined reprint!

Basic Command Daquan 1

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.