How to query the current shell versions and types under the Linux command line

There are several ways to see what shell you are currently using, and the easiest way is to use the shell's special parameters. First, a special parameter named "$$" represents the PID of the shell instance that you are currently running. This

Shell to find query file operation instance

Example 1 Typical operation, traversing all JS in the directory and using Yuicompressor compression The code is as follows Copy Code For i in ' Find Asset/v2-name ' *.js ';Todoecho "Compress $i"Java-jar

A summary of common methods for Linux shell commands

Date# Take the day beforedate-d ' 1 days ago ' +%y-%m-%d Order, E-Name, set function: (alias)Alias Ll= ' Ls-al ' Some special values$$: (for this shell PID)$!: Get the process pid of the subprocess, for example the Nohup command can get the PID$: (

Solve the problem of CentOS shell display-bash-4.1$ does not display the user name path

Problem Description: CentOS A new user, log in after the information of the shell script is as follows: Linux CentOS Shell display-bash-4.1$ does not display the user name path solution Ps: If you mistakenly delete files in the user directory, it

Shell interrupt continues to exit

Key words in the loop: Break, continue, exitBreak650) this.width=650; "src=" Http://note.youdao.com/yws/res/3245/WEBRESOURCE132ee14de25ca983e690a082c34a51f4 "alt=" Webresource132ee14de25ca983e690a082c34a5 "/>650) this.width=650; "src="

Shell programming (eight) text viewing and processing tools

Text viewing and processing tools: WC, cut, Sort, Uniq, diff, PatchWc:word CountWC [OPTION] ... [FILE] ...-l:lines-w:words-c:bytesCutCut OPTION ... [FILE] ...OPTION:-D CHAR: Delimiter with the specified character;-F Fields: the selected field;#: The

The most common shortcuts for Linux shell commands

Bash provides a number of shortcut keys, the following are the most commonly usedCTRL + A cursor moves to the beginningCtrl+e cursor moves to end of lineCtrl+l Clear ScreenCTRL + C terminating processCTRL + Z Hang up processCtrl+u Delete the

What does "-e,-d,-f" mean in a shell under Linux?

File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if

Shell programming in Linux (i)

Conditional judgment, control structure:Single Branch if statementif judgment condition; ThenStatement1Statement2...FiTwo-branch if statement:if judgment condition; ThenStatement1Statement2...ElseStatement3Statement4...FiMulti-Branched if

What does "-e,-d,-f" mean in a shell under Linux?

File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if

Shell (check return of each line) and Sudoer

Shell result from CmdLineecho $?If 0 then success; else failure(Shell executes each return value, RM-RF error, package cannot overwrite)Solve Sudo:sorry, you must has a TTY to run sudo  a few days ago encountered a problem, call another shell in one

Shell Special variable Meaning

Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the

How to solve the shell script in Jenkins obviously failed to execute, but not self-exit, and the construction results still show success problem??

First, you need to make sure that the results of the shell command execution are $0 or not 0 can only represent the execution of this statement, for example: Execute statement: ADB connect 192.168.XX. XX execution Result: Unable to connect to 192.168

Shell script Remote Batch execution command

#! /usr/bin/expectip_array = $ (cat /tmp/ip.txt) username = rootfor ip  in ${ip_array[*]} {                 ##### #IPspawn  ssh -p 6122 [email protected]$ $ipexpect  {"(yes/ NO)? "  { send  "yes\r";  exp_continue } "Password:"  { send  "[email 

Login shell and non-logon shell

Log-in Shell:Su–usernameSu-l usernameNon-logon Shell:SU usernameOpen Command Window under graphics terminalShell scripts that are executed automaticallyBash's configuration fileGlobal

Initial shell, set NIC parameters

See the shell, write a script to set the parameters of the network card try it. It's inefficient, but it's a good use.===================#!/bin/bashLang=zh_cn. UTF-8Clear #Select the network cardecho "' Date '"Echo-e "\033[34m Select Network Card

Compare digital subtraction based on shell scripts no BC

The following methods can not install the BC calculatorCreate sh fileCheck------------------------------------------------------------------v#!/bin/Bashread-P"Please enter the first number"Aread-P"Please enter a second number"Becho"and the"' Expr $a

A simple example of shell-script

#!/bin/Bash#defind the Pathpath=/usr/Localexport Pathread-P"Please input your first name:"Firstnamereap-P"Please input your last name:"LastNameEcho-E"\nyour name is: $firstname $lastname"#useDateCreatefileRead-P"Please input your

Examples of shell multithreaded programming

#!/bin/bash#a_sub () {    sleep 5}multi_thread () {    thread=5              #  define the number of threads here      tmp_fifo= "/tmp/$.fifo"     /usr/bin/mkfifo  $TMP _fifo    #  Create a new FIFO type of file     exec 6<> $TMP _fifo    /bin/rm -f 

Shell script deletes the backup file instance one day ago

Today, the company asked me to copy the backup files on the server to the internal server, and as long as they are up-to-date, well, what is the ideal goal of O & M personnel, that is, what can be done by computers, never do it by yourself.System:

Total Pages: 541 1 .... 326 327 328 329 330 .... 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.