LoginSignup
0

More than 5 years have passed since last update.

Linux で chmod のパーミッション (権限) を数値で取得する

Posted at

概要

パーミッションが 700 になってるのかパッと見わかりずらいから数字で出したい...。
そんな時の備忘録。

前提

  • OS: CentOS Linux release 7.6.1810 (Core)

普通に表示すると

/home/
$ ls -l

# 結果⬇︎
total 0
drwx------. 4 user_name_1 user_name_1 126 Dec 25 00:19 user_name_1
drwx------. 8 user_name_2 user_name_2 207 May  2  2018 user_name_2
drwx------. 9 user_name_3 user_name_3 204 Feb 14 19:59 user_name_3
drwx------. 3 user_name_4 user_name_4 95 Sep 16 13:16 user_name_4

コマンド

# stat --format='%a %U:%G' 表示させたい1階層上のディレクトリ/*
stat --format='%a %U:%G' /home/*

結果⬇︎

700 c_tomioka:c_tomioka
700 iadev:iadev
700 iaportal:iaportal
700 tommy:tommy

おっ、できた。

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
0