Learn Linux command

xiaoxiao2021-03-02  42

Linux, developed to the present, have a lot of versions, and the Linux developed by different companies is different. One Dragon Sheng Jiuzi, the child is different, used to describe Linux, the most suitable.

Although Linux is free, it is indeed a very excellent operating system, which has the advantages of reliable, stable, speed, and has a strong power based on the Unix version of the UNIX version than MS-Windows. Below, as a typical DOS and Windows users, let us learn some of Linux's major orders, I hope everyone can enter the world of Linux as soon as possible.

First, start

Linux's startup operation procedure and DOS are similar (even though, as the operating system itself, Linux works more than DOS when starting and exiting), or by pressing the Ctrl Alt Del three button to start. Start. Different is that Linux is started to the end, you need to log in. Below is a typical login process:

...... Redhat Linux Release 5.1 Kernel 2.0.32 on AN i686 login:

You type: root

After the computer displays the output command (Password :), enter your password (if you start start, you are in the password you entered during installation). When a computer has a "#" prompt, you indicate that you are successful!

[root @ localhost root] #_linux prompt C: /> _ DOS prompt

Second, some orders commonly used:

1. Display the file directory command ls (DOS is DIR)

Display files and directories in Linux (of course, you can still use DIR commands, just here). For example: #LS

Root MNT Boot Dev Bin USR Xiong TMP ETC Games

It seems that it seems simple (it is equivalent to "DIR / W" in DOS), but you will find some difficulties you see, what is the directory which is the file is not clear, what is the executable file? Don't close? Please enter: #LS -F root / mnt / boot / dev / bin / usr / xiong * TMP / etc / games / readme

See you clearly, bring * for executable (equivalent to EX and COM files in DOS), with / for subdirectory, and other universal files. In addition, we can use the LS -L to display the details of the file directory (equivalent to the DIR command in DOS). Thousands of attention are case sensitive !! Rustus, such as ls -f; ls, etc. are wrong. In addition, there are many parameters in the LS command, you can use Man LS or LS - Help to learn more.

2. Change the current directory command CD (DOS CD)

In DOS, we can use C: /> CD / MNT / CDROM or CD / MNT / CDROM C: / MNT / CD / MNT / CD .. or CD .. or CD / or C: / MNT> CD / and in Linux is CD / MNT / CDROM, the case of the directory name must be the same, and there must be spaces after the CD. PWD displays the current directory CD .. must be lowercase, must have space CD / total directory /, CD and / must have spaces

3. Creating subdinders MKDir (MD or MKDIR under DOS) can only use mkdir in Linux, with relative paths and absolute paths, compare: c: /> md xiong or MD / Xiong or MD / Xiong DOS system [root @localhost /] # mkdir xiong or MKDIR / XionG Linux system

4. Delete subdirectory command RMDir (DOS is RD)

Delete subdirectory in Linux, for example: RMDIR / MNT / CDROM is equivalent to RD / MNT / CDROM Note: Like DOS, the subdirectory to be deleted must be empty, and must be deleted in the previous directory The next subdirectory.

5. Delete the file command RM (DOS is DEL or EARSE)

Remove files with RM commands in Linux, example: RM /UCDOS.BAT is equivalent to del /ucdos.bat

6. Document Renname Command MV (REN or RENAME Under DOS) Use mv commands in Linux to rename, Example: MV / MNT / FLOPPY P Description: MV command in Linux in addition to files Outside the rename, there is also a function of file movement. Please see examples: MV / MNT / FLOPPY / BIN is equivalent to command MOVE / MNT / FLOPPY / BIN in DOS

7. Document copy command CP (DOS is COPY)

File replication with the CP command in Linux, example: CP / UCDOS / * / FOX is equivalent to copy /ucdos/*.* / fox Note: *. * In DOS is replaced in linux.

8. Get the help information command Man (DOS is HELP)

Get help information in Linux, for example: MAN LS is equivalent to Help Dir Ls - Help equivalent to DIR /

9. Show the contents of the file Less (Type under DOS)

Use the Less command in Linux to display the file, for example, we want to display the contents of MWM.LX under the Man1 subdirectory, just enter: [root @ localhost man1] #less mwm.lx

I.e. In Linux, we can also display file content with another command "more", for example: more mwm.lx. You will see that these two commands are very similar, in fact, the functionality of the Less command is better than more, you can explore yourself. In Linux, there is also a command to read the reading files in DOS, which are the head and tail commands, which are used to display some of the heads and rear parts of the file. Use the format: Head (tail) [m]

, When default N, 10 lines are displayed, for example:

Head /usr/man/mwm.lx display file MWM.LX top 10 lines of content head 15 /usr/man/mwm.lx Display file MWM.LX 1 TAIL 17 /usR/MAN /MWM.LX display 17 lines of file MWM.LX

10. Redirection and pipelines know that in DOS, we can make some special operations with the redirection and pipeline, such as: Dir> Direct put the current directory into the file direct; type readme >> Direct, will file The content of the readme is appended to the file Direct; as: Type Readme.txt | More, page display text file readme.txt content. The redirection in Linux is almost the same as the operation in DOS, and the above two examples should be in Linux: LS> Direct; Less Readme.txt | more (Note: In fact, more and less command in linux Itself has a paging function).

11. Shell: Command Interpreter (Command)

In the DOS system, most users are using a command intermand.com command interpreter. Of course, you can also exchange Dosshell after Norton or DOS4.0. In Linux, there are several shells. Common: ASH, BASH, KSH, TCSH, ZSH, etc., from the above environment variables shell = / bin / bash can see which shell you use, where it is. The default computer is generally BASH.

The DOS function is similar to the Linux command, and Linux is a multi-user, multitasking operating system, and its powerful features are far more than this. I am still waiting for you to discover.

转载请注明原文地址:https://www.9cbs.com/read-31621.html

New Post(0)