mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-24 05:36:59 +00:00
Merge 8bf41a1135
into 3199d638ae
This commit is contained in:
commit
93a935b0e6
19
README.md
19
README.md
@ -1034,6 +1034,16 @@ find . -type f -empty -delete
|
|||||||
find . -type f | wc -l
|
find . -type f | wc -l
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### List all files with name [FILE] under /
|
||||||
|
```bash
|
||||||
|
find / -name [FILE] 2>&1 | grep -v 'Permission denied'
|
||||||
|
|
||||||
|
# 2>&1 redirects STDERR outputs to STDOUT which is piped
|
||||||
|
# to the grep inverse filter (-v) filter command.
|
||||||
|
# Thus, any errors are surpressed, mainly due to access attempts
|
||||||
|
# on priviliged directories.
|
||||||
|
```
|
||||||
|
|
||||||
## Condition and loop
|
## Condition and loop
|
||||||
[[back to top](#handy-bash-one-liners)]
|
[[back to top](#handy-bash-one-liners)]
|
||||||
|
|
||||||
@ -3208,6 +3218,15 @@ cd $(mktemp -d)
|
|||||||
# for example, this will create a temporary directory "/tmp/tmp.TivmPLUXFT"
|
# for example, this will create a temporary directory "/tmp/tmp.TivmPLUXFT"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Quickly return to last working directory
|
||||||
|
```bash
|
||||||
|
cd -
|
||||||
|
# example that will get you back to home directory:
|
||||||
|
# cd ~
|
||||||
|
# cd /tmp/tmp.TivmPLUXFT
|
||||||
|
# cd -
|
||||||
|
```
|
||||||
|
|
||||||
##### Make all directories at one time!
|
##### Make all directories at one time!
|
||||||
```bash
|
```bash
|
||||||
mkdir -p project/{lib/ext,bin,src,doc/{html,info,pdf},demo/stat}
|
mkdir -p project/{lib/ext,bin,src,doc/{html,info,pdf},demo/stat}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
theme: jekyll-theme-cayman
|
|
||||||
google_analytics: UA-88670245-2
|
|
Loading…
Reference in New Issue
Block a user