Shell condition Test

File Status Test -B filename Returns True when filename exists and is a block file (returns 0) -C filename Returns True when filename exists and is a character file -D Pathname Returns True

2017 the latest enterprise face Test shell (iv)

2017 the latest enterprise face Test shell (iv)First, the draw script (1) requires the following:1, write a script execution, enter the name, generate a random number 01-99 between the number;2, after entering the name, the screen output information,

Linux Shell Programming Combat---to count the word frequency of words in a particular file

Method 1 : Using sedShell>cat A1.txt123a123,555456.333566 . 555!88,thisis a good boy.Shell>cat a1.txt|sed ' s/[[:space:]|[:p unct:]]/\n/g ' |sed '/^$/d ' |sort|uniq-c|sort-n-k1-r2 5551 This1 is1 good1 boy1 A1231 A1 881 5661 4561 3331 123Shell>Sed '

The role of various parentheses in the shell (), (()), [], [[]], {}

One, parenthesis, parentheses ()1, single parenthesis ()① Command group . The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in

Shell script to get basic information about Linux server

Test Run Environment: SLES12SP2#!/bin/bash#系统名称;os_type=$ (Uname-o | awk ' {print ' | ' +} ')#系统位数; 32/64os_bit=$ (uname-m | awk ' {print ' | ' +} ')#内核发型版本kernal_version=$ (uname-r | awk ' {print ' | ' +} ')#系统版本信息sys_info=$ (cat/etc/issue | awk ' {

How the shell generates random numbers

Method 1: Use/dev/urandom[[email protected] shell]# tr -dc  "0-9"   Method Two: Use Date +%s Randomly generate a bunch of numbers [Email protected]:/home/dell/shell# date +%s |cksum |cut-d ""-F 1 1934689009Expansion: Randomly generates

Shell Getopts Learning

#!/bin/bashwhile getopts I:VH Namedo case $name in i) Opt=1 echo $OPTARG;; V) opt=2 Echo 2;; h) opt=3 echo 3;; *) echo "Invalid arg-$OPTARG";; EsacdoneThe getopts is used in the following form:

Shell and VI Editor

1.1 What is a shell? in computer science, Shell commonly known as Shell , used to distinguish from Kernel ( nucleus ), refers to the "User interface " software ( command parser ). It is similar to DOS command and later cmd.exe. It receives the

"265" Shell file creation link

Advantages: You can run the corresponding *.sh file in other folders, for example, through the putty will default into the folder, you can put the link file there, you can call directly!Method: Very simple1. Right click on the file to create the

Linux Shell Usage Notes

1. BackgroundThe Linux shell is a basic skill, because the weird syntax, combined with poor readability, is often replaced by scripts such as Python.Since it is the basic skills, it needs to be mastered. After all, the process of learning shell

One-click installation of shell scripts

One or one-button installation Nginx script#!/bin/bash#####################################Name: nginx_install.sh#Author:d Oublelinux#version: 1.1#Date: 2017/08/19####################################Yum-y Install Pcre Pcre-develYum-y Install OpenSSL

The use of wget in the shell

The use of Wget-V Version Information-H Help Information-B Background Execution wget-o filename put the record in the file filename-a filename attaches the record to the file filename-D Display Debug information-Q No output download mode-v Verbose

Shell script Add or remove user and command use method

Shell Requirements: Write a scriptOne, add 10 users user1 to User10, password with the user name, if the user exists, but requires only the user does not exist in the case can be added, in the format of/useradd.shSolution ideas: 1. Use the FOR Loop

Division operations in the shell

A= ' expr $num 1/$num 2 'This time num3=0 because expr does not support floating-point divisionHow to identify the decimal point:A= ' echo ' scale=2; $num 1/$num 2 "| BC 'Using the BC tool, sclae controls the number of decimal pointsA different

Use the shell to find the largest file in a directory

This is a very interesting question, because as a shell rookie, I have no idea for the first time. I wonder why this kind of operation Linux actually does not have a direct command to implement such a query.Naturally, the first feeling is to use awk

Getting Started with Shell scripting--on

Hello everyone! Today's share is the basic knowledge of some shell scripts, chapter for the introduction of the content of this article are: variables (classification, assignment, query, reference), arithmetic operation implementation.Introduction

Linux Common Command Collation (v): Shell Basics

Hello everyone, I'm a singing program, ape ~~~~~~.Recently in the study of Linux, spare time on these basic commands to organize, I hope you can use, the purpose of the finishing is to forget when the turn out to see ^?_?^, before and after a total

Shell practice: Using the For loop to bulk modify file name extensions

Shell practice: Using the For loop to bulk modify file name extensionsDescription: (1) Under Linux batch modify the file name, the command shown in the "_linux" removed.650) this.width=650; "src="

Shell generates a random password

One of the great advantages of the Linux operating system is that you can use up to hundreds of ways to implement it for the same thing. For example, you can generate random passwords in dozens of ways. This article describes 10 ways to generate a

Insert sort-Hill sort (Shell ' s sort) principle and Java implementation

The hill sort was proposed by D.l.shell in 1959, and the relative direct ranking has been greatly improved. Hill sort is also called narrowing the incremental sortBasic idea:First, the entire sequence of records to be sorted into a number of

Total Pages: 541 1 .... 260 261 262 263 264 .... 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.