Is there a shell command to just print the file owner?
I think I could just do:
ls -l | awk '{print $3}'
but this seems like a simpler answer to the problem.
Try using stat(1)
stat(1)
[ cnicutar@fresh ~]$ stat -c %U file.c cnicutar
There are many format sequences available: user ID, total size, etc.
You can also use the find :
find
find -maxdepth 1 -name 'file.c' -printf '%u\n'
Source: https://habr.com/ru/post/906330/More articles:Selectively delete mostly duplicate records from MySQL - sqljQuery.live ('click') works even when the buttons are disabled - jqueryUnmarshalException - namespace problem? - javaWhat makes a heap based scheme slower than a stack based scheme? - compiler-optimizationUnknown server tag "ajaxToolkit: CalendarExtender". - asp.netHow to increase the heap size used by the GWT Maven module when IntelliJ βmakesβ it call? - intellij-ideaDeclaring Pointer Syntax in a Function - cHow can I get JAXB2 to emit CamelCase bindings? - javaRuby Logical Operators - Elements in one, but not both arrays - arraysalign columns left / right - highchartsAll Articles