![]() It might need additional tuning and you may have ls command complaining about arguments list too long. Now take place a sed magic which replaces each blank space with a plus ( ) sign and finally bc (basic calculator) does the math. This (sometimes) huge output is piped towards cut command and only the fifth field ( -f5), which is the file size in bytes is taken and again piped against xargs which produces again a single line of sizes separated by blanks. ![]() with whatever directory you like), also hidden files are included and (using xargs) outputs their names in a single line, then produces a detailed list using ls -l. type f | xargs) | cut -d" " -f5 | xargs | sed 's/\ / /g'| bc I think there might be different ways to answer your question but this is mine: ls -l $(find. Hence it will lead you to a wrong result, an approximation (maybe close to the sum size but most likely greater than the actual size you are looking for). You cannot use du command if you need to know the exact sum size of your folder because (as per man page citation) du estimates file space usage. Just in case you want to make a comparison with the du -sb / command, it will output an estimated disk usage in bytes ( -b option) # du -sb /Īs I was expecting it is a little larger than my command calculation because the du utility returns allocated space of each file and not the actual consumed space. This is going to be much faster and precise than the initial version below and will output the sum of all the file size of current directory: echo `find. 0,0 B 0,0 B 0,0 B 0,0 B 0,0 B vmlinuzĭelete the currently highlighted element with d, exit with CTRL c ![]() After a few seconds for analyzing the path, you will see something like this: $ ncdu 1.11 ~ Use the arrow keys to navigate, press ? for help Installation on Ubuntu: $ sudo apt-get install ncdu The command line tool ncdu is way better suited to this task. Other apps like Catfish or commands like locate are also really useful to search for specific files. It will instantly locate any file on the computer, but also help launch applications, run commands and do other services quickly. ![]() When I came to this question, I wanted to clean up my file system. The best tool to quickly find a file on Ubuntu is Albert. r is for "reverse" (biggest file first).max-depth=0 means du will not show sizes of subfolders (remove that if you want to show all sizes of every file in every sub-, subsub.h is for "human readable" (both, in sort and in du). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |