Linux Operating system knowledge

Source: Internet
Author: User
Tags mysql create snmp apache log ftp protocol mysql backup egrep

1. What are the common Linux distributions? Which one are you good at? What is its official website? Which one do you specialize in?

For:

Common Linux discovery versions are Redhat, Centos, Debian, Ubuntu, Suse

Best at Redhat and CentOS

Redhat Official website: www.redhat.com

CentOS Website: www.centos.org

I am best at Linux Basic command operation and related service building

What is the detailed step of the 2.Linux boot process? System installs, forgot password how to crack?

For:

Boot Step by A--h

A, the first is the BIOS power-on self-test, initialization, this process will detect the relevant hardware (CPU, memory, video card, hard disk, etc.), and then read a boot sequence, in the case of hard disk, will read the MBR on the hard disk.

B. Load the kernel to read the config file inside/boot.

C. Start the initialization process and start running/sbin/init

D, read/etc/inittab determine the operating level

E, according to/ETC/RC.D/RCN.D load boot program, RCN.D are linked files, all point to/ETC/RC.D/INIT.D and then run/etc/rc.d/rc.local

F, user login (3 ways of SSH, command line, graphical)

G, enter the login shell, the command behavior example, first read/etc/profile This global configuration file, and then read the home directory for the current user ~/.bash_profile and ~/.bash_login and ~/.profile

H, the last step is to open the Non-login shell, after entering the GUI manually create a new terminal, but this shell does not read/etc/profile

Forgot password

A, restart the system, in the Grub interface, choose the forgotten Password system, press the E key to enter the editing mode

b, option kernel ..... Press the E key to edit

c, add a space after the edit interface rhgb quiet, then enter "single" or "1" carriage return

D, press B to launch into single user mode

F, after entering the system passwd enter the new password (if there is SELinux, first temporarily shut down Setenforce 0)

3. What are the Linux Server System partitioning standards in the enterprise? (HDD 300G, Memory 16G)

For:

/boot 200M

/swap 16G

/70G

/data all the rest of the space

4. What do you do when a day suddenly discovers that the Linux system files are read-only? Complete operation steps.

For:

First shut down the system and then boot into rescue mode (Linux rescue) with CD, execute "fsck.ext3-y/dev/sda2" (if the read-only partition type is EXT3, partition is/dev/sda2)

5. Install a system using DVD disc installation, how to install 50 Linux systems How to install it? Think for a second.

For:

A, you can use more than a few DVDs of a single installation.

b, can be used Kickstart batch installation (client booting from the network)

6. With a virtual machine installed a Linux system, suddenly want to clone a server, after cloning found unable to surf the internet, how to solve?

For:

A, edit the network card profile/etc/sysconfig/network-scripts/ifcfg-eth0, hwaddr and MAC address these two lines to delete.

b, modify the file/etc/udev/rules.d/70-persistent-net.rules, delete the line before eth0, change the next line eth1 to Eth0

C, reboot

What is the 7.Linux NIC configuration file path? What are the conditions that must be met for the server to sisu the network? What do I need to configure?

For:

Network adapter Profile Path:/etc/sysconfig/network-scripts/ifcfg-eth* (* for numbers)

To Sisu network needs: can be linked to the Internet network cable (or wireless), has a network card

Required configuration: IP, netmask, Gateway, DNS (automatic or manual OK, Server general automatic)

8. What software can I use for remote Linux servers? Upload files and download files via what?

For:

Software for remote connection to Linux: Xshell, SecureCRT, Putty, VNC (graphical)

Uploading and downloading files: Lrzsz, SFTP

What is the main use of the 9./mnt directory? What does the/root directory have to do with the root user? /What is the connection between the root directory and the/boot directory?

For:

/MNT is typically used to mount external devices

/root is a directory that is the root user's home directory

/boot directory is a subdirectory under/directory

10. What happens when the RM-RF * is executed on one day? Please give an example.

For:

A, if the current directory is "/tmp", then everything in this directory will be deleted (the default does not contain hidden files)

b, if the current directory is "/", then the data on the system will be lost, and cannot start, the system crashes (use this command with caution)

Second, the Linux command and file operation

1. Create the Test.txt file in the/tmp/directory with the contents: hello,world! , write it with a command.

For:

echo "hello,world!" >/tmp/test.txt

2. Add the Execute permission to the Test.txt file except the owner, and finally write down the file's permissions as a number.

For:

655

The default is 644 and can be "chmod 655/tmp/test.txt"

3. Edit the Test.txt with the VI command, how to jump to the last line, the first line, the beginning of the line, how to insert the next line in the cursor line, how to copy 5 rows, delete 10 rows, find Jingfeng characters, replace Jingfeng with Jfedu.net

For:

Last line: G

First line: GG

Beginning of the line: ^ (shift+6)

End of Line: $ (shift+4)

Insert one line below the cursor: o

Copy 5 rows: 5yy

Delete 10 rows: 10DD

Replacement::%s/jingfeng/jfedu.net/g

4. Find the Linux system under the TXT end, 30 days without modification of the file size is greater than 20K simultaneously has the execution permission of the file and back up to the/data/backup/directory.

For:

Find/-name *txt-mtime +30-type f-size +20k-perm a=x-exec cp {}/data/backup/\;

5. The current test.txt belongs to the user root, the group is ABC, please test.txt the owner is ABC, the group is root, write out the command.

For:

Chown Abc:root Test.txt

6. How to modify the Linux boot level to be character mode and permanent, how to temporarily and permanently shut down selinux and firewall, please write out the operation method separately.

For:

Change the character pattern: Modify the/etc/inittab line to Id:3:initdefault:

Temporary shutdown selinnux Setenforce 0

Temporarily shut down the firewall iptables-f

Permanently off SELinux Modify/etc/selinux/config line to Selinux=permissive

Permanently shut down the firewall iptables-f;/etc/init.d/iptables save

7. Create a date folder for the day in the/tmp directory each time you boot (hint: the current date is represented by: ' Date +%y%m%d ')

For:

echo "mkdir/tmp/' date +%y%m%d '" >>/etc/rc.d/rc.local

8. How to view the contents of the file, what are the commands? View the file line 1th to 3 to see the last line of the file.

For:

View file contents: Vim, Cat, head, tail

View 1th to line: head-3 file

View last line: Tail-1 file

9. View the commands for the Linux server IP and print only the lines that contain the IP.

For:

Taking eth0 as an example

Print only the line: ifconfig eth0 | grep "inet addr:"

Print only ip:ifconfig eth0 | grep "inet addr:" |awk-f: ' {print $ {} ' |awk-f ' ' {print '} '

10. What is the command to add the normal user test to the root group?

For:

USERMOD-G Root Test

Third, Linux disk and software management operations

1, how to add a new 50G hard disk to the Linux server system as a separate partition, and is in use? What steps do I need?

For:

A. Put the hard drive into the server and connect

B. Create a hard disk partition (via fdisk command)

c, Format the partition

D, Mount Partition (can be written to/etc/fatab, restart auto mount)

2. There is a Kingston U disk, need to go to the server/var/www/html/directory to upload a index.html file, how to do and complete.

For:

A, mount the USB stick to the server (need to install ntfs-3g), copy index.html to/var/www/html/

b, link the USB drive to Windows, remote connect to the server, remotely copy

3 A removable hard disk with 300G data on it, how to quickly CP to a Linux server?

For:

Assume that the hard disk is recognized as SDBC on the server

Mkdir/mydata

Mount-t Ntfs/dev/sdbc/mydata

4. The CD has a httpd-2.2.15.xx.rpm bag, how to mount and install it?

For:

A, mount the CD-ROM to/mnt (MOUNT/DEV/CDROM/MNT)

b, installation (RPM-IVH/MNT/PACKAGES/HTTPD-2.2.15.XX.RPM)

5. Use the RPM command to install, uninstall, and update the NTP-0.7.12.X86_64.RPM software package.

For:

Installing RPM-IVH ntp-0.7.12.x86_64.rpm

Uninstalling Rpm-e NTP--nodeps

Update RPM-UVH ntp-0.7.12.x86_64.rpm

6./var/www/html/is the publishing directory of the site, how to automatically back up every 0 o'clock in the morning 30, write the procedure?

For:

A, crontab-e into the editing mode

B. Add the following 0 * * */bin/tar-czf/backup/web_bak_$ (date +\%y\%m\%d). tar.gz/var/www/html >/dev/null 2>&1

C. Start service crontab Start;chkconfig crontab on

7. Use the TAR command to package and compress the/root directory, and then move it to/TMP and set its permissions to other people to read only.

For:

Tar-czf/tmp/root_bak.tar.gz/root

chmod o=r/tmp/root_bak.tar.gz

What is the difference between the 8.Yum command and the rpm command? How do I install a dependent package using RPM?

For:

RPM is typically used to install local packages, Yum is typically used for online installation (or you can create a Yum source on a local CD-ROM)

The biggest difference is that Yum can automatically install the packages it depends on (not including the environment)

Add "--nodeps" option such as: RPM-IVH **.rpm--nodeps

9. In this month, every day in the morning 6 to 12, every 2 hours to create a test.txt file, the content is OK, how to implement?

For:

A, crontab-e into the editing mode

B. Add the following 0 6-12/2 * 4 */bin/touch test.txt (for example, April)

C. Start service crontab Start;chkconfig crontab on

10. Transfer files larger than 100K in the/usr/local/test directory to the/tmp directory.

For:

Find/usr/local/test-type f-size +100k-exec MV {}/tmp \;

11. Briefly describes the working principle and characteristics of three kinds of working modes of RAID0 RAID1 RAID5.

For:

RAID 0 Number >=2 disk utilization 100% Hot-spare No advantages read-write performance high disadvantage no fault tolerance

Data is distributed to different disks, does not provide redundancy, cannot be expanded, any one disk is broken, the data is all lost. Suitable for areas where performance requirements are high, but the security of data is not too much to care about.

RAID 1 Number >=2 disk Utilization 50% Hot-spare has the advantage of providing data redundancy, high security disadvantage waste disk space

Suitable for high data security places, generally 2 disk, space for the smallest disk space, if there are 4 disk, where 3 of space is wasted (do mirror redundancy) as long as there is a disk, the data will not be lost.

RAID 5 number >=3 disk utilization (N-1)/n Hot-spare has advantages of fault tolerance, redundancy, high read performance, low write performance

RAID5 equivalent to RAID0 and RAID1 's compromise plan

Application server (like Apache) doing raid 12 HDD

Data server (like MySQL) doing RAID 104 HDD

12. How to view the process that occupies port 8080.

For:

NETSTAT-ANLP | grep 8080

lsof-i:8080

Iv. Linux service configuration and management

1. Please write apache2. The X version of the two modes of operation, and how each works. How do I view the modules currently supported by Apache and see which mode is working in?

For:

Apache has two modes of operation, one for Prefork mode and the other for work mode

Prefork: A process has only one thread to receive one access request, high stability, a process crash does not affect other processes, but the use of more memory, high hardware requirements.

Work: One process has multiple threads and responds to access requests separately, consuming less memory, but one process crash can affect other requests

View Support module: httpd-l

View Working mode: httpd-v

2.Linux NFS cannot be mounted on client, please write troubleshooting steps?

For:

A, check whether it is the effect of firewall or SELinux

B. Check syntax and server address for errors (Mount directory only, cannot mount the document)

C, check whether the configuration file is correct on the server and whether the client has permission to access

3.Linux has deployed a DHCP server, the client cannot obtain the IP, how to resolve?

For:

A, restart the Client Network service, IP changed to automatically get

b, check whether the client is within the same network as the server

C. Check server-related configuration and view logs

4. What are the common FTP software? What is Linux most commonly used for? How do I share a resource for someone else to access with a user name and password?

For:

A, the common FTP software has vsftpd, ProFTPD, pureftpd and WUFTPD, etc.

B, Linux most commonly used for the VSFTPD

C, close anonymous access, establish the relevant user

5. How do I disable FTP logons using anonymous users? How does the command line access the FTP server?

For:

Turn off anonymous access (ANONYMOUS_ENABLE=NO)

FTP server_ip

Where is the 6.ApacheWEB server publishing directory?

For:

A, yum installation defaults to/var/www/html

b, the source code installation defaults to/usr/local/apache/htdocs (when installing Apache, the installation path is/usr/local/apache)

7.ApacheWEB Server has several working modes, the simple difference of each mode?

For:

Apache has two modes of operation, one for Prefork mode and the other for work mode

Prefork: A process has only one thread to receive one access request, high stability, a process crash does not affect other processes, but the use of more memory, high hardware requirements.

Work: One process has multiple threads and responds to access requests separately, consuming less memory, but one process crash can affect other requests

What is the purpose of the 8.MySQL server? Can Apache and MySQL be installed on a single machine? How do I view Apache and MySQL ports and processes?

For:

A, MySQL server for storing some data

B, Apache, and MySQL can be installed on a single machine

C, view port netstat-anlp |egrep ' Httpd|mysql '

View Process Ps-aux | Egrep ' Httpd|mysql '

9. How do I deploy 4 sites on a virtual machine, and access the domain names www.a1.com test.a1.com www.a2.com test.a2.com?

For:

A. Uncomment the Include conf/extra/httpd-vhosts.conf in httpd.conf

b, in the site publishing directory to establish four directories, mkdir web{1,2,3,4}

C, edit the httpd-vhosts.com, the <virtualhost *:80>...</virtualhost> content copy four points, modify documentroot and other related configuration can be

10. Assuming that Apache generates a log file named Access_log, when Apache is running, execute the command MV Access_log Access_log.bak, after execution, ask where the new Apache log will print to, why?

For:

It will still print to Access_log (a new file is created by default), because the Apache configuration file specifies the name of the file, which is automatically created when there is no

11. We all know that the FTP protocol has two modes of operation, saying their approximate work flow?

For:

FTP has two modes of operation:

FTP Active mode: The client connects from an arbitrary non-privileged port N (n>1024) to the Port 21 command ports of the FTP server. The client then starts listening on port n+1 and sends the FTP command "Port n+1" to the FTP server. The server then connects to the client-specified data port (n+1) from its own data port (20).

FTP Passive mode: The client connects from an arbitrary non-privileged port N (n>1024) to the Port 21 command ports of the FTP server. The client then starts listening on port n+1 while the client submits the PASV command. The server opens an arbitrary non-privileged port (p >1024) and sends the Port P command to the client. The client then initiates a connection from the local port n+1 to the server's port p to transmit the data.

When the 12.Linux kernel boots, the file system to be loaded is read from which file.

For:

From/etc/fstab

13. Write down the following service's common port FTP HTTP DNS SNMP POP3, DHCP, NFS, MySQL, Samba and other services.

For:

Service (port number) FTP (2021), HTTP (80), DNS (53), SNMP (161), POP3 (110), DHCP (67 68), NFS (111), MySQL (3306), Samba (137 138 139)

14.MYSQL Create a database command, create a table command, insert a statement command?

For:

Create Database Jacken;

CREATE table use Jacken; CREATE TABLE Jacken (name varchar), age int (ten), Love varchar (20));

Insert a statement INSERT INTO jacken_1 (name,age,love) VALUES (' Tom ', 2, ' reading ');

15.Mysql backup command? MySQL how to jfedu user authorized access, password is jfedu.net, please write the command?

For:

MySQL backup mysqldump-h localhost-u root-p jacken >/data/jacken.db

Authorized:mysql> Grant all privileges on * * to [email protected] identified by "jfedu.net";

16.Mysql Forget the password how to do it?

For:

Stop the MySQL service, edit/etc/my.cnf, add a row in the MYSQLD option--skip-grant-start Save and start MySQL, no password is required at this time.

Go in and execute.

mysql> use MySQL;

mysql> Update user Set password=password= (' Newpass ') where user= ' root ';

mysql> flush Privileges;

In the/ETC/MY.CNF comment--skip-grant-start this line, restart the service can

What are the skills and professional qualities required for 17.Linux OPS engineers?

This is very important, this does not say, this article only say technical things oh! /haha

The skills that a person deems necessary are: at least ccna,linux basic commands, cluster knowledge, SQL language, Shell language;

Professional quality: Cooperative spirit, careful, practical.

Linux Operating system knowledge

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.