
No.3ベストアンサー
- 回答日時:
↓のようなでもいいのかな?
○CentOS 5.2
[lean@brynhildr ~]$ cat /etc/redhat-release
CentOS release 5.2 (Final)
[lean@brynhildr ~]$ stat --version
stat (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
作者 Michael Meskes.
[lean@brynhildr ~]$ echo 'test' > text
[lean@brynhildr ~]$ ls -l text
-rw-rw-r-- 1 lean lean 5 10月 11 17:23 text
[lean@brynhildr ~]$ stat text
File: `text'
Size: 5 Blocks: 16 IO Block: 4096 通常ファイル
Device: fd00h/64768d Inode: 1507337 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 500/ lean) Gid: ( 500/ lean)
Access: 2008-10-11 17:12:53.000000000 +0900
Modify: 2008-10-11 17:23:16.000000000 +0900
Change: 2008-10-11 17:23:16.000000000 +0900
[lean@brynhildr ~]$ stat --format='%A %a' text
-rw-rw-r-- 664
[lean@brynhildr ~]$ stat --format='%A %h %U %G %s %y %n' text
-rw-rw-r-- 1 lean lean 5 2008-10-11 17:23:16.000000000 +0900 text
[lean@brynhildr ~]$ stat --format='%a %h %U %G %s %y %n' text
664 1 lean lean 5 2008-10-11 17:23:16.000000000 +0900 text
[lean@brynhildr ~]$
No.2
- 回答日時:
ls -l で、rw-r--r-- となる場合に、644 と表示したいわけですよね。
コマンド一発というのは無さそうな気がします。
C,Perl等で書くか、シェルスクリプトでtestをつかってごりごり書くか、ls -l の結果を場合分けして書くか。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
Core 2 Duo の古いパソコンに最...
-
linuxのインストール
-
ubuntu(linux)のシャットダウン...
-
インストールできないですどう...
-
VirtualBox 6.1 → 7.1 でUbuntu...
-
「/var/log」内のログの削除の...
-
Linux のシェルスクリプトの強...
-
ubuntu が起動しない。
-
LinuxでWine使うとどのくらいWi...
-
bashでシングルクォート内の変...
-
ssl_error_logのエラー内容(AH...
-
ubuntuのシャットダウンが進ま...
-
ubuntuで デイスク/deb/loopと...
-
Ububtuでファイル共有できない...
-
Ubuntu でinvalid filenameとな...
-
Rasberry pi のオンボードNICの...
-
linuxサーバーのキャッシュをク...
-
Linuxでブートディスクの交換後...
-
他のLinuxでも動くa.outの作り方
-
ssl_request_logの必要性について
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
scpコマンドでリモートサーバの...
-
【ターミナル】MacBookにディー...
-
Illustratorのデータをまとめて...
-
DOSコマンドでのワイルドカ...
-
Windows10のRegSys32に登録され...
-
telnet,rlogin,rshの違いってな...
-
IBM漢字コードのSJIS変...
-
rcpコマンドについて、教えて!
-
コマンドでのコンピュータ名変...
-
DOSのAUTOEXEC.BATの書き方、等
-
cactiでグラフが表示されない
-
wgetの正規表現について
-
FTP接続中のコマンド実行結果を...
-
AIX ksh利用 grep 検索で マ...
-
linuxのreadコマンドについて
-
今年の経過日数 linixコマンド...
-
属性変更できないです。
-
Solaris rmコマンドをシェルで...
-
Linux9でのCUIの日本語表示につ...
-
lsコマンドで表示するファイル...
おすすめ情報