The rsh command is short for remote shell. This command starts a shell on the specified remote host and executes the command specified by the user in the rsh command line. If the user does not provide the command to be executed, RSH uses the rlogin
Simple usage
#! /Bin/sh (sleep 10; echo "username"; sleep 10; echo "password"; sleep 10; echo "PWD"; sleep 50; # echo exit) | Telnet $ IP
Connect to the remote machine and check the current directory.
Username/password is the username and
(1) automatically log on to FTP
(2) Place the downloaded file to the specified local directory
(3) determine whether there are any files to be downloaded on the FTP server
#! /Bin/bash# Create a directory with the downloaded file in the format of
The test statement must have spaces before and after the equal sign, and there can be more than one space. To promote it, there must be no spaces before and after the equal sign of the value assignment statement, non-assignment statements require
When learning Linux shell scripts, one of the most common errors is to useFor(For line in $ (cat file.txt) do ...) Read files row by row. The following example shows the result.
File file.txt content:
Cat file.txt
This is the Row No 1;
This is
1. display the 10 processes that consume the most memory/CPU
ps aux | sort -nk +4 | tailps aux | sort -nk +3 | tail
2. view the number of concurrent Apache requests and their TCP connection status
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S)
1. variable order
In the script, there is no global or local variable for the same process.
It is just a break. If you use a variable in a function, and there is no trace of this variable outside the function. However, as long as you have called
Source: http://zhidao.baidu.com/question/322131711.html
File comparison operator-E filename if filename exists, it is true [-E/var/log/syslog]-D filename if filename is a directory, it is true [-D/tmp/mydir]-F filename if filename is a regular
$ @ Refers to all command line parameters. Each parameter is enclosed ""
$ * Indicates all command line parameters
The following procedure:
Test1.sh
-------------------
Sum = 0For VaRIn "$ @"DoLet sum = sum + $ VaRDoneEcho "sum = $
(1) substr in awkSubstr (source string, start index, length) Start index starts with 0Example:Awk '{$ A = substr ($, 2); print $ A;}' filenameAssume that only one row in the file is abcdefg, the returned result is AB.
(2) expr substrExpr substr
Transferred from: t00lsExp, a vulnerability circulating on the internet, indicates that the backend can be used only if the plus directory exists and the server can be connected externally._ 1 U-T (B-F8 CPrerequisites: You must prepare your own Dede
Using shell scripts to monitor and manage Oracle databases will greatly simplify DBA workload, such as common instance monitoring, monitoring, and alarm log monitoring, and database backup, AWR report automatic mail, etc. This article describes how
The flexible combination of Linux/Unix shell and SQL variable transmission greatly improves DBA efficiency, this article provides a few simple examples of passing variables between Linux/Unix shell SQL statements for your reference.
Call SQL in
Http://itsecuritylab.eu/index.php/2010/07/05/hide-shell-in-a-target-system/
It seems that you like shell very much. It's cute and happy. Next we will introduce a method to hide shell. htaccess attack.
This must be an Apache server.
Click it to
root@bt:~/test# who --helpUsage: who [OPTION]... [ FILE | ARG1 ARG2 ]Print information about users who are currently logged in. -a, --all same as -b -d --login -p -r -t -T -u -b, --boot time of last system boot -d, --dead
root@bt:~/test# chgrp --helpUsage: chgrp [OPTION]... GROUP FILE... or: chgrp [OPTION]... --reference=RFILE FILE...Change the group of each FILE to GROUP.With --reference, change the group of each FILE to that of RFILE. -c, --changes like
In the Linux Shell environment, input and output redirection is supported, expressed by symbols .
0, 1, and 2RepresentStandard input, standard output, and standard errorInformation output. It can be used to specify the standard input or output to
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