Shell command Exercise 20160425

1, in three ways to achieve delete the last line of the file.[[email protected] sjx]# cat 123123[[email protected] sjx]# sed ' $d ' 12312[[email protected] sjx]# cat 123 |head-$[$ (cat 123|WC-L) -1]12[[email protected] sjx]# cat 123 |sed-n ' $!p ' 12

Shell Color configuration under Linux

Color configuration involves the following places (I often use): command prompt, file and directory name display, ECHO-E command1. Color values are divided into foreground and background colors, and the corresponding relationship of color code

Shell History Command Logging function

The history command allows you to view all of the user's historical records under Linux. At the same time, the shell command action record is saved by default in the. bash-history file in the user directory, through which you can query the execution

"Shell" variable

Variable settings:~/dos # dfs=2 Variable use:You can read it using EHCO, but you need to precede the variable name with $, or the ${variable}.~/dos # echo $dfs 2 ~/dos # echo ${dfs}

Linux Shell abs--Special characters

The special characters are as follows: "#"--Comment, beginning with # at the beginning of the line (#! is an exception).“;” --the command delimiter, which can be used to write multiple commands on a single line.“;;” --Terminates the "case" option.“.”

Linux Shell variables

IntroductionVariables are an essential part of Shell scripting, and using variables in scripts does not need to be declared in advance. Each variable in bash is a string, so whenever a variable is assigned a value, whether or not the quotation marks

Linux Video Learning 3 (Linux installation, SHELL,TCP/IP protocol, network configuration)

Installation of Linux systems:1.linux System Installation Method three kinds:1. Install the Linux system independently.2. Install the Linux system on the virtual machine.A. Install the virtual machine, basically go all the way down.B. Install

Install JDK in Linux and Tomcat and shell scripts to shut down the started process

Enter UNAME-A in the command line mode, for example, when the interface shows i386 that the Linux system is version 32, download the corresponding JDK version on the official website, or load it directly onto my network disk

LNMP install shell script with one click (v1.2)

Since setting up a LNMP environment uses a step-by-step approach to installation is clumsy, the installation steps are written into a simple shell script, and most of the requirements can be achievedSuitable system version: centos6.5-6.7

[Linux] Linux Shell Find Files

#!/bin/bash# Find all files larger than 1MB in the current directory, write the file name to a text file, Count # # Find command, Parameters: path address, command arguments,-size n (find files of length N)-type F ( Find a type of file, F normal

Shell command to see the number of files under a folder

shell command to see the number of files under a folder2010-06-25 17:05:15| Category: Shell | Font size Subscription 1. View the number of files under a folder:Ls-l |grep "^-" |wc-l or find/company-type f | Wc-l2. Look at the number of files in a

Linux Shell Common Tips (10) pipeline combination

Linux Shell Common Tips (10) pipeline combinationTwenty. To get the system run data through the pipeline Combination shell command :1. Output the 5 most memory-intensive commands in the current system:#1) Lists all the processes that are running on

Shell Programming----Notes

Consider the next, just own a little record, according to their own situation to record it, follow up with new things to add at any time. Oh, yes. First, getting started with common sense1. Several commands1)!n: Executable nth command in

Linux Learning Path: Shell variables (ii) Environment variables

1. ENV (environment abbreviation) and export Show all environment variables 2. Description of Environment variables environment variable home" user home folder equivalent to "~" shell

Linux Common shell command Daquan

First, the basic command1. Immediately shutdown and restart, execute the following command:Shutdown-r Now or reboot2, immediately shutdown, execute the following command:Shutdown-h now or Poweroff3, wait 2 minutes to shutdown and restart, execute

Linux Shell Basics (vii)

Vii. Process Control   conditional judgment control in bash Scripts   [] (the expression in [] is true)  && (the result of the front is true when executing the command behind)   | | (The result of the front is false when executing the command behind)

Shell shortcut keys under Linux

Ctrl+p repeat the last commandCTRL + a jumps to the first characterCtrl+x, but press again to return to the original position.Ctrl+b move forward one character without deleting the character caseCtrl+h Delete the previous characterCtrl+u all

Shell programming for while until loops

The shell's for loop format is as follows:For variable in listDo...DoneA list is a series of values that each value is separated by a space, once per loop, and the next value in the list is assigned to the variableThe in list is optional, if you do

Various judgment grammars in the shell

Shell judgment#按照文件类型进行判断-B To determine if the file exists and whether it is a fast device file (The block device file is true)-C Determines whether the file exists and whether it is a character device file (the character device file is true)-D to

Shell programming (vi)---------arrays and functions

Definition of the array:Array name = (element 1 element 2 element N) # A pair of parentheses indicates an array, and the elements of the array are separated by a "space" symbol.Example: myarray= (1 3 5 7 9) # Note the method defined, parentheses,

Total Pages: 541 1 .... 311 312 313 314 315 .... 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.