feat: add atuin sqlite tricks
parent
8e3a99a399
commit
b5b1c4ea56
|
@ -387,6 +387,24 @@ rsync -avzP src/ dst</pre>
|
|||
in <strong>src</strong>, useful to sync dst with src
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<a
|
||||
id="user-content-atuin"
|
||||
class="anchor"
|
||||
aria-hidden="true"
|
||||
tabindex="-1"
|
||||
href="#atuin"
|
||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
||||
><a href="https://github.com/atuinsh/atuin">atuin</a>
|
||||
</h2>
|
||||
<p>Remove duplicated command:</p>
|
||||
<div class="highlight highlight-source-sql">
|
||||
<pre><span class="pl-k">delete</span>
|
||||
<span class="pl-k">from</span> history
|
||||
<span class="pl-k">where</span> id not <span class="pl-k">in</span> (<span class="pl-k">select</span> <span class="pl-c1">max</span>(id)
|
||||
<span class="pl-k">from</span> history
|
||||
<span class="pl-k">group by</span> command);</pre>
|
||||
</div>
|
||||
<h2>
|
||||
<a
|
||||
id="user-content-f2"
|
||||
|
|
|
@ -295,6 +295,18 @@ Be careful flags (need dry run if not sure):
|
|||
- `--delete`: delete files in **dst** if not exist in **src**, useful to sync
|
||||
dst with src
|
||||
|
||||
## [atuin](https://github.com/atuinsh/atuin)
|
||||
|
||||
Remove duplicated command:
|
||||
|
||||
```sql
|
||||
delete
|
||||
from history
|
||||
where id not in (select max(id)
|
||||
from history
|
||||
group by command);
|
||||
```
|
||||
|
||||
## [F2](https://github.com/ayoisaiah/f2)
|
||||
|
||||
Rename:
|
||||
|
|
Loading…
Reference in New Issue