0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[zsh]端末ウィンドウが一つしか開かないときのための、ファイルの移動機能のおまけ

Posted at

zshで、端末ウィンドウが一つしか開かないときのために、ファイルをget/putするほんの些細な機能を作りました。

ファイルのget
function get() {
    export CLIPFILE="`pwd`/$1"
}

これを、~/.zshrcに書いておいてください。

ファイルのput
alias put="mv \$CLIPFILE . && unset CLIPFILE"

これを、~/.zshrcに書いておいてください。

実行例
$ source ~/.zshrc
$ ls
file1  testdir/
$ get file1
$ ls
file1  testdir/
$ cd testdir
$ ls
$ put     
$ ls
file1
$ 
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?