How can you print the 6 smallest files in /usr/bin directory for Shell?
ls /usr/bin
I know that this shows all the files that is in that directory but I just don't know to to print out the 6 smallest files.
What would be a one line command for this process on the command line for Shell?
Try this:
ls -SrqL /usr/bin | head -6
-Smakes it sorted by file size
-rfor reverse order
-qto print ? instead of nongraphic characters (line breaks included)
-Lwhen showing file information for a symbolic link, this shows information for the file the link references rather than for the link itself
headShows the 6 first lines of the previous output
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With