Use the method to copy it, save it as a shell file, such as security.sh. Upload it to a Linux server, execute SH security.sh, you can use the script!
The code is as follows:
#!/bin/sh
# Desc:setup Linux system security
# AUTHOR:CORALZD
#
The Linux du command also looks at the usage space, but unlike the DF command, the Linux du command is a view of the space used by files and directory disks, or some difference from the DF command.
What's the difference between Du/bin and Du-s/bin?
A few days ago, there were some interesting examples of redirects and piping-related usage. Software communication based on TCP/UDP protocol is implemented through redirection.
There is a special file in the Linux device:
/dev/[tcp|upd]/host/port
One, while loop
The while loop is used to continuously execute a series of commands and to read data from an input file; a command is usually a test condition. The format is:
Copy Code code as follows:
While command
Todo
Command1
Project release, write a shell script to start the project, including the start of the project, turn off the restart, including the project log output to the specified file, not for anything else, just for the next project release, you can directly
I've been writing a script for the last two days and learned three days, then wrote two days of time, feeling OK, also not very difficult, is some things are not ripe, feel the shell inside some processing and C voice difference is quite large, I
Brief introduction:
The Ssh Secure Shell Client tool uses commands to remotely control Linux and facilitates file interaction with Linux systems, making it a convenient bridge between Linux and Windows.
We know that as Windows and Linux file
Friends who know more about operating system principles will know that a complete operating system provides a shell (shell) to make it easier for ordinary users to use the various features provided by the operating system. Windows (here refers to
if logic judgment in shell scripts
Logical judgment Expression:
-GT (>); Greater than great than
-lt (=); Greater than or equal to
-le (
If logical judgment format:
Format 1:if condition; Then statement; Fi
format 2:if condition; then
The shell script is used to export the DB2 database table to a file, and in another blog post, Java code calls the shell script and passes in the parameter implementation DB2 database table export to a file to invoke the script and pass in the
Example No. 1As a shell writer, to avoid the user's input data is malformed, that is, to intercept the possible errors before the shell script is published, this example is to determine whether the data (or positional variables) entered by the user
25, Shell special symbol Cut command, sort_wc_uniq command, tee_tr_split command, Shell special symbol underFirst, shell special symbol Cut commandSpecial symbols*: Wildcard.?: any one character.#: Comment characters, add to command before command
Shell Introduction* shell是一个命令解释器,提供用户和机器之间的交互。* 支持特定语法,比如逻辑判断、循环。* 每个用户都可以有自己特定的shell。* Centos7默认shell为bash。* 还有zsh、kshCommand historyWe have the command on the terminal, all have its history, such as pressing the UP button at this point will see
In the loop, sometimes you need to force out of the loop when the loop end condition is not reached, like most programming languages, the shell also uses break and continue to jump out of the loop.Break commandThe break command allows you to jump
Part 1: hadoop BinThe following hadoop bin is based on the actual needs of the project:Hadoop ShellHadoop-config.sh, which is used to assign values to some variablesHadoop_home (hadoop installation directory ).Hadoop_conf_dir (hadoop configuration
An error occurred while executing the script today, such:
root@ApFree:/usr/sbin# ./conntrack_num_graph.sh ./conntrack_num_graph.sh: line 9: syntax error: unexpected "then" (expecting "}")root@ApFree:/usr/sbin#
I am wondering, this script can be
Redirection, environment variables, and Shell functions of advanced shell script Programming
Shell is not limited to simply executing commands line by line. One of the more powerful functions is the ability to create functions and function
It takes some time for BASH Shell to have a complete and in-depth understanding, but sometimes it is necessary to quickly master its basic usage and write simple programs to meet the needs of the project, then you can read the following article,
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