System Management: Shell basic commands 1

Source: Internet
Author: User

1.shell Introduction

Command line: The interface for the user to enter a command, which itself only accepts input and passes the command to the command interpreter.

Shell:shell is a command interpreter and a program that provides a line-oriented, interoperable interface between the user and the operating system.

The user enters commands at the command line and the shell running in the background sends the command to the operating system disk.

Shell type: BASH TCSH shell Z-shell different shells provide an endless range of syntax and features

2. Command line completion and wildcard characters

2.1 Command Line completion

The command line applies to all Linux commands.

Enter the first few characters of the file, and then press the TAB key, the shell will complete the file name, if more than one file with the beginning of the type of characters press two Tab,shell will list all the files that begin with the characters you typed.

If the current directory has a a,asom,buring file.

To view the contents of a file: Enter the cat b<tab>at the command line, and the shell automatically complements the cat buring. Enter the cat a<tab><tab>, The shell lists the a,asome file.

2.2 Wildcard characters

* Match characters of any length

? Match only one character

[] matches the characters in the inside, which is available in []--that represents the character set range including the upper and lower bounds.

Current directory has t1,t2,t3,t44,ta,tb,tc,td.cpp,q.cpp

$ ls *.cpp Result: td.cpp,q.cpp

$ ls t? Results: T1,T2,T3,TA,TB,TC

$ ls t[1a] Results: T1,ta

$ ls t[1-3] results; t1,t2,t3

$ ls t[a-c] Results: TA,TB,TC

3. viewing directories and files

3.1 Display current directory: $ pwd

3.2 Changing the directory:

$ CD. Return to upper level directory

$ CD.  /.. Go to the root directory, i.e./directory

$ CD or CD ~ Return to user home directory

3.3 View catalog contents: ls

3.4 Viewing text files: Cat pagination Displays longer text: more

3.5 Display the beginning of the file: Head display end of file: tail

3.6 Less is more powerful than much. Less is more like a text editor

3.7 grep Find File contents

3.8 Find the specified file and directory

3.9 Locate command to increase the speed of searching files by implementing database creation

3.10 Whereis command to find the location of a specific program

3.11 who command to see who is currently recording the system

3.12 uname Displays information about the current system version

3.13 Man command to get help for a command

3.14 whatis command, apropos back to a command

  

      

System Management: Shell basic commands 1

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.