Merge branch 'dev' into vhs
This commit is contained in:
commit
4cc4603b2e
@ -24,20 +24,41 @@ Also `which` shows where a binary file (the program) is,
|
|||||||
which cmus
|
which cmus
|
||||||
```
|
```
|
||||||
|
|
||||||
# Quick Search for Files
|
# Search Instantly with `plocate`
|
||||||
|
|
||||||
You'll need to set up `locate` for this by installing `mlocate`.
|
You can search every file on the computer instantly by installing `plocate`.
|
||||||
`mlocate` needs a list of all files on the machine, so run:
|
|
||||||
|
Once installed, run `sudo updatedb` to create the database of (nearly) every file on the computer.
|
||||||
|
|
||||||
|
Check how big the database is:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
du -h /var/lib/plocate/plocate.db
|
||||||
|
```
|
||||||
|
|
||||||
|
Once you have the database, you can find nearly any file instantly.
|
||||||
|
|
||||||
|
- Search for gifs: `locate .gif`
|
||||||
|
- Search for gifs in the `/usr/` directory: `locate /usr/ .gif`
|
||||||
|
- Search for jpg images with 'dog' or 'Dog' in the name: `locate -i dog jpg`
|
||||||
|
- Search for videos: `plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'`
|
||||||
|
|
||||||
|
For best results, run `updatedb` regularly, perhaps in [crontab](../system/cron.md).
|
||||||
|
|
||||||
|
## Search More Places
|
||||||
|
|
||||||
|
`plocate` will not search `/tmp/`, because nobody cares about those files, and won't search inside `/mnt/`, because that's where USB sticks get mounted, so the files keep changing as USB sticks come and go.
|
||||||
|
|
||||||
|
Change where `plocate` searches by editing the configuration file at `/etc/updatedb.conf`.
|
||||||
|
|
||||||
|
By default, the `/mnt` directory is 'pruned' from the database.
|
||||||
|
So if you want to search `/mnt` for videos, remove the word `/mnt` from the configuration file.
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cat /etc/updatedb.conf
|
||||||
|
sudo sed 's#/mnt/##' /etc/updatedb.conf
|
||||||
sudo updatedb
|
sudo updatedb
|
||||||
|
plocate --regex '.mp4$|.mkv$|.wmv$|.webm$|.mov$|.avi$'
|
||||||
```
|
```
|
||||||
|
|
||||||
Then to find a file called 'my-cats.jpg', run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
locate cats
|
|
||||||
```
|
|
||||||
|
|
||||||
For best results, run `updatedb` regularly, perhaps in crontab.
|
|
||||||
|
|
||||||
|
15
networking/scraping/Copy_Website.md
Normal file
15
networking/scraping/Copy_Website.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "Download Website"
|
||||||
|
tags: [ "networking", "scraping" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
```bash
|
||||||
|
domain=splint.rs
|
||||||
|
mkdir $domain
|
||||||
|
cd $domain
|
||||||
|
wget --recursive --convert-links --backup-converted \
|
||||||
|
--page-requisites --level=inf --adjust-extension \
|
||||||
|
-U "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" \
|
||||||
|
-p --mirror --html-extension --convert-links \
|
||||||
|
$domain
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user