The Linux shell gets the process ID, or gets the process in the application Id__linux

1, the Linux shell to get the process ID method: ps-a |grep "/usr/sbin/gps_app" | awk ' {if ($ = = ' start ') {print}} 'Pidof "CmdName" Pgrep "CmdName" The results of these three kinds of operations in bash and BusyBox ash are slightly different,

Linux Shell Script Learning Introduction notes 3__linux

Today continue the last Find command content, mainly find and-exec and xargs combination and use. (9) The Find command can be combined with other commands with the help of an option-exec. -exec is one of the most powerful features of find. For

The shell extracts the file suffix name and determines whether it is a specific string

If the file is a. css file or a. js file, it is processed. File=$1 if ["${file##*.}" x = "css" x]| | ["${file##*.}" x = "JS" x];then Do something Fi Attention: 1> extract file suffix name: ${file##*.} # #是贪婪操作符, matching from left to right,

The shell script implements the monitoring of whether a process is running or not

Problem description A few days ago, a friend needs real-time monitoring of a Linux system under a process, when the program is running to continue to monitor, when the program is finished to the end of a word to the end, and do follow-up. Problem

Java Implementation sort (insert sort + bubble sort + Select Sort + Shell sort + quick Sort) __java

To sort an integer element in the ArrayList collection in ascending order: Package org.hyp.test; Import java.util.ArrayList; Import Java.util.Random; public class Mysort {private arraylist list, public arraylist getlist () {return list;} PU Blic

Arrays and traversal __linux in the Linux shell

When using the shell under Linux, the array is occasionally used for convenience. The array is declared in the following way: array= (element1 element2 element3 ... elementn) That is, wrap the array elements of the parentheses package together,

LINUX SHELL parsing JSON format __linux

cas

LINUX SHELL parsing JSON format 1. Use tool JQ https://stedolan.github.io/jq/ Download version Linux version Jq-linux64 Ubuntu Direct sudo apt-get install JQ can be. 2. Parse JSON [Root@cas script]# cat Test.json {"Tasks": [{"id":

LUnix How do I start and close a Java program with a shell?

I wrote a Java program with the main method entry, already packed a jar and already started running under UNIX, but I wanted to write a script file to make it easier for managers to start and shut down my Java process. Similar to Tomcat

Linux Shell Set__linux

SET Command The set command acts primarily to display shell variables that already exist in the system, and to set new variable values for shell variables. When you use set to change shell attributes, the function of the symbol "+" and "-" is to

Linux enables fast switching between JDK versions via shell scripts __linux

"Lead" on the Android website, the installation part of the JDK has the following requirements: The Master branch of Android in the Android Open source project (AOSP) needs to use Java 8, and OpenJDK is needed in Ubuntu. For a lower version, refer

Shell get file suffix

Introduce a file in a makefile file by using include Include $ (shell./getname) and the contents of the GetName are as follows: pwd=$ (PWD); if ["${pwd#*/zloader.}" = "$pwd"];then Echo Makefile.cpci Else echo Makefile.${pwd#*/zloader.} fi I've

Shell cutting Nginx Log tool for five days without restarting Nginx

Ideas: 1, back up yesterday's log, while deleting the five days before the backup data. 2, copy the log file, and set the original log file is empty Shell #!/bin/bash #function: Cut nginx log files #author Kung log_path= '/home/wwwlogs/'

How to implement Shell concurrency

Reprint: http://blog.chinaunix.net/uid-27571599-id-3473078.html Many people have asked me how to write shell script, how to achieve the same time to upload files to three FTP servers, how to detect the three servers are alive and so on, in fact,

Read text file content line-by-row with Linux shell __linux

It's a lot better than writing code: ubuntu@vm-0-13-ubuntu:~$ cat a.txt gaga agagag agaga agagd xxx agadaa Agaoo yyy zzzz ubuntu@vm-0-13-ubuntu:~$ ubuntu@vm-0-13-ubuntu:~$ ubuntu@vm-0-13-ubuntu:~$ cat a.sh Cat A.txt | While read

Bash Shell determines if there is a given element in the array

#判断数组中是否有给定元素 #参数: 1 arrays; 2 element #返回: Yes/no # Example: # Determine if there are elements in array Xrsh_array i3 # xrsh_array= (i1,i2,i3) # xrsh_tmp= ' echo ${xrsh_array[*]} ' # Xrsh_arrhasitem ' $XR Sh_tmp "" i3 "# returns YES # Note: The

Shell determines whether a string is a number

#!/bin/bash # # method 1 A=1234;echo "$a" | [-N "' Sed-n '/^[0-9][0-9]*$/p" "] && echo string A is numbers The first-n is the shell's test flag, and the subsequent string "' Sed-n '/^[0-9][0-9]*$/p '" is tested, and if not NULL,

Several methods of self-increment (plus 1) of shell integer variables

#!/bin/shA=1 a=$ (($a + 1)) a=$[$a +1] A= ' expr $a + 1 ' Let a++ Let A+=1 ((a++)) Echo $a 1. Classical methodsLength= ' expr length + 1 '2. Bash only$ ((length++)) 1. i= ' expr $i + 1 ';2. Let i+=1;3. ((i++));4. i=$[$i +1];5. i=$ (($i + 1))

Digital mini-game under the shell

Rules: a--number pair, position is right b--The result of a, the number is correct, but the position is incorrect. After starting, a systematic initialization of a 4-bit repeatable number, such as "1223". Assuming that the user enters "1234" for the

Shell Scripting day three-special variables

First, position variables: $ $ Gets the file name of the current execution script, including the script path.$n gets the nth parameter of the current execution script, 1~9, greater than 9, enclosed in {}, for example: ${10}.$# indicates the number

Shell script Recursive compression practice

#!/bin/bashsrc_path=/data/www/logsdst_path=/data/www/logs_bakfor rfile in ' Find $SRC _path/-depth-maxdepth 1-type F | Awk-f '/' {print $NF} ' DOTAR-ZCPVF $Dst _path/$rfile. tar.gz $Src _path/$rfiledonefor dir in ' Find $SRC _path/*-type D|awk -F '/

Total Pages: 541 1 .... 400 401 402 403 404 .... 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.