Linux face questions (2)

Source: Internet
Author: User
Tags bz2 mysql create apache log ftp protocol mysql backup rsync learn perl

First, Linux operating system knowledge

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

Centos,ubunto,fedora,opensuse,debian and so on, good at centos,www.centos.org

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

Post-->bios (boot,sequence)-àmbr (bootloader,446)-àkernelàinitrdà (ROOTFS) init

Password hack

1, start the server, press E, enter the GRUB edit mode

2, the cursor moves kernel, press E to edit

3. Enter single at the end

4, press ENTER, and then press B to enter the single maintenance mode

5. #passwd Change Password

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

/boot 300M

/20G

/swap 32G

/Home 100G

/usr 80G

/var 50G

/tmp 30G

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

Mount View

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

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?

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?

/etc/sysconfig/network-scripts/ifcfg-eth0,

Device= "Eth0"

Bootproto=none

onboot= "Yes"

Type= "Ethernet"

Ipaddr=

gateway=

dns1=

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

Xshell,put and get

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?

/MNT is typically used to temporarily mount other file systems

Root's home directory is under/root

/boot is the mount point/root directory

10. What happens when a day is rm-rf* and the operation is performed? Please give an example.

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.

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.

Chmod +x/tmp/test.tx; Ll/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

G

1G

0

$

The next line of the cursor line is inserted by the O

5y

10d

[Email protected] @jfedu. Net

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.

Find/-name *.txt-mtime-30–size +20k–a–perm/--x >/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.

Useradd ABC;

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.

Vim/etc/inittab Setenfoce 0 Vim/etc/selinux/config

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 ')

Vim/etc/rc.d/rc3.d/s99local

Add to

Mkdir-p/tmp/' date+%y%m%d '

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.

Cat, Less,more,head,tail

Head–n 3

Tail-1

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

Ifconfig eth0 | grep bcast

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

Gpasawd–m Test Root

Third, Linux disk and software management operations

1. How do I add a new 50G hard drive to the Linux server system as a separate partition and are using it? What steps do I need?

#Fdisk –l Find the 50G device name, assuming/DEV/SDB

#Fdisk/dev/sdb

N

Select the starting magnetic column to the last end of the magnetic column

+50g

W Save and exit

This time the partition is/DEV/SDB1

#partprobe/DEV/SDB1

#mkdir/pardisk

#mkfs –t EXT4/DEV/SDB1

#mount/dev/sdab1/pardisk

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.

#mount –t Vfat/dev/sdb/mnt/flash

# Cd/mnt/flash

#cp index.html/var/www/html/

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

#dd If=/dev/sdb Of=/tmp/usb.back just looked at the notes, synchronized mirror backup is rsync fastest, mobile hard drive hangs in/mnt/flash

Rsync-av/mnt/flash/tmp/usr.back

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

#mount –t Iso9660/dev/cdrom/media/cdrom

#cd/media/cdrom

#rpm –

IVH httpd-2.2.15.xx.rpm

5. Use the RPM command to install, uninstall, delete, update ntp-0.7.12.x86_64.rpm this soft package.

RPM–IVH ntp-0.7.12.x86_64.rpm

Rpm–e Ntp-0.7.12.x86_64.rpm–nodeps

RPM–FVH 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?

#crontab –e

0 * * */bin/tar–jpcv/backup/html.bzip2/var/www/html/*

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.

#tar –jcv/tmp/root.bz2/root/*

#chmod o+r/tmp/root.bz2

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

Yum on-Line Mount Mount

RPM Manual Install Upgrade

When installing, if there is a dependency package, install with Yum, if you can ignore it, use rpm--nodeps or RPM--force to force the installation.

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?

#crontab –e

* 6,8,10,12 * 4 */bin/touch/tmp/test.txt

4 represents the month of April

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

#find/usr/local/test-size +100k-exec mv {}/tmp/\;

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

RAID0: Suppose there are two hard disks A and B, cut out the equivalent chunks, and then store them in these two disks sequentially.

RAID1: Plainly, the same piece of data, intact on two disks

RAID5: At least three disks, one more same-bit check code record

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

#netstat –TLNP | grep 8080

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?

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

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

Isn't it

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?

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

Where is the 6.ApacheWEB server publishing directory?

If RPM or Yum is installed in/var/www/html if the compilation is installed in general at/usr/local/http/

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

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?

Data storage and querying, you can

NETSTAT-TLNP | grep HTTPD;NETSTAT-TLNP | grep mysqld

9. How to deploy 4 Web sites on a virtual machine and access the domain name www.a1.com test.a1.comwww.a2.comtest.a2.com?

#vim/etc/httpd/conf.d/virtual.conf

Namevirtualhost 192.168.1.154:80

<virtualhost 192.168.1.154:80>

ServerName www.a1.com

DocumentRoot "/www/a1.com"

Customlog/var/www/httpd/a1.org/access_log combined

<directory "/www/a1.com" >

Options None

AllowOverride authconfig

AuthType Basic

AuthName "Rrestrict area."

AuthUserFile "/ETC/HTTPD/.HTPASSWD"

Require Valid_user

</Directory>

</virtualHost>

<virtualhost 192.168.1.154:80>

ServerName test.a1.com

DocumentRoot "/test/a1.com"

Customlog/var/www/httpd/d.gov/access_log combined

<dire

Ctory "/test/a1.com" >

Options None

allowoverride None

Order Deny,allow

</Directory>

</virtualHost>

......

10. Assume 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 the new Apache log will print to where, why?

Renaming files in ACCCSS_LOG.BAK,MV

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

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

/etc/fstab

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

cat/etc/services | grep "A"

FTP 21,HTTP80,DNS53,SNMP161,POP3 110,dhcp67,nfs2049,mysql3306,samba137

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

Mysql>create database Love;

Mysql>create table tb1 (ID INT UNSIGNED NOT null auto_incrementprimary key,name CHAR (NO) null,age TINYINT not NULL) ;

Mysql>insert into SET name= ' Panfeng ', age=24;

15.Mysql backup command? MySQL How to give root user access to jfedu, password is jfedu.net, please write the command?

Backup command

#mysqldump

Mysql>grant all privileges on * * to ' jfedu ' @ ' localhost ' identified by ' jfedu.net ';

16.Mysql Forget the password how to do it?

1. #service mysqld Stop

2, Vim/etc/init.d/mysqld

Find $bidir/mysql_safe--datadir= "$dataidir"

Revision changed to

$bidir/mysql_safe--skip-grant-tables--skip-networkin--datadir= "$dataidir"

3, Servicemysqld restart

4. Log in to MySQL

Mysql>update User SET password=password (' 1234 ') WHERE user= ' root ';

5, restore the configuration of the 2nd step

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

This is Baidu out of, I think the summary is in place, share a

Operation and maintenance work, especially Linux operations, in fact, the most test of the ability of people, because there are too many things to learn.

To understand the network-Cisco Huawei Equipment configuration;

To understand performance tuning-including the performance tuning of lamp or LNMP, also including Linux operating system tuning;

To understand the database MySQL or nosql--such as MongoDB;

To understand the programming language--shell is the most basic, but also to learn Perl,python, and even Ruby and C + + (because some software is written in these languages), but also have to master awk,sed,grep and regular expressions;

To understand some debugging the use of the wrong command tools-such as Htop,dstat,strace,systemtap,iostat,sar;

To have a better level of English-because many software or tools and problems in the wrong answer is not done by the people, and even need to communicate with the original author, in Google group inside the message discussion;

To have a strong physique and the psychological preparation of overtime work-upgrade maintenance is in the people are still dreaming. At night 2 O'Clock website hangs you also have to get up, the cell phone keeps receiving various alarm SMS ... ;

To have blame endurance-operation is always the company dad does not hurt Niang do not love the position, others do not have to do with you, you do bad people do bad is you influence. Manpower and finance is the service of the technical department, operation and maintenance is the service of various technical departments, large-to-line operations, small to help the company other use of Linux desktop colleagues, the company's internal computer room, IDC maintenance (errand server), dry, even if, dry, a bunch of people behind scold you;

Also have (this is the most important) a positive learning heart-because the technology development does not allow you to stay in place, if you are not technical geek, think Shell+apache is anything, in fact, I think do not do operation and maintenance will do well, hehe ...

Of course, the Linux operation is still a success:

General Change jobs are headhunting reception;

The biggest wage increase is also the fastest, other industries rarely have a job 1, 2 years can be more than 1W?

Understand things too wide ... Change job is very simple, turn occupation also so easy

Linux face questions (2)

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.