Linux Shell Common directives

Source: Internet
Author: User
Tags clear screen readable

1. Man helps explain commands you are familiar with or unfamiliar with

Eg:man ls to view LS-related usage

Note: Press the Q key or CTRL + C to exit, under Linux you can use CTRL + C to terminate the current program run.

2. LS to view the directory or the properties of the file, listed as a directory below the file

Eg:ls/usr/man

Ls-l

A.D represents the directory, if it is a "-" represents a file, if L is a connection file (link)

B. Represents a file or directory permission permission. Separate with readable (R), writable (w), can be run (x).

3. CP Copy File

EG:CP filename1 filename2//copy filename1 to Filename2

CP 1.c NETSEEK/2.C//1.c Copy to Netseek directory named 2.c

4. RM Delete files and directories

EG:RM 1.c//delete 1.c this file

5. MV Remove directory or change file name

EG:MV filename1 filename2//renamed filename1 to Filename2

MV Qib.tgz. /QIB.TGZ//move to the top level directory

6. CD changes the current directory

EG:CD Netseek//Enter Netseek this directory

CD//Exit current directory

Cd.. Switch to the previous level directory

CD-//Switch to previous directory

7. Cat, more commands

Displays the contents of a file. The two commands differ: The cat prints the contents of the file, while the more is displayed on a split screen

eg CAT>1.C//You can paste the code into the 1.c file, press Ctrl+d to save the code.

Cat 1.c or more 1.c//can view content inside.

Gcc-o 1 1.c//compile 1.c into an. exe file, we can compile the code with this command.

8.chmod Command Permission modification usage: chmod one 8 binary number filename.

Eg:chmod u+x filenmame//Just want to run for themselves, others can only read

U represents the file owner, and G represents the group where the file is located. o denotes others; R table readable, W table writable, x table can be run

chmod g+x filename//Same group of people to perform

9. Clear, date command

Clear: Clear screen, quite with DOS Cls;date: Displays the current time.

Mount Mount A hardware device umount Uninstall device

Usage: Mount [parameter] mount point of the device to be mounted

Eg:mount/dev/cdrom

Cd/mnt/cdrom//Enter the disc directory

One. su switches to another person's identity without exiting the login

Usage: SU-L User name (if user name is default, switch to root state)

Eg:su-l netseek (Switch to netseek This user, will be prompted to enter the password)

Whoami,whereis,which,id .

WHOAMI: Confirming your identity

Whereis: Query the directory where the command resides and the directory where the Help document resides

Which: Query the directory where the command is located (similar to Whereis)

ID: Print out your UID and GID. (UID: A unique identification of the user identity.) GID: User group identity unique identity. Each user can only have a unique UID and GID)

Eg:whoami//Display your self-logged in user name

Whereis bin Displays the directory where the bin is located and will be displayed as:/usr/local/bin

Which bin

Grep,find .

grep: text content search; find: File or directory name, and permissions belong to the main matching search

EG:GREP Success */* Find files containing success characters in all files under the current directory

Kill kills a process that is running or is already in the Dest state

eg Kill Ax

passwd can set the password

The commands used by the history user

Eg:history//can display commands used by the user in the past

.pwd View the current directory full path

EG:PWD//view current directory path

mkdir Creating a directory

Eg:mkdir Netseek//create Netseek this directory

. Tar decompression command

EG:TAR-ZXVF nmap-3.45.tgz//unzip this into the nmap-3.45 directory.

finger can allow users to query some other user's information

Eg:finger//View the user's usage profile

Finger root//view root information

shutdown, halt, reboot shutdown or restart commands

Eg:shutdown-h now//shutdown immediately

fdisk view disk partition status

EG:FDISK-L//view disk partition status

Ping to see if the network is connected

ifconfig View or configure network-related parameters, such as IP address

Eg:ifconfig eth0 192.168.2.20//Set IP address

uname Display information about the current operating system

Linux Shell Common directives

Related Article

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.