How to find a file whose name contains at least 7 of any characters?

How to use the awk command to make a new line transition?

For example :

find -name '???????' -exec ls -is {}\; " awk '{print $3 " " $1 " " $2)' 

It is necessary to make so that $ 3 $ 1 $ 2 were deduced on a new line, but not through a gap ("").

  • The question contains two completely unrelated questions. please split the question into two questions. or specify exactly what and how the find and awk programs bind you. - aleksandr barakin
  • I search for a file that contains 7 characters, then output its i-node and size, and then filter this output so that the file name is displayed first, then its inode and size. The problem is that you need a name, an inode, and the size to output on a new line, and not in one. - aleshka-batman
  • 1. the command given by you is not syntactically correct. 2. In the predicate -name you specify to search for exactly seven characters, and not “greater than or equal to seven”. - aleksandr barakin
  • I know, therefore, I ask how to find at least 7. - aleshka-batman

1 answer 1

at least 7 of any characters

In the predicate -name you must specify '???????*'

first the file name is displayed, then its inode and size

it is better to use the stat program for this, rather than trying to alter the output of the ls program:

 $ stat --printf="%n\n%i\n%s\n" файл 

see $ man stat details.


total:

 $ find -name '???????*' -exec stat --printf="%n\n%i\n%s\n" '{}' \; 

example output:

 ./файл1234 65233 139 ./файл123 65229 0 
  • And no more than 7 characters as specified in -name? - aleshka-batman
  • in -name - no way. If you have a new question, please ask it using the “ Ask a Question ” button in the upper right corner of the page. - aleksandr barakin
  • @ aleshka-batman, you can already not ask. I wrote a generic question-answer: ru.stackoverflow.com/q/600410/178576 - aleksandr barakin