Note
This article compiles from the Commandlinefu.com series article top Ten one-liners from Commandlinefu explained. As a Web site recommended by the user as the most useful shell command, it records tens of thousands of shell commands, some of
http://fhqdddddd.blog.163.com/blog/static/186991542012417104144188/
EchoUse the echo command to display a line of text or a variable, or to enter a string into a file. Its general form is:echo stringThe echo command has many features, the most
If you are not familiar with the Linux shell array, see an article: Linux Shell array Building and use techniques , this article is mainly about the dynamic generation of array series. There should be a lot of methods here, I mainly take a sum
Under Windows, after using nodepad++ to write the shell script, upload the shell script to the Linux system, execute the shell script on Linux, report the error message, and cannot execute the shell script, the error message is as follows:
-bash:.
Purpose Description
In executing the Linux command, we can redirect the output to the file, such as LS >a.txt, then we can't see the output, if we want to save the output to the file, but also want to see the output on the screen, we can use the
Recently do a group purchase file download service, their lazy do not want to write the logic of the file download, and Linux Curl command is very powerful, so want to directly through the Java to execute Curl command to do the download.
In Java,
1. Array definition, the shell uses a pair of parentheses to represent the array, and the array elements are separated by "spaces"
# empty array arr1
arr1= ()
# array arr2, members are 1, 2, 3, 4, 5, 6
arr2= (1 2 3 4 5 6)
2. Array elements read,
Reproduced from: http://changyang319.com/archives/2234
NO-IP is an established free Internet domain name provider, and if you've ever had a friend using an active IP stand, you should be impressed by how NO-IP can update the domain name IP through
In the shell programming process, you often encounter problems getting file names and file suffix names. The general processing methods are as follows:
#code
file= "Thisfile.txt"
echo "filename:${file%.*}"
echo "extension:${file##*.}
"
Reprint Address: http://blog.chinaunix.net/uid-25099259-id-3187481.html
VxWorks commands that are commonly used
1. Task-related commandsSP FUNCTION,[ARG1],..., [ARG9]-Start a task, accept up to 9 parameters, default priority 100, stack 20000
A program that often needs help explaining.
The ways to activate help instructions are described in two ways
1. The simplest way is to discriminate by the number of parameters. For example, displays the help description without any parameters.
2.
1. Use shell script to find the process ID corresponding to the program and kill the process
#!/bin/sh
name=$1
echo $NAME
id= ' ps-ef | grep "$NAME" | grep-v "grep" | awk ' {print $} '
echo $ID
E Cho "---------------" for
ID in $ID
does
kill-9
Where the shell script needs to interact with the here document is the implementation, but some commands require the user to manually go on the interaction such as passwd, SCP
It is very painful to eliminate user interaction for automatic deployment,
Http://blog.zol.com.cn/2322/article_2321763.html
$ () and ' (anti-quote)
In the bash shell, $ () and "(anti-quote) are used for command substitution.
The so-called command substitution is similar to the variable substitution we learned in the fifth
One, bash internal variables:
Common internal commands: Echo,eval,exec,export,readonly,read,shift, wait,exit, and Dot (.) are also the source commands.
Command
function
Echo Variable Name
Displays the variables
1. Process ControlShell script is a procedural programming language, the process of programming language is divided into three types of execution, namely sequential execution, select execution, loop execution, these three execution methods to build
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
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
In general, we are the most common command for copying data on the same server is CP, which can be used if you want to copy between different servers.Now there are two servers, you need to migrate the files on the a server to B server, because the
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.