Linux Command script
Script command is used to save the operation process in the log Script command format:
Script [-a] [-q] [filename] # [-a] append, Not Overwrite previous records # [-q] Quiet Mode, do not show the script sta
According to Brother Bird's ping script, I changed it a bit. Used knowledge: Read, Linux read by line, shell output effect adjustment, etc.Where Linux reads files by line is more important, you can see the link1 Scripting Features:Bulk Ping the IP address in the file under the current path, the IP address must be filled in one line2 Note:Follow the prompts to run
The basic course of Linux shell script describes the beginning, comments, variables, and environment variables of the basic syntax. Here we will introduce the first part of the shell command and control process, three types of commands can be used in shell scripts, but the control process should be put in the next lecture.
1.1.5 Shell command and Process Control
Three types of commands can be used in shell
Today, using notepad++ to write a Python script under Windows, to the Linux server after the execution prompt:-bash:./logger.py:usr/bin/python^m:bad interpreter:no Such File or directory1. Cause Analysisthis is caused by different system encoding formats: The logger.py file edited in the Windows system may have invisible characters, so the above exception information is reported in the
Transferred from: http://futeng.iteye.com/blog/2064143 demand
can automatically detect the OPENJDK that may be installed by default, and can delete it.
Can automatically configure the JDK in the/etc/profile environment.
Can carry the parameter, the parameter is the ordinary user name, may the JDK related configuration into the ordinary user's. Bash_profile environment.
One-click installation scriptScript-installed files have been backed up to the cloudinstalljdk.shShell Cod
Early knowledge of sed and gawk in Linux Command Line and shell script ProgrammingThe sed editor of the Text Processing editor can process data in a data stream based on commands that are input to the command line or stored in the Command text file. It reads a row each time, matches the data with the provided editor command, modifies the data in the stream in the way specified in the command, and then outpu
name to determine whether the user is an administrator or a regular user#! /bin/bashname=kdyzmuserid= ' id-u $NAME ' if [$USERID-eq 0]; then echo "Admin user" Else echo "Common user" fi2. Write a script to determine if there is a user's default shell for bash, and if so, how many of these users are displayed, otherwise there is no such user.#! /bin/bashusers= ' grep ' bash$ '/etc/passwd | Wc-l ' If [$USERS-eq 0]; then echo "No de
obtained from the log. But there is also a problem, for the first alarm, where the T2 from, and simply, we ourselves define a time stamp that satisfies the new exception condition, such as two hours ago.T2= ' date-d ' hours ago ' +%s 'For a problem that has been found to be solved, that is, the corresponding time stamp difference of less than one hour, if our script is executed one minute, we can make a counter, each discovery, count once, when the c
There is a script that wants to run automatically when the Ubuntu virtual machine is powered on.Creating a script fileCreate a new script file under "/opt/lampp/": lampp_start.sh#!/bin/bash/opt/lampp/lampp startEdit Startup fileAdd the self-startup script directory in the first line of the Do_start () function of the/e
In this paper, we mainly introduce two methods of executing Python script in timed cycle in Linux environment.Method One: NohupVim time.py 1importtime 2 while (True): 3 #time. Sleep (1) 4 Open ('time. Log ', ' A + ') as logfile: 5 logfile. Write(' Hello, world!\n ') 6time . Sleep (1) 7 #breakRun the following command at the terminaltime. PY Function: Implements a "Hello, wor
Source of author: Gull uses php for linux automatic execution scripts. recently, Gull uses PHP as a community. when writing to calculate the maximum number of online users, it is successfully debugged to run PHP directly on the server as a shellscript. when working in the community, it is often necessary to count the number of online users and other data. the general practice is to put this code in the user login or a page, with the author/source: Gul
Recently in the learning of the Linux system script development, when I finished writing specimens, the following situation occurredThis time there is no Such file or directory situation appears, the hint files do not exist;But this script is accessed through the VIM command, which is able to enter this scriptThis time I guess, probably because of the coding prob
Use php for linux automatic script execution. Recently, I used PHP as a community. when I wrote the code to calculate the maximum number of online users, I successfully debugged the code to run PHP directly on the server as a shellscript. when working in the community, it is often necessary to count the number of people going online. recently, PHP is used as a community. when writing to calculate the maximu
Inotify-tools + php script for Linux Server File monitoring and email reminder,
Requirement Description:
Because servers are infected with Trojans and are often written into sensitive html pages, leaders are often invited to drink tea by cyber police, you know. Therefore, there are two requirements: one is to find out the server's Trojan backdoor and fix code vulnerabilities, and the other is to monitor the
If condition judgment of Linux shell script, linuxshellIF condition judgment1. Basic Syntax:If [command]; thenStatements that meet this conditionFi
2. Extended Syntax:
If [command]; then
Statements that meet this condition
Elif [command]; then
Statements that meet this condition
Else
Statements that meet this condition
Fi
3. syntax description:
Bash shell will execute the if statement in sequence. if the c
password
Click Reboot and you're done.
you may find that the installation of the graphical interface is too cumbersome, the following to introduce a key script installation method 2.kickstart Script Installation Method
KickstartWith kickstart, a system administrator can create a file that contains answers to all frequently asked questions during installation to automatically install Red Hat Enterprise
Tags: script standalone file Sharing window Source Package script installation SystemScript installation PackageThe script installation package is not a standalone package type, and the common practice is the source package.is to manually write the installation process into an automatic installation script, as long as
Requirements: Copy the folder to the Linux directory, overwriting all folders with the same name under the Linux directory target: Linux, execute this script, enter the folder name, you can bulk copy overwrite. Instructions for use: first putThis script fileand thethe folder
Although the frequency of writing the shell is very low ... But every time you write a lot of jar file paths, the new jar package must also be modified to start the shell.Find a nice generic shell script on the web.Just modify some of the configuration variables to make the start script.And in addition to being able to start, it also supports shutting down, restarting, and checking whether the feature is running.Original address: HTTP://WWW.TUDAXIA.CO
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.