Used to record shell scripts that use commands after login _linux shell

Copy Code code as follows: #/bin/bash # History After #把以下代码直接粘贴到/etc/profile user_ip= ' who-u am I 2>/dev/null| awk ' {print $NF} ' |sed-e ' s/[()]//g ' Histdir=/var/log/.hist If [-Z $USER _ip] Then User_ip= ' hostname ' Fi if [!-D

Linux shell implementations two ways to get user input to a single character in a specified range _linux shell

Method One: Copy Code code as follows: Echo ' echo {a.. Z} ' echo {A.. Z} ' >/tmp/letterfile While Read-p ' please input a letter: ' Letter Todo ((' Awk-v var= "$letter" ' Begin{print length (var)} ' = = 1)) && grep-q

Bulk Modify SSH configuration expect script _linux shell

The first idea, with iptables the external network SSH packet drop off;The second idea, with Tcpwrapper to sshd allow write death;The third idea, revise sshd_config, only listens intranet request. Due to some unclear reasons, the iptables approach

Shell Script Implementation Monitor iptables run State _linux shell

Recently in the debugging server iptables, oneself made a timed turn off iptables, but at night home rarely open a computer, so can not go to start iptables, of course, you may say, why not cancel timed shutdown iptables, I can only say that

Shell script automatically deletes backup files above a specified size _linux shell

The recent local virtual machine space is always backed up to fill, in order to lazy don't want to log up every day to clear, just write this automatic cleanup script. System: CentOS 5.x Script content: Cat make_room.sh Copy Code code as

Shell command Bulk modify picture filename _linux Shell

Company colleagues today to find me help modify the filename, I see, well, hundreds of files to rename, file name format is _01.png _02.png so in turn, colleagues asked the front of the "_" to remove, fortunately, the request is simple, did not let

Shell script implements whether the file is consistent across the line server _linux shell

Sometimes you need to compare files consistently in your work, and you can do it with the following script (simpler): share it, hoping to help friends with the same needs Copy Code code as follows: #!/bin/bash #对比服务器上文件是否一样 # Richard

Shell script to slow down system time (used when testing the server) _linux Shell

The company's recent server testing, the need to constantly adjust the system time, one or two is ok half, a little more points, on a variety of entanglements, the author of these several sets of the author is going crazy. Eldest brother: All speed

Shell script Implementation Batch Add user _linux Shell

Copy Code code as follows: useradd.sh #!/bin/bashFor name in Tom Joy John Mark JamesDo Useradd $nameecho "Redhat" | passwd--stdin $nameDone OK, after the execution, the new user will be automatically created Tom, Joy, John, Mark, James,

A simple shell script sharing _linux shell that monitors squid running processes and automatically restarts

Copy Code code as follows: #!/bin/sh While Sleep 30 Todo Squidnum= ' Ps-ef|grep squid|grep-v grep|wc-l ' #HttpNum = ' netstat-an|grep 0.0.0.0:80|grep-v grep|wc-l ' #80状态 If [$SquidNum!= 3]; Then /etc/rc3.duid start Adddate= '

Linux shell Script learning recording and playback terminal session _linux Shell

Copy Code code as follows: amosli@amosli-pc:~/learn$ script-t 2> timing.log-a output.session# start recording Script started, file is Output.session amosli@amosli-pc:~/learn$ Hello1 No command ' hello1 ' found, did you mean: Command ' Hello

Print process number (PID) _linux shell with interface provided by kernel

C File Printpid.c Copy Code code as follows: #include #include #include #include #include static __init int printpid (void)//install module functions{struct Task_struct *task,*p;struct List_head *ps;int count=0;PRINTK

Linux automatic cleanup log script sharing _linux Shell

1. A streamlined script for automating the deployment of systems, with the main function of cleaning up all directory logs 2. According to the given log directory, delete time combined with crontab to clean the log, clean up after completion, after

Linux automatically restarts Tomcat script sharing _linux Shell

Copy Code code as follows: #!/bin/bash # #chkconfig: 35 88 14 #description: Tomcat Auto Start script #script by Okhelper Case "$" in Start echo "Here is start script ..." java_home=/usr/jdk1.6.0_13; Export Java_home Jre_home= $JAVA

The shell script implements the bulk download resource and retains the original path _linux shell

Sample Resources Listsuch as Url.txt: Copy Code code as follows: Http://su.bdimg.com/static/superplus/img/logo_white_ee663702.png Http://su.bdimg.com/static/superplus/img/logo_white_ee663703.png

Use Plink tool in Shell to implement remote batch shutdown _linux Shell

My operating system is centos6.4. Operating system: Rhel 6.2 x86_64 Download and install the Putty software package, I downloaded the putty-0.62-1.el6.rf.x86_64.rpmDownload the address below: HTTP://RPM.PBONE.NET/INDEX.PHP3 1. Remote Host IP

Shell periodically deletes files before the specified time _linux shell

Recently the World Cup has come, has been busy between work and the World Cup, there is no time to manage my blog, today can only be the whole simple small shell to everyone. The company asked to delete one months before the backup file, so that the

Shell Monitor iptables run State _linux shell

Recently in the debugging server iptables, oneself made a timed turn off iptables, but at night home rarely open a computer, so can not go to start iptables, of course, you may say, why not cancel timed shutdown iptables, I can only say that

The shell script implements monitoring swap space usage and viewing processes that occupy swap _linux shell

Copy Code code as follows: #!/bin/bash Echo-e ' Date +%y%m%d%h%m ' Echo-e "Pid\t\tswap\t\tproc_name" # Take out all directories in the/proc directory (the process name is the number is the process, others, such as sys,net, etc. store

The shell script realizes the hard disk space and the table space usage statistics and the mail informs the _linux shell

Copy Code code as follows: #/bin/bash #该脚本用于统计硬盘空间和表空间的使用情况, and Mail out #初始化环境变量 Source/home/oracle/.bash_profile #获得本机ip ip= '/sbin/ifconfig eth0 | grep bcast | Cut-d:-F 2 | Cut-d ""-F 1 ' #切换到本脚本目录 cd/home/oracle/shell/

Total Pages: 541 1 .... 529 530 531 532 533 .... 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.