How to find the largest file in a directory and its subdirectories?

前端 未结 15 1404
醉梦人生
醉梦人生 2020-11-28 18:29

We\'re just starting a UNIX class and are learning a variety of Bash commands. Our assignment involves performing various commands on a directory that has a number of folder

15条回答
  •  星月不相逢
    2020-11-28 18:52

    That is quite simpler way to do it:

    ls -l | tr -s " " " " | cut -d " " -f 5,9 | sort -n -r | head -n 1***
    

    And you'll get this: 8445 examples.desktop

提交回复
热议问题