you need to display separately the name of the owner, access rights and date of creation.

The ls -l prints everything at once. you need the script to display them separately (each from a new line).

tell me the commands.

  • That is, you just need to break into the fields and output via \n ? All this is awk . - PinkTux
  • It’s probably easier to explain (a script piece): echo "владелец: $(...)" echo "права доступа: $(...)" echo "дата создания: $(...)" - Sanya

2 answers 2

for example:

 $ stat --printf="%U\n%A\n%y\n" файл user -rw-r--r-- 2014-11-21 00:34:37.899050859 +0300 

for details on the meaning of options, see man stat .


One clarification: the file creation date (at least in ext * file systems), alas, is not fixed.

    Or something like this:

     ls -l файл | \ awk -F' ' '{printf( "%s\n%s\n%s %s, %s\n", $3, $1, $7, $6, $8);}'