-------------------------------------- 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
Grep-I ignores case-I skipping binary files-C Calculated Quantity-N Display Line number-R recursion-V does not match a keywordCommon combination CommandsGrep-iirn keyword * Search for files containing this keyword (n displays line numbers, I ignores
Linux file system is the hard disk space format into a number of node and block data blocks, the creation of general files, directory creation, will occupy a node, if the creation of a file, the specific data stored in a number of block data block,
I. AWK application ScenarioFormat data or extract records from a large text fileTwo. How to use
Command line mode$awk [-F field-separator] ' commands ' input-file (s)Commands is the real awk command.The [-F domain delimiter] is optional, and if
(1) under the shell, operate the Hadoop directory, batch name or delete, the final command sed the regular greedy replacement, look at the following script:Java code
# traverse the file name under the Hadoop directory
for line in ' Hadoop
Very depressed, do not know what the reason, on the virtual machine to get that, the Centos6.5 seems to make a problem, the use of SSH remote landing on the CentOS, only show:bash-4.1#, very strange, whoami the root permissions displayed, PWD
1. Historical Order (History,↓, ↑,!) )The default value for history is 1000, which is specified in/etc/profilecommand history, which is used to query recent command histories;Use the arrow keys (↑) to query the previous command;Use the arrow keys (↓)
#! /bin/bashclearfunction verify{ If [$1-eq "Bob"] && [$2-eq "555"] then echo "verified" else
echo "rejected" fi}verify Bob 555Run-time occurrence (integer expression required here) errorThe reason is a small error:"-eq" to compare
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
There are many shell types in Linux, common: Bourne shell (/user/bin/sh or/bin/sh),Bourne Again Shell (/user/bin/bash or/bin/bash),C Shell (/user/bin/csh or/BIN/CSH),TC Shell ((/user/bin/tcsh or/BIN/TCSH).The Bourne shell (i.e. sh) is the first
Shell scripting is like a language, involving the environment, basic syntax, variable definitions, functions, parameters (System parameters), condition determination, execution Process control, and so on.This article describes the following aspects:
Use the read command when you need to get input from the scripting people during the execution(1) Basic readingThe read command accepts standard input or other file descriptor input. After reading the data into a standard variable.- p allows you to
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=
Recently encountered a problem in the work, want to add a flag bit after the specified location of a file, required to be implemented in the shell script.Problem Description:Want to add a flag after a string of sys_config.fex textFor example, there
Package com.yc.utils;Import java.sql.SQLException;public class Shellutil { Private Boolean flag=false; private int xx; The x-axis of the mouse position when you click the interface private int yy; The y-axis of the mouse position when you
In the process of learning the algorithm, we will inevitably touch many and sort-related algorithms. All in all, the basic sorting algorithm must be mastered for any programmer.Starting today, we're going to be explaining the basic sorting algorithm.
Run the system command and write the shell script that writes the output to the specified log file (2 ),
The previous article was a simple script that can be executed and written into logs. However, if it is placed in the production environment, it
Shell scripts that execute system commands and write output to log files
This is probably the requirement. Run the usysfault command on the aix system to retrieve the fault light information. However, it seems that only the root user can execute
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