sed tutorial: sed address and address range(select lines) with examples
sed address and address range tutorial, by using addresses or address ranges, the sed command can apply certain actions to these address lines....
How to use sed to replace multiple patterns at once in linux/unix?
sed is a powerful streaming text editor, and replace pattern is one of the most used functions. This article introduces how to replace multiple patterns...
How to remove the first line of a text file using the linux command line?
remove the first line: use awk NR variable, awk '{if(NR>1){print $0}}' file ; use sed action option d, sed '1d' file; use tail n...
How to delete empty lines in a text file in linux/unix
To delete blank lines in a text file, you can use awk NF variable, awk regular expression, sed regular expression and grep -v '^$'...
How to delete lines containing a specific string in a text file in linux/unix
Delete lines containing a specific string in a text file, we have three implementation methods: sed -i '/ pattern/d', grep -v 'pattern' and awk '!/pattern/...
Shell Command Test
The command test in the shell is used to check whether a condition is true. It can test numbers, strings and files. Number arguments test...
Shell Flow Control
The flow control of shell cannot be empty which is different from other languages such as Java and PHP.The following is the writing of PHP...
Shell Command Printf
In the previous chapter we learn the command echo, this chapter we will introduce the command printf. Printf mimics the printf () program in the...
Shell Command Echo
Echo in shell is similar to the echo in PHP which all output string.The syntax for echo is: You can use echo to achieve more...
Shell Basic Operators
There are various operators supported by shell.We will now discuss the following operators: Arithmetic Operators Relational Operators Boolean Operators String Operators File Test Operators Bourne...
Shell Arrays
Shell arrays can hold multiple values,Bash shell only support one-dimensional values(can not support multi-dimensional) .We don’t need to define array size during initialization (similar to PHP).The...
Shell Passing Arguments
Arguments can be passed to the script when it is executed,we can get the arguments by the formats like $n.Inside the script, the $1 variable...
Shell Variable
When you define the a variable name, the name should not prefix $(excepting in PHP ),for example your_name="www.linuxcommands.site" We should not add blank space between...
Shell tutorial
The Shell is a program written in C language, it is a bridge use Linux users.The Shell is a command language and a programming language.Shell...
How to sort by size using the du command
The default options of the linux du command are not sorted according to the size of the disk. If you want to display the results...