Shell God plugin for Mac Zsh

Since the use of Mac after the various configurations, the premise of this article is to use Tmux friends, introduce a god plugin zsh, first of all why use it: Crtl + Z Displays the PID of the process when the process is suspended, so that

Linux Shell: The program PID and occupancy size of swap in statistical system

#!/bin/bash sum=0overall=0for dir in  ' find /proc/ -maxdepth 1 - type d -regex  "^/proc/[0-9]+" ' do    pid= ' echo  $DIR  | cut  -d / -f 3 '     progname= ' ps -p  $PID  -o comm - -no-headers '     for SWAP in  ' grep swap  $DIR/smaps 2>/dev/ null 

Linux shell Script Daemon monitors SVN services

svn

The recently built SVN service does not know why the service is always turned off (if you do not know how to build SVN can refer to the SVN version control software under Linux ), so a daemon is implemented with shell scripts. Used to monitor if the

Execute shell command

First name the shell command as a. sh fileSave the above code as test.sh and CD to the appropriate directory:chmod +x./test.sh #使脚本具有执行权限./test.sh #执行脚本If an error/bin/bash^m:bad interpreter:no such file or directoryOne of the reasons for the

Common shell command logging under Linux 1

Hardware Chapter CPU-related Lscpu #查看的是cpu的统计信息. Cat/proc/cpuinfo #查看CPU信息详细信息, such as the model of each CPU, frequency, etc. Memory-related Free-m #概要查看内存情况 The unit here is

Shell command and Process Control

Shell command and Process ControlThere are three types of commands that can be used in shell scripts:1) Unix command:Although you can use any Unix command in a shell script, there are some relatively common commands. These commands are usually used

Ubuntu_ using the shell

The shell is a command interpreter that provides interaction between the user and the operating system for a non-interactive interface that is oriented to the command line. The user enters commands at the command line, the shell interprets them, and

Shell scripting Getting Started learning notes

1.shell between the operating system and the user. Responsible for interpreting the command line2./etc/shells Record login system effectively supports Shell3./ETC/PASSWD Finally, someone who can see the user's default shell4. Directly enter the name

Shell function parameters

In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, $ $ for the first argument, and $ = for the second argument ...Examples of

Shell finds files and deletes

-mtime 0 represents files that are currently 0 days away from the file modification time, which is less than 1 days (24 hours) away from the current time.-mtime 1 is a file that is currently 1 days away from the file modification time, which is 1

Shell Learning 31-day----function problem

FunctionCase One :#!/bin/bashHello () {echo "Hahahah"}HelloExecutes the function with the result : hahahaCase two :#!/bin/bashFunwithreturn (){echo "The function is to get the sum of the number"Read-p "Input first number" NUM1Read-p "Input second

Shell learns 33 days----about redirection

About redirectsAdditional redirection operatorsUse set-c collocation Posix shell : execute set -c command to open shell The so-called forbidden override option simple > redirect encountered when the destination file already exists

Shell Step by Step (3)--stdin & IF

4. Input and output#! /bin/bash# Read users input and then get his nameread"Please input your first name: " firstNameread"Please input your last name: " lastNameecho-e"Your full name is: $firstName $lastName"Read usage:read[-ers][-a 数组][-d

Bash Shell and variable explanation

Structure of this article: Bash shell Introduction--variables and variable operations, array-->bash Environment profile analysis What is a shell: Operating system is a set of software to control the entire hardware and management

Shell Programming---grep command

grep is a powerful text-search tool that uses regular expressions to search for text and print matching lines grep [option] [mode] [file]-C #只输出匹配行的数量-I. #搜索时忽略大小写-H #查询多文件时不显示文件名-L #只列出符合匹配的文件名 instead of listing specific matching rows-N#列出所有的匹配行

Split of shell command

Listen to people say that text classification when processing 100G text files, incredibly without big data, processing method is to use the shell split to split into a number of small files.Split commandNAME split-split a file into Piecessynopsis

Shell script to split nginx logs

#!/bin/bashLogs_path= "/opt/nginx/logs/"Pid_path= "/opt/nginx/logs/nginx.pid"MV ${logs_path}access.log ${logs_path}access_$ (date-d "Yesterday" + "%y%m%d"). LogKILL-USR1 ' Cat ${pid_path} 'Crontab-eXX * * * * sh/opt/shell/cutnginx.shThe script

Shell Script (ii)

Shell Script (ii)#find查找文件 to find based on time, name, UID, GID, permissions, size, etc.A file or directory accessed within #-amin-10:10 minutes; a file or directory accessed +10:10 minutes ago. The time unit is minutes.#查找10分钟之前30分钟之内访问过的文件或目录Find/

${},# #和 percent usage in the shell

Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Remove the last/and left string: my.file.txt$

Solution: show only-bash-4.1 in shell command line # Do not show users and paths

Solution: show only-bash-4.1 in shell command line # Do not show users and pathsToday, I accidentally typed the home Directory deletion command. Although it was not deleted for various reasons, many files and directories in the home directory were

Total Pages: 541 1 .... 224 225 226 227 228 .... 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.