Linux Common commands

Source: Internet
Author: User
Tags log log parent directory

First, the user

1 su Switch User

2 Su-with slash indicates permission to replace User configuration information

Second, network card

1 Ps-ef

Ps-ef|grep sshd to see if the SSH service is started (process number PID)

2 kill-9 Lore

kill-9 pid forced stop SSH Service

3 Service

Service sshd start SSH services

Service sshd restart Restart SSH Services

Service sshd Stop SSH Services

4 ifconfig

Ifconfig viewing the network card IP (enabled)

IFCONFIG-A View all network cards (including disabled)

Ifconfig NIC name Up/down enable/disable a NIC

5 dhclient network card name network card automatically obtain IP

Dhclient (2419) running existing ====> process occupancy

Kill-9 2419 forced stop

Third, Directory

1/root directory

2.. Upper Directory

3 CD jumps to the specified directory (CD/return root), (CD.. Return to parent directory)

4 ls view files and folders in the current directory

5 Ls-l View the details of a file in the current directory

6 ls-a View all files in the current directory (including hidden files)

7 Ls-la View all files in the current directory (in the form of a list)

8 mkdir folder name Create Folder

RmDir folder name Delete directory

Mkdir-p path creation of multi-level catalogs

Rmdir-r path Delete multi-level directory

RMDIR-RF path without prompting for multi-level directory deletions

9 Mount Mount ()

Mount/dev/cdrom/mnt/cdrom attach an app in CDROM to the path you specify

Umount un-mount

Umount/mnt/cdrom Cancel the application mounted to the specified path

Iv. Documents

1 Whereis

Whereis command name search for the path to the command and where the help document is located

Whereis-b ls only looks for executable files

Whereis-b LS only find help documents

2 Touch file name (relative path/absolute path)

3 Cat View Small files

4 Tail viewing large files

TAIL-10 View after 10 lines

HEAD-10 View Top 10 lines

Tail-f View Log log (-F to make it easy to see the log files that are being changed--to show what is constantly updated at the tail)

5 VI file name (Baidu command for VI)

VI Three modes (1, command work mode 2, edit working mode 3, bottom line mode)

6 MV Rename

MV Original name New name

7 CP-FR Copy

CP-FR the path where the original file holds the copy

Five, the Authority

1 d rwxr-xr-x: D directory rwx user rights r-x user group permissions r-x other group permissions

R reads Read W writes write X executes execute

r--===>100 ===> 4 Read-only

R-x ===> 101 ===> 5

rw-===>110 ===> 6

RWX ===> 111 ===> 7

2 chmod g (u/0) + (-) W file Add (cancel) Write permission to group (user/other group)

chmod 777 File name

Chmond 777-r filename included in file (recursive authorization)

Linux Common 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.