Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@sawanoboly

すべての開いているターミナルのCWDを取得 - macos

More than 3 years have passed since last update.

癖で普段から沢山ターミナルを開いています。しかし、イベントでの発表とか、ちょっとした都合で自分の端末を映像配信・録音に使うなどのため、できるだけ負担を減らす目的で全部閉じることがあります。

で、閉じる前何やってたっけ。。があるのでダンプしておくことにしよう。

lsofでcwdつき出力して、あとは良くあるフィルタのワンライナーで実施。

$ for x in $(pidof bash); do lsof -a -d cwd -p $x ; done |  grep bash | awk '{print $9}' | sort | uniq
/Users/sawanoboly
/Users/sawanoboly/develop/src/git.example.com/kafka-docker
/Users/sawanoboly/develop/src/git.example.com/zookeeper-docker/stack
/Users/sawanoboly/develop/src/git.example.com/sawanoboly/kafka-miscs
/Users/sawanoboly/develop/src/git.example.com/sawanoboly/kafka-miscs/landloop
/Users/sawanoboly/develop/src/github.com/confluentinc/cp-docker-images
/Users/sawanoboly/develop/src/github.com/getshifter/base
/Users/sawanoboly/sandbox/kafka-leaning/fluentd
/Users/sawanoboly/sandbox/spot/opencv
/Users/sawanoboly/sandbox/spot/opencv/face_recognition/examples
/Users/sawanoboly/sandbox/spinnaker

脳内コンテキスト復旧の手助けになるよう。

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?