Open-source News

Blender Introducing GPU-Accelerated, Real-Time Compositor

Phoronix - Thu, 07/07/2022 - 19:30
The Blender open-source 3D modeling software is in the process of working on a new GPU-accelerated, real-time compositor...

MGLRU v13 Published, Benchmarks Continue Looking Good For This Kernel Feature

Phoronix - Thu, 07/07/2022 - 18:39
The newest version of the MGLRU patches were posted and I've also finished up some more benchmarks of this Multi-Gen LRU kernel feature...

Mesa 22.2 Pushed Back By Two Weeks To Let More Features Land

Phoronix - Thu, 07/07/2022 - 18:05
Mesa 22.2 as the quarterly feature update to this collection of open-source predominantly OpenGL and Vulkan graphics drivers has been pushed back by two weeks. This delay is for allowing more last minute features to land, which will hopefully ensure that Intel Arc Graphics and RDNA3 support is in better shape for this release...

Tesseract OCR 5.2 Engine Finds Success With AVX-512F

Phoronix - Thu, 07/07/2022 - 17:40
As time goes on more open-source projects are beginning to make better use of AVX-512 support even though it's no longer enabled in the latest Alder Lake processors. After reporting on the big AVX-512 wins for JSON parsing with simdjson, another open-source project finding gains is the Tesseract optical character recognition (OCR) engine...

Intel Meteor Lake Bring-Up Begins For Linux Kernel Graphics Driver

Phoronix - Thu, 07/07/2022 - 17:29
Following yesterday's debut of Meteor Lake platform support within Intel's Graphics Compiler, Intel's "i915" Linux kernel graphics driver has begun seeing patches around Meteor Lake support as that 14th Gen Core successor to Raptor Lake...

wxWidgets 3.2 Released After 15k+ Commits, HiDPI, Initial Wayland Support

Phoronix - Thu, 07/07/2022 - 17:06
The cross-platform wxWidgets GUI toolkit is out today with version 3.2 that represents more than 15,000 commits and comes the better part of a decade since they started their last stable release series...

Check disk usage in Linux

opensource.com - Thu, 07/07/2022 - 15:00
Check disk usage in Linux Don Watkins Thu, 07/07/2022 - 03:00 1 reader likes this 1 reader likes this

Knowing how much of your disk is being used by your files is an important consideration, no matter how much storage you have. My laptop has a relatively small 250GB NVME drive. That's okay most of the time, but I began to explore gaming on Linux a couple of years ago. Installing Steam and a few games can make storage management more critical.

The du command

The easiest way to examine what's left for storage on your disk drive is the du command. This command line utility estimates file space usage. Like all Linux tools, du is very powerful, but knowing how to use it for your particular needs is helpful. I always consult the man page for any utility. This specific tool has several switches to give you the best possible snapshot of file storage and how much space they consume on your system.

There are many options for the du command. Here are some of the common ones:

  • -a - write counts for all files and not just directories
  • --apparent-size - prints apparent sizes rather than disk usage
  • -h - human-readable format
  • -b - bytes
  • -c -grand total
  • -k - block size
  • -m - size in megabytes

Be sure to check the du man page for a complete listing.

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles Display all files

The first option you could choose is du -a. It provides a readout of all files on your system and the directories they are stored in. This command lets me know I've got 11555168 bytes stored in my home directory. Using du -a provides a quick recursive look at my storage system. What if I want a more meaningful number, and I want to drill down into the directories to see where the big files are on my system?

I think there are some big files in my Downloads directory, so I enter du -a /home/don/Downloads to get a good look at that Downloads directory.

$ du -a ~/Downloads
4923    ./UNIX_Driver_5-0/UNIX Driver 50
4923    ./UNIX_Driver_5-0
20     ./epel-release-latest-9.noarch.rpm
12    ./rpmfusion-free-release-9.noarch.rpm
2256    ./PZO9297 000 Cover.pdf
8    ./pc.md
2644    ./geckodriver-v0.31.0-linux64.tar.gz
466468  

The numbers on the far left are the file sizes in bytes. I want something more helpful to me so I add the switch for the human-readable format to my du -h /home/don/Downloads command. The result is 4.8 G(igabytes) which is a more useful number format for me.

$ du -ah ~/Downloads
4.9M    ./UNIX_Driver_5-0/UNIX Driver 50
4.9M    ./UNIX_Driver_5-0
20K    ./epel-release-latest-9.noarch.rpm
12K    ./rpmfusion-free-release-9.noarch.rpm
2.2M    ./PZO9297 000 Cover.pdf
8.0K    ./pc.md
2.6M    ./geckodriver-v0.31.0-linux64.tar.gz
456M    .

As with most Linux commands, you can combine options. To look at your Downloads directory in a human-readable format, use the du -ah ~/Downloads command.

[ Read also: 5 Linux commands to check free disk space ]

Grand total

The -c option provides a grand total for disk usage at the last line. I can use du -ch /home/don to display every file and directory in my home directory. There is a lot of information, and I really just want what is at the end, so I will pipe the disk usage command to tail. The command is du -ch /home/don | tail.

Image by:

(Don Watkins, CC BY-SA 4.0)

The ncdu command

Another option for Linux users interested in what is stored on their drive is the ncdu command. The command stands for NCurses Disk Usage. Depending on your Linux distribution, you may need to download and install it.

On Linux Mint, Elementary, Pop_OS!, and other Debian-based distributions:

$ sudo apt install ncdu

On Fedora, Mageia, and CentOS:

$ sudo dnf install ncdu

On Arch, Manjaro, and similar:

$ sudo pacman -S ncdu

Once installed, you can use ncdu to analyze your filesystem. Here is a sample output after issuing ncdu inside my home directory. The man page for ncdu states that "ncdu (NCurses Disk Usage) is a curses-based version of the well-known du, and provides a fast way to see what directories are using your disk space."

Image by:

(Don Watkins, CC BY-SA 4.0)

I can use the arrow keys to navigate up and down and press the Enter key to enter a directory. An interesting note is that du reported total disk usage in my home directory as 12GB, and ncdu reports that I have total disk usage of 11GB. You can find more information in the ncdu man page.

You can explore a particular directory by pointing ncdu to that directory. For example, ncdu /home/don/Downloads.

Image by:

(Don Watkins, CC BY-SA 4.0)

Press the ? key to display the Help menu

Image by:

(Don Watkins, CC BY-SA 4.0)

Wrap up

The du and ncdu commands provide two different views of the same information, making it easy to keep track of what's stored on your computer.

If you're not comfortable in the terminal or just looking for yet another view of this kind of information, check out the GNOME Disk Usage Analyzer. You can easily install and use it if it's not already on your system. Check your distribution for baobab and install it if you'd like to experiment.

The du and ncdu commands provide two different views of the same information, making it easy to keep track of what's stored on your computer.

Linux Command line What to read next Replace du with dust on Linux Check used disk space on Linux with du Check free disk space in Linux with ncdu 5 Linux commands to check free disk space This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. 3 Comments Register or Login to post a comment. Greg Pittman | July 7, 2022

Your second example doesn't show the right command. It should have been:

du -ah ~/Downloads

I never use du without the -h option. Otherwise, the results are too cryptic to understand.

Don Watkins | July 7, 2022

Good catch Greg! I'll mention that to the editors.

In reply to by Greg Pittman

Robert Harker | July 12, 2022

The -h flag is new to me. I like it. Try adding this alias to your .bashrc file:
alias du='du -h'

I learned the -s flag for summary rather than the -c flag. Easier to remember.

Some du commands I use:

du -sh *
Summarize disk usage for directories and files in the current directory.

du -sh * | sort -n
Sort the size of the directories or files in the current directory.
-n sorts based on numerical value not alphanumeric. -rn reverse the sort order.

du -sh * | sort -n | tail -5
Show the 5 largest directories or files in the current directory.
This is just a summary of the top level files and directories in the current directory.

find . -type f | xargs -d '\n' du -sh * | sort -n | tail -5
Find the 5 largest files in the current directory.
Useful for finding unexpected huge files you were not aware of.
The -d '\n' argument to xargs tells xargs to break arguments on newlines. It avoids problems with filenames with spaces in them.

du was one of the first UNIX commands I learned 45 years ago. An oldie but goodie.

Community is at the heart of Red Hat

Red Hat News - Thu, 07/07/2022 - 12:00

In an industry undergoing constant change, Red Hat’s annual community and social responsibility report is an opportunity for reflection. This is particularly true of our 2021 report, which offers a view into how throughout the pandemic (and beyond), we found new ways of collaborating and contributing to the communities around us. 

Pages