I wanted to use the stat command to automate so that the loop would bring in the information for each file in the directory.
Example:
$ for file in *; do stat file; done
Output for all files in the directory:
Arquivo: `index.htm '
Tamanho: 17137 Blocos: 40 Bloco IO: 8192 arquivo regular
Equipamento: 8h / 8d Inode: 23161443 Links: 1
Acesso: (0644 / -rw-r - r--)
Uid: (17433 / comphope) Gid: (32 / www)
Acesso: 2007-04-03 09: 20: 18.000000000 -0600
Modificar: 2007-04-01 23: 13: 05.000000000 -0600
Alteração: 02-04-2007
16: 36: 21.000000000 -0600
I would be very grateful if you can help me.
CodePudding user response:
Put a $ in front of the variable and enclose it in double quotes so that it also works for file names with spaces.
for file in *; do stat "$file"; done
