<Python, iPython> shellのaliasの設定
ipython
上でのシェルコマンドshell command
のエイリアスalias
の設定方法。
まずは、次のコマンド実施。
そうするとホーム/home/hage/.ipython/profile_default/
以下に下記ファイルができる。
[1:hage@hoge~]> ipython profile create [ProfileCreate] Generating default config file: '/home/hage/.ipython/profile_default/ipython_config.py' [ProfileCreate] Generating default config file: '/home/hage/.ipython/profile_default/ipython_kernel_config.py' [ProfileCreate] Generating default config file: '/home/hage/.ipython/profile_default/ipython_console_config.py' [ProfileCreate] Generating default config file: '/home/hage/.ipython/profile_default/ipython_qtconsole_config.py' [ProfileCreate] Generating default config file: '/home/hage/.ipython/profile_default/ipython_notebook_config.py' [ProfileCreate] Generating default config file: '/home/hage/.ipython/profile_default/ipython_nbconvert_config.py'
で、このあとipython_config.py
を開いて次を追加。
c.AliasManager.user_aliases = [ ('la', 'ls -al'), ('m', 'more') ]
これでaliasが効く。
マニュアル。
Introduction to IPython configuration — IPython 4.0.0 documentation