Shell Features: History

[Email protected] ~]# history # View command history, command history exists in ~/.bash_history file ~]# !! # Indicates the execution of the previous command ~]# ls!$ # represents the last parameter of the previous command ~]#!950

A small script written by the shell

You want to use a shell script to convert all the images in a folder to a pixel.Here are some of the wrong places:1. When defining a variable, the variable name does not add a dollar sign ($), such as:  VariableName="value" Note that there can be no

Shell programming--conditional judgment

1. Judging by file type (common)-B To determine if the file exists-D to determine if it exists and whether it is a directory (the directory is true)-E to determine if the file exists (exists as true)-F to determine if the file exists and whether it

Getting Started with Shell programming

Getting Started with Shell programmingOne, variable assignment and arithmetic operationDemo Sample code:A=1echo $alet b= $a +1echo $bc =$[a+b]echo $cd =$[c*2]echo $dlet e=d*2echo $ef =$[e%5]echo $fNote the "=" number must not have spaces on either

Hive shell command.

Hive shell command.Connect Hive ShellDirect Input Hive 1. Display tableHive> Show tables;OkTestTime taken:0.17 seconds, fetched:1 row (s) 2. Create a tableHive> CREATE TABLE Test (key string);OkTime taken:0.265 seconds3. Create partition Table:Hive>

Shell--bash Environment

First, what is the shellThe shell typically represents two levels of meaning, one is the command interpreter, such as bash, and the other is the shell script. In this section we stand on the command interpreter's point of view to illustrate the

Shell script in the case of the if conditional regular expression =~ quotation mark problem

Today, when you run the If judgment in the script, you always get into the corresponding branch and check the regular expression without errors. In the shell alone to execute or show no match. Rather strange, it was searched, it was found in the =~

[Shell] simple shell hints and parameter scripts

The shell script resembles the following: Bash or dash The wording of a case statement Script Help notation The wording of whether the argument is empty Parameters #! /bin/Bash Case " $" inch-h|--help|?) Echo "usage:1

Shell execution prints the variables in the script to the specified log file

In order to locate the problem, we need to locate the running log or error message of the task.When some scripts are called through the shell, the log information is printed in the shell. However, there are users in the shell call normal, but to

5 TR of the shell command

This is a wonderful command.TR's whole spell is translate, that is, translation. Interestingly, we are able to make rules for translation. Use methods such as the following:TR [option] set1 [Set2]TR accepts input from standard input. The results are

Enterprise Shell face question 1: Batch generate random character file name case

use the For loop to bulk create 10 HTML files in the/oldboy directory, where each file needs to contain 10 random lowercase characters plus a fixed string oldboy, with the following name examples:[[email protected]]# ls/oldboyapquvdpqbk_oldboy.html

Bird's Linux private cuisine--16th chapter: Learning Shell Scripts

Video link:1. What is shell script (script written by Shell)1.1 Why study shell scripts? ()1.2 Writing and execution of the first script1.3 Creating a good habit of writing shell script2. Simple shell Script Exercise: (read-p date)3. Use the

Write your own shell command ls-r1ff

The R-parameters of the LS command represent a recursive listing of all the files in all subdirectories, and 1 means that each row shows only one file or directory, and F means that the output is not sorted. F represents the end of each item's

Linux Command basics: Shell operators and keyboard wildcard characters

A wildcard wildcard is a class of keyboard characters. Wildcards are often used in place of one or more real characters when looking for a folder, when you don't know the true character, or if you don't want to type the full name.             *

The method of generating random numbers in Shell series

One: RANDOMEcho $RANDOMRandom number is a range of 1--32767, generally used it can be cracked1.2 Generate a eight-digit random password:echo $ (($RANDOM +11111111))Two: Md5sum random encryption method generates a longer passwordTake 9-digit password:

Spark-shell Unable to start the network problem

Due to the need to manually install SBT for the first time, networking is required, so the network adapter mode of the virtual machine is set to "bridge mode" so that it can be connected to the Internet.However, when the "Spark-shell--master

Array of shell programming uses

Record the use of arrays in the shellThe main is the creation of elements, elements of the increment, delete, change operation.1#!/bin/Bash2 3 #基本数组操作4A= (1 2 3) # # () denotes an empty array5 Echo "a No. 0 element:"${a[0]}6 Echo "all elements:"${a[@

Usage of shell arrays

Variable: Stores the memory space of a single element:Array (multiple contiguous memory spaces): a contiguous memory space that stores multiple elements:Array Name:Index: Numbering starting from 0, is a numeric index;Note: Indexes can also support

Shell Script-----Loop Array

Aa=

Java calls the shell script and returns the result set

1 /**2 * Run shell scripts3 * @paramShell scripts that the shell needs to run4 */5 Public Static voidExecshell (String shell) {6 Try {7Runtime RT =runtime.getruntime ();8 rt.exec (shell);9}Catch(Exception e) {Ten

Total Pages: 541 1 .... 410 411 412 413 414 .... 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.