Beginner--linux First Lesson

Source: Internet
Author: User
Tags arithmetic echo command time and date


The composition and function of the computer

Computer systems consist of hardware systems and software systems. Computer hardware systems usually have "five bulky" components: input devices, output devices, memory, operators, and controllers.

650) this.width=650; "src=" http://s8.sinaimg.cn/large/b7aab809hcfb18b82d5d7&690 "alt=" B7aab809hcfb18b82d5d7 &690 "/>

input Device data, programs, text symbols, images, sounds and other information to the computer. The commonly used input devices are keyboard, mouse, touch screen, digital converter and so on.

Output Device Print or display the results of the computer's operation or the intermediate results. Common output devices are: monitors, printers, plotters and so on.

Memory The memory stores the information received by the input device in binary data form into memory. There are two kinds of memory, called internal memory and external memory respectively.

Arithmetic Device an operator is a device that accomplishes various arithmetic and logic operations, and can perform mathematical operations such as addition, subtraction, multiplication, and addition, and can be compared, judged, searched, and logically operated.

Controller The controller is the center of the computer to command and control the work of other parts, and its working process is the same as the human brain directing and controlling the human organs.


The controller is the command center of the computer, which decides the order of executing the program and gives the operation control commands required by the machine parts when executing the instruction.

It is composed of program counter, instruction register, instruction decoder, timing generator and operation Controller, which is the "decision-making organ" of issuing the command, which is to complete the operation of coordinating and directing the whole computer system.

Main functions:

Remove an instruction from memory and indicate the next instruction in the in-memory location

The instruction is decoded or tested, and the corresponding operation control signal is generated in order to initiate the specified action;

Directs and controls the direction of data flow between the CPU, memory, and input/output devices.

The controller gives the control information according to the command given beforehand, so that the whole computer instruction is executed step-by-step, which is the nerve center of the computer.


Distribution of Linux

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s4.51cto.com/wyfs02/m02/87/51/wkiom1fcnnnic9staachhkpstu8187.png "title=" qq picture 20160917090729.png "alt=" Wkiom1fcnnnic9staachhkpstu8187.png "/>

Linux is a set of free-to-use and free-to-propagate classesUNIX Operating system, is a POSIX-and Unix-based multiuser, multitasking, supportMultithreadingand a multi-CPU operating system. It can run major UNIX tools software, applications, andNetwork protocol. It supports 32-bit and 64-bit hardware. Linux inherits the design idea of Unix as the core of network, and is a stable multi-userNetwork operating system.

commands on a Linux system


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/87/4E/wKioL1fcoC_iRTG9AAA3t5MCgjk094.png "title=" Linux command Daquan. png "alt=" Wkiol1fcoc_irtg9aaa3t5mcgjk094.png "/>

Ifconfig

Syntax ifconfig (parameters)


add< Address: Set the IP address of the network device IPV6;

del< Address: Delete the IP address of the network device IPV6;

Down: Closes the specified network device;

< hardware address;: Set the type and hardware address of the network device;

IO_ADDR: Set the I/O address of the network device;

IRQ: Sets the IRQ for the network device;

media< network media type;: Set the media type of network equipment;

mem_start< memory Address: Set the starting address occupied by the network device in main memory;

Number of metric<;: Specifies the number to be added when calculating the number of packets to be transferred;

mtu< byte;: Sets the MTU of the network device; netmask< subnet mask;: Sets the subnet mask of the network device;

tunnel< Address: Establish the tunnel communication address between IPV4 and IPv6; up: Start the specified network device;

-broadcast< Address: Packets destined for the specified address are treated as broadcast packets;

-pointopoint< address;: Establish a direct connection with the network device of the specified address, this mode has the secrecy function;

-promisc: Turn off or start the promiscuous mode of the specified network device;

IP Address: Specifies the IP address of the network device; network device: Specifies the name of the network device.


The echo command is used to print the value of the shell variable in the shell, or to output the specified string directly. The echo command of Linux, which is very common in shell programming, is often used when printing variable value under a terminal, so it is necessary to understand the use of the echo command to display a piece of text on the display, generally acting as a hint
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);


the PWD command displays the user's current working directory as an absolute path. command to write the full path name of the current directory (from the root directory) to standard output. All directories are used/delimited. The first/represents the root directory, and the last directory is the current directory. The PWD command immediately learns the absolute path name of the working directory where you are currently located.

History history Command shell built-in command the history command is used to display a specified number of command commands, to read the contents of the historical command file into the historical command buffer and to write directories in the historical command buffer to the command file. When this command is used alone, only historical commands are displayed, and symbols can be used on the command line! The history command that specifies the ordinal is executed. For example, to perform a 2nd history command, enter! 2. The history command is stored in memory and is automatically saved or read when you exit or log in to the shell. In memory, the history command can only store 1000 historical commands, which are controlled by the environment variable histsize.

syntax History (options) (parameters)

Option-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.

reboot command to restart Linux operating system
syntax Reboot (option)  

Option-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.

The Poweroff command is used to shut down the computer's operating system and power off.

Syntax poweroff (option)

Option-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.

The date command displays or sets the system time and date. Many shell scripts need to print time or date in different formats, and to perform actions based on time and date. Latency is typically used during script execution to provide a period of time to wait. Dates can be printed in multiple formats, or you can use commands to set a fixed format. In a Unix-like system, a date is stored as an integer that is the size of the number of seconds since world standard Time (UTC) January 1, 1970 0:0 0 seconds elapsed.

Syntax Date (option) (parameter)

Option-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.


Help commands for Linux systems

The man command is a help instruction under Linux, which allows you to view information such as instruction help, configuration file Help, and programming help in Linux.

Syntax Man (option) (parameter)

Option-A: Search in all man help manuals;

-F: Equivalent to the whatis instruction, displaying a short description of a given keyword;

-P: Use a paging program when specifying content;

-M: Specifies the path of the man manual search. Parameter number: Specifies which man manual to search for help; keyword: Specifies the keyword to search for help.


help command to display she Help information for ll internal commands. The help command can only display command assistance information inside the shell. The Help information for external commands can only be viewed using the man or Info command.

syntax Help (optional) (parameters) option-S: output short format help information. Includes only the command format.


Linux Base Directory

Linux file idea, everything begins with the root

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/87/4E/wKioL1fcpfHi6-P0AADNQB0diow603.jpg "title=" QQ picture 20160917100742.jpg "alt=" Wkiol1fcpfhi6-p0aadnqb0diow603.jpg "/>

Beginner--linux First Lesson

Related Article

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.