A command-line file manager
Standard View
To open a view of the directory tree, you use:
br -dp
which is similar to ls -la
. However, broot supports interactive operation, as well as searching in directories and direct actions against the files and folders. If you want to keep this (or some other) view as the default, define it in the config file under ~/.config/broot/conf.hjson
by removing the comment sign in front of default flags
and entering the desired view.
While you are in the config file, you might want to adjust the color output to suit your preferences under skins
. Broot can theoretically also display file type icons [9], but I was unable to configure this; instead, empty rectangles appeared rather than icons.
The config file's location follows XDG convention, which is dependent on your system settings. The fastest way to find the configuration file is to type a question mark in broot's search field, which launches a help screen. From the help screen, you can then open the file in your system's editor by typing os
(for open_stay
).
By default, broot uses two panels (Figure 4), but you can increase the number in the configuration file. You can open an additional panel by pressing Ctrl+Right arrow. If you want to open a file and exit broot at the same time, you can do this by pressing Alt+Enter. Otherwise, select Ctrl+Q to exit broot when you are finished.
Using arguments, you can add desired attributes to the view at startup. For example, br -h
toggles hidden files, while br -gi
toggles .gitignore
files that would normally be hidden. Broot clarifies the status of these two attributes with a y or n in the search field bottom right. For both of these arguments, you can use br -d
to see the date of the last change.
To find out which files and folders are taking up the most space, you can use "whale spotting" mode (br -w
) to get a list of files sorted by size; broot visualizes the size ratios as a bar chart in a similar way to ncdu or GDU (Figure 5).
Fuzzy Search
The search field, located bottom left, is one of broot's strengths. Directly above the search, a status bar indicates what an entered command does or if an argument is incorrect, as appropriate.
You can use broot's fuzzy search capability to find files, even if you've forgotten the exact file name. For example, if you are unsure about how to spell "LinuxUser" but know that it contains the three letters l, x, and u in that order (sequential, but not necessarily consecutive order), broot can find all of the files whose names contained those three letters in that specific order (Figure 6).
If you introduce the search term with a slash, you can also use regular expressions. A question mark entered in the search field calls the built-in help, which offers a subset of the detailed documentation found under the Usage tab on the website [10].
If you want to run a search on very large or very slow disks, it may be necessary to enable :total_search
or press Ctrl+S to ensure that broot searches the entire disk.
To exit broot but first change to a directory in the shell beforehand using cd
, navigate to the desired directory and press Alt+Enter. If you apply the same key combination to a file, broot again exits and opens the file with the associated application. Speaking of shells: Alongside Bash or Dash, broot also works well with Z shell and Fish.
Verbs
You can also use the search field to enter verbs, which the developers explain on the website under Usage | Verbs & Commands [11]. These verbs are actually Linux commands that you can execute directly in broot. To list all the available verbs, enter a question mark in the search field. In addition, you can also define verbs yourself in the broot configuration file.
The search field has two modes: input mode and command mode. Use command mode to find content. If you want to use verbs here, you must enter a space or a colon as a prefix followed by the verb and, where needed, an argument. For example, to open a file in your favorite editor, navigate to the file and type Space+E or Shift+.+E in the search field.
The frequently-used commands mv
, cp
, rm
, and mkdir
are available as verbs. In addition, d
shows the last change date, pe
lists the ownership, ss
sorts directories and files by size, and h
unearths hidden files. For directories managed by Git, gf
displays the number of changed or new files at the top of a status line, while gs
maps the git status
command. You can also combine searches with commands. Navigate to a file by typing a letter and then, without removing the search term with Esc, delete the file with :rm
.
If you work with panels, you can also use the cpp
(copy to panel) verb; it supports copying from one panel to the other. For example, exporting directory trees with the pt
(print tree) command exports the directory tree to the shell. You also can modify the command in the configuration file to export to a specific directory. To start broot in a monochrome look and without decoration, type broot --no-style
.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.