Use the shell to get the date n days before the specified date _linux shell

First, create test files test.sh #!/bin/sh ./etc/profile # Parameters: # Args[0], data date, date format Yyyy-mm-dd # Take 30 days before the date function Get_date_ 30daysbefore () { sec= ' date-d $ +%s ' sec_30daysbefore=$ ((sec-86400*30))

How to test Port pass (four methods) _linux shell

In general, use the "Telnet IP port" to determine the port pass, in fact, testing methods more than this one, there are many ways, the following small series to share several methods, the specific content please look down: Preparing the Environment

Shell 1 less than/dev/null 2 is greater than &1 meaning _linux shell

The shell may often see: >/dev/null 2>&1 The result of the command can be defined as the output in the form of%> /dev/null represents empty device files > represents where to redirect, for example: echo "123" >/home/123.txt 1 indicates stdout

Shell basic calculation, logical operation, bit operation detailed _linux shell

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

Shell Script Learning Guide Text Processing tool _linux Shell

4.1 Sort Text Sort of 4.1.1 RowsWhen command-line options are not provided, the entire record is sorted according to the order defined by the current locale.In the traditional C locale, which is the ASCII order. 4.1.2 Sorted by FieldThe-K option

Unpack the RPM package with Linux commands and rpm command introduction _linux Shell

RPM is a red Hat (REDHAT) package management tool that implements features like Add/Remove Programs in Windows RPM-IVH install_rpm Tar xvf Informix-linux.tar Inux to extract the command Daquan . tarUnpack: Tar xvf Filename.tarPacking: Tar cvf

LINUX production environment Build recommended tutorials _linux shell

Because the Linux production environment to build a lot of steps, it is cumbersome and necessary steps. Although it has been done many times, but because of the cumbersome steps, it is easy to forget, the following small set up a time to build the

4 ways to implement SSH automatic login _linux shell

ssh

1. Automatic Ssh/scp method A is a local host (that is, a machine used to control other hosts);b is a remote host (that is, a controlled machine server), if IP is 192.168.60.110;Both A and B systems are Linux. To run a command on a:# ssh-keygen-t

Shell scripts that consume CPU resources _linux shell

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

Shell judge file, directory exists or have permission code _linux shell

Copy Code code as follows: #!/bin/sh Mypath= "/var/log/httpd/" Myfile= "/var/log/httpd/access.log" #这里的-x parameter to determine whether $mypath exists and has executable permissions if [!-X "$myPath"]; Then mkdir "$myPath"

Linux Shell Script Series Tutorial (vii): script Debugging _linux Shell

First, debug scripts Debugging is one of the important features that every programming language should implement, and when something unexpected happens, use it to generate the running information of the script, and the debugging information can

Putty method to realize automatic landing of remote Linux host _linux Shell

Because the work needs, often from the Windows host to access the remote Ubuntu server, each input account and the old password, feel very troublesome, so the reference online tutorial simple set up can automatically login remote host, very

Shell implementation to identify the number of physical CPUs, core number _linux shell

How to identify the number of physical CPUs, a few cores, is hyper-threading or multi-core Judge the basis: 1. CPUs with the same core ID are the same core hyper-threading.2. CPUs with the same physical ID are the same CPU-encapsulated threads

Linux kernel linked list implementation process _linux shell

On the realization of the double linked list, the general textbook defines a two-way linked list node in the following ways: Copy Code code as follows: struct list_node{ Stuct List_node *pre; Stuct List_node *next; Elemtype data;

Understanding and learning of shell programming Basics Bash_linux Shell

1. Understanding Bash Through the shell will input the instructions and kernel communication, let kernel control hardware workView Shell:cat/etc/shellA preset shell type is recorded in the/etc/passwd after login and is related to the accountCommand

Two methods of changing passwords interactively in shell scripts _linux shell

Today, when writing a shell script to find that you need to set the user's password, and set the password is interactive, so in the script is obviously not very good, so the Internet to find data, found the following two common way to set the

CSH script Syntax Instance _linux shell

CSH Example Reference: Copy Code code as follows: #!/bin/csh-vx #csh-VX Show the command before running to help debug #just to check syntax#csh-N $ #argvif ($ #argv echo "Sorry, but you entered too few parameters"echo "Usage: $

25 Useful shell Scripts Common command sharing _linux shell

ssh

1. List all directory usage and sort by size. Copy Code code as follows: Ls|xargs Du-h|sort-rn #不递归下级目录使用du-sh 2. View the file exclusion with the # switch and blank line, suitable for viewing the configuration file. Copy

Using shell script to quickly build the Nodejs development environment under Ubuntu _linux Shell

Nodejs is really very hot, before the past, but never seriously recorded anything. Build its development environment under Ubuntu Try a quick, easy way to get the system to automatically help you install what you need, and we'll generate a shell

Shell script to get the domestic major carriers network segment script sharing _linux Shell

pow

The Asia Pacific Network information is recorded here, updated every day. Http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest The following script will edit this text, output several major network segments of the domestic operators.

Total Pages: 541 1 .... 176 177 178 179 180 .... 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.