linux shell

Read about linux shell, The latest news, videos, and discussion topics about linux shell from alibabacloud.com

A collection of 55 Linux system management commonly used in some shell commands _linux shell

Execute remote program and display it locally Copy Code code as follows: Ssh-n-L Zouyunhao 192.168.2.14 "Ls-al/home/zouyunhao" 11.shell segment Annotation Copy Code code as follows: : 12. See if the network card is physically connected Copy Code code as follows: /sbin/mii-tool 13. See what the Linux system or MySQL error code means, such

Linux shell array creation and use techniques _linux shell

The Linux shell is much more powerful in programming than in Windows batching, whether in loops or operations. There is no comparison of data types. The following is a summary of how an individual operates on an array while in use. 1. Array definition [Chengmo@centos5 ~]$ a= (1 2 3 4 5)[Chengmo@centos5 ~]$ Echo $a A pair of parentheses is an array, and the array elements are separated by a "space" symbol

Calling another shell (exec, source, fork) in a Linux shell script

There are three ways to invoke external scripts when running shell scripts, exec (exec script.sh), source (source script.sh), fork (./script.sh)EXEC (exec/home/script.sh):Using Exec to invoke the script is equivalent to executing a command in the current shell, without generating a new process, and the executed script inherits the environment variables of the current sh

Linux implementation ssh password-free login and implementation of secret Key management, distribution, deployment shell script sharing _linux Shell

Environment: SSH server:192.168.100.29 server.example.comSSH client:192.168.100.30 client.example.com Create secret key authentication through root user to implement Shell script management, distribution, deployment First, the client side creates the secret key pair and distributes the public key to the SSH server that needs to be logged on Note: The public key is equivalent to a lock, the private key is equivalent to a key, we here is equivalent

Linux Shell Series Tutorial (16) Shell input and output redirection

This article is part of the Linux Shell Series Tutorial (16), more Linux shell tutorials: Linux Shell Tutorials The output and input redirection in the shell is a feature that is of

Linux Shell Advanced Programming Tips 2----shell tools

2.shell Tools2.1. log filesBrief introductionIt is important to create a log file, which records important information. In the event of an error, this information is very useful for our troubleshooting, and the monitoring information can be logged to the log file.Common methods of log filesLog files identified by timeExample#!/bin/bash# the current date current_date= ' date ' +%y%m%d ' #今天的日志文件名todaylog = ' log/${current_date}.log ' #如果日志文件不存在, create

Linux Shell function return value _linux Shell

The Shell function returns the value, generally has 3 kinds of ways: Return,argv,echo 1) Return statementThe return value of the Shell function, as in other languages, can be returned through the return statement.Example: #!/bin/bash- function mytest () { echo "arg1 = $" If [$ = 1]; then return 1 else return 0 Fi } echo echo "MyTest 1" mytest 1 echo $? # Print return result e

Linux shell String Operations (length, find, replace) detailed _linux shell

String-related operations are often involved in the shell batch process. There are a lot of command statements, such as: awk,sed can do various operations of string. In fact, the Shell has a series of operating symbols, you can achieve similar effects, you know, using the internal operator will omit the start of the external program and so on time, so the speed will be very fast. First, judge read string v

Introduction to comparison symbols and special symbols in Linux shell _linux Shell

Shell string comparisons, judging whether it's a number Binary comparison operators, comparing variables or comparing numbers. Notice the difference between the number and the string. Integer Comparisons -eq equals, such as: if ["$a"-eq "$b"] -ne is not equal to, such as: if ["$a"-ne "$b"] -GT is greater than, such as: if ["$a"-gt "$b"] -ge is greater than or equal to, such as: if ["$a"-ge "$b"] -lt is less than, such as: if ["$a"-lt "$b"] -le is

The shell script _linux shell that retains the specified number of files under Linux under the file system

The content of this section:Keep the specified number of files remaining under the file system Example: Copy Code code as follows: #!/bin/bash #------------------------------- #Description: Back Up your files #site: Www.jb51.net #------------------------------- #shell variables Path_source=/mnt/fifth/shell Path_backup=/mnt/fifth/backup/shellbackup path_delete=/mnt/fifth/tmp/rubbish/

Linux shell script Regular Expression instance explanation, shell instance explanation

Linux shell script Regular Expression instance explanation, shell instance explanation I. concepts and features of Regular Expressions: A regular expression is a logical formula for string operations. It uses predefined characters and combinations of these specific characters to form a "rule string ", This "rule string" is used to express a filtering logic for s

My Way on Linux-[Shell Basics]-a common method of judging whether a file, directory exists, or whether it has a certain class of attributes (permissions) in the Bash shell

comparing the timestamp implementation of the file /c2>-ef file, to determine whether File2 and File2 is the same file, by judging the two files pointing to the inode is the same to achieve, can be used in hard link decision# Two integers in a comparison-eq #equal equals -ne #not equal not equal -GT #greater than greater than - Lt # less than smaller than -ge #greater than or equal greater than or equal to-le # less than or equal smaller than or equal to# Multiple c

"Shell" Linux shell direct assignment and indirect assignment

What is direct assignment?1. The way the author directly assigns parameter values is called direct assignment.2. In general, an indirect assignment is assigned by an interactive method.Example 1:varl=arppinging.comThis is a direct assignment that is directly assigned to a fixed value by the programming author.Example 2:[[emailprotected] ~]# read -p "Please enter a number:" var2Please enter a number:arppinging.com[[emailprotected] ~]# echo $var2arppinging.comThis is an indirect assignment.

Linux--note Shell common commands for cut, sort, unqi, tee, TR, split, and Shell Connectors && | |

[Email protected] split_dir]# LS-LH x*-rw-r--r--1 root root 100 January 6 23:29 Xaa-rw-r--r--1 root root 100 January 6 23:29 Xab-rw-r--r--1 root root 100 January 6 23:29 Xac-rw-r--r--1 root root 100 January 6 23:29 Xad-rw-r--r--1 root root 100 January 6 23:29 xae-rw-r--r--1 root root 100 January 6 23:29 Xaf-rw-r--r--1 root root 100 January 6 23:29 XAG-rw-r--r--1 root root 100 January 6 23:29 Xah-rw-r--r--1 root root 100 January 6 23:29 Xai-rw-r--r--1 root root 43 January 6 23:29 XajYou can give

Linux shell if else and greater than, less than, equal to logical expression introduction _linux Shell

For example, to compare strings, to determine whether a file exists and whether it is readable, and so on, usually use "[]" to represent the conditional test.Note: The space here is very important. To ensure that the square brackets are blank. I have been because of the lack of space or the wrong location, and waste a lot of precious time.If ...; Then....Elif ...; Then....Else....Fi[f "Somefile"]: To determine whether a file[-X "/bin/ls"]: Determine if/bin/ls exists and has executable permission

Linux Shell Learning Note two shell command line LS

LS is the command to view files in directories and directoriesNow let's look at the use of this commandLsThe syntax of LS is mainlyLS View directory contentsLs-l Viewing folder detailsLs-a Viewing hidden filesLs-a view hidden files, but does not show "." and ".." Directory informationLs-d the directory as a file, rather than showing the file beneath itLs-h Display file size units (usually with other parameters)Ls-r recursively displays the contents of directories and subdirectoriesLs-s files fro

Linux shell txt convert to HTML implementation code _linux shell

Principle: awk command, split formatted TXT (TXT file format with "|") divided) into groups, then spliced into HTML format (html-head-title-body-table) Shell Source #!/bin/sh file_input= ' txt.log ' file_output= ' txt2html.html ' td_str= ' function Create_html_head () {echo-e ' TXT format for test: Angry birds| Arcade action|4.6|887,058|10,000,000-50,000,000| free| August, 2011|1.6.3|19m|1.6 and up| Low maturity Angry Birds seasons|

3 ways to allow cron to execute shell scripts in seconds in Linux _linux shell

Need to use shell script every 3 seconds to monitor the running state of a software process, found that Crond seems to only support to the points, do not know seconds, how to do? The first method: Of course the first thought is to write a trigger script that uses a dead loop in the trigger script to solve the problem, as follows: Cat kick.sh Copy Code code as follows: #!/bin/bash While:;d o /home/somedir/scripts.sh 2>/dev/null

Linux Shell Script Tutorial series (ii): TERMINAL Print command detailed _linux shell

Terminal printing A terminal is an interactive tool through which users can interact with the shell environment. Printing text in a terminal is a basic task that most shell scripts and tools need to perform on a daily basis. Through the terminal printing, people can know the running state of the system, which is critical to the user. echo Terminal printing Copy Code code as follows: echo

Considerations for Linux shell script programming _linux Shell

Copy Code code as follows: #-------------------the wrong wording------------------- RM-RF ${path}/* #---------------------------------------------- #-------------------the right wording------------------- If [-D "${path}"] Then RM-RF ${path}/* Fi #---------------------------------------------- 7. Use of double brackets [[]] The double middle bracket of the shell has many functions Copy Code code as

Total Pages: 15 1 .... 7 8 9 10 11 .... 15 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.