Test network engineer's notes (Liunx)

The network project is in preparation, so I summarized a liunx and reviewed the previous liunx review. I also hope that this summary can help more people and give Xiaobai a reference.

Partition and file management (everything under Liunx is a file)
The root directory at the top of the digital structure is represented by'/'
/boot: contains the system kernel and the main boot directory.
/home: Store the home directory of supporting users in the
system /tmp: System temporary directory, store frequently used commands.
/usr: used to store a large number of system applications and related files
/var: store frequently changing files in the system.
/dev: various device files for devices such as terminals and disks
/etc: store configuration files in the system.
/bin: Binary executable file.
/sbin: used to store standard system management files. Usually execute binary files
/mnt: mount point, so external devices must be mounted in this directory

System startup process (1, boot loader-2, load the kernel-3, execute the init process (two functions: 1, can terminate the parent process 2, the corresponding program when entering a specific run level)- 4. Initialize through the /etc/inittab file.
Run level
(0: system shutdown state)
(1: single user working state, only ROOT permission)
(2: multi-user state)
(3; complete multi-process user mode, command Line mode)
(4: The system is not in use, dead)
(5: X11 console, log in to the graphical user interface)
(6: Restart cannot be set to 6, should be init 6)
Daemon: at the end, it means d (10 daemons)
dhcpd: service daemon of Dynamic Host Control Protocol.
httpd: wed server APacheco daemon.
IPtabies: firewall daemon
named: DNS server daemon.
pppoe: ADSL connection daemon.
sendmial: mail Server daemon
smb: Samba file sharing/printing service process
snmpd: simple network management process.
squid: proxy service process
sshd: SSH service daemon.
Common configuration files
ifcfg-ethx (store the IP configuration information of the system eth interface)
/etc/ sysconfig/network (store basic information of the network system, such as computer name, default gateway)
/etc/host.conf (save the system resolution name or domain name, hosts first, DNS second)
/etc/hosts (save the correspondence between the system IP address and the host)
/etc/resolv.conf (set the local DNS server)
liunx command (Format: command-option-parameter)
file attributes (d directory,-normal, b block, l connection, c character)-number of files-owner-group to which they belong-file size-date of creation- — File name
Permission: a group of three (r=4 (readable), w=2 (writeable). x=1 (executable)
Insert picture description here

ls—(View 2 file and directory information; common parameters (-a display hidden files) (-l view file content)
'>'—redirection,'|': pipeline, format: ls>xixi (ls view file transfer to xixi) xmd1|cmd (the output of cmd1 is used as the input of cmd2)
chomd-change permissions, (attribute rwx=7, rw-=6, rx=5, format chomd a=rwx file or chomd 741 file
cd-directory switch
mkdir – Create a new directory, rmdir – delete the created directory
cp – copy command (format: cp source target)
rm – delete command (-f force deletion, -i delete or not)
mv – move command (format: mv source target)
cat-display the general text file of the connection (cat file1 file2 >file3: connect file1 and file2 and redirect to file3)
pwd-display the current working directory of the current user
ln-connection (establish a different connection for a file in another location, Soft link and hard link)
grep-find all file contents in the current folder (-a: search the binary file as a text file) (-L: ignore case)
mount-mount to an empty file in Linx ( Format: mount -t Mount the partition mounted partition (usually /mnt, which is the mount point), unmount it as umount)
rpm-query package (format: rpm -qa | grep keyword: query keyword package, realize Installation)
ps-view process number command
kill-unconditionally terminate (format: kill process number)
chkconfig-provides a simple way to set the run level of a service. (List all system services)
passwd-current user password (-l: lock the password, that is, disable the account) (-u: password release) (-d: no password) (-f: forced to modify the password, available under root )
Useradd-create a user account (-d user home directory: add to the directory) (-g user group: add to the group) (-s Shell file: specify the shell that the user logs in)
groupadd-create a group (-g gid: specify a group ID) (-0: create a new group)
network configuration command
ifconfig-view network interface status (-a: so interface) (eth0: status of the first network card) (configure network interface: 1 (ifconfig eth0 down) off Network card 2, (ifconfig eth0 192.168.1.99 broadcast 192.178.1.255 wctmask 255.255.255.0) configure the IP address, broadcast address and netmask 3, (ifconfig eth0 up) start the network card
ifdown and ifup (point to /sbin/ifup and /sbin respectively /ifdown)
router-- configure routing (-add: add a route, -delete: delete a route, -net: to the network is not a host, -netwask: specify the subnet mask of the target network. gw: specify the gateway used by the route, dev : The port designated by the route.
traccroute-display the intermediate route of the data packet from the source host to the destination host. (traccroute -i network card IP address) (-i: interface)
iptables-IP packet filtering function. (-a: add rules to the rules In the chain) (-p: define the filtering strategy) (-s: used to match the source IP address of the data packet) (-d: used to match the IP address of the data packet) (-o: match the network card from which the data packet was sent )

Guess you like

Origin blog.csdn.net/weixin_47514459/article/details/109407895