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 :#

Linux Shell Basics (four) regular expressions and grep commands (in edit)

First, regular expressionBefore learning the Find command, we have been exposed to some simple regular, so we can now learn some complex regularization. First of all, we still have to review what is regular expression, see this tutorial first, must

Pipe character and job control/shell variable/environment variable configuration file

Pipe character and job controlPipe break: The result of the preceding command is passed to the following command by the pipe character.Example [Email protected] ~]# cat/etc/passwd|wc-l43 Job Control: When you run a process, you can use

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

Getting Started with Shell scripting

Shell Scriptdking~ sharing1.1 Scripting ConceptsPut multiple commands into a single file to facilitate one-time execution of a program fileUnified Script Storage Directory:/server/scriptsUsing Vim to edit scripts is recommendedTo view the script

Rapid deployment of network PXE shell scripts

#!/bin/bash#获取当前机器IP地址ip= ' Ifconfig | head-2 | Tail-1 | awk ' {print $} '#获取当前机器MASK地址mask= ' Ifconfig | head-2 | Tail-1 | awk ' {print $4} 'Mask1= ' echo $MASK | Awk-f. ' {print '} 'If [$MASK 1-ne 0];thenIp1= ' echo $IP | Awk-f. ' {print '} 'Min1=

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 Script Basics

Reprinted from Http://www.cnblogs.com/liyuhui-Z/p/7792108.htmlShell IntroductionAs a command language, the shell interprets and executes user-entered commands interactively, and as a programming language, it defines variables and parameters and

1211 Day after Class shell summary

1211shell High wavesArchive: Learning NotesDecember 11, 2017 13:10:56 Shortcut keys:Ctrl + 1 title 1Ctrl + 2 title 2Ctrl + 3 title 3Ctrl + 4 ExampleCtrl + 5 Program CodeCtrl + 6 Body Format Description:Blue

Shell Pass Parameters

Shell Pass ParametersWe can pass parameters to the script when executing the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument

"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

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以.

Introduction to the Shell Basics of Linux (2)

8.6 Pipe break and job control:1, cat 1.txt |wc-l; Cat 1.txt |grep ' aaa '2. Ctrl Z pauses a task3. Jobs View background tasks4, Bg[id] The task to the backstage5. Fg[id] Transfer the task to the front desk6. Add & Drop the command back to the

The use of shell parentheses

Parentheses ():1. The commands in parentheses will be executed in a new sub-shell order, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in parentheses are separated by semicolons, and the last command can

UNIX Shell Basics Summary (ii)

1. The relationship between Vim,vi and exVim does not need to install, VI for ex "Visual Mode", Vim is the advanced version of VI;2. Unix Shell shortcut keysctrl+a/e position the cursor to the head/tail of the commandctrl+u/k ctrl+y Paste ctrl+u/k

Shell Exercises-Cleanup log

Requirements: A total of more than 300 machines, write a script to automatically clean up these two types of machine log files. In the Fortress machine batch release, also want to batch publish to crontab inside.Class A machine log storage path is

Java connection SSH Execution shell script

Wrote a shell script on the Liunx, want to call this shell script through Java, do not know how to call, in the Internet said to use process this way, but my executive machine and my shell script is not the same computer, the boss said Java can

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+

When the shell Script for window is transferred to the Linux server via FTP, the "No file or directory" solution is prompted in the shell script

The cause of the bad interpreter:no such file or directory is an issue with the document format. This file was written under Windows. Line wrapping is not the same as UNIX, but under vim if it is not set a bit and it is completely invisible.Problem

Total Pages: 541 1 .... 282 283 284 285 286 .... 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.