Linux command

xiaoxiao2021-03-30  237

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. 1. Starting the LINUX start operation process and DOS seems (although, but as the operating system itself, Linux is much more than DOS when starting and exiting), or by pressing the Ctrl Alt Del three button to heat up. 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 appears a "#" prompt, you indicate that you log in success! [Root @ localhost root] #_ linux prompt (now the version is updated, the default is started to the KDE environment, so seeing is similar to Windows. The desktop, and root @ localhost root is just a terminal) C: /> _ DOS prompt

Second, some commands: 1. Display the file directory command LS (DOS Under 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 seems to be simple (it is equivalent to "DIR / W" in DOS), but you will find some difficulties you see, even which is the directory, which 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 is clear, with * is an executable file ( Equivalent to the EXE and COM files in DOS, with / for the child directory, 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 under CD) In ​​DOS, we can use C: /> CD / MNT / CDROM or CD / MNT / CDROM C: / MNT / CDROM> CD .. or CD .. or CD .. C: / MNT> CD / or C: / MNT> CD / and CD / MNT / CDROM in Linux, the case of the directory name must be the same, and there must be space after the CD. PWD displays the current directory CD .. must be lowercase, must have a space CD / total directory /, CD and / must have space 3. Create subdirectory MKDir (MD or MKDIR under DOS) can only use MKDIR in Linux, available Relative path and absolute path, 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 under DOS For RD) Use the RMDIR command 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 in the previous directory The next level subdirectory can be removed. 5. Delete the file command RM (DOS Under DEL or EARSE) Use the RM command in Linux, an example: RM /UCDOS.BAT is equivalent to del /ucdos.bat 6. File Rennames command MV (DOS is REN or RENAME In the Linux, use the mv command to rename, for example: MV / MNT / FLOPPY P Description: In addition to the file change, the MV command in Linux has the function of file movement, please see example : MV / MNT / FLOPPY / BIN is equivalent to command MOVE / MNT / FLOPPY / BIN 7 in DOS 7. File Copy Command CP (DOS Under DOS COPY) File CP Commands 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 Under Help) Get Help Information in Linux, Example: Man LS is equivalent to Help Dir Ls --help equivalent to Dir / 9. Content LESS (DOS TYPE) 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. 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/mn/mwm.lx display file MWM.LX's content head 15 /usr/man/mwm.lx display file MWM.LX before 15 lines Content tail 17 /usr/man/mwm.lx Displays the contents of 17 lines after MWM.LX 10. Redirection and pipeline know, in DOS, we can easily make some special operations with the pipeline, such as : Dir> Direct Adds the current directory into the file direct; Type Readme >> Direct, add the contents of the file readme 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. The above two examples should be in Linux: LS> Direct; Less Readme.txt More (Note: In fact, the more and less command itself in Linux Have a paging function). 11. Shell: Command Interpreter (Command) In the DOS system, most users are using Command.com command interpreters. 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 above Linux commands are only similar to the DOS function, and as a multi-user, multitasking operating system, its powerful features are far more than this. I hope more people use this excellent operating system, I believe you will not regret it.

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

New Post(0)