Guide
When you're going to really manipulate your Linux system, there's nothing like a command-line interface that lets you do that. To be a Linux master, you must be able to understand the different types of shell commands and use them correctly under the terminal.
There are several types of commands under Li
Guide
When you're going to really manipulate your Linux system, there's nothing like a command-line interface that lets you do that. To be a Linux master, you must be able to understand the different types of shell commands and use them correctly under the terminal.
There are several types of commands under Li
Introduction to Linux Shell
1. What is shell?Shell is a system user interface that provides an interface for users to interact with the kernel. It receives user-input commands and sends them to the kernel for execution.
In fact, shell is a command interpreter that explains t
Introduction to Linux Shell programming (1)
From the programmer's perspective, Shell itself is a program written in C language. From the user's perspective, Shell is a bridge between the user and the Linux operating system. You can enter commands for execution and use
Linux Shell script interview 25 questions
Q: What is a 1 Shell script and is it necessary?
A: A Shell script is a text file that contains one or more commands. As a system administrator, we often need to use multiple commands to complete a task. We can add all these commands in a text file (
Http://www.3800hk.com/Article/ OS /Linux/bckflu/2005-08-06/Article_37229_2.html
Code :--------------------------------------------------------------------------------
1. Create and run Shell programsWhat is a shell program? Simply put, a shell program is a program that contains several rows.Shell or
From the programmer's perspective, shell itself is a program written in C language. From the user's perspective, shell is a bridge between the user and the Linux operating system. You can enter commands for execution and use shell script programming to perform more complex operations. With the increasingly sophisticate
The difference between the set, Env, declare, and export display shell variables in LinuxThe shell variable consists of two variables1. Shell Local VariablesLocal variables are defined in a script or command, only valid in the current shell instance, and other shell-initiate
What is a shell?Shell is a use C Programming language, which is used by the user Linux the bridge. the Shell is both a command language and a programming language. Shell refers to an application that provides an interface through which users access the service of the operati
...) ...;; EsacExample#!/bin/Bash Case " $" inch"1") Echo 1;;"2") Echo " Both";;*) Echo "your input is $";;EsacCycleWhile expression while Do ... Donefor-expression for inch Do ... DoneBoth of these expressions are relatively simple, and there is nothing special to say. I found some differences between the different systems. I found that red Hat can use the following expressions, but Debian is not. I don't know whether the system version or the system itself is different. for (i=0;i
Use C # To write Shell scripts for Linux,
In this age of determining the personality and the prevalence of the contempt chain, especially in our IT industry, what are the times of your contempt and contempt today? If you do not have the ability to press the box, you have to read it. Today, we also want to improve our style, learn things that are wide open in our minds, and then go to the group to scare othe
)%V ISO-8601 Format Specification for the week of the year, with Monday as the first day of the Week (01-53)%w Day of the Week (0-6), 0 for Monday%W Week of the year, with Monday as the first day of every week (00-53)Date description under the current locale of%x (for example: 12/31/99)Time description Under current locale of%x (e.g. 23:13:48)%y year last two digits (00-99)%Y year%z +HHMM Digital Time zone (for example,-0400)%:z +hh:mm Digital Time zone (for example, -04:00)%::z +HH:MM:SS Digita
$ match end of line
grep "^m" Test_rule.txt
Match lines that start with capital M
grep "n$" Test_rule.txt
Matches a line ending in lowercase n
Grep-n "^$" Test_rule.txt
Match Blank Line
4 [] matches any one of the characters specified in parentheses, matching only one character
grep "S[ao]id" Test_rule.txt
Match between S and I letters, either a, or O's line
grep "[0-9]" test_rule.txt
Match any one number
grep "^[a-z]" test_rule.txt
Match a line that starts with a lowerca
Copy Code code as follows:
#!/bin/bash
#Mysql autobackup Shell
#
#
#----------------Set the MySQL login parameters
Dbuser=root
Dbpasswd=
Dbserver=localhost
dbname=fwserver2008
Dbopt=--opt
backupdir=/dbbackup/
#-----------------Set the FTP paramters, 0 No send to an FTP server,1 send to a FTP server
Copytoftp=1
ftpserver=172.16.25.2
Ftpuser=linux
ftppasswd=123456
#----------------Set th
numbern all characters, Bytes, or fields from the beginning of Nth to the end of the lineN-m all characters, Bytes, or fields from the beginning of Nth to the first m (including the first m)-m all characters, Bytes, or fields from the beginning of the 1th to the first m (including the first m)
Read from standard input when there is no file parameter, or if the file does not exist
Interpretation:
1. Get a column of characters or bytes can be used with-C,-B, etc.
2. A range can be obtained
This shell script is primarily used for initialization of newly installed Linux server systems, including:
Turn off the IPV6 module
Close SELinux
Let vim display color
Set System language encoding
Optimizing System Services
Kernel parameter optimization and so on.
Can be modified according to their actual situation, can be used in production environment. The original author is Netseek, I made a partial mod
While and for are circular statements, relative, the For loop uses a bit more. But the while loop is especially useful when reading a file line.While formatwhile [ 条件 ]do 内容done
Example: Determine if I is small and equal to 5, if less than or equal to 5 prints the value of I
i=1while [ $i -le 5 ]do echo $i i=$(($i+1))done[Email protected] scripts]# bash while.sh12345
Use while to read the number of file rows
#!/bin/bash -while read linedo echo $linedone[E
Tagged with: Linux centos Shell wildcard8.1shell IntroductionThe shell is a command interpreter that provides human-computer interaction.Supports specific syntax.Each user can have their own specific shell (bash).CentOS7 default bash (Bourne Agin Shell).Others are zsh, ksh a
From the programmer's point of view, the shell itself is a program written in C language, from the user's point of view, the shell is the user and the Linux operating system communication Bridge. The user can either enter command execution or use shell scripting to do more complicated operations. In the increasingly pe
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.