Article From:

New zoning:fdisk /dev/sda(aOn behalf of the first hard disk.)
                   After the construction is finished, W is saved
Update partition table:partprobe
mkfs.ext4 /dev/sdb{1..3} : Formatting is only a file system
mount /dev/sdb1(Source device) /sdb1 (mapping directory): mount
df:View the mount information (block)df -h:View mount information (G)mount:View specific mount parameters
umount /sdb1/(The cataloging Directory:Unloading and mounting
umount -l /sdb1/(The cataloging Directory:Forced unloading and mounting
du -sh /etc/:File size under statistical catalogues
Look at the file inode:ls -i File path
Build a soft connection:ln -s Source path (absolute path) target path (absolute path)
                          1.Equivalent to a shortcut under Windows
                          2.Delete link files, source files have no impact
                          3.Delete source file, link file failure
                          4.Modify the source file / link file, the content is changed
                          5.The soft connection is directed to the file name
                          6.inodeThe number is different (inode points to block, the inode of the source file points, the source file that the target file points to, so inode is different, the modification is related).
Building hard links:ln Source path target path
                            1.Delete link files, source files have no impact
                            2.Delete source files, link files have no impact
                            3.Modify the source file / link file, the content is changed
                            4.Hard links point to inode
                            5.inodeThe same number (inode points to block, the inode that the source file points to, and the destination file also points to inode, so inode is the same as modification).
Soft connections can be cross partitioned, hard links can’t be (because hard links are the same as inode, but the same inode number in each area, pointing to a different block)
ipAddress:AClass: the top eight (1-126), the top 8 are the network bits, and the latter 24 are the host bits.
              BClass: the top eight (128-191), the top 16 are the network bits, and the latter 16 are the host bits.
              CClass: the top eight (192-223), the top 24 are the network bit, and the 8 bit host bit.
Network address =ip address & subnet mask
Configure the network card:Temporary (dynamic DHCP) — (1) ifconfig eth0 (IP address) /24 (subnet mask)
                                                     ②ifconfig eth0 netmask (subnet mask)
                                                         Restart network services is gone: service network restart
                  Permanent (static static) — 1 VIM /etc/sysconfig/network-scripts/ifcfg-eth0 (modified NIC name)
                                                     ②Modify the ONBOOT=yes in it
                                                                           IPADDR=IP to be configured
                                                                           NETMASK=Subnet mask to be configured
                                                                           GATEWAY=The gateway to be configured
                                                                           DNS1=The main DNS to be configured
                                                                           DNS2=The auxiliary DNS to be configured
                                                   ③Restart the network service (to turn off the daemon NetworkManager, temporarily close service NetworkManager stop, and start the next boot).
                                                                          Permanent pass: 1. Chkconfig –list |grep ‘NetworkManager’
                                                                                        ②chkconfig –level 2345 NetworkManager off(No level default full clearance, on full open, usually change to 35 line.
View the routing (Gateway):route -n
Add the gateway (temporary):route add default gw default gateway
Look at DNS:cat /etc/resolv.conf
There is a IP address conflict within a subnet.arping -I eht0 IPaddress
rpmSoftware package:Installation: RPM -ivh package V: process H: progress
                                rpm -ivh Software package –force = = “overlay installation
                                rpm -ivh Site name / software package
                     Download software package: WGet website name / software package
                     Query: RPM -qa |grep’dhcp’rpm -q package name
                               rpm -ql The package name = = query package is installed in those locations.
                               rpm -qi Software package name = = “query software package information
                     Delete: RPM -e software package name (no extension)
                               rpm -e Software package name –nodeps (ignoring dependency)
View version:cat /etc/redhat-release
Emptying firewall rules:iptables -F Or service iptables stop
No DNS parsing is needed: vim /etc/hosts (With IP and its domain name
Modify the host name:hostname Host name (temporary)
                       vim /etc/sysconfig/network(Permanent)
Configure the local Yum source: vim /etc/yum.repos.d/local.repo
(yumEditor: [local]
                                             name=local yum
                                             baseurl=file//yumSource path ==> tell Yum where the source is (file// is the protocol).
                                                     (There should be 3 /) here.
Solve the dependency installation by yourself:yum install Software package name (before installation needs to be confirmed)
                                         yum -y install Software package name (no confirmation before installation)
yumInstead of going directly to the package installation, first look for the source path, and then find a file with a dependency relationship named repodata.
uriThe address (three paragraphs):http://         /game
                                (Agreement) (domain name /ip)
Clean up the yum cache:yum clean all
Build a dependency relationship:①First install createrepo RPM package: Yum install createrepo software package.
                                  ②Build a directory: MKDIR /test
                                  ③Test the package into this directory: CP package /test
                                  ④createrepo /test (Building a dependency relationship
                                  ⑤Modify /etc/yum.repo.d/local.repos
yumFuzzy installation:yum -y install *http* (Do not remember to use * instead, it’s better to use less)
yumUninstall software package:yum erase Software package name
yumBuild cache information (load the yum source cache):yum makecache
yumAfter the network is downloaded and installed, the package will be cleared. If you want to save it, you need to modify the configuration file.vim /etc/yum.conf
                                                                                                                  Editor: cachedir (caching directory)
                                                                                                                            keepcache(Reservation cache) =1
Source installation:①Preparation: Yum groupinstall ‘development tool (Development)’
                                 yum install gcc-* glibc-* -y (reinstall:Reinstall)
                   ②Unpack: tar xvf Python-3.5.2.tgz
                   ③Execute configure script, add compilation parameters, such as –prefix specify installation path.
                              cd Python-3.5.2
                              ./configure –prefix=/user/duanshuyu/Python3.5
                   ④Compilation: make
                   ⑤Installation: make install
Configure the environment variable:①Temporary: look at PATH:echo $PATH
                                         Add: PATH=
                          ②Perpetual: VIM /etc/profile
                                         Add: PATH=
                                                     export PATH
sshdConfiguration file:vim /etc/ssh/sshd_config
Port number:System can be used: 0-1024
               What you can use: 1024-65535
Slow down SSH links:Add IP address and host name parsing: VIM /etc/hosts
                             vim /etc/ssh/shhd_config
                                Lookup in the command line mode: /UseDNS
                                 Editor: UseDNS no (annotated open)
                                 Reboot service: service shhd restart
                                 Close firewall: Service iptables stop (temporary)
                                                      chkconfig iptables off(Permanent)
Deployment Services:①Preparation environment: A. closes the firewall: Service iptables stop (temporary)
                                        b.Close selinux:setenforce 0 (temporary)
                                                       Perpetual: VIM /etc/sysconfig/selinux
                                                                  Editor: SELINUX=disabled
                                       c.Configuring IP
                  ②Install the package: Yum install httpd -y
                  ③Modify configuration file: VIM /etc/httpd/conf/httpd.conf (package name: httpd; Service Name: Apache)
                  ④Restart service: Service httpd restart (echo’test’> > /var/www/html/index.html)
                                                                     (echo ‘test’ >> /var/www/html/a.txt)
                  ⑤Test: open browser = = “http:// service port IP: port number /a.txt (default index.html)”
sambaAdd users:smbpasswd -a user
Users only allow Samba services to be logged in:usermod -s /sbin/nologin User name

Link of this Article: Linux basic learning two

Leave a Reply

Your email address will not be published. Required fields are marked *