In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What is the basic knowledge of Linux? in view of this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Basic knowledge:
The disk partition in Linux indicates:
For example, the / dev/hda5: / dev/ directory stores hardware device files, hd represents IDE devices, sd represents SCSI devices, and a represents the sequence number of the hard disk, that is, the first hard disk is a, and the second is b. Wait, just like disk C and disk D under windows, 5 represents the first logical partition. Linux partition consists of primary partition and extended partition, no more than 4 primary partition, logical partition is divided in extended partition, so logical partition starts from 5, regardless of whether the primary partition is full of 4 partitions, the first 4 blocks are allocated to the primary partition.
Similarly, the second logical partition of the second hard disk of a SCSI device is represented as / dev/sdb6
File system type:
The default file system type used in Linux is EXT3 (EXT4), SWAP, and other file system types are also supported, such as FAT16, FAT32, NTFS, XFS and so on.
Directory structure:
Top level: root directory (/). Several important directories under the root directory are: / root,/bin,/boot,/etc,/home,/var,/usr,/tmp. (what content is important in each directory)
Switching of graphic and character operation interface:
Graphical interface-- > character terminal: Ctrl+Alt+Fn (n takes a value of 1x6, why will be described in later notes)
Character terminal-- > character terminal: Alt+Fn
Character terminal-- > graphical interface: Alt+F8
After logging in, the prompt is "#" for root users and "$" for ordinary users.
Shutdown and restart commands:
Restart: shutdown-r now
Shutdown-r + 15 "warning: the system will restart in 15 minutes"
The reboot command also indicates a restart, but unlike shutdown, it is mandatory to restart, and the shutdown command prompts the user to save, so it is recommended to use the shutdown command.
Shutdown: shutdown-h now or halt
Start executing some simple commands:
Note that Linux is case-sensitive, unlike windows, where powershell is not case-sensitive in terms of commands, function methods, and so on.
The code is as follows:
[jzhou@localhost ~] $su-root switch to root user
Password:
[root@localhost ~] # prompt is # after switching to root
[root@localhost ~] # date displays date and time
Tuesday, March 05, 2013, 21:09:09 CST
[root@localhost ~] # echo $LANG shows currently supported languages
Zh_CN.UTF-8
[root@localhost ~] # LANG=en_US setting language
[root@localhost ~] # echo $LANG
En_US
[root@localhost ~] # cal View current monthly Calendar
March 2013
Su Mo Tu We Th Fr Sa
two
4 5 6 7 8 9
11 12 13 14 15 16
18 19 20 21 22 23
25 26 27 28 29 30
[root@localhost ~] # bc Open Calculator
Bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
4. 3.
Quit press the quitters button to leave
[root@localhost ~] #
In addition, mastering some commonly used hotkeys can help improve the speed of commands, such as Tab (auto-populating, and pressing the TAB key twice will result in all commands when there are no commands, which can also be used as a help.) ; Ctrl+C: interrupt the currently running program; Ctrl+D: the end of keyboard input, with Exit;Ctrl+L: clear the screen; Ctrl+U to the beginning of the line; Ctrl+K: clear to the end of the line; "\": force line wrapping.
Linux command help:
Just said that pressing the TAB key twice without typing any command will show all the available commands, this method is not commonly used, the common method is help, the usage is: command-help, commonly used is man help (that is, manual manual), usage is: man command, another help method is info, usage is info command, in fact, this is not very common, because normally man can already solve most of the problems.
In addition, due to the use of man or info command, there will be multiple pages, sometimes do not want to see, press Q to exit the help, and because there is a lot of real information, how can you quickly find what you want? at this time, type "/ the character you want to find" and press enter
You can see what a command does: the whatis command
You can also see where a command is stored: the which command (except cd, because cd is built into the kernel)
Toggle execution level:
View run level: runlevel
Level 0: shutdown (the commands available for shutdown are described in the following notes on the init 0jinit process)
Level 3: pure command line mode, that is, the terminal character mode that we right-click to open in the graphical interface
Level 5: graphical interface mode (as a server, this level is basically not enabled and goes directly to level 3 character mode)
Level 6: restart (restart available command init 6)
Level 1 represents single-user mode, level 2 represents character interface multi-user mode, level 4 is not allocated for use, and these three levels are basically not used. So as long as you know the above four levels. The specific startup process and configuration files will be reflected in subsequent notes.
Classification of Linux commands:
(Linux command: an instruction or program used to perform a function whose execution depends on the interpreter program, such as / bin/bash)
Internal commands: part of the Shell interpreter (can be understood as commands included under bin/)
External commands: programs independent of the Shell interpreter (that is, programs that can be executed without / bin/bash, such as Vim, LVM)
Format of the Linux command:
Command word [option] [parameter] option: used to adjust the specific functional parameters of the command: objects operated by the command, such as files, directories, etc. Options for multiple segment formats can be written together and can only be connected with a "-".
Finally, I think one of the problems I need to figure out is linux shell. In fact, shell is an interface between Kernel and user. Users will not deal with the kernel directly, but the commands entered by users will be recognized by the kernel. This is what shell does.
The answers to the questions about the introduction to Linux are shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.