This commit is contained in:
deinonychus 2024-09-02 11:03:52 +08:00 committed by GitHub
commit 93a935b0e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 2 deletions

View File

@ -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}

View File

@ -1,2 +0,0 @@
theme: jekyll-theme-cayman
google_analytics: UA-88670245-2