Marco 2016 new Linux+python high-end operation Viban first week

Source: Internet
Author: User
Tags add numbers log log

Describe the composition and function of the computer.

A: Modern computer systems follow the von Neumann architecture, which consists of the following components:

Arithmetic: Used for binary arithmetic and logic operation;

Controller: Used to control the coordination of computer components, is a scheduling control center;

Memory: Used to store data, usually referred to as memory. Store the data that participates in the calculation including the result;

Input device: Used to enter data into a computer, such as a keyboard;

Output device: Displays the result or process of computer calculation, such as a display, printer;

Where the operator and controller are concentrated in the CPU, the input/output device is the device by which the computer interacts with the person.


Second, listing Linux distributions by series and describing the links and differences between different distributions.

A: Linux distributions:

Slackware: (The oldest active maintenance Linux distribution)

SuSE (two releases based on Slackware, free to use) (the most popular distribution in Europe)

openSUSE (three releases based on Slackware)

Debian: (original version)

Ubuntu (secondary release) (with beautiful gorgeous desktop)

Mint: (Three-time release version)

Redhat

Rhel:redhat Enterprise Linux (Corporate Edition) (release a new version every 18 months)

CentOS: Rhel-compatible format, re-compiled once (program community organization maintenance)

Fedora: Release a new version every 6 months (main test software, test stability)

ArchLinux

Gentoo

Lfs:linux from scratch (this new version is not a CD-ROM, is the first book, we have to do a Linux, guidance document only)

Android:kernel+busybox+java virtual Machines

Gnu:gplv2, GPLv3, LGPL (Lesser)

Apache:apache

Bsd:bsd


Third, describe the philosophy of Linux, and according to their own understanding of its interpretation of the description.

A: 1. All files, all files in the computer directory, and almost all resources, including hardware devices are organized into file format.

2. A single function program (composed of many small programs, a program to complete a function, and many small programs can be combined to complete a complex task.) )

3. text File Save configuration information

4. Try to avoid user interaction (note: Try not to interact with the user, a program once run, there is no need for users to do anything, such as viewing ip:ifconfig, date: dates, etc. )

5. Provide a mechanism, not a policy


Iv. description of the use format of commands on Linux systems; Ifconfig, Echo, TTY, STARTX, export, pwd, history, shutdown, Poweroff, reboot, Hwclock, and date commands are described in detail. , and is elaborated in conjunction with the corresponding example.

Answer: 1, ifconfig: View and configure network devices.

ifconfig [Interface]ifconfig interface [Aftype] options | Address ...

Format: ifconfig

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/85/EF/wKioL1ev7hHhW1QEAAA6tw6CjlI391.png "title=" aep@ex6u) RFM%BD}]) 2) 38y.png "alt=" Wkiol1ev7hhhw1qeaaa6tw6cjli391.png "/>

To enable or disable the network card, use the following command.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/85/EF/wKioL1ev7tPjw-reAAAGN_HFSQA307.png "title=" ta~ 6t@16t45~7u ' Ieqfe5h9.png "alt=" Wkiol1ev7tpjw-reaaagn_hfsqa307.png "/>

Up: Indicates enabled down: Indicates disabled

2, Echo: Echoing, printing, formatted output:

[[email protected] ~]# echo Hello, hello.

-N Non-wrapping display (prevents the automatic addition of line breaks.) )

[Email protected] ~]# echo-n Hello hello [email protected] ~]#

-E allows the use of the transfer character \t,\n,\b (BACKSPACE), \c ...;

[Email protected] ~]# echo-e ho "\b" w is you? # (b: Delete the previous character) HW is you?  [Email protected] ~]# echo-e ho "\ t" W is you? # (\ t: Insert tab.) HO W is you?  [Email protected] ~]# echo-e Ho "\f" W is you? # (\f: newline, but the cursor begins after the character that is stuck.) ) HO W is you? [Email protected] ~]#

echo "x": X can be a string, or it can be a variable

3,tty: Displays its terminal name, Print the file name of the terminal connected to standard input.

[Email protected] ~]# Tty/dev/pts/0[[email protected] ~]#

4,STARTX: Switch to the Xwindow interface, provided the graphical desktop is installed.

5,export: Setting Global variables

[[email protected] ~]# exportdeclare -x cvs_rsh= "SSH" Declare -x g_broken_ filenames= "1" declare -x histcontrol= "ignoredups" declare -x histsize= "Declare -x"  home= "/root" declare -x hostname= "Localhost.localdomain" declare -x lang= "En_US". UTF-8 "Declare -x lessopen=" | | /usr/bin/lesspipe.sh %s "declare -x logname=" root "declare -x ls_colors=" rs=0:di=01;34: ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43 : ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*. lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*. Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31 :*. deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*. Jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35 :*. png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35 :*. mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:* . asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf =01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac= 01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01 ; 36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36: "Declare -x mail="/var/spool/mail/ Root "declare -x oldpwddeclare -x path="/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/ Bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin "declare -x pwd="/root "declare -x qtdir="/usr/ lib64/qt-3.3 "deClare -x qtinc= "/usr/lib64/qt-3.3/include" declare -x qtlib= "/usr/lib64/qt-3.3/lib" declare  -x selinux_level_requested= "" Declare -x selinux_role_requested= "" declare -x  Selinux_use_current_range= "" Declare -x shell= "/bin/bash" declare -x shlvl= "1" declare - X ssh_client= "192.168.2.45 61282 22" declare -x ssh_connection= "192.168.2.45  61282 192.168.2.52 22 "declare -x ssh_tty="/dev/pts/0 "declare -x term=" xterm " declare -x user= "Root" [[email protected] ~]#

6,PWD: Show Current path

[Email protected] ~]# pwd

/root

[Email protected] ~]#

7,history: Historical Command

(1), Parameters:
N: number, to list the most recent n-pen commands
-C: Eliminate all history content in the current shell
-A: Add the current New History command to Histfiles, and if there is no histfiles, the default write ~/.bash_history
-r: Read Histfiles's contents into the current Shell's history memory
-W: Writes the current history memory content to Histfiles. Linux system when you enter and execute commands in the shell (console), the shell automatically logs your commands to the history list, which is typically saved in the. bash_history file in the user directory. Save 1000 By default, and you can change this value. If you type history, it will show you the top 1000 historical commands you used, and give them a number, and you'll see a numbered list quickly rolled over the screen. You may not need to see all the items in the 1000 commands, but you can also add numbers to list the most recent n-pen commands. The history command in Linux not only allows us to query historical commands. We can also use the relevant features to help us execute commands. Run a specific historical command history lists all of the history commands that bash has saved and numbers them, and we can run specific historical commands in the same way as the exclamation mark number.

①. List all the history records:

[[Email protected] ~]# history    1  ll    2   ifconfig    3  halt    4  ifconfig     5  ifconfig up eth0    6  vim / etc/sysconfig/network-scripts/ifcfg-eth0     7  service network  restart    8  ll    9  ifconfig    10  ping www.baidu.com   11  ll   12  yum  -y install lrzsz   13  ll   14  sz -bey  install.log   15  rz -bey    16  ll    17  ifconfig   18  trr   19  tty    20  date   21  ll   22  vim install.log    23  ll   24  vim install.log.syslog    25   ll   26  cd /   27  ll   28   cd /usr/local/   29  ll   30  cd src/    31  ll

②, List only the last 10 records

[Email protected] ~]# history echo-e Ho "\f" W is you? C;ear TTY, TTY, clear, export, and 10[[email protect Ed] ~]#

③, executes the command using the command record number, executes the 60th command in the history list

[[email protected] ~]#!60 (my 60th history is echo-e ho "\ t" W is you?) ) echo-e ho "\ t" W is You?ho W is you? [Email protected] ~]#

④, repeatedly executes the previous command

[[email protected] ~]#!! Echo-e ho "\ t" W is You?ho W is you? [Email protected] ~]#

⑤, executes the last command that begins with Echo (!), which is a string that can be randomly lost, and the shell will search forward from the last history command, and the first matching command will be executed. )

[Email protected] ~]#!echoecho-e ho "\ t" W is You?ho W is you? [Email protected] ~]#

⑥. Immediately clears history of all history commands

[Email protected] ~]# history-c

8, Shutdown: safe shutdown or restart

shutdown [OPTION] ... Time [MESSAGE]

-r:reboot restart

-h:halt shut down the machine

-C: Cancel

-K: Prompts the user to shut down/restart, but does not actually execute.

Time setting:

Now: Immediately

+m:m represents minutes, such as +3, indicating 3 minutes after

hh:mm absolute time, specifying the time to execute

9,poweroff: Power off

-F--force Forced restart

-N--no-sync direct reboot without writing memory data to disk

10,reboot: Restart

Normal restart

11,hwclock: The system hardware time, is also the COMs battery uninterrupted power supply, is the computer time no longer loses power condition restores the appearance time.

[Email protected] ~]# Hwclocksun 08:50:59 AM EDT-0.438195 seconds[[email protected] ~]#

Option:-s–hctosys: Adjust the system time to the hardware time

-W–SYSTOHC: Adjust the hardware time, whichever is the system time.

12,date: Show Date

[[email protected] ~]# Datesat 6 23:41:41 EDT 2016[[email protected] ~]#

Date [OPTION] ... [+format]

Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]

Date+[potions]+[+format]

%y year

%m Month

%d days

%d months/day/year

%f Date

%t time

When%h

%m min

%s seconds

%a Short Week

%a Long weeks

Set Date format dates

Date [YYMMDDHHMM[[CC]YY][.SS]]

MM Month

DD Day

HH Time

MM points

YY Short Year

CCYY years format

. SS sec


How to get help for commands on Linux systems, please list them in detail and describe how the chapters of the man document are divided.

Answer, 1.help+command.

2.command+--help (-h)

3.man+command

4.info+command

5. Help documentation for the program itself:/usr/share/doc/command. VERSION

6. View the program's official documentation

7. Official documentation of the release version

8.Google, Baidu

Man manual page sections and contents

Man1 User Commands and applications

Man2 system calls and kernel error codes

MAN3 Library Call

MAN4 device drivers and network protocols

MAN5 standard file format

Man6 Games and Demos

Man7 various files and documents

MAN8 System Administration Commands

Man9 ambiguous kernel specifications and interfaces


Six, please list the Linux distribution of the basic directory name naming law and function provisions

Answer: 1./: Root

2./boot/: System boot directory, kernel file vmlinuz, boot file, boot loader boot loader,grub (boot setup file related);

3./root/:root User home directory;

4./home/user name: normal user home directory;

5./bin/: General Command storage directory;

6./sbin/: Commands that can be operated by power-on or single-user mode;

7./etc/: Configuration file storage directory, INIT.D under the various software startup scripts;

8./dev/: Any device and interface device is stored in this directory as a file, by accessing the file in the directory is equal to access to a device, which is equivalent to the device's entrance, similar to the/dev/null,/dev/zero,dev/tty,/dev/sd*,/dev/ lp*,/dev/hd* and other equipment files;

9./lib/: Basic shared Library, kernel module file/lib/modules;

10./LIB64: Dedicated to the storage location of the secondary shared library files on the x86_64 system;

11./usr/:unix Software resource,linux System installation complete the default installation directory of the software. The equivalent of C:\Windows\ and C:\Program files\ two directories under Windows. /usr/subdirectories include:

①./usr/bin/users can use the command

②./usr/include/Include files

A library of ③./usr/lib/software, a target file, and an executable file or script that is not commonly used.

④./usr/sbin/system commands that are required for non-system uptime.

⑤./usr/local/local software or user-installed software catalog

⑥./usr/share/places a directory of shared files, which have/usr/share/man online Help documentation,/usr/share/doc software Miscellaneous documentation instructions,/usr/share/zoneinfo time zone files related to the time zone.

⑦./usr/src/General source location.

12./var/: Files that have normal changes, including cache, login files (log file), and files generated by certain software operations, including program files (lock File,run file), and possibly MySQL database files. /var/subdirectories include:

(1)./var/lib

(2)./var/cache The cache file generated during the run of the program

(3)./var/lock Lock File

(4)./var/log Log File

(5)./var/run

(6)./var/mail Mail

(7)./var/spool Program Data Pool

①./var/spool/cron

②./var/spool/mail

③./var/spool/mqueue

④./var/spool/lpd

13./opt/: Third-party Software installation directory

14./mnt/: Temporary mount directory

15./media/: such as cdrom,floppy and other temporary media;

16./sys/: Belongs to the virtual file system, in-memory data, such as the kernel, file system, and so on.

17./proc/: Belongs to the virtual file system, in-memory data, such as kernel, program process, external device state, network status, etc., in the dynamic change.

18./srv/:service, some of the data directories that are required to be used by these services after the startup of some network services. Common services are related to WWW,FTP, etc., and different services are in different sub-folders.

19./tmp/: Temporary storage directory, the user can access,

20./selinux/

21.lost+found when a file error occurs, place some missing fragments in this directory.

Marco 2016 new Linux+python high-end operation Viban first week

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.