Before we begin to learn Linux formally, we first need to understand what Linux is, how it came from, and some basic commands to understand it, and below I will tell you my basic knowledge of Linux from 6 points.
1, describe the composition of the computer and its functions.
The computer consists of four parts, namely CPU, memory, input device and output device.
CPU: Arithmetic, controller, register, cache, provide logic calculation and control.
Storage: Memory, RAM, cache and save data.
Input device: Next instruction, provide data.
Output device: Result of output data processing
2. List Linux distributions by series and describe the connection and difference between different distributions.
There are hundreds of types of Linux distributions, which can be divided into:
Debain:ubuntu,mint,knoppix
Slackware:s.u.s.e,sles,opensuse,slax,
Redhat:RHCL:redhat Enterprise Linux
They all release a new version every 18 months.
Centos: Compatible with RHCL format
Kirin: Winning software
Fedora: Release a new version every 6 months
ArchLinux: Light weight and simplicity
Gentoo: Extreme Performance with no traditional installation program
Lfs:linux from Scrath homemade Linux
Android:kernel+busybox (tool Set) +java virtual machine
3, describe the philosophy of Linux, and according to their own understanding of its interpretation of the description.
One, everything is a file (including hardware): Everything is file, in the Linux system it will almost all of the resources are abstracted into file form, of course, including hardware devices and even communication interfaces and so on.
Second, small, single-use procedures: small single, a program to do only one thing, and to do it well.
Third, linking the program, together to complete the complex task: by a number of functions of a single small program linked together to complete complex tasks.
Avoid confusing user interface: Unlike the instability of the Windows operating system user interface, Linux tries to avoid interacting with the user, so that the system can be stable and fast, and realize automation tasks in a programmatic way.
V. Configuration data is stored in text: Linux systems use text files to save configuration information.
4, description of the use of the command on the Linux system format, details Ifconfig, Echo, TTY, STARTX, export, pwd, history, shutdown, Poweroff, reboot, Hwclock, the use of the date command , and is elaborated in conjunction with the corresponding example.
Syntax general format for commands:
#COMMAND OPTIONS ARGUMENTS
Ifconfig: Configuring and displaying network parameters for network interfaces
Echo: Used to print the value of a shell variable in the shell, or to output the specified string directly
Grammar
Echo (options) (parameters)
Options
-E: Activates the escape character.
When using the-e option, if the following characters appear in the string, they are handled in particular, not as general text output:
\a issued a warning sound;
\b Delete the previous character;
\c finally not add the line break symbol;
\f the line but the cursor remains in its original position;
\ n Wraps and the cursor moves to the beginning of the line;
\ r The cursor moves to the beginning of the line, but does not wrap;
\ t Insert tab;
\v is the same as \f;
\ insert \ Character;
\NNN inserts the ASCII character represented by the NNN (octal);
Parameters
Variable: Specifies the variable to print.
Instance
Use the echo command to print text with color:
Text color:
TTY command: Displays the file name of the terminal connection standard input device
Grammar:
TTY [-s][--help][--version]
Parameters:
- -S or--silent or--quiet do not display any information, only return status code
- --help online Help
- --version displaying version information
Example: ctrl+alt+f1-7 can switch freely
。。。。
The STARTX command is used to start the X window, and the program that actually launches X window is xinit.
Grammar
StartX (parametric)
Parameters
Client and Options: x client and options;
Server and options: X Server and Options.
Instance:
To start an X session on a workstation or x terminal, enter: StartX
Export: Used to output a shell variable as an environment variable, or to output a shell function as an environment variable
Grammar
Export (options) (parameters)
Options
-F: Represents the function name in [variable name];
-N: Deletes the specified variable. The variable is not actually deleted, but is not exported to the execution environment of the subsequent instruction;
-P: Lists all the environment variables that the shell assigns to the program.
Parameters
Variable: Specifies the environment variable to output or delete.
Instance
View environment variables that already exist
PWD: Displays the user's current working directory as an absolute path
Grammar
PWD (option)
Options
--HELP: Display Help information;
--version: Displays version information.
Instance
History: Used to display a specified number of command commands, to read a directory from a historical command file to a history command buffer and to write a directory in the history command buffer to a command file
Grammar
History (options) (parameters)
Options
-C: Clears the current History command;
-A: Writes the command in the history command buffer to the history command file;
-r: Reads commands from the history command file into the current History command buffer;
-W: Writes the current History command buffer command to the history command file.
Parameters
N: Prints the most recent n history command.
Instance
Using the history command to display the most recently used 10 historical commands, enter the following command:
Shutdown: System shutdown command
Grammar
Shutdown (option) (parameter)
Options
C: When the "shutdown-h 11:50" command, just press the + key to interrupt the shutdown instructions;
-F: Do not perform fsck when restarting;
-F: Perform fsck upon reboot;
-H: Shut down the system;
-K: Just send out information to all users, but not actual shutdown;
-N: Do not call the INIT program to shut down, but by the shutdown themselves;
Restart after-r:shutdown;
-t< seconds;: How many seconds to delay between sending the warning message and deleting the message.
Parameters
[TIME]: Set how long after the execution of shutdown instructions;
[Warning message]: information to be transmitted to all logged-in users.
Instance
Specify to shut down immediately: #shutdown –h now
Specifies that the computer shuts down after 2 minutes and gives the prompt message
Poweroff: Used to shut down the computer operating system and power off the system
Grammar
Poweroff (option)
Options
-N: Do not perform sync operation when shutting down the operating system;
-W: does not really shut down the operating system, only in the log file "/var/log/wtmp";
-D: When the operating system is shut down, the operation is not written to the log file "/var/log/wtmp" to add the corresponding record;
-F: Force shutdown of the operating system;
-I: Shut down all network interfaces before shutting down the operating system;
-H: Set all hardware in the system to standby mode before shutting down the operating system.
Instance
If you confirm that no user exists in the system and all data is saved, you need to shut down the system immediately, you can use the Poweroff command.
To shut down the system immediately using Poweroff: #poweroff
Reboot: Restarting a running Linux operating system
Grammar
Reboot (option)
Options
-D: Do not write data to the record file/var/tmp/wtmp when rebooting. This parameter has the effect of "-n" parameter;
-F: Force reboot, do not invoke the function of shutdown instruction;
-I: Close all network interfaces before rebooting;
-N: Do not check whether there is an unfinished program before re-booting;
-W: Test only, do not actually reboot the system, will only write the data of the reboot to the Wtmp record file in the/var/log directory.
Instance
Reboot//re-boot.
REBOOT-W//Do a reboot of the simulation (only the record does not really restart the boot).
Hwclock: is a hardware clock access tool that can display the current time, set the hardware clock time and set the hardware clock as the system time, or set the time of the system time to the hardware clock.
Grammar
Hwclock (option)
Options
--adjust:hwclock each time the hardware clock is changed, it is recorded in the/etc/adjtime file. Using the--adjust parameter, the Hwclock can be used to estimate the deviation of the hardware clock based on the previous records and to correct the current hardware clock.
--debug: Displays detailed information on hwclock execution;
--directisa:hwclock presets to access hardware clocks from/DEV/RTC devices. If not accessible, this parameter can be used to access the hardware clock directly with the I/O instruction;
--hctosys: Adjust the system clock to match the current hardware clock;
--set--date=< Date and time;: Set hardware clock;
--show: Displays the time and date of the hardware clock;
--SYSTOHC: Adjust the hardware clock to match the current system clock;
--test: Test only the program without actually changing the hardware clock;
--UTC: To use GMT, add this parameter, Hwclock will perform the conversion work;
--version: Displays version information.
Instance
View the current hardware date and time
Date: Displays or sets the system time and date
Grammar
Date (option) (parameter)
Options
-d< string: Displays the date and time that the string refers to. Double quotation marks must be added before and after strings;
-s< string;: Sets the date and time according to the string. Double quotation marks must be added before and after strings;
-U: Display GMT;
--help: Online Help;
--version: Displays version information.
Parameters
<+ time date format;: Specifies the date and time format to use when displaying.
List of date format strings
%H hours, 24-hour (00~23)
%I Hours, 12-hour (01~12)
%k hours, 24-hour (0~23)
%l hours, 12-hour (1~12)
%M min (00~59)
%p Show AM or PM
%r display time, 12-hour system (HH:MM:SS%p)
%s from January 1, 1970 00:00:00 to the number of seconds currently experienced
%s Display seconds (00~59)
%T display time, 24-hour system (HH:MM:SS)
%x shows the format of Time (%h:%m:%s)
%Z Display time zone, date field (CST)
%a week abbreviation (SUN~SAT)
Full name of%A week (Sunday~saturday)
%h,%b month abbreviation (JAN~DEC)
Full name of%B month (January~december)
%c Date and time (Tue Nov 20 14:12:58 2012)
%d the day of the one month (01~31)
%x,%d Date (MM/DD/YY)
%j the first day of the Year (001~366)
%m Month (01~12)
%w Day of the week one (0 for Sunday)
%W Week of the year (00~53, Monday for first day)
The last two digits of the%y year (1999 is 99)
Instance:
Formatted output:
Output after 1 seconds
Set the time
5, how to get the Help information of the command on the Linux system, please detailed list, and describe how the chapters of the man document are divided.
There are two ways in Linux: Internal command: Help command
External command: 1, command to bring the use of a brief format help
#COMMAND---Help
2. User manual: Manual location:/usr/share/man
#man COMMAND
The section of the man document is divided into:
|1| Standard user commands (executable programs or shell commands)
|2| system call (systems calls) functions provided by the kernel
|3| Library Call (library calls) functions within program libraries
|4| Access entry for special files (device files) (/dev) special files (usually found In/dev)
|5| file Format (configuration file syntax), specifying the program run attribute file formats and conventions
|6| Game (games)
|7| Miscellaneous (Miscellaneous) including macro packages and conventions
|8| Management Command System Administration commands
|9| files related to kernel kernel routines
6, please list the Linux distribution version of the basic directory name of the law and function provisions
The rules of nomenclature are defined according to the Fhs:filesystem Hierarchy standard of the file system hierarchy.
/bin: Basic command Program Files available to all users;
/sbin: A tool program for use in system management;
/boot: Each static file that the bootloader must use: Kernel, Initramfs (INITRD), grub, etc.;
/dev: Store special files or device files;
There are two types of devices: Character devices (linear devices), block devices (random devices);
/etc: The configuration file of the system program, can only be static;
/home: The central location of the general family directory; The home directory of each ordinary user is the default subdirectory with the same name as the user name in this directory,/home/username;
/root: Administrator's home directory; optional;
/lib: Provides a shared library for system startup or applications on the root file system (/bin,/sbin, etc.) and provides kernel modules for the kernel
Libc.so.: Dynamic link C library;
LD: Runtime linker/loader;
Modules: The directory used to store kernel modules;
/LIB64:64-bit system-specific path for storing 64-bit shared libraries;
/media: Portable equipment mount point, CDROM, floppy, etc.;
/MNT: Temporary mount point for other file systems;
/OPT: Installation location of the additional application, optional path;
/SRV: Data provided by the current host for the service;
/tmp: A directory for temporary files that can be generated by the program that will generate the temporary file, a write operation for the user, and special permissions;
/USR:USR Hierarchy, globally shared read-only data path;
Bin, Sbin
LIB, lib64
INCLUDE:C program header file;
Share: Storage location of schema-specific files such as command-book pages and self-documenting documents
Local: another level directory;
Installation location of the X11r6:x-window program
SRC: Where the program source files are stored
/usr/local:local hierarchy, which allows the system administrator to install local applications, and is typically used to install third-party programs;
/var:/var Hierarchy, a directory that stores data that is often changed;
Cache Application Cache Data
Lib Variable state information
Local Variable Data for/usr/local
Lock lock files
Log log files and directories
Opt Variable Data for/opt
Run Data relevant to running processes
Spool Application Spool Data
TMP temporary files preserved between system reboots
/proc:基于内存的虚拟文件系统,用于为内核及进程存储其相关信息;它们多为内核参数,例如net.ipv4.ip_forward, 虚拟为net/ipv4/ip_forward, 存储于/proc/sys/, 因此其完整路径为/proc/sys/net/ipv4/ip_forward; /sys:sysfs虚拟文件系统提供了一种比proc更为理想的访问内核数据的途径;其主要作用在于为管理Linux设备提供一种统一模型的的接口;
Basics of getting Started with Linux