Linux Shell: File directory Operations and instances

This article describes the underlying file operations: Create, move, edit, delete files and foldersCommand and Case:mkdir Creating a Directory--Create two directories[Email protected]:~$ mkdir test2 test3--Create a new directory under Test1

Shell's most commonly used service script

fpm

Mission Requirements: Managing/USR/LOCAL/PHP7/SBIN/PHP-FPM-C in the simplest way/usr/local/php7/etc/php.ini This command includes starting a stop restartUsing technology: Shell Scripting Chkconfig Service ManagementImplementation process:1. Create a

Server auto-patrol shell script

#!/bin/sh# defines a function that checks the operating system version num_version=$ (UNAME-R) function check_os () {[[  $NUM _version =~  el6 ]] && return 0| | return 1}echo  "##### #CPU使用情况 ######" cpu_hardware=$ (cat /proc/cpuinfo | grep name

Preliminary understanding of Linux-shell scripts Script

1. What is a scriptThe shell script is actually a plain text document, we can edit this document, and then let this file Help usExecute more than one instruction at a time, or achieve some specific functionality.To install a certain logical

"Shell"--Basic knowledge (2)

1. How shell scripts runCreate shell script files, usually ending with. SH (e.g. example.sh)The shell script works as follows: Add ' x ' Execute permissions (relative or absolute path execution) To invoke a script file using the bash or

CentOS Install fish Shell

For CentOS 7, run the following command with root user root :Cd/etc/yum.repos.d/wget Https://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish: Release:2.repoyum Install FishFor CentOS 6, run the following command with

Shell Script Programming Learning notes (i)

First, the script formatVim shell.sh#!/bin/bash//Declaration script interpreter, this ' # ' is not a comment, the rest is a comment#Program://program Content description#History://Time and authorIi. Types of Shell variablesUser-defined variables:

Shell script Programming Basic syntax:

Shell Script Programming Syntax:Note:Article source http://www.cnblogs.com/yunquan/p/6821850.htmlVideo Source: https://www.bilibili.com/video/av10565321/index_1.html?t=684Each statement here must have a space control, or syntax error 1. file format以.

Shell special symbol, Wc,uniq,tee_tr_split command

[[email protected] ~]# cut-d:-F 3/etc/passwd-d: delimiter-F plus number paragraph F is the first paragraph012[[email protected] ~]# cut-d:-F 3,4,5,6,7/etc/passwd can choose a few more paragraphs plus, you

Day07_ network management, SSH, Shell, and meta-characters

I. Network management Temporarily Modify network configuration Modify IP Address Ifconfig NIC name IP address Modify DNS vim/etc/resolv.conf: Modify nameserver DNS Address

Shell programming, backing up files across servers

Requirements: Query all files under a folder, change the file modification time to less than the current time, and be larger than the current time the previous day of the file backup to another server corresponding to the folderIdeas:1, recursive

To learn the shell programming of Linux in a face

1: What is Shell??? (1) The shell is an interface that the user interacts with the kernel, and the most popular shell is now called the Bash shell(2) The shell is also a programming language (3) A system can have more than one shell, you

Simple introduction and simple application of Shell Script Foundation

Shell scripting is a very important "program" in Linux. What shell script? A shell script is an executable statement that is designed ahead of time to complete a particular task's file.Shell scripts can be divided into interactive and

Linux operational ENGINEER1.4 (Shell Scripting Basics)

ENGINEER1.4Shell Script BasicsUnderstanding the shell environmentHow bash shells are usedInteractive:--manual intervention, high degree of intelligence----explain execution by article, low efficiencyNon-interactive:-Need to design in advance, the

CentOS 7.4 Shell does not display current user and path issues

The steps are as follows: Vim ~/.bash_profile (no tube. Bash_profile This file has several, own new one is also possible) at the end add Export ps1= ' [\[email protected]\h \w]\$ ' Then execute the source ~/.bash_profile so the shell can display the

The shell counts the number of files and directories in the current folder

1. Count the number of files in the current folderLs-l |grep "^-" |wc-l2 . Count the number of directories under the current folderLs-l |grep "^d" |wc-l3. count the number of files in the current folder, including subfoldersLs-lr|grep "^-" |wc-l4.

Shell Programming (iii)

In the first two articles, we have mastered some of the basic syntax of the shell, the use of variables, and the operation of basic data types. So this time we will learn the shell's structured commands, which are conditional selection statements

Shell finishing (40) = = to crack the encrypted QQ number

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/A7/58/wKioL1nlhuKSgQOnAAD7ZPQ7koc703.jpg "style=" float : none; "title=" QQ picture 20171017123847.jpg "alt=" Wkiol1nlhuksgqonaad7zpq7koc703.jpg "/>650) this.width=650; "src="

A client-side shell script that installs the environment and services in one click

#!/bin/bashbasepath=$ (CD ' DirName $ '; pwd)Shell_dir= "${basepath}/shell"Package_dir= "${basepath}/package"############################# #install rpm###########################关闭不必要的软件并禁止开机启动Systemctl Stop FirewalldSystemctl Disable

One shell per day (ii) Log IP statistics sorting

Statistical analysis of log files in the number of accesses per IP and sorted from high to low?Download the file to a local suffix#!/bin/bashawk? ' {print?$1} '? ip.log?|? Sort?|? Uniq?-c?|? Sort?-rn?|? MoreSh-x uniqip.sh?+ awk ' {print $} ' Ip.log+

Total Pages: 541 1 .... 207 208 209 210 211 .... 541 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.