LoginSignup
0
1

More than 1 year has passed since last update.

Mac | ターミナル最後のコマンドをコピー&ペーストする

Last updated at Posted at 2017-05-27

エイリアス登録

~/.zshrc
setopt hist_no_store
alias last-command="history | tail -n 1 | awk '{ \$1=\"\"; print \$0 }' | sed 's/ //'"
alias pbcopy-last-command="last-command | pbcopy"

反映

source ~/.zshrc

実行

適当なテキストエディタとかにペースト。

$ echo "a b c d"
$ pbcopy-last-command

検証

image.png

環境

  • Mac OSX 10.12.5

リンク

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1