CentOS7 Basic Command Summary

Source: Internet
Author: User
Tags chmod readable tmp folder ssh file permissions

provide relevant information download address: http://download.csdn.net/detail/u010879420/9921831
CentOS7 First, introduce

The double plate of Red Hat

Ii. Tools Needed

CentOS7 CD image file

-everything (full version)

SECURECRT Remote Landing terminal software

WinSCP Linux and window transfer tools

Iii. Common operation commands

Ifconfig

View IP Address

Init 3

Toggle Command mode

Init 5

Toggle Graphical Interface

Pwd

View the current directory

Touch A.C

New File A.C

Ls

View files and folders in the current directory

Ls/tmp

View files and folders under the TMP folder in the current directory

RM A.C

Deletes the file a.c in the current directory of the file (prompts for deletion)

RM A.C-RF

Permanently delete (do not prompt for deletion)

MKDIR ABC

New Catalog ABC

CP anaconda-ks.cfg/tmp

Copy file [Anaconda-ks.cfg] to the current directory TMP folder

Cat Anoconda.log

View the contents of the file [Anoconda.log]

VI Anoconda.log

Open the file [Anoconda.log] content with the editor

Vim Anoconda.log

Open the file [Anoconda.log] content with the editor

Iv. Specific Operations 1. How to modify the IP address.

2. User-related Operations

Add user

USERADD ABC add user ABC

View User

Vipw

Jump last line

Capital D

Add a group

Groupadd CCNA Add Group CCNA

View Group

Vigr

Skip to last line

Capital D

View the groups to which the user belongs

Groups ABC View group of ABC users

View Current User is

WhoAmI

Exit

Exit

Specify a user to a group

GPASSWD-A ABC CCNA Set user-owned group to CCNA

Delete User

Userdel ABC Delete User ABC

Delete a group

Groupdel CCNA Delete Group CCNA

View User IDs

ID ABC view the ID value of user ABC (the smaller the ID value, the greater the general permissions)

Toggle User

SU-ABC switch Current user to ABC

File Permissions Related

Permissions

R Readable W writable x executable

Permission Correspondence encoding

4==r 2==w 1==x

Extended

6==RW (Readable and writable)

3==WX (writable executable)

5=rx (Readable executable)

Create a file

Touch A.C Create File A.C

View information about a file

(Permissions, creator, creation time, etc.) for the file by the current user

ll

Permissions to modify Files

chmod 777 A.C Modify file A.C permissions for-rwxrwxrwx

chmod 643 a.c Modify file A.C permissions for-rw-r---WX

Add File Permissions

chmod +x a.c Add executable permissions to file A.C

problem

Problems with virtual machine Ubuntu connection using WINSCP ...

Ifconfig problem.

Final issue: No SSH service, need to download the installation SSH service package

To see if there is an SSH Service command: Service SSH--status

2017/7/11, 8:24 3. Toggle file-Owning user and group

New File A.C

Touch A.C

View file information

ll

Chown Root A.C

The user of the specified file is root

CHGRP CCNP A.C

The specified file corresponds to a user group of CCNP

The following are abbreviated:

Chown ABC.CCNP A.C

Specifies that the owning user of the file A.C is ABC, and the owning user group is CCNP

Chown Root.root A.C

Specifies that the owning user of the file a.c is root and the owning user group is root

Useradd YP1

Useradd YP2

Useradd YP3

Mkdir/tmp/test

Cd/tmp/test

Chown YP1.YP2 ABC-RF

Add the owning user and the owning user group to the folder ABC, force all files and folders in the folder to add the owning user and the owning user group

4. Process-related

Ps-ef

View all processes (including system processes)

Ps-ef |more

Paging View all processes (including system processes)

Ps-ef |grep Firewalld

View FIREWALLD related processes

Which FIREWALLD

FIREWALLD Directory

Kill 970

Ending process with process ID 970

Kill-9 970

Force shutdown process with process ID 970

Jobs

viewing processes (without system processes)

Kill-stop 80477

Pause process with process ID 80477

Kill 80477

Shut down process with process ID 80477

5. Network-related

SCP index.html Root@192.168.80.100:/root

Send the file as user root index.html to the root directory of the 192.168.80.100 server

Hostname

View current host Name

Hostname abc.com

Modify the current host name to ABC.com

Ping www.baidu.com

View IP for Domain name

Nslookup www.baodu.com

View IP for Domain name

SSH 192.168.80.100

Log on to the 192.168.80.100 server

Ifconfig

View IP Address

Route

View routing Information

wget http://www.baidu.com/index.html

Download File http://www.baidu.com/index.html

6. System-related

Shutdown

Shutdown

Shutdown-r

Reboot

Shutdown-h now

Shutdown

Shutdown-h 20:00

Timed shutdown

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.