There are three common file descriptors in shell programming:0: stdin, standard input. The default value is the keyboard input.1: stdout, standard output. The default value is screen output.2: stderr, standard error output. The default value is
1. mv
1) mV-move (rename) files
MV [Option] source dest
MV [Option]... source... directory
Rename source to DEST, or move source (s) to directory.
2) Options
①-F, do not prompt before Overwriting
②-I, prompt before Overwrite
③-N, -- no-
Latency functions in Linux Shell
Latency processing is often required in Linux shell scripts.
Therefore, sleep or usleep functions are often used.
The difference between sleep and usleep is as follows:
Sleep: the default unit is seconds.
It is simple and powerful to share shell usage and scripts that you may not know!
Before reading the following sections, we strongly recommend that you open a shell experiment, which is not a major commodity in Shell textbooks :)
! $! $ Is
Here we recommend a few Linux books and good tutorials to help learners avoid detours. It can make boring things fun. Isn't it?
First recommended entry-level books:
Laruence's Linux basic learning for Private food (3rd)
It explains Linux in a
The following describes the direct insertion sorting, binary insertion sorting, table insertion sorting, and shell sorting in sequence.
1. Sort directly inserted
It is a bit similar to playing poker. Every time you grab a card, you can put the
The requirement today is to write the creation of all tables to the storage process.
After receiving the script for creating a table, it is silly. There are 60-70 tables, including stored procedures and views.
How can this problem be solved.
Job Control
Bash can run jobs in the background or in the foreground. A running
Program It is called a process or job. Each process has a process ID, PID. Generally, all programs run on the foreground. You can use Ctrl + D to send a signal to
In the Linux Shell environment, input and output redirection is supported, expressed by symbols . 0, 1, and 2 indicate the standard input, standard output, and standard error information output, which can be used to specify the standard input or
1. file security and permissions
1 file typeD directoryL Symbolic LinkS socket FileBlock B Device FilesC character Device FileP name MPs queue File-Common files
2. For the file owner, if only the read permission bit is set, the file can still
Style files are often processed row by row. In Shell, how to obtain each row of data, then process the row of data, and finally read the next row of data can be processed cyclically. There are multiple solutions:
1. Run the READ command.
The
Source: Old Boy's Linux blog Author: Old Boy
The problem is: 4) known: the content of/etc/hosts is
192.168.1.11 oldboy11.etiantian.org
192.168.1.21 oldboy21.etiantian.org
192.168.1.31 oldboy31.etiantian.org
#192.168.1.111
The host may be down, or there may be a problem with the network connection.
Sometimes such problems can also be caused by a misconfigured firewall.
The following problems may occur:
1. SSH is not installed when centos is installed.
2
$ {# String} $ String Length
$ {String: Position} In $ string , Extract substring from position $ position
$ {String: Position: length} In $ string , Extract substrings with a length of $ length from the position $ position
1. I want to know which shells have been installed on my machine?
You can view the following two methods:
First:
[Rocrocket @ wupengchong ~] $ CHSH-l
/Bin/sh
/Bin/bash
/Sbin/nologin
/Bin/zsh
Second:
[Rocrocket @ wupengchong ~] $ CAT/etc/shells
/Bin/
1 -- shell Method for reading files
# Use the READ command to read a row of data while read mylinedoecho "line:" $ mylinedone
# Use the READ command to read a row of Data cat datafile.txt | while read mylinedo echo "line:" $ mylinedone
# Read
ShellProgramIs a common file containing Unix commands. the permissions of this file should be readable and executable. Like a common executable program, you can either specify a full path name or put it in the path list specified by the PATH
Shell scripts can read data in the following ways:1. keyboard input, default2. Read from the file3. Pipeline Command Transmission
Echo functions:\ C: Do not wrap\ F: Paper Feed\ T: Skip\ N: line feed\ Indicates escape, for example: "\"/dev/rmt0 "\"
1. Introduction to file typesLinux mainly includes the following seven file types: d directory-common file l symbol link s socket file B device file c character device file p name pipe File
2. Regular ExpressionRegular Expressions are very important
Use the here document
Copy codeThe Code is as follows :#! /Bin/sh
Ftp-ivn 210.29.28.124 User yun yun2011
LCD/home/veyun
Cd/home/veyun/yhb
Get v
Bye
EOF
Explanation:
-I: Disable interaction prompts during multi-file transmission, so there
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