I have the command:
du /home | sort -nr +0 -1 | head -10
and need to know what each piece (“du”, “/home”, “|”, “sort”, “-nr”, “+0”, “-1”, “head”, and “10”) does.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
gives a list of the “Disk Usage” (thus the name of the command) of every directory in /home and, recursively, all sub-directories. One line output per directory. “|” sends the output to the next command.
Sorts the result, with “-n” specifying numeric (as opposed to lexicographic) sort, “r” specifies reverse order so the largest value appears first). “-nr” is equivalent to “-n -r”
Outputs only the first 10 lines of the previous command.
In essence it’s finding the 10 largest directories in /home.