Linux Study Notes (1) -- getting started

Source: Internet
Author: User

My junior year was the first time I came into contact with Linux. I only knew some simple commands. When I used them again at work, I had to relearn the knowledge and study the system. Now I will record it in the form of study notes, share some simple knowledge and personal opinions. If you have any mistakes, please note.

Basic knowledge:

Disk Partition in Linux:

For example, the/dev/hda5:/dev/directory stores the hardware device files. HD indicates the IDE device, SD indicates the SCSI device, and a indicates the sequence number of the hard disk, that is, the first disk is A, and the second disk is B... in Windows, like drive C, drive d, 5 indicates the first logical partition. Linux partitions are composed of primary partitions and extended partitions. There are no more than four primary partitions. logical partitions are divided in extended partitions. Therefore, logical partitions start from 5, no matter whether the primary partition is full of four partitions, the first four are allocated to the primary partition.

Similarly, the representation of the second logical partition of the second hard disk Of a scsi device is/dev/sdb6.

File System Type:

In Linux, the default file system type is ext3 (ext4) and swap. It also supports other file system types, such as fat16, FAT32, NTFS, and XFS.

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 for each directory)

Switching between the graphic and character operation interfaces:

Graphical interface --> character terminal: CTRL + ALT + FN (N value 1 ~ 6. I will explain why in my subsequent notes)

Character terminal --> character terminal: Alt + FN

Character terminal --> graphic interface: Alt + F8

After logon, if it is a root user, the prompt is "#". If it is a common user, the prompt is "$"

Shutdown and restart command:

Restart: shutdown-R now

Shutdown-R + 15 "Warning: the system will restart in 15 minutes"

The reboot command also indicates a restart, but the difference with shutdown is that it is mandatory to restart, And the shutdown command will prompt the user to save it. Therefore, we recommend that you use the shutdown command.

Shutdown: shutdown-H now or halt

Start to execute some simple commands:

Note that Linux is sensitive to uppercase and lowercase letters, which is different from windows. powershell in Windows is case-insensitive for both commands and function methods.

[Jzhou @ localhost ~] $ Su-root switch to the root user password: [root @ localhost ~] # After switching to root, the prompt is # [root @ localhost ~] # Date: Display Date and Time: Tuesday, January 1, March 05, 2013 21:09:09 CST [root @ localhost ~] # Echo $ Lang display currently supported language zh_CN.UTF-8 [root @ localhost ~] # Lang = en_us language [root @ localhost ~] # Echo $ langen_us [root @ localhost ~] # Cal view current month calendar March 2013 su Mo tu we th fr SA 1 2 3 4 5 6 7 8 910 11 12 13 14 15 1617 18 19 20 21 22 2324 26 26 26 27 28 29 3031 [root @ localhost ~] # BC open the calculator BC 1.06 copyright 1991-1994,199 7, 1998,200 0 Free Software Foundation, Inc. this is free software with absolutely no warranty. for details type 'warranty '. 4*312 press the quit key to exit [root @ localhost ~] #

In addition, it is helpful to master some common hotkeys to speed up the command, such as tab (automatically filled, and when no command is available, if you press the tab twice, all the commands will appear, this can also be used as a help .); CTRL + C: interrupt the current running program; Ctrl + D: Enter the keyboard to end, the same as exit; Ctrl + L: clear screen; Ctrl + u to clear the first line; Ctrl + K: clear to the end of the line; "\": force line feed.

Linux Command help:

If you press the tab key twice without executing any command, all available commands are displayed. This method is not commonly used. The commonly used method is help, and the usage is: Command -- help, commonly used is man help (that is, manual Manual), which is used as the man command. Another help method is info, which is rarely used, generally, man can solve most problems.

In addition, when the man or info command is used, multiple pages may appear. Sometimes you don't want to read more pages. At this time, press Q to exit the help. In addition, due to the fact that there is a lot of information, how can you quickly find what you want? Enter "/the character you want to search for" and press Enter.

You can view the role of a command: whatis command

You can also view where a command is stored: Which command (except Cd, because CD is embedded in the kernel)

Switch execution level:

View running level: runlevel

Level 0: Shutdown (the command init 0 can be used to shut down. The INIT process will be described in the following notes)

Level 3: pure command line mode, that is, the terminal character mode that we right-click on the graphic interface

Level 5: graphical interface mode (this level is basically not enabled as a server, and it enters Level 3 character mode directly)

Level 6: restart (restart the available command init 6)

Level 1 indicates single-user mode, level 2 indicates multi-user mode on the Character interface, and Level 4 is not allocated for use. These three levels are basically not used. Therefore, you only need to know the above four levels. The specific Startup Process and configuration file will be reflected in subsequent notes.

Linux Command classification:

(Linux commands: commands or programs used to implement a function. Command Execution depends on interpreter programs, such as/bin/bash)

Internal commands: part of the shell interpreter (can be understood as the commands contained in Bin)

External command: A program independent of the shell interpreter (that is, it can be executed without/bin/bash, such as vim and LVM)

Linux Command Format:

Command word [Option] [parameter] Option: it is used to adjust the specific function parameters of a command: the object of a command operation, such as files and directories. The options in multiple segment formats can be written together and connected by.

Finally, I think the problem to be clarified is the Linux Shell. In fact, shell is an interface between the kernel and the user, and the user will not directly deal with the kernel, however, the commands entered by the user will be recognized by the kernel, which is the role of shell.

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.