Score:0

ls or ll listing without permissions and hardlinks

sy flag

I need recursive listing of directories for my DVD backups. The prefect format is following:

Name of the directory:
subdirectory0/
subdirectory1/
size date time name0.txt
size date time name1.sh
size date time name2.odt

I got it with this crazy command:

ls -alFRgGv --time-style='+%Y-%m-%d %H:%M:%S' --group-directories-first | sed -r 's/^[drwx-]{10} *[0-9]* //;/^total /d;/.*\.{1,2}\/$/d ';

Please, is there any other way how to omit permissions and hard links in ls output? ("ls", not with the command "find")

Post scriptum:

There are some crazy numbers after total. There is "total 18" and only 2 files in the directory. Are those all hard links together?

in flag
Total is the "total number of file system blocks" which are probably 512-byte blocks. So 18/2 = 9kb, which seems reasonable for a couple of files and a directory.
in flag
I don't see an easy way to produce the output you want with the U18.04LTS version of `ls`. To get what you want will take writing a script to generate the output you want or to filter the `ls` output so it is close enough. For a filter look at `sed` regex replacements.
waltinator avatar
it flag
Read `man stat`. You can specify your own output format.
Cyrus avatar
cn flag
Please note: [Why *not* parse `ls`?](http://unix.stackexchange.com/questions/128985/why-not-parse-ls)
xerostomus avatar
sy flag
So, as I see your answers, Sirs, there is no way how to switch off permissions and hardlinks out of the ll... :-( PS. Cyrus, you are rights. I did not want it to parse, but switch off via parameters. PS. Chick - thanks for explanation of the total meaning. PS. Waltinator - yes, stat is good, but I looked for faster way how to get it without much programming... Anyway, thank you. It is fain to have smart heads around to brainstorm. :-) I always run backups at the end of a year so, that is why I needed.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.