Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2722

[bash] コマンド履歴を一気にコピペする方法

$
0
0

history で見るとコマンドの番号が入ってそのままではコピペに使えなくてめんどくさい。
調べたら簡単なコマンドでできたのでメモ

https://qiita.com/catfist/items/82ed3df7a0b524aeab69
を参考にしました

history_pbcopy
history | tail-n(何個まえまで見たいか) | cut-d' '-f 5- | pbcopy

で取れます。便利!!!

ここからここまでって決まっていたら、

history_pbcopy
history | tail-n(何個まえまで見たいか) | head-n(そこから何個まで見たいか) | cut-d' '-f 5- | pbcopy

で取ることができます


Viewing all articles
Browse latest Browse all 2722

Trending Articles