Linux Shell Application Tips

-------------------------------------- Shell application Tips------------------------------------------A command completion: Tab completion shell command two: Clear or ctrl+l clean screen ctrl+u Erase all previous contents of the cursor history

Variables and shell programming

Programming Ability:Script programmingProgramming languages: Machine language, assembly language, advanced languagesAdvanced Language:Static language: Compiled languageNo additional binaries are required, and a compiler is required to directly

memcached Start the shell script

#!/bin/sh## memcached:memcached Daemon## Chkconfig:-90 25# description:memcached Daemon## Source function library.. /etc/rc.d/init.d/functions. /etc/sysconfig/network#[${networking} = "No"] && exit 0#[-r/etc/sysconfig/dund] | | Exit 0#.

A shell statistic code line number

Xcode statistics code, with the shell command can be very simple. Open the terminal, enter your project directory, execute the following codefind . -name "*.m" -or -name "*.h" -or -name "*.html" -or -name "*.c" |xargs wc -lIf you want to count iOS

A very simple shell backup script

The library to be backed up, passed in as an argument, delete the backup file from the previous 30 daysThe backup directory is created if it does not exist,/back/mysql/#!/bin/bashDatabase=$1Username= "Root"Passwd= "Redhat"Backupdir=

SHELL Variable Summary

Positional variables$ A Gets the file name of the current user script contains the path$n gets the nth parameter of the currently executing shell script if n is greater than 9 in curly braces ${10}$# gets the number of arguments for the currently

Judging usage in the shell

Test structure:The test command can be used to test the true and false of the expression condition, and returns0,false, which is not 0; format:Test expression    #expression是一个表达式, the expression can be compared by numbers, strings, text and file

Common shell commands

1. SearchGREP-LR YHB./Indicates that all files in the current directory, including sub-files, are searched for the YHB character, and the file name is printed. If there is no-l, the searched rows will be printed out.2. Display the number of rowsNL

Shell--shift usage

Shift is a very useful command in UNIX. You can move the command parameter to the left so that the command parameter position in the script is not changed, and all parameters are traversed in turn.As Shift 3 indicates that the original $4 now become

Initial knowledge of shell scripts

#! /bin/bash (the declaration of theLinux scripting environment is the interpreter, which is bash, under the bin directory in the root directory )Definition and assignment of variables:Format: Variable name = variable value ( No need to declare

Shell Script Link Collation

Learning Shell Pre-script basics: http://www.92csz.com/study/linux/12.htm Shell Scripting Full Learning: http://blog.chinaunix.net/uid-9078183-id-2436460.html Shell script Programming Common sense: http://www.cnblogs.com/ebusi/archive/2011/02/09/195

Built-in variables for common shell scripting

Processing of parameter processing-shell incoming parameters $#The number of arguments passed to the script $*Displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be

Restarting the Tomcat shell

#!/bin/bash#1, determine if the service is available 2, do not use restart TOMCAT#*/30 * * * */home/wsm/restart.sh >>/home/wsm/restart.log# Stop tomcatfunction Killtomcat () {pid= ' ps-ef | grep "/home/wsm/bin/tomcat" | grep-v grep | awk ' {print $}

Awk writes shell distribution scripts

When you use Hadoop or deploy Hadoop, you often encounter situations where you want to copy files to other machines, but if the individual writes, it happens that the cluster is large and exhausting, and now uses an awk to write shell scripts that

Shell script programming (merge sort)

#!/bin/bash#shell Sorting of Scripts a= (1 3 5 7 9) b= (2 4 6 8) C=n=5m=7i=0j=0k=0while [$i-lt $n-a $j-lt $m];d OIF test ${a [$i]} -GT ${b[$j]};thenc[$k]=${b[$j]}j=$ (($j + 1)) k=$ (($k + 1)) elsec[$k]=${a[$i]}i=$ (($i + 1)) k=$ (($k + 1))

A quick sort of shell script programming algorithm

#!/bin/bash#shell implementation of the fast sequencing of script programming (with the idea of a meta-point at the far right) a= (8 5 3 2 for 4 1 2 3 + 9 for 8 6) temp=buff= #交换函数swap () {buff=${a[$1]}a[$1]= ${a[$2]}a[$2]= $buff}fun () {i=$ ($1-1)

Shell Array notes.

1), the definition of the array (self-dividing):Static array= (123)Dynamic array array= ($ (command))Example:array= ($ (LS)) echo ${bb[@]} color01.sh color.sh ip.sh touch.sh tou.sh user.sh while01.sh while_02.sh2), display the contents of the

Linux shell Command and execution script, linuxshell

Linux shell Command and execution script, linuxshell Http://blog.csdn.net/pipisorry/article/details/44681081 Cut all subfolders in the current folder to the current folder For dir in $ (ls)Do# Echo $ dirIf [-d $ dir-a "$ (ls-A $ dir)"]; thenMv./$

Introduction to Sed Regular Expressions in Linux shell scripts, shellsed

Introduction to Sed Regular Expressions in Linux shell scripts, shellsedSed IntroductionSed is a lightweight stream editor, short for stream editor. Sed is also called a row editor because it is used to edit a file in a behavior unit. It can

Gzexe encrypts shell scripts 01, gzexeshell

Gzexe encrypts shell scripts 01, gzexeshell Gzexe encrypts shell scripts 01 I. Introduction Most of the time, our script involves some private information, such as the user name, password, or other important information. We use some encryption

Total Pages: 541 1 .... 506 507 508 509 510 .... 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.