space, which is used to report the use of disk space in the file system
Related commands
Du (disk usage) Diskette utilityFree Memory Information
Getting Started example
1. $df
As shown in figure:
Explanation:DF Default printing information, with K as block, calculate hard disk total space, used and available, and file system mount point
2. $DF –m
As shown in figure:
Explanation: Change the basic unit of a block
3. $DF-T
As shown in figure:
Explanation: Type of file system to p
Q: What is a shell and what is a shell script? The A:shell is a program written in C that is a bridge between the user and the Linux operating system. Users can either enter command execution and use shell scripting to accomplish more complex operations. It is a general designation of command Language, command interpr
Shell The technique of text slicing inIn the shell there is also a string slice this thing exists, has been used in Python slices, the following record the use of slices in the shell.(1) , replacing some of the text in the variable contents$var = "This was a line of text"$ echo${var/line/replaced}This is areplaced of text " Line be replaced by replaced . (2) ,
Shell script:
1, #! Shell that specifies script execution2, # Annotation3. command or grammatical structureecho "Input"Echo Output blank linePerform:
1. Shell ScriptSH Example2, to the shell script execution permissionschmod U+x ExampleCase: Example sysinfo.sh3ABC x cannot begin with a numberAbc3ABC3
environment var
There are multiple shells in Linux, where Bash is used by default. This chapter describes how shell works, shell types, General Shell operations, and bash features. Shell is the interface between the user and the Linux operating s
use external program files to run.(1) such as exit and CD are built-in commands$type exit$type CDSome commands have multiple implementations, such as PWD and Echo, which have both external and built-in commands#type-a EchoThe which only displays external command files.Type-a shows two implementations of each command.Tip: For multiple implementations of the command, the default execution is built-in, if you want to execute an external command can specify the corresponding file is good.Like what$
This article is part of the Linux Shell Series Tutorial (vii), more shell tutorials See: Linux Shell Series Tutorials
As with other languages, there are output operations in the shell, and in practical applications it is also
There are two ways to execute shell commands under Linux
Executing shell commands in the current shell
Generates a subshell in the current shell, executing shell commands in Subshell
1. Executing
If statement formattingIf conditionThenCommandElseCommandFi, don't forget this ending.If statement forgets the end fiThree conditional expressions of Test.sh:line 14:syntax error:unexpected end of Fi if
IfCommandThen ifFunctionThenCommand executed successfully, equal to return 0 (such as grep, find a match)Execution failed, returned non 0 (grep, no match found)if [Expression_r_r_r]Then the result of the expression is true, return 0,if to the 0 value thenif test Expression_r_r_rThen the result o
Introduction to Shells and scripts
The Gnu/linux Shell is an interactive tool that provides users with the means to start programs, manage files on file systems, and manage processes running on Linux systems.
At the heart of the shell is the command line prompt
It's the interactive
Linux command and ShellThe so-called Shell is the command interpreter, which provides programming interfaces that can be programmed using programs. Learning the shell is very important for Linux beginners to understand Linux systems. LThe
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
This article introduces the Linxu shell of the relevant knowledge of the array, and a lot of examples for reference, including the copy of the array, calculation, deletion, replacement, etc., is to learn the shell array of rare good articles.
The declaration of an array:
1) Array[key]=value # Array[0]=one,array[1]=two2) declare-a Array # array is treated as an array name3) array= (value1 value2 value3 ...
First, Introduction
Environment variables are typically used to store path lists that are used to search for executables, library files, and so on. For example: $PATH, $LD _library_path, they usually look like this:
Copy Code code as follows:
Path=/usr/bin;bin
Ld_library_path=/usr/lib;lib
This means that whenever the shell needs to run a binary executable, it looks for/usr/bin first and then looks for/bin. In ubuntu14.04, th
Daily backup MySQL database tasks, delete the specified number of days before the data, keep the date of the specified day;
Demand:1, backup MySQL data 4 points per day;2, to save space, delete more than 3 months of all backup data;3, delete more than 7 days of backup data, keep 3 months of 10th number 20th number of backup data;
#创建shell文件
vim backup_mysql.sh
mysqldump-uroot-p123456--all-databases >/data/dbdata/mysqlbak/' Date +%Y %m%d '. SQL
Shell itself is a program written in C language, which serves as a bridge between users using Linux. Shell is both a command language and a programming language. As a command language, it interactively interprets and executes user-input commands. as a programming language, it defines various variables and parameters and provides many
Tags: Linux bash shellShell syntax Shell performs command operation
When the shell reads the input, it performs a series of actions. If the input represents the beginning of a comment, the shell ignores the comment symbol (' # ') and the remainder of the line.
When the
My colleague sent a shell question to find the maximum and minimum values in a multidimensional array.such as file 99file:33 55 23 56 99234 234 545 6546 3411 43 534 33 7543 34 76 756 33343 890 77 667 55
One of my implementations:
#! /bin/bash
echo "The file is:"
cat 99shu
max=0
min=999999
line=1
dnum=$ (cat 99shu| WC-L) while
(($line
Results:The max number is:6546The min number is:11
Implementation of the second:
#! /bin/bash
#
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.