WebI always use du -h --max-depth= 1 or 2 or maximum 3. Then drill down (cd) into where I want to go, and run the same command agin. When tree is used with -L it counts only directories/and files up to a given level. Comapred to du which calculates all files irrespective of --max-depth parameter, but just prints up to a specified level. WebAug 1, 2012 · For du, the following shell function called dutop will display the top-level of the specified folder (or the current folder). With this, you can probe sub-folders one at a time. function dutop() { du --max-depth=1 --one-file-system -h $@ sort -h; } This will likely report inconsequential "Permission denied" errors if you apply it to /, but you could resolve those …
du command in Linux with examples - Linux command …
WebSep 12, 2024 · By default, du command will go into the subdirectories of all the directories and the output becomes difficult to figure out specially if you have too many nested … WebDec 11, 2024 · $ find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \; I try that --max-depth every. single. time. Update: it’s even easier than that. Sure, the find line works, but turns out I’ve been missing a much easier shortcut here. $ du … binding shot macro wow
How to sort the output of the du -h command by size?
WebDec 11, 2024 · $ find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \; I try that --max-depth every. single. time. Update: it’s even easier than that. Sure, the find line works, but turns … WebFeb 6, 2024 · -maxdepth levels Descend at most levels (a non-negative integer) levels of directories below the starting-points. -maxdepth 0 means only apply the tests and actions to the starting-points themselves. -mindepth levels Do not apply any tests or actions at levels less than levels (a non-negative integer). -mindepth 1 means process all files except … WebNov 6, 2024 · Examples. du -s *.txt. Reports the size of each file in the current directory with the extension .txt. Below is an example of the output: 8 file1.txt 8 file2.txt 10 file3.txt 2 file4.txt 8 file5.txt 8 file6.txt. du -shc *.txt. Display the same data, but in a "human-readable" size format, and display a grand total. binding shop potters bar