The shell script that backs up Tomcat logs on Linux every week __linux

Background information: The project has two log folders, one for Tomcat itself, and two for the project. This script is used in conjunction with Crontab once a week and can be done without restarting the Tomcat catalina.out normal situation to

A command in the Linux shell command to determine if a known suffix name file exists under the directory __linux

Today, there is a problem that needs to be judged whether there is a. c file in the directory. I used the IF [-f *.c], using the-F and wildcard characters to determine if there is a. c file, while Linux always complains "unexpected operator", so

Execute the shell script function periodically through Linux crontab __linux

Paste: http://blog.csdn.net/allenlinrui/article/details/7490206 With Crontab you can execute a shell script or a series of Linux commands at a specified time. For example, the system administrator schedules a backup task to run every day Getting

The difference between Su and su in the Linux shell __linux

The difference between Su and Su- The former only switches identities, but the shell environment is still the original user's shell, while the user and the shell environment switch to the new user. The PATH environment variable error will not

A shell command to get the count of code lines

The most crude version Shell code find. -name "*.java" |xargs wc-l|grep "Total" |awk ' {print $} ' find. -name "*.java" |xargs cat|wc-l #Output: 37634 The above two sentences are the same, but the second one is to use cat to merge the contents of

The delay function in the Linux shell sleep__oracle

Article from: http://blog.sina.com.cn/s/blog_77051ec50101br8g.html It is often necessary to do some delay processing in Linux shell scripts.So you often use sleep or usleep functions.Here's a look at the difference between sleep and usleep: Sleep:

Making shell scripts for spring boot executables

After the Spring boot project is packaged into an executable jar, for ease of management, we can make a script that manages the steps of starting, stopping, and so on. Instructions for use Assuming that the script is eventually named App.sh, you can

Shell && vs | | Operator_bash

CMD1 && cmd2 If the command cmd1 result status 0, the CMD2 is executed, otherwise the CMD2 command is not executed. cmd1 | | CMD2 if the command cmd1 result status 1, the CMD2 is executed, otherwise the CMD2 command is not executed. can be used for

HBase Common shell command _hadoop

Enter HBase Shell Console $HBASE _home/bin/hbase Shell If you have Kerberos authentication, you need to use the appropriate keytab for authentication (using the Kinit command), and then use the HBase shell after the authentication is successful. You

Shell Script Connection Create database

1. Connect to create a database #!/bin/bashmysql="mysql -uroot -p111111"#sql="show tables from mysql"sql="create table test.user( id int unsigned auto_increment primary key, username varchar(20), password varchar(30))"$mysql -e "

Shell Application 4

1, write a small script named getarp.sh, log the MAC address of each host in the LAN:1. Writing getarp.sh script files(1) Send ARP request via arping command, record MAC address according to feedback result.(2) Assign a network segment address (such

Simulating a shell script to resolve Dos attacks

Method 1:#!/bin/shWhile TrueDoawk ' {print $} '. Access.log|grep–v "^$" |sort|uniq–c >/tmp/access.log#netstat –an|grep est|awk–f ' [:]+ ' {print $6} ' |sort|uniq–c >/tmp/access.log determine network ConnectionsEXEC While Read lineDoIp= ' echo $line |

Shell File/dir exist

Https://www.cnblogs.com/37yan/p/6962563.htmlCAUTION!!! If should is end with fiCAUTION!!! There should be a space between [and!, also between 1 and]1 ];then#!/bin/bash# Determine if the number of parameters passed in is not an if1 ];then echo

Shell programming guessing numbers game. (Master please detour)

Guess the number game. First let the system randomly generate a number, give the number a range (1-60), let the user enter the guessing number, the input to judge, if not meet the requirements, give high or low hint, guess the right after the number

Shell script--02 Modify the IP in the configuration file

1. Modify the IP in the JSON$. IP. SH '8.8. 8.1 '#!/bin/bash#localIP =$ (command)#localip= '/sbin/ifconfig-a|grep inet|grep-v 127.0.0.1|grep-v inet6|grep 8|awk ' {print $} ' |tr-d ' addr: 'forIpinch$ ( Do if[${ip} = ="9.9.0.224" ] Then

Seeking for OEP from shell-two memory breakpoint Methods

0x00 Preface The first thing for shelling is to find the OEP (oringinal entry point). Because of shelling, when the PE file is loaded into OD or other debugging software, it is usually the entry address of the shell program. So the first step of

Why do CD commands need built-in shell commands?

If you do not use the built-in command but fork to output a sub-process and execute it in the sub-process, the path of the parent environment will not be changed. After the execution is completed, it returns to the parent shell environment, and the

The shell script monitors whether a process has finished running.

Problem description a few days ago, a friend needs to monitor a process in the Linux system in real time. When the program runs, he will continue monitoring. When the program ends, he needs to output a sentence to the terminal, and perform

Linux Shell script programming-cut command

Cut The cut command can extract text columns from a text file or text stream. Cut syntax [Root @ WWW ~] # Cut-D 'delimiter '-F fields   The PATH variable is as follows: [root@www ~]# echo $PATH/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/

Usage of shell -- tr

TR is used to delete control characters in a file or convert characters.Syntax: TR [-C/D/S/T] [set1] [set2]Set1: Character Set 1Set2: Character Set 2-C: complement. Use set2 to replace characters not included in set1.-D: delete all characters in set1

Total Pages: 541 1 .... 260 261 262 263 264 .... 541 Go to: GO

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.