Shell script implements dynamic clock

#!/bin/bash tput civis while [ 1 ] do    tput clear    tput cup 3 10    tput setb 0    tput setf 2    echo -e "\e[1;32m$(date "+%Y-%m-%d %H:%M:%S  %A")\e[0m"    sleep 1 done Running in Xshell will have splash screen,

Shell Script Application (v) if statement

Single-branch if statement: If condition test actionThenCommand SequenceFi Example: Determine if the mount point directory exists, or create a new directory if it does not exist. [email protected] script]# cat chkmountdir.sh#!

Shell Echo Color Example

#!/bin/bash# Test color for scriptred_color= ' \e[1;31m 'green_color= ' \e[1;32m 'yellor_color= ' \e[1;33m 'blue_color= ' \e[1;34m 'pink= ' \e[1;35m 'res= ' \e[0m 'if [$#-eq 2] Thenecho "Usage: ' basename $ ' content {Red|blue|yellow|pink|res|green}"

Use of the "shell" nmap tool

NMap, also known as Network Mapper, is the Web scanning and sniffing Toolkit under Linux, which has three basic functions, one is to detect whether a group of hosts are online, the second is to scan host ports, to sniff out network services, and to

Conditions in the shell determine if and test

(a) Conditions to determine if the meaning of-Z to-D[-A file] is true if file exists.[-B file] True if file exists and is a block special file.[-C file] True if file exists and is a special file of a word .  [-D file] True if file exists and is a

Linux Shell Series Tutorial (10) Shell for Loop

This article is part of the Linux Shell Series Tutorial (10), more Linux shell tutorials: Linux Shell Tutorials Basically any language has its own looping statements, of course, the shell is no exception, today we introduce the use of shell for

Linux Shell Instructions

How the Linux shell commands work:Linux is strictly speaking of an operating system, we call it "core (kernel)", but we generally users, cannot directly use kernel. Instead, it communicates with kernel through kernel's "shell" program, the so-called

HDFs Common shell commands (reprint)

Original address: http://www.cuiweiyou.com/1405.html0.shell[Email protected]:~# Hadoop Fsusage:hadoop fs [generic options] [-appendtofile ... ] [-cat [-IGNORECRC] ...] [-checksum ...] [-CHGRP [-R] GROUP PATH ...] [-chmod [-R] PATH ...] [-chown

Shell Tutorial-002: Common shell types

The shell is a scripting language, so you have to have an interpreter to execute the scripts.The common shell scripting interpreters on Unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell. we often say that there

Shell from getting started to discarding step two + +

This article takes the shell from getting started to giving up the first stepThus, continue from small white to give up the second part of @[email protected] First, the shell operator The shell supports a number of operators, including:

Shell gets all file names, paths, file sizes under directory (including subdirectories)

A sample shell script:Gets all file names, paths, and file sizes under the directory (including subdirectories).Code, Shell script: lsdir.sh#!/bin/bash# #site: www.jquerycn.cnfunction ergodic () { forFileinch' LS $1` Do if[-D $1"/"$file] then

Ansible's shell and script module

Using the shell module, the remote command is executed through/bin/sh, so we can use the various command methods in the terminal input;But we define our own environment variables in. Bashrc/.bash_profile The shell module is not recognized because it

Shell scripting multiple ways to rearrange the contents of a file (shuffle problem)

Shuffle question: Wash a pair of poker, what good way? Can be washed evenly, and can wash fast? How efficient is the order of chaos relative to a file?Chinaunix is really a place where the Shell masters are gathered, so long as you want to get the

Part 2: Enable the Shell to read commands

This article is part of the article "writing a Shell" series. In the previous article, we have completed the first step of our shell: the shell prompt. In this article, we begin to enable our Shell to start reading commands, and to do simple

Shell Date Command

Direct run will show time[Email protected] shell]# Datesat APR 12:56:47 CST 2016View Calendar[[email protected] shell]# cal April 2016Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 910 11 12 13 14 15 1617 18 19 20 21 22 2324 25 26 27 28 29 30View a full year[[

Linux Shell ${} simple usage

Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtWe can replace each other with ${} to get different values:${file#*/}: Take out the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string:

Print output from the Linux shell

IntroductionOften need to deal with shell commands, but there has been no systematic learning, then it will take 1-2 months to learn the shell command system, then open the magical journey of the shell command. This chapter focuses on the print

Shell string length

Method One of the $ expr length "Find out the length of this string from the Linux Bash shell." 57 Method Two Str1=aaaaaaaaaecho ${#str1}Echo-n xxxxx |wc-cecho Xxxx|awk ' {print length ($)} 'echo "$str" |awk ' {print length ($)} 'awk ' {$a =length ($

Linux Shell Series Tutorial (vi) Shell array

This article is part (vi) of the Linux Shell Series tutorial, more on the Shell Tutorial: Linux Shell Series Tutorials The shell is very powerful in programming, its array function is also very perfect, today we introduce the use of the shell

Java calls shell commands and scripts

1. IntroductionSometimes when we run Java programs on Linux, we need to invoke some shell commands and scripts. The Runtime.getruntime (). Exec () method provides us with this functionality, and Runtime.getruntime () provides us with the following

Total Pages: 541 1 .... 118 119 120 121 122 .... 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.