LoginSignup
12
7

More than 5 years have passed since last update.

PATHを見やすく一覧表示する

Last updated at Posted at 2013-11-26

sedを使って、区切りで改行してやると見やすい。

$ echo $PATH | sed -e 's/:/\n/g'
Before
$ echo $PATH
/home/ginpei/.nvm/v0.9.5/bin:/home/ginpei/.rvm/gems/ruby-2.0.0-p247/bin:/home/ginpei/.rvm/gems/ruby-2.0.0-p247@global/bin:/home/ginpei/.rvm/rubies/ruby-2.0.0-p247/bin:/home/ginpei/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
After
$ echo $PATH | sed -e 's/:/\n/g'
/home/ginpei/.nvm/v0.9.5/bin
/home/ginpei/.rvm/gems/ruby-2.0.0-p247/bin
/home/ginpei/.rvm/gems/ruby-2.0.0-p247@global/bin
/home/ginpei/.rvm/rubies/ruby-2.0.0-p247/bin
/home/ginpei/.rvm/bin
/usr/local/bin
/usr/bin
/bin
/usr/local/games
/usr/games

sedはファイル群を対象に置換処理するのにも使えて大変便利。

参考:

12
7
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
12
7