mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-22 21:07:00 +00:00
fix 'back to top' link
This commit is contained in:
parent
f5f7b2bd55
commit
2bc18431d9
32
README.md
32
README.md
@ -117,7 +117,7 @@ $! :is the PID of the most recent background command.
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Grep
|
## Grep
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Type of grep
|
##### Type of grep
|
||||||
```bash
|
```bash
|
||||||
@ -299,7 +299,7 @@ grep -d skip 'bbo' /path/to/files/*
|
|||||||
|
|
||||||
|
|
||||||
## Sed
|
## Sed
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
##### Remove the 1st line
|
##### Remove the 1st line
|
||||||
```bash
|
```bash
|
||||||
sed 1d filename
|
sed 1d filename
|
||||||
@ -506,7 +506,7 @@ sed -r -e 's/^.{3}/&#/' file
|
|||||||
|
|
||||||
|
|
||||||
## Awk
|
## Awk
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Set tab as field separator
|
##### Set tab as field separator
|
||||||
```bash
|
```bash
|
||||||
@ -663,7 +663,7 @@ awk '{$6 = $4 - prev5; prev5 = $5; print;}'
|
|||||||
|
|
||||||
|
|
||||||
## Xargs
|
## Xargs
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Set tab as delimiter (default:space)
|
##### Set tab as delimiter (default:space)
|
||||||
```bash
|
```bash
|
||||||
@ -784,7 +784,7 @@ grep -rl '192.168.1.111' /etc | xargs sed -i 's/192.168.1.111/192.168.2.111/g'
|
|||||||
|
|
||||||
|
|
||||||
## Find
|
## Find
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
##### List all sub directory/file in the current directory
|
##### List all sub directory/file in the current directory
|
||||||
```bash
|
```bash
|
||||||
find .
|
find .
|
||||||
@ -822,7 +822,7 @@ find . -name "*.mso" -size -74c -delete
|
|||||||
|
|
||||||
|
|
||||||
## Condition and loop
|
## Condition and loop
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### If statement
|
##### If statement
|
||||||
```bash
|
```bash
|
||||||
@ -921,7 +921,7 @@ esac
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Variable
|
## Variable
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
##### Variable substitution within quotes
|
##### Variable substitution within quotes
|
||||||
```bash
|
```bash
|
||||||
# foo=bar
|
# foo=bar
|
||||||
@ -983,7 +983,7 @@ helloworld
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Math
|
## Math
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
##### Arithmetic Expansion in Bash (Operators: +, -, *, /, %, etc)
|
##### Arithmetic Expansion in Bash (Operators: +, -, *, /, %, etc)
|
||||||
```bash
|
```bash
|
||||||
echo $(( 10 + 5 )) #15
|
echo $(( 10 + 5 )) #15
|
||||||
@ -1041,7 +1041,7 @@ echo "var=5;--var"| bc
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Time
|
## Time
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Find out the time require for executing a command
|
##### Find out the time require for executing a command
|
||||||
```bash
|
```bash
|
||||||
@ -1076,7 +1076,7 @@ job 1 at Wed Apr 18 11:16:00 2018
|
|||||||
|
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Download the content of this README.md (the one your are viewing now)
|
##### Download the content of this README.md (the one your are viewing now)
|
||||||
```bash
|
```bash
|
||||||
@ -1139,7 +1139,7 @@ wget -P /path/to/directory "http://example.com"
|
|||||||
|
|
||||||
|
|
||||||
## Random
|
## Random
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
##### Random pick 100 lines from a file
|
##### Random pick 100 lines from a file
|
||||||
```bash
|
```bash
|
||||||
shuf -n 100 filename
|
shuf -n 100 filename
|
||||||
@ -1171,7 +1171,7 @@ echo $(((RANDOM %10)+1))
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Xwindow
|
## Xwindow
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
X11 GUI applications! Here are some GUI tools for you if you get bored by the text-only environment.
|
X11 GUI applications! Here are some GUI tools for you if you get bored by the text-only environment.
|
||||||
|
|
||||||
@ -1233,7 +1233,7 @@ xcowsay
|
|||||||
|
|
||||||
|
|
||||||
## System
|
## System
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Display CPU and IO statistics for devices and partitions.
|
##### Display CPU and IO statistics for devices and partitions.
|
||||||
```bash
|
```bash
|
||||||
@ -1963,7 +1963,7 @@ systemctl list-unit-files|grep enabled
|
|||||||
|
|
||||||
|
|
||||||
## Hardware
|
## Hardware
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Collect and summarize all hardware info of your machine
|
##### Collect and summarize all hardware info of your machine
|
||||||
```bash
|
```bash
|
||||||
@ -2091,7 +2091,7 @@ ipmitool -I bmc lan set 1 defgw ipaddr 192.168.0.1
|
|||||||
|
|
||||||
|
|
||||||
## Networking
|
## Networking
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
|
|
||||||
##### Display IP address
|
##### Display IP address
|
||||||
```bash
|
```bash
|
||||||
@ -2140,7 +2140,7 @@ hostnamectl set-hostname "mynode"
|
|||||||
|
|
||||||
|
|
||||||
## Others
|
## Others
|
||||||
[[back to top](#handy-bash-oneliner-commands)]
|
[[back to top](#handy-bash-one-liners-commands)]
|
||||||
##### Get parent directory of current directory
|
##### Get parent directory of current directory
|
||||||
```bash
|
```bash
|
||||||
dirname `pwd`
|
dirname `pwd`
|
||||||
|
Loading…
Reference in New Issue
Block a user