Linux でのフルパス名付きの ls

Linux ターミナルのコマンド シェルで、ファイルとディレクトリを一覧表示してフル パス/絶対パス名を表示する方法。

 

ls で絶対ディレクトリ名を取得するには、ターミナルのコマンド シェルに次のように入力します。

$ ls -d $PWD/*

絶対ディレクトリ名の ls:

$ ls -d $PWD/*
/home/user/Desktop   /home/user/Music    /home/user/Templates
/home/user/Documents /home/user/Pictures /home/user/todo.txt
/home/user/Downloads /home/user/Public   /home/user/Videos
$

 

長いリスト形式の ls (-l) 絶対ディレクトリ名 (-d):

$ ls -ld $PWD/*
total 4
drwxr-xr-x 2 user user  80 2011-08-17 16:52 /home/user/Desktop
drwxr-xr-x 2 user user  40 2011-08-17 16:52 /home/user/Documents
drwxr-xr-x 2 user user  40 2011-08-17 16:52 /home/user/Downloads
drwxr-xr-x 2 user user  40 2011-08-17 16:52 /home/user/Music
drwxr-xr-x 2 user user 120 2011-08-17 18:14 /home/user/Pictures
drwxr-xr-x 2 user user  40 2011-08-17 16:52 /home/user/Public
drwxr-xr-x 2 user user  40 2011-08-17 16:52 /home/user/Templates
-rw-r--r-- 1 user user 131 2011-08-17 18:07 /home/user/todo.txt
drwxr-xr-x 2 user user  40 2011-08-17 16:52 /home/user/Videos
$

 

 


こちらもご覧ください

Advertising

LS コマンド
°• CmtoInchesConvert.com •°