"Brother even experience skills" some of the help commands that Linux novices should know

Source: Internet
Author: User
Tags exit in locale

The real power of Linux is his "command line." Every Linux command is actually a program, and with these commands we can do a lot of things. What commands should be used to solve the difficulties? The mini-series will introduce you to a few common help commands.

How to ask for help?

if you have problems with Linux, the most important thing is to ask for your own help, here are three ways to find help.

Mans

Man is the Linux help manual, the manual. Because most programs bring their own manuals, you can get help with the man command. After execution, press Q to exit in the Man page page.

get help with LS

$ man ls

See how many (for different aspects) of the same name manual

$ man-f ls

LS (1)-List Directory contents

LS (1p)-List Directory contents

View a specific manual

$ man 1p ls

Info

Unlike man, you can jump across nodes like a Web page.

Start browsing from the first page of the document

$ info

Get help for a specific program

$ info Program

Help

In addition to the above two methods, there is a simple way to use, that is , the--help parameter, the general program will have this parameter, will output the simplest and most useful introduction.

$ Man--help # # # get man's Help

$ Info--help # # # Get help with Info

$ ls--help # # # get help with LS

How to do it simple?

in the Terminal (terminal), there are many operating techniques, here are a few simple.

Cursor

Up (on the arrow keys) can bring up the input history execution record, quickly executes the command

Down (arrow key) Mate up select history execution record

Home move cursor to the beginning of the bank

End moves the cursor to the end of the bank

PgUp PAGE Up

Padn PAGE Down

CTRL + C terminates the current program

Tab completion

Tab completion is a very useful feature that can be used to automatically complete commands or filenames, saving time and accuracy.

Double-press two times without input status TAB Lists all available commands

You have entered a partial command name or file name, press Tab for automatic completion, multi-use you will certainly like.

Common Commands

The following commands are arranged according to the usual frequency of use.

Cd

A CD is a command to open a path, that is, to open a folder and jump to that location.

$ cd Path # # # path for the path you want to open.

where path has an absolute path and a relative path, the absolute path emphasizes from/onwards until the path is located. Relative path is compared to the current path, assuming that the current home directory has etc folder (absolute path should be/home/username/etc), if the direct CD etc into this folder, but if cd/etc/is to enter the system etc, more pondering can be understood. In addition, in Linux,. Represents the current directory,.. Represents the parent directory, so the parent directory can be returned to CD. 。

Ls

LS is list, listing files.

$ ls # # # only lists the current directory visible files

$ ls-l # # # Lists the current directory visible file details

$ LS-HL # # # Listing details and displaying the file size in a readable size

$ ls-al # # # list all files (including hidden) details

Note: Linux in the. The files or folders that begin with are hidden files or hidden folders.

Pwd

The PWD is used to return the name of the current working directory, which is the absolute path name.

$ pwd

/home

Mkdir

MkDir is used to create a new folder.

$ mkdir Folder

$ mkdir-p Folder/subfolder # #-P parameter is ignored when the parent directory exists and is established if it does not exist, using this parameter to create a multilevel folder

Rm

RM is remove to delete the file.

$ rm FileName # # # Delete filename

$ rm-i FileName # # # # before deleting the filename prompt, if multiple files each prompt

$ RM-RF folder/subfolder/# # # recursively deletes all files and folders under subfolder, including subfolder itself

$ rm-d Folder # # # Delete Empty folders

Cp

The CP is copy and the file is copied.

$ CP Source Dest # # # will copy source to Dest

$ cp folder/* Dest # # # Copy all Files under folder (without files in subfolders) to Dest

$ cp-r Folder Dest # # # Copies all files under folder (including all files in subfolders) to Dest

Mv

The MV is the move that moves the file.

$ MV Source folder # # # to move source to folder, after completion is Folder/source

$ mv-i Source Folder # # # # # # # # # # # # # # # # # # # # # # #

$ mv Source Dest # # # in Dest not directory, rename source to Dest

Cat

Cat is used to output file contents to Terminal.

$ cat/etc/locale.gen # # # Output Locale.gen content

$ cat-n/etc/locale.gen # # # Output Locale.gen content and display line numbers

More

Much like cat, you can view the contents of a file, except that when a document is too long, cat can only show the last content that is covered by the screen, and the front content is not visible. This is where you can display content more than once.

$ more/etc/locale.gen

$ More +100/etc/locale.gen # # # Starting from 100 lines display

Less

Less is similar to more, but less supports scrolling up and down to view content, and more only supports progressive display.

$ less/etc/locale.gen

$ less +100/etc/locale.gen

Nano

The Nano is a simple and practical text editor that is easy to use.

$ nano FileName # # # # Edit filename file, if the file does not exist, then open a new file, if you save on exit, create the file

after editing,Ctrl + X prompts to save, press Y to confirm the save.

Note: You can use Ctrl + G to get help during usage.


"Brother even experience skills" some of the help commands that Linux novices should know

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.