Recently, to the internal network for debugging and access, bought 3 peanuts can only map 6 ports, is not enough to meet the needs, just have a friend to me said Ngrok can also be carried through the intranet, research for a few days, light
A regular expression and wildcard characters
1 A regular expression is a string that matches the criteria in a file, and a positive one contains a match, and grep,awk,sed commands can support regular expressions
The 2 wildcard is used to match the
The tree command is the protagonist of printing files and directories in a graphical structure. This command is not normally included in Linux distributions. You need to install it yourself with the package Manager.
Instance:
1. Tree
Print all
Objectiveor do you write an automated packaging script today that takes you to get the last file name from the path name. Here is a record of the implementation process. Of course, in the end I will also give the official practice. (PS: Very awkward,
Most people use grep to find the specified process in the PS aux output when they write the shell filtering process, but they also display the grep process, such as finding the pptpd process, which matches two:
Copy Code code as follows:
Provides an operational expression in the following format: $ ((expression))
$ echo $ ((5* (3+3))
30
$ result = $ (($myvar-10))
The shell provides a convenient number of conversions between:
$ echo $ ((013)) #八进制
$ echo $ ((0xa4)) #十六进制
You can
1. Print some header informationCommand ............Dilimiter
The standard input of the command as the content of the boundary symbol DilimiterCommonly used in the echo command, this avoids the need to use an echo command without outputting a line,
First, through the timing of email to detect network connectivity
Copy Code code as follows:
#/bin/bash
echo "Daily Test mail" > State.txt
Mail-s Server_state Abc@jb51.net Rm-df./state.txt
~
Crontab-e
Add the following
Requirements: Delete files, directory structure: ip/year/month, everyone has a copy of this directory now need to delete all files before 2012, 2012 after the deletion of a specific month.Originally wanted to use find, the results found that these
First of all, let's look at the problem description, the following figure is my run-time error screenshot:
Solving method
Analyze the reason, maybe because I have a problem with my platform migration, we have permission to convert.
1 conversion
Here today we discuss a very funny system configuration error in Linux systems, which is sudo, and why it's funny, because if it's improperly configured, it's easy for the average user to claim root, and without a bit of technical content, System
Copy code code as follows:
#
Is it really a headache, or do you want to write a shell script to get rid of these scripts
Copy Code code as follows:
#!/bin/sh
LS $1/*.htm | While read file
Todo
Sed-i-E "/if (
Various points of knowledge are written in the notes.
Only need sudo $PATH/ftpsetup.sh, default to test/test for user name password login, after the root directory read-only, subdirectory writable writable.
Test OK on Ubuntu 13 and Linux Mint 15.
centos6.0 is installed, many packages are not installed because a minimal installation is selected, so some commonly used commands are not supported, as follows:# SCP-bash:scp:command not found
My solution is to find the package on the SCP on a
Copy Code code as follows:
#! /bin/sh
# filename killcpu.sh
If [$#!= 1]; Then
echo "USAGE: $ "
Exit 1;
Fi
For i in ' seq $ '
Todo
Echo-ne "
i=0;
While True
Todo
i=i+1;
Done "| /bin/sh &
pid_array[$i]=$!;
Done
The previous script is in save mode, now attach the command to a file, so that it can be easily modified two times or somethingThe script is basically like this, we can change with their situation again ~ add function or something.
1, the shell variable statement judgment
An expression
meaning
${var}
Variable var with the same value as $var
${var-default}
If Var is not declared, then use $default as
1, the simplest way
Copy Code code as follows:
: .... Comment Content
Block
The input is redefined to the previous command, but: it is an empty command, so it is equivalent to a comment.If a command with an inverted
Original file:Find/etc-name passwd 2>&1 | Tee Ee.log1. Cat-n The document contents of the E.log with the line number and enter E2.log in this document:[Email protected] ~/t2scripts $ cat-n E.log |Tee E2.log1/etc/passwd2 3 4Find:
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