Tag:shell

  • How to delete special symbol filename file in Linux

    Time:2019-12-15

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com 1. For files with special character columns such as those beginning with < > \ * remove the quotation marks [[email protected] 51mn]# rm “<>\*” rm: remove regular file ‘<>\\*’? y 2. For text beginning with, delete and use — [[email protected] 51mn]# rm — […]

  • Four execution modes of shell script

    Time:2019-12-15

    There are four ways to execute the shell script in Linux: working directory execution, absolute path execution, SH execution and shell environment execution. First, take a look at our script [[email protected] scripts]$ ll total 4 -rw-rw-r–. 1 tan tan 68 May 8 23:18 test.sh [[email protected] scripts]$ cat test.sh #!/usr/bin/bash /usr/bin/python <<-EOF print “Hello Shell” EOF […]

  • Shell script restart project

    Time:2019-12-14

    You need to restart the project manually every time you send and package the projectShellScript one click restart project Shell script #!/bin/bash while getopts “n:p:” arg do case $arg in n) echo “NAME’s arg:$OPTARG” NAME=$OPTARG ;; p) echo “PORT’s arg:$OPTARG” PORT=$OPTARG ;; esac done PROCESS=echo | lsof -i TCP:$PORT | grep LISTEN | awk ‘{print […]

  • Rmdir: the command to delete an empty directory in Linux

    Time:2019-12-13

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com Rmdir is used to delete an empty directory. Only when the directory is empty will the directory be deleted. In this way, we don’t need to check whether the directory is empty in advance. If there is a file in the directory, the […]

  • Essential tips for getting started with Linux (e-Book)

    Time:2019-12-13

    0 basic introduction Linux system operation and maintenance essential secret collection Many years ago, migrant workers taught themselves Linux system on the basis of 0. It was very hard along the way. Why write this e-book? It’s because the migrant workers encountered many difficulties and troubles when they were learning Linux, because there are too […]

  • The switch sets up the communication subnet and shares the network through Mac OS

    Time:2019-12-12

    Prepare materials: Three raspberry pies without Internet, with centos7 installed; One switch; One MacBook; A wireless router normally connected to the external network; There are several network cables, and the network cable adapter may be prepared according to the specific situation; Example of network composition I feel that the description of light and text is […]

  • The reason why root can’t delete files with RM in Linux

    Time:2019-12-12

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com By using the command chattr Command + I attribute, the file can be prevented from being modified, re ordered and deleted. View the properties of the file through Lsattr [[email protected] root]# lsattr B.file —-i——–e– B.file The discovery file has an I attribute. Delete […]

  • Global substitution of VI commands

    Time:2019-12-9

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com First open the file you want to operate with the VI command, and then enter:% s / line / line / gExplain the function of this command:: used to start an ex command%Determines the scope of the action, from line 1 to the […]

  • How to prompt the user for confirmation when the VI command makes a global replacement

    Time:2019-12-8

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com VI command replaced command:% s / 51mn / manong / g only need to add C parameter after G. :%s/51mn/manong/gcReplace with manong (Y / N / A / Q / L / ^ E / ^ y)?Describe the parameters prompted above:Y replaceN skip […]

  • Linux server cluster management platform in China

    Time:2019-12-7

    For the stationmaster or operation and maintenance personnel who use server cluster to manage operations, everyone has opinions on manual deployment environment and one click deployment environmentFor server cluster management, here I recommend two platforms to facilitate the use of the most simple and convenient way for the station master or operation and maintenance personnel […]

  • VI command how to edit multiple files

    Time:2019-12-7

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com 1. Directly enter VI file1 File22. Input: n switch to the next file3. Input: n switch back to the previous fileWhen users switch from one file to another, if there are changes to the current text, VI requires users to save the changes […]

  • Loading order of startup files of login shell session in Linux

    Time:2019-12-6

    WeChat public address:51 yards of rural networkProfessional programming Q & a communitywww.51manong.com The login shell session prompts the user for a user name and password. One or more startup files will be read/Etc / profile global configuration script for all users~/. Bash? Profile user’s personal startup file~/. Bash? Login if. Bash? Profile is missing, bash […]