aliasとは

コマンドを定義する別名をaliasという

aliasを利用すれば、よく使うコマンドを別名として登録して、簡単に使うことができます。
よく設定されているのは、
ll

ls -l
(ファイル一覧をリスト形式オプションで)を呼び出すようになっているaliasですね。

現在どんなaliasが設定されているかは、aliasコマンドで確認できます。

現在のaliasのリストを表示する

[user@myserver ~]$ alias
alias ll=’ls -l –color=tty’
alias ls=’ls –color=tty’

独自のaliasを設定する

自分用のaliasを独自に設定する場合は、ホームディレクトリにある.bashrcに記述します。

例えば、viコマンドでvimを実行したい時はこんなふうに記述します。

$ vi ~/.bashrc
alias vi=’vim’
# User specific aliases and functions
alias vi ="vim"

記述して保存したら、一旦ログインし直すか、sourceコマンドで先程の.bashrcを実行することで反映されます。

source ~./bashrc

1 thought on “aliasとは

  1. AlexisBrums

    Both sayings highlight the benefits of waking up early.
    Because let’s face it, perseverance is the key to success in life.
    It’s one of my favorite aphorisms because it’s simple but yet powerful.
    He once stated, It is better to be alone than in bad company.
    Sometimes, though.
    They’re easy to remember and pass down through generations because they’re concise.
    For example.
    How many times have you heard one of the following aphorism examples.
    Both sayings highlight the benefits of waking up early.
    This famous motto highlights the truism that life is full of ups and downs.
    It’s one of the most recognized aphoristic statements today.
    Sandys said, Honestie the best policie, which in modern English is…
    Yup, he was reminding Philadelphians that preventing fires is better than fighting them.
    Not good.
    And then.
    But not today.

    返信

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です