Shell script used to record the use of commands after Logon

CopyCodeThe Code is as follows: #/bin/bash # History # Paste the following code directly to/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 =

Shell Command xargs

Shell commandsXargs Build and execute command lines from standard input Xargs can be readStdinAnd use a space character or line break character as the resolutionStdinData is separatedArguments. 1) Description Xargs [-0epn] command Options

52. Search for Linux Shell

1,Which Which-shows the full path of (Shell) commands. Which [Option] 2,Whereis Whereis-locate the binary, source, and manual page files for a command Whereis [Option] filename 3,Find Find-search for files in a directory hierarchy Find [

Shell (2)

Unix-like systems such as Linux always have a single file system tree, regardless How many drives or storage devices are attached to the computer. Storage Devices Are attached (mounted) at various points on the tree according to the system

Shell Development of X Pishu

Recently, we are busy developing data synchronization for Douban, mainly because the Douban interface is not powerful and the data cannot be captured when the access volume exceeds a certain value. Therefore, we decided to import Douban data to the

About Windows Power shell (1)

I will take the time to study windows powershell recently. First of all, it starts with the userguide of powershell itself. Just a rough look at the powershell directory. Powershell is quite powerful. In powershell, we can process the registry,

Share a simple Linux Server initialization Shell script

The Shell script is mainly used to initialize the new Linux server system, including: Disable IPv6 ModuleDisable SELinuxShow vim colorsSet system language EncodingOptimize system servicesKernel Parameter optimization.It can be modified according to

Shell script code for automatically restarting the service

Copy codeThe Code is as follows :#! /Bin/bash If [! -F/tmp/down_count]; then Echo "0" & gt;/tmp/down_count Fi Curl-I tomcat-host-o "/tmp/status" & gt;/dev/null 2 & gt; & amp; 1 Code = 'awk' NR = 1 {print $2} '/tmp/status' If ["$ [code]"-ge 500]

Code for parsing shell sorting

Copy codeThe Code is as follows: # include Using namespace std; Void ShellQin (int A [], int n) { Int gap = n/2; Int I, j; For (; gap> 0; gap = gap/2) // set the initial gap, group by gap, and decrease by gap/2 { // After the gap is set, insert and

Basic knowledge of linux shell scripts

Shell script: 1 ,#! Shell for Script Execution2. # comment3. Command or syntax structureEcho "input content"Empty line output by echo Run: 1. shell scriptSh example2. Grant shell script execution permissionChmod u + x example Case: example sysinfo.

Bash Shell script learning Summary

1. Character truncation: For normal path truncation, you can use the basename and dirname tools:Basename can intercept a file name from a file path. For example: Copy codeThe Code is as follows: $ basename/home/file.tar File.tar Dirname can be

How to modify the output result of linux shell (ui color)

The color of the text terminal can be generated using an ANSI unconventional character sequence. Example: Echo-e "\ 033 [44; 37; 5 m ME \ 033 [0 m COOL" The above command sets the background to blue, foreground white, blinking cursor, output

Common shortcut keys for linux shell commands

Ctrl + a switch to the command line Ctrl + e switch to the end of the command line Ctrl + l clear screen content Ctrl + u clear the content before cutting the cursor Ctrl + k cut the content after clearing the cursor Ctrl + y copy the content

Tips for searching processes using shell grep

When writing a Shell filter process, most people use grep to search for the specified process in the output result of ps aux. However, the grep process is also displayed, for example, the pptpd process, two matching items are displayed: Copy

Linux Command Line and shell script programming book Richard Blum

First script file Copy codeThe Code is as follows :#! /Bin/bash Echo "This is my first bash code! " Exit 0 Redirection symbols and mathematical computationCopy codeThe Code is as follows :#! /Bin/bashEcho-n "The time and date are :"DateValue1 = 100 #

Use shell programming to implement DOS-style Linux Command lines

If you are an IT person who is used to Windows command prompt, when you use Linux Command lines for the first time, you will feel at a loss. The DOS command you are familiar with does not exist in Linux. There are a lot of commands to remember

Shell implements simple process monitoring (watchdog)

#! /Bin/bashNAME = javaNOP =/bin/trueDATE = $ (/bin/date + "% Y-% m-% d % H: % M: % S ") ps-ef | awk-F "" '{print $8, $2}' | grep ^ java>/dev/null 2> & 1 case "$? "In0) # It is running in this case so we do nothing. echo "$ NAME is running OK. relax.

Shell signal capturing

Before capturing signals, you must first understand how to use kill: Kill-l view Signal 650) this. width = 650; "title =" kill-l.jpg "src =" http://www.bkjia.com/uploads/allimg/131227/2315524596-0.jpg "alt =" 225340553.jpg"/> Usage: Kill-NUMBER

Shell extracts date log files

Introduction: In the production environment, the application service generates fixed log files by date every day. Developers often need O & M personnel to provide these application logs, sometimes for a single day, sometimes for a period of time,

UNIX Shell commands

1. Output inbound Steering In UNIX, each process has three special file descriptor standard inputs.(Standard input), standard output, and standardError ). The three normally accept terminal input, which is displayed by terminal. HoweverUNIX provides

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