The door to O & M

Source: Internet
Author: User

The door to O & M
1. teaching environment 2. Cloud computing concept 3. Jobs and content 4. Introduction to linux Systems 5. shell concept 6. linux basic command man/help/info/pwd/cd/ls/ mkdir/stat/touch/rm/copy/mv/echo/cat/less/more/tty/pipe 7. Redirection>, 1>, 2>, <<>> 1. teaching environment Linux + VMware WorkStation 2. cloud computing concept cloud computing (cloud computing) it is an Internet-based service increase, use, and delivery model. It usually involves providing dynamic and scalable resources through the Internet and is often virtualized. Cloud is a metaphor for networks and the Internet. Cloud computing even allows you to experience 10 trillion operations per second. With such powerful computing capabilities, you can simulate nuclear explosions, predict climate changes, and develop the market. Cloud Computing is Distributed Computing, Parallel Computing, Utility Computing, Network Storage Technologies, and Virtualization) load Balance, High Available, and other products that combine traditional computer and network technologies. 3. O & M engineers and dba o & M Engineers (Operations) are also called O & M development engineers (Devops) in China and also known as SRE (Site Reliability Engineering) abroad ). Maintains and ensures the high availability of the entire service, and constantly optimizes the system architecture, improves deployment efficiency, and optimizes resource utilization to improve the overall ROI. The biggest challenge facing O & M engineers is the management of large-scale clusters. How to manage services on hundreds of thousands of servers and ensure the high availability of services is the biggest challenge facing O & M engineers. Database Administrator (DBA) is a general term for staff engaged in the management and maintenance of Database management systems (DBMS). It is a branch of O & M engineers, it is mainly responsible for the full lifecycle management of business databases from design, testing to deployment and delivery. The core objective of DBA is to ensure the stability, security, integrity and high performance of the database management system. Iv. linux system Introduction Linux is a free-of-charge and freely-spread Unix-like operating system. It is a POSIX and UNIX-based operating system with multiple users, multi-tasking, multi-thread and multi-CPU support. It can run major UNIX tool software, applications and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits the network-centric Unix design philosophy and is a stable multi-user network operating system. The Linux operating system was born in October 5, 1991 (this is the first official release date ). Linux has many different Linux versions, but they all use the Linux kernel. Linux can be installed on various computer hardware devices, such as mobile phones, tablets, routers, video game consoles, desktop computers, mainframes, and supercomputers. 1. Features: completely free; fully compatible with the POSI1.0 standard; multi-user, multi-task; good interface (KDE, gnome, Xfce, LXDE ); supports multiple platforms (x86, 680x0, iSCSI, and Alpha ). 2. Basic Idea: Linux has two basic ideas: first, everything is a file; second, every software has a definite purpose. 3. file type:-regular file: a file that is generally accessed. According to the file content, it can be divided into plain text files (ASCII) and binary files ); data ). D directory file (directory): directory. L link: similar to the shortcut in Windows. Symbol devices and device Files: some files related to system peripherals and storage are usually concentrated in the/dev directory. There are two types of device files: c (the interface device that stores data for system access, or hard disk) B-character device files (the interface device of the serial port, for example, the keyboard, mouse, and so on ). S socket (sockets): these types of files are usually used for network data connections. You can start a program to listen to the requirements of the client, and the client can communicate with each other through a socket. P pipeline (FIFO, pipe): FIFO is also a special file type. Its main purpose is to solve errors caused by simultaneous access to a file by multiple programs. # Ls/-- view the file structure bin boot data dev etc home jenkins lib lib64 media mnt opt proc root sbin selinux srv sys tmp usr var v. ShellShell is the user interface of the system, provides an interface for users to interact with the kernel. It receives user-input commands and sends them to the kernel for execution. In fact, Shell is a command interpreter that explains the commands entered by the user and sends them to the kernel. In addition, Shell has its own programming language for editing commands. It allows users to write programs composed of shell commands. Like Linux, Shell has many different versions. It mainly includes the following versions of Shell: Bourne Shell: Developed by Bell Labs. BASH: it is the GNU Bourne Again Shell, which is the default shell on the GNU operating system. /Bin/bashKorn Shell: The Development of The Bourne SHell. It is compatible with the Bourne Shell in most aspects. C Shell: the BSD version of SUN Shell. Z Shell: The last shell you'll ever need! Z is the last letter, that is, the ultimate Shell. It integrates important features of bash and ksh, and adds its own unique features. 6. Common Linux commands 1. Linux Commands include internal commands and external commands: Internal commands are transferred to the memory at system startup, Which is resident memory, so the execution efficiency is high. An external command is a software function of the system. It is read from the hard disk only when needed. The system will read the environment variable file. bash_profile and/etc/profile to find the PATH. # Echo $ PATH -- view the paths contained in the path # enable-a -- view all internal commands # type service -- type determines whether the command is internal or external # type pwd -- service is an external command; pwd is an internal command # enable tree -- enable can also be judged 2. linux command syntax rules command-option file3, command help -- man \ help \ info # man passwd -- use man manual to find passwd how to Use the # tree -- help -- external command query method (or-h) command ); not all commands support # help cd -- Internal Command query method # info ls4, working directory switch -- pwd \ cd absolute path: must begin with "/" (Root, it is the only way to describe the path of an object. "/" The root directory is the top-level directory of the linux operating system, and there is no path before it. The directory (partition) Where the operating system is located ). Relative Path: the path is relative, and the path of the object is different from the current path. The relative path of the target object is different. # Pwd -- view the current working directory # cd/usr/local/-- go to the/usr/local directory in an absolute path # cd bin/-- go to/usr in a relative path the bin directory under the/local/directory. How to use absolute mode? # Cd. --. indicates the current directory. This command indicates that the working directory is not active # cd .. -- returns the parent directory of the current directory, that is, the previous level. It also belongs to the relative path # cd--- returns the working directory of the previous time # cd ~ -- To the current user's home directory # cd/usr/local/../lib/... -- where is this ?? 5. list the contents in the directory -- ls # ls -- view the list of objects in the current directory # ls/bin/-- view the files in the/bin directory # ls-l/etc /-- view the file details in the/etc directory, parameter-l-rw-r --. 1 root 46 Apr 22 adjtime '-' is a common file. There are 7 types of files:-dslbcprw-r -- for File Permission # ls-a/root -- display '. 'hidden file, parameter-a # ls-ld/etc/-- view the information of the Directory itself. Parameter-d # ls-lt/data/test -- sort by file creation/last modification 6. create directory -- mkdir # mkdir/data -- create directory in absolute path # mkdir test -- create a directory with relative strength # mkdir dir1 dir2 -- create several directories at the same time # mkdir test/a/B/c-p -- recursively create directories with relative strength, parameter-p7, File status -- stat # stat aa File: 'A' -- File name Size: 0 Blocks: 0 IO Block: 4096 regular empty fileDevice: 803 h/2051d Inode: 1968262 Links: 1 Access: (0644/-rw-r --) Uid: (0/root) Gid: (0/root) Access: 16:54:56. 010977018 + 0 800 -- access time Modify: 16:53:34. 722976466 + 0800 -- modification time Change: 16:53:34. 722976466 + 0800 -- Status Change Time note: the access time only records the File status and the first access time after the content changes. If the modification time and state change time remain unchanged, the access time will not change in Linux even if the file is accessed multiple times. There is no concept of File Creation Time. Only the file access time, modification time, and state change time are allowed. If the file has not been modified after creation, the modification time is equal to the creation time. If the status of the file has not changed after creation, the state change time is equal to the creation time. If the file is not modified after creation, if it has not been read, the access time is equal to the creation time, this is basically impossible 8. Create a file -- touch # touch/data/a # touch test/a # touch a B c # touch file {1, 2, 3 ,} # touch ["a B"] ['a'] [a \ B] -- create a file a B # touch-r a aa -- replace aa with the attribute time of attribute time # touch-d '2017-10-10 'aa -- modify the Object Access time and modification time. Symbol-d # touch-m-d '2017-11-1 'aa -- only modify the file modification time. Symbol-m # touch-a-d '2017-6-6 'aa -- only modify the Object Access time. Symbol-a # touch-a-t 201505050555 aa -- modify the file access time in this time format. Symbol-t9, delete a file -- rm # rm/root/test/a -- delete a common file, and let's confirm rm: remove regular empty file '/root/test/'? Y # rm-f/root/test/aa -- delete common files without confirmation. Symbol-f # rm-rf/root/test/-- delete the directory without re-confirmation. Symbol-r # rm-rf/root/test1/* -- delete all files in the directory 10. Copy files -- cp # cp/etc/passwd/root/test/-- Copy common file # cp/etc/passwd/root/test/password -- copy a common file, and renamed # cp-r/etc/root/test -- copy the/etc/directory to the/root/test directory # cp-r/etc/*/root/test/bak /-- open all the files in the/etc/directory to the/root/test/bak/directory # cp-a/etc/passwd/root/test/-- convert all the files copy all the attributes to the destination. 11. Move the file-mv # mv/root/test/passwd bak/-- move the file # mv/root/test/passwd bak/pass -- move the file and change Name # mv/root/test/bak/root/test/bak-01 -- move directory and rename 12, output -- echo/tty # echo 'Hello world' -- output to terminal # tty -- view the current device name # echo 'Hello world'>/dev/pts/1 -- output to another terminal # echo-n 'Hello world' -- output to the terminal, do not wrap. Symbol-n # echo-e '2014 \ nhello world' -- enable backslash escape. Symbol-e common escape parameters: \ n (line feed) \ t (Tab) \ B (Return key) \ v (line feed and Tab) 13. view the file -- cat/more/less # cat/etc/passwd -- output file content # cat-n/etc/passwd -- display the row number of each row. Symbol-n # cat-nb/etc/passwd -- only displays non-empty rows. Symbol-B # more/etc/passwd -- open a file on one page, with a space on the next page, B on the previous page,/search, q exit # less/etc/passwd -- the open form is similar to more. F next page, w Previous Page, j next line, k previous line,/search, h help, q Exit 14. filter -- grep # grep root/etc/passwd -- find the matching string in the file # grep-v root/etc/passwd -- filter out rows that do not contain root. -V # grep-A2 root/etc/passwd -- filter out the rows that meet the condition and display the following two rows. -A # grep-B2 root/etc/passwd -- filter out the qualified rows and display the first two rows. -B # grep-C2 root/etc/passwd -- filter the rows that meet the condition and display the two rows before and after the condition. -C # grep-c root/etc/passwd -- calculate the number of rows that meet the requirements. Symbol-c # grep-I Root/etc/passwd -- ignore case sensitivity. Symbol-I # grep root/* -- wide range search # grep-R root/* -- Wide Range recursive search, wider search range. Symbol-R # grep-Rl root/* -- only lists the file names that meet the requirements, not content output. Symbol-l # grep-w bin/etc/passwd -- only displays columns with full-text matching. Symbol-w # grep-wo bin/etc/passwd -- only the characters that meet the requirements are displayed. Symbol-o15, pipeline -- | usage: command 1 | command 2 function: is to pass the result of the first command 1 execution as command 2 input to command 2 # cat/etc/passwd-n | less # echo-e 'rootjjjjjjj \ nkkkkkkkkkkk '| grep root # cat/etc/passwd | grep root 7. Redirection function: redirect the output content to another place; input: standard input (0); default: keyboard output: standard output (1) and standard error output (2 ); the default screen-related symbols are:>, 1>, 2>, & >,<># ls-l/etc/passwd -- the standard output is correct; default to Terminal-rw-r -- 1 root 1920 Oct 11/etc/passwd # ls-l/etc/kkk -- standard error output; default Terminal ls: cannot access/etc/kkk: No such file or directory # echo $? -- Judge the correctness of the previous command; if the value is not 0, a standard error is output. 1. What is the difference between redirection and append? # echo 'Hello world'> george -- redirect the content that should have been output to the terminal to the george file # echo 'Hi, george '> george -- redirects the new content to the george file and finds that it overwrites the original content # echo 'Hi, frank'> george -- append the content with another line, write new content. Symbol> 2. Standard and correct output redirection symbol>, 1> # ls-l/etc/passwd 1> george -- the standard output is redirected to the george file # ls-l/etc/kkkkk> george -- the standard error output is still ours. terminal ls: cannot access/etc/kkkkk: no such file or directory3. Standard Error output redirection symbol 2> # ls-l/etc/kkkkk 2> george -- standard error output redirected to the george file # ls-l/etc/passwd 2> george -- and the standard output is still to our terminal-rw-r -- 1 root 1920 Oct 11/etc/passwd4, the standard is correct & the error output redirection Symbol &> # ls-l/etc/jjj/etc/passwd> correct 2> error -- redirect the standard output to correct; redirect standard error output to error # ls-l/etc/jjj/etc/passwd &> george -- redirect standard errors to george5 and standard input symbols <# mail- s 'ooo' root @ localhost -- enter hello using the keyboard standard, root, wo zai yong jian pan qiao zi .. # mail-s 'ooo' root @ localhost </etc/passwd -- use the standard input symbol for standard input. The content is in/etc/passwd.

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.