Linux first day

Source: Internet
Author: User
Tags clear screen create directory parent directory

Basic use of common Linux commands ls view contents under current folder PWD View directory under current folder clear clear screen cd[directory name] Toggle folder touch[file name] If the file does not exist, create directory rm[file name]  Delete the specified file name rmdir[directory name] Delete the specified directory (empty directory) rm-r [directory name] Delete the specified directory (can be a non-empty directory) shortcut to enlarge the terminal window font display "CTRL + SHIFT plus =" to reduce the font display of the terminal window "CTRL +-" auto-completion After tapping the first few letters of the file/directory/command, press the TAB key if the input is not ambiguous, the system auto-complete if there are other files/directories/commands, press the TAB key (press the TAB key altogether), the system will prompt the command that may exist once used to press up/down The cursor keys can be toggled back and forth between commands that you have used, if you want to exit the selection and do not want to perform the currently selected command, you can press CTRL + C Linux terminal command format commands [-options] [parameter] command: The name, the corresponding function of the English Abbreviation for word or Word [-options]: option that can be used to control commands or omit parameter: arguments passed to the command, which can be 0, one, or more [] for optional Lookup commands Help information--help command--HELP display Comman The Help information for the D command the Man Man command read the command Manual man is Manual ' handbook ' abbreviation, is a Linux provided manual, contains most of the commands, the function of the detailed use of the operator key:
operation Key function
SPACEBAR Show man page next screen
enter key One line of the scroll manual page
b Roll back one screen
f Roll forward one screen
q exit
  Files and directories common commands to view directory contents ls: Lists the contents of the directory, similar to the dir command under DOS list Linux files or directory names can have a maximum of 256 characters. The file at the beginning is a hidden file and requires Ls-a to be displayed. Represents the current directory: Represents the previous Directory LS common option-a displays all subdirectories and files in the specified directory, including hidden files (file names starting with.)-l display file details in a list-LH displays file sizes in a humane way-ALH Show all file sizes (including hidden files) the use of the LS wildcard (also included with the file or directory name suffix) * represents any number of strings (including 0)? Represents any one character, or at least one [] that can match any one of the [ABC] matches in a group of characters [A-f] matches any one of the characters in the range from a to f   switch directory CD changes the current working directory Chang A,b,c E directory Note: All Linux directories and filenames are case sensitive to the CD switch to the current user's home directory (/home/user directory) CD ~  switch to the current user's home directory (/home/user directory) CD .  remain in the current directory Unchanging CD:   Switch to parent directory CD-  can switch back and forth between the last two working directories relative and relative Paths    (/: root)   Create and delete actions touch Create file or modify file time if the file does not exist, you can create a Build a blank file if the file exists, you can modify the last modified date of the file mkdir create a new directory-P can be recursively created directory the name of the new directory cannot be deleted from the existing directory or file with an RM delete file or directory file cannot be recovered after the-R   Recursively delete the contents of the directory, delete the folder must add this parameter-f  force Delete, ignore the nonexistent file, do not need to prompt RM + wildcard use rmdir Delete folder (empty folder)   Copy and move the file Tree command can be Tree chart lists the file directory structure-D displays only the directory CP command function is to copy the given file or directory to another file or directory, the equivalent of a DOS copy command CP source file destination file (the target file is not created)-F already exists in the target file directly overwrite-I overwrite the file before the prompt-R if the given source file is a directory file, then cp    will Recursively copy all directories and files under this directory, the directory file must be a directory name the MV command can be used to move files or directories, or to rename files or directories to the MV source file destination file (the destination file is not created)-I overwrite prompt to view file contents cat file name  &nb Sp View file contents, create file, file merge, append file contents etc. concatenate ' link, merge ' Show all content at once, fit less content-B to non-null output line number-N to output all line numbering There is also an NL command in Linux and a cat -B effect same more filename split screen display file contents suitable for more content space key display next screen enter key down one line B roll back a screen f roll one screen Q exit/word search word string grep search text      File name search text file content powerful Text Search tool grep allows pattern lookups on text files (regular expressions)-n displays matching rows and line numbers-V displays all rows that do not include matching rows (equivalent to inverse)-I ignores case two pattern lookups commonly used: ^a  the beginning of the line, searching for lines beginning with a ke$, searching for lines ending in ke other echo text content   Displaying the specified text in the terminal, usually in conjunction with redirection, you can create and write content   REDIRECT > and > > Linux allows the command execution results to be redirected to a folder that should be output/appended to the specified folder on the terminal > represents the output, overwriting the original contents of the file >> representing the Append, and appending the content to the end of the existing file redirects can save the output and nbsp;  pipeline |  the output of one command through the pipeline as the input of another command Common Pipeline command: More split-screen display content grep queries the specified text based on the result of the command execution   

Linux first day

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.