1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Macのターミナルなどで使う ls コマンドについての備忘録

Posted at

ls

ls -- ディレクトリ内のコンテンツをリスト表示する

ls      # 現在のディレクトリ内のコンテンツを表示
ls -l   # 各コンテンツの詳細情報も表示
ls -a   # 隠しコンテンツも表示
ls −la  # 隠しコンテンツも含め現在のディレクトリ内のすべてのコンテンツの詳細情報を表示する

ls -r   # ソート逆順表示
ls -t   # 最終更新時刻が新しい順に表示
ls -G   # カラー表示

ls -altr -G # 更新日時が古い順に、現在のディレクトリ内のすべてのコンテンツおw,隠しコンテンツを含めて、カラー表示する

~/.zshrc に以下の様に記載をして、lsコマンドを上書きして、ls と入力すると自動で ls -altr -G の結果が得られて、便利かもしれません。

alias ls='ls -al -G'
1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?