### Install QDirStat Source: https://github.com/shundhammer/qdirstat/blob/master/README.md Install QDirStat after compiling. This command typically installs to the default /usr directory. Use 'su -c make install' for root privileges if needed. ```bash sudo make install ``` -------------------------------- ### Build and Install Software Manually Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Unpkg-View.md Standard command sequence for compiling and installing software directly to system directories. ```bash make && sudo make install ``` -------------------------------- ### Install and Run QDirStat from Live Media Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Shadowed-by-Mount.md Install QDirStat on a live Linux system using `apt` and then run it with `sudo` to analyze a mounted filesystem. Running with `sudo` ensures access to all subdirectories. ```bash tux@live-linux:~$ sudo apt install qdirstat tux@live-linux:~$ xhost + tux@live-linux:~$ sudo qdirstat /mnt ``` -------------------------------- ### Install QDirStat Packages on Ubuntu Source: https://github.com/shundhammer/qdirstat/blob/master/README.md Use this command to install the necessary packages for building QDirStat on Ubuntu. It includes build essentials, Qt6 development files, and zlib. ```bash sudo apt-get install build-essential qtbase6-dev qt6-5compat-dev zlib1g-dev ``` -------------------------------- ### Install QDirStat to Custom Directory Source: https://github.com/shundhammer/qdirstat/blob/master/README.md Install QDirStat to a custom directory by specifying the INSTALL_PREFIX during the qmake6 configuration. This is useful for non-standard installations. ```bash qmake6 INSTALL_PREFIX=/usr/local ``` -------------------------------- ### Install QDirStat Packages on SUSE Source: https://github.com/shundhammer/qdirstat/blob/master/README.md Install the required development packages for building QDirStat on SUSE Linux. This includes C/C++ development tools, Qt6 development files, and zlib. ```bash sudo zypper install -t pattern devel_C_C++ sudo zypper install qt6-widgets-devel qt6-qt5compat-devel zlib-devel ``` -------------------------------- ### Start QDirStat with Package Filter (Starts With) Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md Launch QDirStat and filter packages starting with 'chrom'. This uses auto-mode, defaulting to a 'starts with' match for package names. Patterns are case-insensitive. ```bash qdirstat pkg:/chrom ``` -------------------------------- ### QDirStat Cache File Format Example Source: https://github.com/shundhammer/qdirstat/blob/master/doc/cache-file-format.txt An example of a QDirStat cache file in version 2.0 format. This format is used for storing directory and file information. Lines starting with '#' are comments and are ignored. ```text # Generated by qdirstat-cache-writer # Do not edit! # # Type path size uid gid perm. mtime D /work/home/sh/src/qdirstat 4096 1000 1000 0775 0x65e0ce47 ``` -------------------------------- ### Generate Dpkg File Lists Source: https://github.com/shundhammer/qdirstat/blob/master/scripts/pkg-tools/README.md Creates lists of installed packages and their files for dpkg-based systems. Output paths are printed to stdout. The QDirStat temporary directory is created if it doesn't exist. ```bash [sh @ balrog] ...qdirstat/scripts/pkg-tools % complete-filelist-dpkg 2459 /tmp/qdirstat-sh/pkglist.txt 268507 /tmp/qdirstat-sh/filelist.txt ``` -------------------------------- ### Install URI::Escape Perl Module Source: https://github.com/shundhammer/qdirstat/blob/master/doc/QDirStat-for-Servers.md Install the URI::Escape Perl module using cpan. Ensure 'make' is installed if the installation fails. ```bash cpan URI::Escape ``` -------------------------------- ### Retrieve Installed Package List Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md Commands used by QDirStat to fetch the list of installed packages from the system. ```bash dpkg-query --show --showformat='${Package} | ${Version} | ${Architecture} | ${Status}\n' ``` ```bash rpm -qa --queryformat '%{name} | %{version}-%{release} | %{arch}\n' ``` ```bash pacman -Qn ``` -------------------------------- ### Start QDirStat with Unpackaged Files View Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Unpkg-View.md Launches QDirStat directly into the unpackaged files view for a specified directory. Uses previously saved exclude and ignore patterns. ```bash qdirstat unpkg:/usr/share ``` ```bash qdirstat unpkg:/ ``` -------------------------------- ### Select Qt6 Environment on Ubuntu Source: https://github.com/shundhammer/qdirstat/blob/master/README.md If you have multiple Qt versions installed, use qtchooser to select Qt6 for building QDirStat. This ensures the correct Qt libraries are used. ```bash sudo apt-get install qtchooser export QT_SELECT="qt6" ``` -------------------------------- ### Display Disk Usage of Qt Installation Directory Source: https://github.com/shundhammer/qdirstat/wiki/QDirStat-MacOS-Dev Use 'du -skh *' to display disk usage for each item in the current directory. This is useful for understanding the space occupied by a Qt installation. ```bash cd ~/qt du -skh * ``` -------------------------------- ### Start QDirStat with Package Filter (Wildcard) Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md Launch QDirStat and filter for packages containing 'gtk'. The '*' wildcards must be quoted to prevent shell expansion. Patterns are case-insensitive. ```bash qdirstat "pkg:/*gtk*" ``` -------------------------------- ### Start QDirStat with Package Filter (Regular Expression) Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md Launch QDirStat and filter for packages matching the regular expression '.*qt[45].*'. This selects packages related to Qt4 or Qt5. Patterns are case-insensitive. ```bash qdirstat "pkg:/.*qt[45].*" ``` -------------------------------- ### Profile QDirStat with Valgrind Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Debugging-Tips.md Start QDirStat with Valgrind's callgrind tool to profile its execution. This significantly slows down the application, so avoid using very large directories. Results are saved to callgrind.out.* files. ```bash valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes qdirstat ~ ``` -------------------------------- ### Filter Snap Packages with df Source: https://github.com/shundhammer/qdirstat/blob/master/doc/DevHistory.md Example command to identify snap package loopback mounts cluttering filesystem output. ```bash df -hT | grep snap /dev/loop0 squashfs 159M 159M 0 100% /snap/chromium/1244 /dev/loop1 squashfs 55M 55M 0 100% /snap/core18/1880 /dev/loop2 squashfs 63M 63M 0 100% /snap/gtk-common-themes/1506 /dev/loop3 squashfs 30M 30M 0 100% /snap/snapd/8542 ``` -------------------------------- ### Start QDirStat with Package Filter (Multiple Regex) Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md Launch QDirStat and filter for packages matching a list of common browser names using a regular expression. Use anchors like '^' and '$' for precise matching if needed, as regex uses partial matching by default. Patterns are case-insensitive. ```bash qdirstat "pkg:/(firefox|mozilla|chrome|chromium|opera)" ``` -------------------------------- ### Start QDirStat with Package Filter (Exact Match) Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md Launch QDirStat and filter for the exact package name 'emacs'. The '=' prefix explicitly sets the match mode to 'exact match'. Patterns are case-insensitive. ```bash qdirstat pkg:/=emacs ``` -------------------------------- ### Display QDirStat Help Source: https://github.com/shundhammer/qdirstat/blob/master/README.md View all available command-line options for QDirStat by using the --help option. ```bash qdirstat --help ``` -------------------------------- ### Bind-Mount Multiple Directories Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Shadowed-by-Mount.md Demonstrates creating target directories and performing bind-mounts for multiple distinct directories, ensuring unique target paths to avoid shadowing. ```bash root@linux:~# mkdir -p /mnt/shadowed/win_app root@linux:~# mount -o bind /mnt/root/win/app /mnt/shadowed/win_app root@linux:~# mkdir -p /mnt/shadowed/win_boot root@linux:~# mount -o bind /mnt/root/win/app /mnt/shadowed/win_boot ``` -------------------------------- ### Build QDirStat on MacOS Source: https://github.com/shundhammer/qdirstat/wiki/QDirStat-MacOS-Dev Follow these steps to clone the QDirStat repository, configure the build with qmake, and compile the application using make. The resulting executable will be in a .app directory. ```bash mkdir ~/work cd ~/work git clone https://github.com/shundhammer/qdirstat.git cd qdirstat qmake make ``` -------------------------------- ### Start QDirStat Without Directory Prompt Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Unpkg-View.md Starts QDirStat without prompting for a directory, allowing immediate access to the menu for selecting a scan target. ```bash qdirstat -d ``` -------------------------------- ### Launch QDirStat via Command Line Source: https://context7.com/shundhammer/qdirstat/llms.txt Use these commands to launch the QDirStat application with specific directories, cache files, or specialized views. ```bash # Basic usage - scan a directory qdirstat /home/user/Documents # Scan with slow update mode (3 sec intervals instead of 333 ms) qdirstat --slow-update /home/user qdirstat -s /var/log # Start without showing the directory selection dialog qdirstat --dont-ask qdirstat -d # Read from a pre-generated cache file qdirstat --cache /path/to/cache.gz qdirstat -c /tmp/server-cache.qdirstat.cache.gz # View installed packages matching a pattern (starts with "chrom") qdirstat pkg:/chrom # View all Qt4 or Qt5 packages using regex qdirstat "pkg:/.*qt[45].*" # View exact package name only qdirstat "pkg:/=emacs" # View unpackaged files in system directories qdirstat unpkg:/usr/share qdirstat unpkg:/ # Show help qdirstat --help ``` -------------------------------- ### List All Block Devices with lsblk Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Shadowed-by-Mount.md Use `lsblk` to display all block devices and their partitions, regardless of whether they are mounted. This command does not require root permissions. ```console sh@balrog:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931,5G 0 disk ├─sda1 8:1 0 97,7G 0 part /win/boot └─sda2 8:2 0 833,9G 0 part /win/app sdb 8:16 0 931,5G 0 disk ├─sdb1 8:17 0 2G 0 part ├─sdb2 8:18 0 30G 0 part /hd-root-18-04 ├─sdb3 8:19 0 30G 0 part /hd-root-14-04 ├─sdb4 8:20 0 1K 0 part └─sdb5 8:21 0 869,5G 0 part /work sdc 8:32 0 232,9G 0 disk ├─sdc1 8:33 0 2G 0 part [SWAP] ├─sdc2 8:34 0 30G 0 part / ├─sdc3 8:35 0 30G 0 part /ssd-root-20-04 └─sdc4 8:36 0 170,9G 0 part /ssd-work sr0 11:0 1 1024M 0 rom ``` -------------------------------- ### Create New Feature Branch Source: https://github.com/shundhammer/qdirstat/blob/master/doc/GitHub-Workflow.md Starts a new development branch based on the current state of the pull request branch. ```bash git branch kilroy-hyperforble git checkout kilroy-hyperforble ...(work in that branch...) ``` -------------------------------- ### List Block Devices and Mount Filesystem Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Shadowed-by-Mount.md Use `lsblk` to identify partitions and `mount` to access a specific partition from a live environment. This is useful for inspecting filesystems that might be inaccessible from the running system. ```bash tux@live-linux:~$ lsblk /dev/sdb NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 931,5G 0 disk ├─sdb1 8:17 0 2G 0 part ├─sdb2 8:18 0 30G 0 part ├─sdb3 8:19 0 30G 0 part ├─sdb4 8:20 0 1K 0 part └─sdb5 8:21 0 869,5G 0 part tux@live-linux:~$ sudo mount /dev/sdb2 /mnt ``` -------------------------------- ### Rename Git Remote Source: https://github.com/shundhammer/qdirstat/blob/master/doc/GitHub-Workflow.md Rename an existing Git remote, for example, changing 'origin' to 'mine'. This is useful if the default remote name was not set as desired during cloning. ```bash git remote rename origin mine ``` -------------------------------- ### Compile QDirStat Source: https://github.com/shundhammer/qdirstat/blob/master/README.md Compile QDirStat from source after setting up the build environment. Navigate to the source directory and run qmake6 followed by make. ```bash qmake6 make ``` -------------------------------- ### Download and Make Executable qdirstat-cache-writer Source: https://github.com/shundhammer/qdirstat/blob/master/doc/QDirStat-for-Servers.md Download the qdirstat-cache-writer script to the server and make it executable. It's recommended to review the script's content for security. ```bash ssh root@myserver cd /usr/local/bin wget https://github.com/shundhammer/qdirstat/raw/master/scripts/qdirstat-cache-writer chmod 755 qdirstat-cache-writer ``` -------------------------------- ### Open QDirStat Application on MacOS Source: https://github.com/shundhammer/qdirstat/wiki/QDirStat-MacOS-Dev After building QDirStat, you can open the application bundle using the 'open' command or by navigating to it in Finder. ```bash cd qdirstat.app open qdirstat.app ``` -------------------------------- ### Clear Linux Disk Caches Source: https://github.com/shundhammer/qdirstat/wiki/disk-usage-tools-compared Use this command in a root shell to clear the kernel directory caches before performance testing. This ensures consistent results by starting with a cold cache. ```bash echo 3 >/proc/sys/vm/drop_caches ``` -------------------------------- ### Create and Checkout a Feature Branch Source: https://github.com/shundhammer/qdirstat/blob/master/doc/GitHub-Workflow.md Start by checking out the master branch, then create and switch to a new feature branch for your work. This isolates your changes and makes managing pull requests easier. ```git git checkout master git branch kilroy-transmogrify git checkout kilroy-transmogrify ``` -------------------------------- ### Inspect shadowed files with QDirStat Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Shadowed-by-Mount.md Launch QDirStat to visually inspect and manage shadowed files. ```console root@linux:~# qdirstat /mnt/shadowed ``` -------------------------------- ### C++ Brace Style Example Source: https://github.com/shundhammer/qdirstat/blob/master/doc/Contributing.md Follow this brace style for C++ code, with opening braces on new lines and spaces after opening and before closing parentheses. Avoid K&R style. ```cpp if ( someCondition ) { doSomething( arg1, arg2 ) } ``` -------------------------------- ### Access Application Settings Source: https://context7.com/shundhammer/qdirstat/llms.txt Manage application configuration using QSettings and the Settings class. Use fixFileOwners to correct permissions after sudo operations. ```cpp #include "Settings.h" #include // Access settings (uses QSettings internally) QSettings settings; // General settings settings.beginGroup("MainWindow"); bool showTreemap = settings.value("ShowTreemap", true).toBool(); int treemapHeight = settings.value("TreemapHeight", 300).toInt(); settings.endGroup(); // Directory tree settings settings.beginGroup("DirectoryTree"); bool crossFilesystems = settings.value("CrossFilesystems", false).toBool(); int slowUpdateMs = settings.value("SlowUpdateMillisec", 3000).toInt(); settings.endGroup(); // Treemap settings settings.beginGroup("Treemap"); int minTileSize = settings.value("MinTileSize", 3).toInt(); bool squarified = settings.value("Squarify", true).toBool(); settings.endGroup(); // Package view settings settings.beginGroup("Pkg"); int maxParallel = settings.value("MaxParallelProcesses", 6).toInt(); int minCacheSize = settings.value("MinCachePkgListSize", 200).toInt(); settings.endGroup(); // Cleanup settings are stored per-cleanup in numbered groups: // [Cleanup_01], [Cleanup_02], etc. // MIME categories stored in: // [MimeCategory_01], [MimeCategory_02], etc. // Exclude rules stored in: // [ExcludeRule_01], [ExcludeRule_02], etc. // Fix file ownership after running with sudo QDirStat::Settings::fixFileOwners(); ``` -------------------------------- ### Collect Disk Usage Data on Server Source: https://github.com/shundhammer/qdirstat/blob/master/doc/QDirStat-for-Servers.md Use qdirstat-cache-writer with root permissions to collect disk usage data for specified filesystems. The first argument is the scan start point, and the last is the output cache file name. ```bash sudo qdirstat-cache-writer / myserver-root.cache.gz sudo qdirstat-cache-writer /var myserver-var.cache.gz sudo qdirstat-cache-writer /srv myserver-srv.cache.gz ```