Du human readable. It tells you how much space everything in the given directory is taking up. -k ...

Du human readable. It tells you how much space everything in the given directory is taking up. -k like --block-size=1K. It offers many helpful options individually or in the correct combinations. 6 days ago · Command: See also: Mastering the Linux Command Line — Your Complete Free Training Guide du -h filename. Jan 30, 2024 · A breakdown of the -exec option: • exec ls - this tells find to execute the ls command on every filename that matches the search string. To print sizes in human readable format such as 5K, 400M, or 3G, type the following command: This command gives you a single, human-readable value for the entire directory. Jul 15, 2010 · I need to get a list of sizes in human readable du output format. Else, also from man du: --si like -h, but use powers of 1000 not 1024. However, du does not have a "sort by size" option, and piping to sort doesn't work with the human readable flag. . Jul 20, 2019 · The manual for du says the following: -h, --human-readable print sizes in human readable format (e. It's intended for LLM input as a drop-in, lossless representation of your existing JSON. Use it as a reference to find often-used options or those that come handy in time. , 1K 234M 2G) Thus: du -h should give you what you need. Apr 21, 2020 · The du command is a standard Linux/Unix command that allows a user to gain disk usage information quickly. Q: Can someone explain to me how du arrives at the numbers 5. --max-depth=1 means it will only count the files and directories in current directory, sub-directories and sub-files will not display. • -lah - displays all files, including hidden files, their permissions, and other file metadata, such as sizes, in a human-readable format. txt To check a specific folder size: du -sh /path/to/directory Explanation: -s (Summary): Shows the total size of the folder instead of listing every single file inside it. By default, du shows the size of every subdirectory, which can be overwhelming. profile or Dec 28, 2017 · I sometimes wish human-readable du -h option to be more fine-grained while still human-readable. For example, running: du | sor Aug 7, 2019 · The du command, short for disk usage reports the estimated amount of disk space used by given files or directories. How do I get the output for du command in GB under Linux or UNIX operating systems? The du command is used to estimate file space usage. It’s especially handy for a quick overview of the total space a directory is using, without having to go through each file’s size. You can remove or change any arguments and find out the differences between them. 3T, 5. Instead of showing: 14G it would show something like: 14G 236M 788k 110b Is there an easy / for example I have command that shows how much space folder takes du folder | sort -n it works great, however I would like to have human readable form du -h folder however if I do that than I can Feb 21, 2022 · The du command summarizes disk usage of each file and recursively for each directory. 5G, rather than only a number. -h: Displays the size in Human-readable format (K, M, G). Oct 9, 2025 · Description: Lists the five largest files in the specified directory and subdirectory, sorted in descending order by size, and displayed in a human-readable format. 8T, and 6 for the last three commands above? Aug 25, 2025 · Check file space usage in Linux with the du command Once df tells you a partition is nearly full, the Linux du command helps you pinpoint the culprit. Token-Oriented Object Notation is a compact, human-readable encoding of the JSON data model that minimizes tokens and makes structure easy for models to follow. print sizes in human readable format (e. -h means human readable, it will display the size like 1K or 3. Unfortunately this makes it not sortable numerically. To get a summary for a specific directory, use the -s (summarize) and -h (human-readable) flags. Mar 12, 2025 · Get more out of the du utility with this cheat sheet. , 1K 234M 2G) --si like -h, but use powers of 1000 not 1024 which does not help me at all understand what's going on. Feb 20, 2015 · The "h" in the du -hs command that @sam gave as the answer for your question about directories also means "human-readable", and it also appears in df -h which shows the human readable amounts of used and free space on disk. On a Linux machine [Debian based], I get this when opening the man page for du: -h, --human-readable. TOON combines YAML's indentation-based structure Sep 15, 2022 · This tutorial explains how to sort du -h (human readable) output by size using sort command under any Linux distro or macOS or *BSD Unix. It is best applied to specific directories and allows many variations for customizing the output to meet your needs. As with most commands, the user can take advantage of many options or flags. g. Insert the following function into your . I need to get a list of human readable du output. Show Sizes in Human-Readable Format The -h option allows you to show sizes in human-readable format. Here’s how to sort du by size and keep it as human readable. GNU du introduced a handy option -h making it human readable, or showing sizes using K, M, G rather than bytes. It is practically useful for finding files … Jun 7, 2022 · I recommend you to use du --help or man du to get help, and try these command yourself. Jan 23, 2010 · du is the *nix command for disk usage. zvrhsn qrzee ftzi gaz xtjjj pmzfj khv rwldvry fdg govrzjx