linux ファイルの一覧を行いたい
方法1簡単な方法
$ find /home/shodai/ -ls 1048578 4 drwxr-xr-x 6 shodai shodai 4096 12月 31 12:11 /home/shodai/ 1048579 4 -rw-r--r-- 1 shodai shodai 220 9月 6 23:01 /home/shodai/.bash_logout 1048587 4 -rw-rw-r-- 1 shodai shodai 75 9月 7 10:23 /home/shodai/.selected_editor 1048606 4 drwxrwxr-x 3 shodai shodai 4096 11月 2 22:39 /home/shodai/shell_test 1048607 4 drwxrwxrwx 2 shodai shodai 4096 11月 3 18:42 /home/shodai/shell_test/20141102_hiaDocment 1048609 4 -rw-rw-r-- 1 shodai shodai 539 11月 3 01:35 /home/shodai/shell_test/20141102_hiaDocment/fte.txt 1048608 4 -rwxrwxrwx 1 shodai shodai 89 11月 3 02:09 /home/shodai/shell_test/20141102_hiaDocment/ftp.sh 1048611 4 -rwxrwxrwx 1 shodai shodai 167 11月 3 18:45 /home/shodai/shell_test/20141102_hiaDocment/ftp3.sh 1048610 4 -rwxrwxrwx 1 shodai shodai 203 11月 3 02:52 /home/shodai/shell_test/20141102_hiaDocment/ftp2.sh 1048585 8 -rw------- 1 shodai shodai 4539 12月 31 02:36 /home/shodai/.bash_history
ls -lis と同様の内容らしい。行頭に、inodeと使用ブロックサイズが付与されている。
ls -l をした時の、時刻情報のフォーマットって気になるよね。 --time-style っていうオプションがありました
$ shodai@x22:~$ ll 合計 52 drwxr-xr-x 6 shodai shodai 4096 12月 31 12:11 ./ drwxr-xr-x 3 root root 4096 9月 6 23:01 ../ -rw------- 1 shodai shodai 4539 12月 31 02:36 .bash_history -rw-r--r-- 1 shodai shodai 220 9月 6 23:01 .bash_logout -rw-r--r-- 1 shodai shodai 3486 9月 6 23:01 .bashrc drwx------ 2 shodai shodai 4096 9月 6 23:03 .cache/ -rw-r--r-- 1 shodai shodai 675 9月 6 23:01 .profile $ ll --time-style=iso 合計 52 drwxr-xr-x 6 shodai shodai 4096 12-31 12:11 ./ drwxr-xr-x 3 root root 4096 09-06 23:01 ../ -rw------- 1 shodai shodai 4539 12-31 02:36 .bash_history -rw-r--r-- 1 shodai shodai 220 09-06 23:01 .bash_logout -rw-r--r-- 1 shodai shodai 3486 09-06 23:01 .bashrc drwx------ 2 shodai shodai 4096 09-06 23:03 .cache/ -rw-r--r-- 1 shodai shodai 675 09-06 23:01 .profile shodai@x22:~$ ll --time-style=long-iso 合計 52 drwxr-xr-x 6 shodai shodai 4096 2014-12-31 12:11 ./ drwxr-xr-x 3 root root 4096 2014-09-06 23:01 ../ -rw------- 1 shodai shodai 4539 2014-12-31 02:36 .bash_history -rw-r--r-- 1 shodai shodai 220 2014-09-06 23:01 .bash_logout -rw-r--r-- 1 shodai shodai 3486 2014-09-06 23:01 .bashrc drwx------ 2 shodai shodai 4096 2014-09-06 23:03 .cache/ -rw-r--r-- 1 shodai shodai 675 2014-09-06 23:01 .profile
方法2 上記の2つを合わせて、日時をわかりやすく出す方法
shodai@x22:~$ find /home/shodai -exec ls -ld --time-style=long-iso {} \; drwxr-xr-x 6 shodai shodai 4096 2014-12-31 13:42 /home/shodai -rw-r--r-- 1 shodai shodai 220 2014-09-06 23:01 /home/shodai/.bash_logout -rw-rw-r-- 1 shodai shodai 75 2014-09-07 10:23 /home/shodai/.selected_editor -rw------- 1 shodai shodai 51 2014-12-31 13:47 /home/shodai/.lesshst drwxrwxr-x 3 shodai shodai 4096 2014-11-02 22:39 /home/shodai/shell_test drwxrwxrwx 2 shodai shodai 4096 2014-11-03 18:42 /home/shodai/shell_test/20141102_hiaDocment -rw-rw-r-- 1 shodai shodai 539 2014-11-03 01:35 /home/shodai/shell_test/20141102_hiaDocment/fte.txt -rwxrwxrwx 1 shodai shodai 89 2014-11-03 02:09 /home/shodai/shell_test/20141102_hiaDocment/ftp.sh -rwxrwxrwx 1 shodai shodai 167 2014-11-03 18:45 /home/shodai/shell_test/20141102_hiaDocment/ftp3.sh -rwxrwxrwx 1 shodai shodai 203 2014-11-03 02:52 /home/shodai/shell_test/20141102_hiaDocment/ftp2.sh -rw------- 1 shodai shodai 4539 2014-12-31 02:36 /home/shodai/.bash_history
カラム位置が揃っていないけれども、Excel等で加工するなら問題ないね