Shell module of Ansible

Example: Modify time for a node by command[[email protected] tmp]# ansible slave-m command-a ' date-s "2016/5/13 13:12" 'client02 | SUCCESS | Rc=0 >>Fri 13:12:00 CST 2016agent.test.com | SUCCESS | Rc=0 >>Fri 13:12:00 CST 2016[[email protected] tmp]#

Shell scripting Common (1)

\u indicates that the current user name \h represents the machine name \w represents the base name of the current working directory \w represents the full path to the current working directory. $, $, $, $: $ The name of this shell file refers to the

Linux Shell Basics

View the default shell types supported in Linux:/etc/shellsEcho Output command-e support for character conversions with backslash controlControl character (requires quotation marks) \\ Output \ Itself \a

CentOS6.8 x86_64bit shell scripting to simulate Nginx service startup and shutdown

Shell script simulates Nginx service startup and shutdownNote: 3 slashes////is followed by a representation of the interpretation of the current statement, which must be removed in the actual script#!/bin/bash///defines which scripting language

Shell Programming _ Implement Recycle Bin, avoid accidental deletion of files

The code is as follows:Download: Https://gitee.com/LoongWang/shellrecycling.git1#/usr/bin/EnvBash2 3 4 #定义5 #定义回收站目录6Recyclingdir='/usr/local/recycling/'7 #定义回收站log文件8recyclinglog='/var/log/recyclinglog'9

Shell Script Basics (i)

With the more and more application of Linux system in enterprise, the automatic management of server becomes more and more important, in some complex Linux maintenance work, a lot of repetitive output and interactive operation are not only time

Spoof common user Terminal shell script

Cat a.shfunction joke () {num=0people_list=$ (w | sed ' 1,2d ' | awk ' {print $} ') for user in $people _listdoif [$user! = "root "]then#echo $userinfo =$ (w | Sed ' 1,2d ' | grep "^ $user") pts=$ (echo $info | awk ' {print $} ') while:d oecho-e "\03

Configuration and optimization practices for the Shell Scripting development environment

Configuration knowledge such as Vim path is shown in table: Related configuration Files Function description . viminfo User's operation history using Vim . VIMRC Configuration file for

Shell Scripting Exercises

Shell script exercises 1. Script/root/bin/systeminfo.sh, which displays the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size. #!/bin/bash

Shell to determine whether the stream file under the batch directory is processing complete

#!/bin/bashLog_error () {? ? ECHO-E $target date "+%Y-%m-%d %H:%M:%S" ["\033[31merror\033[0m"]: [email protected]? ? ECHO-E $target date "+%Y-%m-%d %H:%M:%S" ["\033[31merror\033[0m"]: [email protected] >> $LOG _file}Log () {? ? ECHO-E $target date "+

Shell Scripting App (shell scripting Basics vs. Shell variables)

1. Shell: Command interpreter1) supported shells are saved in/etc/shells2) Default shell is/bin/bash2. Shell script writing:1) using the VI Editor2) One command per line, followed by3) Give executable permissions (x)3, the way of implementation:1)

Shell gets string length

Method 1: Use the wc-l commandWc-l can get the length of the current row, so the string for a single row can be obtained in this simple way, and the wc-l is the number of rows that get the current string content.The code is as follows: Echo "ABC"

The shell automatically log out of inactive users after a period of time in CentOS

By defaultShellis not timed out automatically, but it is sometimes necessary for it to automatically exit the terminal after a period of inactivity without an operation. 1. Create a file /etc/profile.d/autologout.sh :#

Shell Script--permission assignment

Because shell scripts are a collection of many commands, these commands may involve manipulating a file, and the execution of the shell script requires the current user to have permission to run the script, otherwise it will fail because of

How to switch the shell environment

To view the commands for the terminal tool:echo $TERMThe returned results are as follows:xterm-256color To view the command for the shell environment:echo $SHELLThe returned results are as follows:/bin/bash Switch the shell environment: chsh

8.10-8.13 Shell Special Symbol

8.10 Shell Special symbol Cut commandSpecial symbols (top):A 1.* represents 0 or more arbitrary characters.2. Represents only one arbitrary character ( whether it is a number or a letter, as long as it can be matched. )3.# This symbol in Linux

Shell Introduction, Command History, command and file name auto-complete; wildcard and input \ Output redirection

Shell IntroductionThe shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the command entered by the user and feeds it into the kernel to execute.There is a layer of things

Shell Script implementation: 5 per week using the tar command to back up all log files under/var/log

Simple little script, big God DetourImplementation steps:1 Writing scripts2 Doing recurring planning tasks1 scripting[Email protected] ~]# vim tar.shScript content:#!/bin/bash#编写备份脚本, the file name contains a date label after the backup, preventing

"Linux Shell Script Raiders" Reading notes

This book focuses on the use of some of the Linux shell commands, explaining some of the shell's artifice.Chapter One small trial sledgehammerMainly introduces some basic shell instructionsTerminal printing: Echo, printfAliases: AliasTerminal

Shell Introduction and basic usage

8.1:shell Introduction:The shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, supports logical judgments, loops, and each user can have his or her own shell:The CentOS default shell

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