Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the problems of Linux server from entry to proficiency?

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what are the problems of Linux server from entry to proficiency", the content is simple and clear, and I hope it can help you solve your doubts. Let the editor lead you to study and learn what are the problems of Linux server from starter to proficiency.

Who is the developer of Q1 Linux?

A: Finnish college student Linus Torvalds

What is the common kernel version of Q2 Linux?

A:2.6.x

What hardware platforms can Q3 Linux run on?

A:Dell, IBM, HP, Oracle and VERITAS

In what year was Q4:Linux version 1.0 released?

Avut released Linux official Core 1.0 in 1994.

What is the purpose of the Q5 exchange partition?

A: used to make virtual memory, similar to the page file of WINDOWS

What boot loading methods does Q6 Linux have?

A: the common ones are GRUB LILO

Which Linux version is the Q7 Ext2 ext3 file system used for?

An EXT2 is a common file system before red hat linux 7.2.The current version usually uses the EXT3 file system.

How to clear MBR after Q8 uninstalls Linux

A: use the FDISK command to delete MBR

What is the Q9 Linux restart and shutdown command

A:halt command

Function: turn off the computer

Format: halt [- n] [- w] [- d] [- f] [- I] [- p]

Description:

If the runlevel of the system is 0 or 6, shut down the system, otherwise replace it with the shutdown instruction (plus the-h parameter)

Init command

Function: change the running level of the system

Format: init [0123456Ss]

Note: init is the parent parent of all process. Boot must start with this instruction (you can use ps-aux to see that the first stroke is init), and refer to / etc/inittab file to complete the boot procedure. There are eight execution levels (runlevel), and changes can only be changed through the instructions of telinit.

Parameters:

0 boot execution level 0, which is used to shut down the system

1 Boot execution level 1, which is used for single-user mode (single user mode)

5 the boot execution level is 5, which indicates the mode when entering X window

6 boot execution level 6, which is used to reboot

S or s is not used directly and is used in conjunction with boot execution level 1. When S or s is added to indicate that the boot does not refer to / etc/inittab file 235, please refer to / etc/inittab file content and / etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc5.d and other directories

Reboot command

Function: restart the system

Format: reboot [- n] [- w] [- d] [- f] [- I]

Note: if the runlevel of the system is 0 or 6, reboot, otherwise replace it with the shutdown instruction (plus the-r parameter)

Parameters:

-n: do not write memory data back to the hard disk before rebooting

-W: it won't really restart, just write the record in / var/log/wtmp file.

-d: do not write records to / var/log/wtmp file (- n this parameter contains-d)-f: force restart, do not call the command shutdown

-I: stop all network-related devices before rebooting

Example:

Reboot the reboot.

Reboot-w does a simulation of rebooting (only records don't really restart).

Shutdown command

Function: shut down the system

Usage: shutdown [- t seconds] [- rkhncfF] time [message]

Note: shutdown can be used to perform shutdown procedures and send messages to all users' running programs before shutting down, and shutdown can also be used to restart.

Parameters:

-t seconds: set the shutdown program after a few seconds

K: it doesn't really turn off, it just sends warning messages to all users only.

-r: power it back on after shutdown

-h: stop after shutdown

-n: do not use the normal program to shut down, kill all the programs in progress by force and then shut down by yourself.

-c: cancel the shutdown that is already in progress

-f: do not do fcsk action when shutting down (check the Linux file system)

-F: force the fsck action when shutting down

Time: set the shutdown time

Message: warning messages sent to all users

What are the three common X-windows desktop environments in Q10?

A: CDE KDE GNOME

How are the permissions of Q11 Linux files and directories divided, and what is the function and usage of the Umask command?

A:LINUX files have four access permissions: r read, w write, x execute,-no permission.

Function: the system administrator uses umask to set default permissions for users

Format: umask mode

Description: umask 022, indicating that the default permission mask of the file is 022: then the file permission of the new folder is 666-022. 644

Umask-S displays the current shield code

If you don't want to change it every time you log in, you can add umask 077 in `/ .bash_profile.

Q12 how to change the permissions of files and directories

A: use the chmod command

Q13 how to change the owner of a file

A: use the chown command

Q14 how to display the size of disk partitions

A: use the df du command

The function and usage of Q15 CD command

A: function: change the current directory

Format: cd path

Description:

1) cd: return to the home directory of the currently logged-in user.

2) cd today: change to the today directory below the home directory.

3) cd..: go back to the directory above.

4) cd /: switch directly to the root directory.

5)。 Represents the current directory

6).. Higher-level directory

7) ls file name: displays the information of the file

How does Q16 add users?

A: use the adduser command

What is the maximum UID for the average Q17 user?

A: it's usually 4294967295

Q18 how do I delete the default permissions for a file?

A: use umask777 to clear all permissions on the file

Mounting and unmounting methods of Q19 file system

A: function: Mount the file system

Format: mount [- parameter] [device name] [mount point]

Description: the commonly used parameters are

-t specifies the file system type of the device. Common ones are:

File systems commonly used in ext2 linux

The fat of msdos MS-DOS is fat16.

Fat32 commonly used in vfat windows98

Nfs network file system

Iso9660 CD-ROM CD standard file system

File system for ntfs windows NT 2000

Auto automatically detects the file system

-o specify options for mounting the file system. Some can also be used in / etc/fstab. The commonly used ones are

Ro is mounted read-only

Rw is mounted in read-write mode

Nouser makes it impossible for ordinary users to mount.

User allows ordinary users to mount devices.

Purpose: unmount file system

Syntax: umount file system

Description:

Unmounting the file system makes the file system unavailable.

Q20 LVM Water what?

A:LVM (Logicl Volume Manager), logical volume manager, can realize the dynamic partition and adjustment of hard disk space by using logical volume manager to manage hard disk storage devices.

How does Q21 view the system behavior of the current user?

A: use the command w to view the system behavior of the current user, w root

Q22 how do I check the user name that has logged in to the system?

A: use the who command to view the current user login who-u in more detail

Q23 what is the way to view all processes?

A:ps command

Function: view process status

Format: ps [options]

Description:

-eCompa lists all processes.

-u Select a valid user ID.

-p Select the process under the specified terminal.

-C selects the specified file name.

-f lists all the details.

-l is displayed in a long format.

-j is displayed in job format.

-x Select a process that does not control the terminal.

Q24 what is the method of deleting a process?

A:kill command

Function: terminating the process

Format: kill [- s p] [- a] PID

Description:

-s indicates the signal sent to the process. For example,-9 (forced termination), TERM signal is sent by default.

-p displays the ID of the process and does not signal.

-a terminate all processes.

0 sends signals to all processes in the current process group.

-1 sends a signal to all processes with a process number greater than 1.

How does Q25 view the ports opened by the system?

A: use the netstar command

Q26 what is a LVM physical volume?

A: physical volumes-PV (Physical Volume) physical volumes are at the bottom of logical volume management, which can be partitions on the actual physical hard disk or the entire physical hard disk.

Q27 what is a LVM volume group?

A: volume group-VG (Volumne Group) volume group is established on top of physical volumes. At least one physical volume must be included in a volume group. After the volume group is established, physical volumes can be dynamically added to the volume group. There can be only one volume group or multiple volume groups in a logical volume management system project.

Q28 what is a LVM logical volume?

A: logical volumes-LV (Logical Volume) logical volumes are built on top of volume groups. The unallocated space in the volume groups can be used to create new logical volumes. After the logical volumes are established, the space can be dynamically expanded and reduced. Multiple logical volumes in the system belong to the same volume group, or they can belong to different volume groups.

Q29 what is the LVM physical region?

A: physical area-PE (Physical Extent) the physical area is the smallest storage unit available for allocation in the physical volume, and the size of the physical area can be specified when the physical volume is established according to the actual situation. Once the physical area size is determined, it cannot be changed, and the physical area size needs to be the same for all physical volumes in the same volume group.

Q30 what is the LVM logical region

A: logical region-LE (Logical Extent) logical region is the smallest storage unit available for allocation in a logical volume. The size of the logical region depends on the size of the physical area in the volume group in which the logical volume resides.

Q31 what is the LVM volume group description area

A: volume group description area-(Volume Group Descriptor Area) the volume group description area exists in each physical volume and is used to describe all the information such as the physical volume itself, the volume group to which the physical volume belongs, the logical volume in the volume group, and the allocation of physical areas in the logical volume. The volume group description area is established when the physical volume is established using pvcreate.

Q32 how to copy files

A: cp / test1/file1 / test3/file2: copy the file file1 from the directory test1 to the test3 directory and rename it to file2.

Cp-ax dir1 dir2:a: copies the specified directory and contains all files and subdirectories under it.

X: the format of this file becomes the same as the file system of the destination sector.

Q33 how to move files

A:mv / test1/file1 / test2/file2: copy the file1 file in the test1 directory to the test2 directory and rename it to file2.

Mv file1 file2 changed the file name file1 to file2

Q34 how do I find files?

A:$find ~-name "* .txt"-print # looks up the .txt file in $HOME and displays $find. -name "* .txt"-print$find. -name "[A murz] *"-print # look for the file $find / etc-name "host*"-print # that begins with capital letter $find. -name "[a murz] [a murz] [0Mel 9] [0Mel 9] .txt"-print # look up the txt file $find, which begins with two lowercase letters and two numbers. -perm 755-print$find. -perm-007-exec ls-l {}\; # check that all users can read, write and execute the same files as-perm 777$ find. -type d-print$find. !-type d-print$find. -type l-print$find. -size + 1000000c-print # look for files longer than 1Mb $find. -size 100c-print # look up a file of 100c length $find. -size + 10-print # check for overexpired files with 10 blocks of invalid length (1 block = 512 bytes)

What is the Q35 compression and decompression command?

A: function: file files

Format: tar parameter archive file name file or directory

Description:

Compress a set of files to the tar.gz suffix.

# tar cvf backup.tar / etc

# gzip-Q backup.tar

Or

# tar cvfz backup.tar.gz / etc/

Release a file with the suffix tar.gz.

# gunzip backup.tar.gz

# tar xvf backup.tar

Or

# tar xvfz backup.tar.gz

Complete compression with one command

# tar cvf-/ etc/ gzip-qc > backup.tar.gz

Complete the release with one command

# gunzip-c backup.tar.gz tar xvf-

Unlock tar.Z 's file

# tar xvfz backup.tar.Z

Or

# uncompress backup.tar.Z

# tar xvf backup.tar

Unlock the .tgz file

# gunzip backup.tgz

Compress and decompress the .bz2 package

# bzip2 / etc/smb.conf

This will compress the file smb.conf into smb.conf.bz2

# bunzip2 / etc/smb.conf.bz2

This will restore smb.conf.bz2 to smb.conf in the current directory

Note: .bz2 compression format is not very common, you can man bzip2

How does Q36 display system environment variables?

A: env command

Function: display environment variables

Format: env

Description:

Show current environment

Env

Suppose there is a corner of the my_job used for the current location of the next environment variable LANG.

When you do not modify the LANG variable, use the env command to execute script my_job, as follows:

Env PATH=/u/testuser/jobs: $my_job

LANG=C

When you modify the value of LANG in the env command, you will have:

Env LANG=C++ PATH=/u/testuser/jobs: $PATH my_job

LANG=C++

What are the three command modes of Q37 VI

A:vi as an editor in Linux system, its usage and interface are very similar to those of Unix platform.

Basically, vi can be divided into three states: command mode (command mode), insert mode (Insert mode) and bottom line mode (last line mode). The functions of each mode are as follows:

1) Command line mode command mode)

Control the movement of the screen cursor, the deletion of characters, words or lines, move and copy a section and enter the Insert mode, or to the last line mode.

2) insert mode (Insert mode)

Text input can only be done under Insert mode, and press the "ESC" key to return to command line mode.

3) bottom line mode (last line mode)

To save or exit vi, you can also set the editing environment, such as finding strings, listing line numbers, etc. Wait.

However, when we use vi, we usually simplify it into two modes, that is, the last line mode mode is also included in the command line mode command mode).

Basic operation of Q38 vi

Avana) enter the vi

After the system prompts for the symbol vi and the file name, go to the vi full screen editing screen:

$vi myfile

It is important to note, however, that after you enter vi, you are in "command line mode (command mode)", and you have to switch to "insert mode (Insert mode)" before you can enter text.

B) switch to insert mode (Insert mode) to edit the file

Press the letter "I" in "command line mode (command mode)" to enter "insert mode (Insert mode)" and you can start typing text.

C) switching of Insert

You are currently in Insert mode mode, so you can only type text all the time if you find that you have typed the wrong word! To use the cursor key to move back and delete the word, press the "ESC" key to go to "command line mode (command mode)" before deleting the text.

D) exit vi and save the file

Under Command Line Mode (command mode), click the: colon key to enter Last line mode, for example:

W filename (enter "w filename" to save the article with the specified file name filename)

: wq (enter "wq", save and exit vi)

: q! (enter qquit, do not save the disk and force to exit vi)

Q39 Command Line Mode (command mode) function key

A (1). Insert mode

Press "I" to switch to insert mode "insert mode". Press "I" to enter the file from the current position of the cursor after entering insert mode

After pressing "a" to enter insert mode, the text is entered from the next position where the current cursor is located.

When you press "o" to enter insert mode, insert a new line and enter text at the beginning of the line.

2)。 Switch from insert mode to command line mode

Press the ESC key.

3)。 Move the cursor

Vi can directly use the cursor on the keyboard to move up and down, but the regular vi uses lowercase letters "h", "j", "k" and "l" to control the cursor to move left, down, up and right respectively.

Press "ctrl" + "b": move the screen one page back.

Press "ctrl" + "f": the screen moves one page forward.

Press "ctrl" + "u": move the screen to "back" half a page.

Press "ctrl" + "d": move the screen half a page to the front.

Press the number "0": move to the beginning of the article.

Press "G": move to the end of the article.

Press "$": move to the end of the line where the cursor is located.

Press "^": move to the beginning of the line where the cursor is located

Press "w": the cursor jumps to the beginning of the next word

Press "e": the cursor jumps to the suffix of the next word

Press "b": the cursor goes back to the beginning of the previous word

Press "# l": move the cursor to the # th position on the line, for example: 5lMagne56l

4)。 Delete text

"x": each time you press, delete the "after" character of the cursor location.

"# x": for example, "6x" means to delete "after" 6 characters where the cursor is located.

"X": uppercase X. each time you press it, one character in front of the cursor is deleted.

"# X": for example, "20X" means to delete the "first" 20 characters where the cursor is located.

"dd": delete the line of the cursor.

"# dd": delete # lines from the line where the cursor is located

5)。 Copy

"yw": copies the character where the cursor is located to the suffix into the buffer.

"# yw": copy # words to the buffer

"yy": copies the line of the cursor to the buffer.

"# yy": for example, "6yy" means to copy "count down" six lines of text from the line where the cursor is located.

"p": paste the characters in the buffer to the position of the cursor. Note: all copy commands related to "y" must work with "p" to complete the copy and paste function.

6)。 Replace

"r": replace the character where the cursor is located.

"R": replaces the character where the cursor goes until the "ESC" key is pressed.

7)。 Reply to the last operation

"u": if you execute a command by mistake, you can press "u" immediately to go back to the previous operation. Press "u" multiple times to perform multiple replies.

8)。 Change

"cw": change the word where the cursor is located to the suffix

"c3w": for example, "c3w" means to change 3 words

9)。 Skip to the specified line

"ctrl" + "g" lists the line number of the cursor.

"# G": for example, "15G" means to move the cursor to the beginning of line 15 of the article.

How to use Q40 Shell

A: the program must start with the following line (must be on the first line of the file):

#! / bin/sh

Symbol #! It is used to tell the system that the parameters behind it are the program used to execute the file. In this example, we use / bin/sh to execute the program.

When you edit a script, you must also make it executable if you want to execute it.

To make the script executable:

Chmod + x filename

You can then execute your script by typing:. / filename.

Notes

In shell programming, sentences that begin with # indicate comments until the end of the line.

Variabl

You must use variables in other programming languages. In shell programming, all variables are made up of strings, and you don't need to declare variables. To assign a value to a variable, you can write:

Variable name = value

Take out the value of the variable by adding a dollar sign ($) in front of the variable:

#! / bin/sh

# assign values to variables:

A = "hello world"

# now print the contents of the variable a:

Echo "An is:"

Echo $a

Enter the above in your editor and save it as a file first. Then execute chmod + x first

Make it executable, and finally type. / first to execute the script.

This script will output:

An is:

Q41 what is a regular expression?

A: to put it simply, use wildcards in the file name.

How does Q42 change the IP address of a network interface?

A: use the ifconfig command

What are the two levels of work of the Q43 SSH?

A: the first level (password-based security authentication) as long as you know your account number and password, you can log in to the remote host. All transmitted data will be encrypted, but there is no guarantee that the server you are connecting to is the server you want to connect to. There may be other servers pretending to be real servers, that is, being attacked by "middlemen".

The second level (key-based security authentication) relies on keys, that is, you must create a pair of keys for yourself and place the public keys on the server you need to access. If you want to connect to the SSH server, the client software will send a request to the server for security authentication with your key. After the server receives the request, first look for your public key in the server's home directory, and then compare it with the public key you sent. If the two keys match, the server encrypts the "challenge" with the public key and sends it to the client software. After receiving the challenge, the client software can decrypt it with your private key and send it to the server.

How does Q44 Telnet work?

A: when you log in to the remote computer system with Telnet, you actually start two programs, one is called the Telnet client program, which runs on your local machine, and the other is called the Telnet server program, which runs on the remote computer you want to log in to. The client program on the local machine needs to complete the following functions: 1, establish a TCP connection with the server; 2, receive the characters you enter from the keyboard; 3, turn your input string into a standard format and send it to the remote server; 4, receive the output information from the remote server; 5, display the information on your screen.

What are the common commands for Q45 ftp?

A:

1! [cmd [ARGs]]: execute interactive shell,exit in the local machine to return to the ftp environment, such as:! ls*.zip.

2. $macro-ame [args]: executes the macro definition macro-name.

3.account [password]: provides the supplementary password required to access system resources after a successful login to the remote system.

4.append local-file [remote-file]: appends local files to the remote system host, or uses the local file name if the remote system file name is not specified.

5.ascii: use ascii type transport.

6.bell: the computer rings once after each command is executed.

7.bin: use binary file transfer.

8.bye: exits the ftp session process.

9.case: when using mget, change the uppercase to lowercase letters in the remote host file name.

10.cd remote-dir: enter the remote host directory.

11.cdup: enter the parent directory of the remote host directory.

12.chmod mode file-name: set the access mode of the remote host file file-name to mode, such as chmod 777 a.out.

13.close: interrupts the ftp session with the remote server (corresponding to open).

14.cr: when transferring files in asscii mode, enter newline is converted to return line.

15.delete remote-file: delete the remote host file.

16.debug [debug-value]: sets the debug mode to display every command sent to the remote host, such as deb up 3. Setting it to 0 means canceling debug.

17.dir [remote-dir] [local-file]: displays the remote host directory and stores the results in the local file local-file.

18.disconnection: same as close.

19.form format: sets the file transfer mode to format and defaults to file mode.

20.get remote-file [local-file]: transfer the file remote-file of the remote host to the local-file of the local hard disk.

What are the components of Q46 URL,URI?

The format of URL consists of the following three parts:

The first part is the protocol (or service mode).

The second part is the IP address of the host where the resource is stored (sometimes including the port number).

The third part is the specific address of the host resource. Such as directories and file names

URI generally consists of three parts:

The naming mechanism for accessing resources.

The hostname where the resource is stored.

The name of the resource itself, represented by the path.

What is the method to modify the maximum number of connections for Q47 Apache? "

A: set it in httpd.conf:

MaxClients n

N is an integer, representing the maximum number of connections, with values ranging from 1 to 256. if you want apache to support more connections, you need to modify the httpd.h file in the source code, increase the defined HARD_SERVER_LIMIT value and then compile.

The function and usage of Q48 CRON command

A:cron command: execute a command in a loop. The at command can only be executed once, although it is a command for scheduled tasks, which is the difference between the two commands. The cron service provides a crontab command to set the cron service. Here are some parameters and instructions for this command: crontab-u / / sets a user's cron service, which is generally required by root users when executing this command

Crontab-l / / lists the details of a user's cron service

Crontab-r / / Delete cron services without users

Crontab-e / / Edit a user's cron service

Classification of Q49 Firewall

A: packet filtering (Packet filtering) type

Application Agent (Application Proxy) type

The usage of Q50 PING command

Common parameter options for the A:Ping command

Ping IP-t

The Ping command is executed continuously on the IP address until it is interrupted by the user with Ctrl+C.

Ping IP-l 3000

Specifies that the length of the data in the Ping command is 3000 bytes instead of the default 32 bytes.

Ping IP-n 300

Execute the Ping command 300 times.

The usage of Q51 Netatart command

A: Netstat is used to display statistics related to IP, TCP, UDP and ICMP protocols, and is generally used to verify the network connection of each port of the machine.

Some common options for netstat

Netstat-s this option can display its statistics according to each protocol.

Netstat-Ce this option is used to display statistics about Ethernet. It lists items including the total number of bytes, errors, deletions, datagrams, and broadcasts of datagrams transmitted. These statistics include both the number of datagrams sent and the number of datagrams received. This option can be used to count some basic network traffic.

Netstat-r displays information about the routing table, similar to what you see when you use the route print command later. In addition to showing valid routes, it also shows the currently valid connections.

Netstat-a this option displays a list of all valid connection information, including established connections (ESTABLISHED) and those that listen for connection requests (LISTENING).

Netstat-n displays all valid connections that have been established.

Usage of Q52 ifconfig command

A:ifconfig command

Used to view and change the address and parameters of the network interface

$ifconfig-a

Lo0: flags=849 mtu 8232

Inet 127.0.0.1 netmask ff000000

Hme0: flags=863 mtu 1500

Inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255

Ether 8:0:20:a7:4d:21

The system displays the name of the network interface and the status of the interface (up or down)

Information such as IP address and mask of the interface

Change the IP address of the network interface:

# ifconfig hme0 down

# ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up

First, use the down command parameter to temporarily stop the service of the network interface hme0, and then use the ifconfig command to

Interface assigns a new IP address and mask and starts the network interface service

You can also change the machine's IP address by changing the value of the IP address in the file / etc/hosts and restarting the system.

/ etc/hosts/:

211.101.149.11 sampdt

Define hostname in / etc/hostname.hme0 and IP address.

The Nic has been changed / added, and the system cannot start the interface service automatically. In this case, you need to create the Nic manually:

# ifconfig hme0 plumb

You can create a network port service for the interface le0.

Accordingly, using ifconfig with the unplumb parameter can stop the service and shut down the network

The above is all the contents of this article entitled "what are the problems from getting started to being proficient in Linux Server". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report