In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "Linux disk cleanup tool Duc how to install and use", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Linux disk cleanup tool Duc how to install and use" it!
Introduction to Duc: Duc is a toolset for indexing, checking, and visualizing system disks on Unix-like operating systems.
Compared with other similar tools, it works on very large file systems.
Tests show that Duc can work on 500000000 files with a total size of several PB disks without a problem.
Duc is a very fast and convenient tool that optimizes your disk usage in a database.
So, after the index is established, you can find your files very quickly.
In addition, it has many user interfaces and supports a variety of database formats. The user interfaces it supports are as follows:
Command line interface; Ncurses terminal interface; X11 GUIOpenGL GUI supports the following database formats:
Tokyocabinet,Leveldb,Sqlite3. By default, Duc uses Tokyocabinet as the database.
Duc installation: download link
Duc download address
How to install Duc
1. Duc can be found in Debian's default repository and its derivatives (such as Ubuntu), so it is easy to install Duc on DEB-based systems, run the following command:
$sudo apt-get install duc
2. On other Linux distributions, you need to compile and install Duc manually from the source code. The current version is 1.4.4:
$wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz
Then run the following command one at a time to install DUC:
$tar-xzf duc-1.4.4.tar.gz
$cd duc-1.4.4
$. / configure
$make
$sudo make install
How to use Duc
The typical usage of duc is:
$duc
You can view a list of general options and subcommands by running the following command:
$duc help
You can also learn the use of specific subcommands, as follows:
$duc help
To see a detailed list of all commands and their options, simply run:
$duc help-all
Now let's look at some practical use cases for duc.
1. Create an index (database)
First, you need to create an index file (database) of the file system. To create an index file, use the duc index command.
For example, to create an index of the / home directory, simply run:
$duc index / home
The above command creates the index of the / home/ directory and saves it in the $HOME/.duc.db file, and if you add a new file / directory in the / home directory in the future, rerun the above command later to rebuild the index.
2. Query index
Duc has various subcommands to query and explore the index.
To view a list of available indexes, run:
$duc info
The sample output information is as follows:
Date Time Files Dirs Size Path
2019-04-10 09:45:55 3.5K 305 654.6M / home
As you can see in the output above, I have indexed the / home directory.
To list all files and directories in the current working directory, do the following:
$duc ls
To list files / directories in a specific directory, such as / home/sk/Downloads, simply pass the path as an argument, as follows:
$duc ls / home/sk/Downloads
Similarly, run the duc ui command to open the ncurses-based console user interface to explore file system usage, and run duc gui to launch the graphical (X11) interface to browse the file system.
To learn more about the use of subcommands, see help:
$duc help ls
The above command displays help for the LS subcommand, which you can refer to: instead of using the ls command to list the contents of the directory, use an alternative command.
3. Visualize disk usage
You can display the file size in a nice chart.
To display the graph of a given path, use the LS subcommand as follows:
$duc ls-Fg / home/sk
As you can see in the output above, the LS subcommand queries the duc database and lists all inclusion sizes.
Given the path of the file and directory, that is, / home/sk/ in this case.
Here, the-F option is used to attach the file type indicator (one of * /) to the entry, and the-g option is used to draw a graph of the relative size of each entry.
Note that if no path is given, the current working directory is explored.
You can use the-R option to view disk usage results in a tree structure:
$duc ls-R / home/sk
To query the duc database and open the ncurses-based console user interface to explore disk usage for a given path, use the UI subcommand as follows:
$duc ui / home/sk
Similarly, we use the Gui subcommand to query the duc database and launch the graphics (X11) interface to explore disk usage for a given path:
$duc gui / home/sk
As I mentioned earlier, we can learn more about the use of subcommands, as follows:
$duc help
For more details about the duc tool, refer to the man page and run the following command:
$man duc
Thank you for reading, the above is the content of "how to install and use Linux disk cleanup tool Duc". After the study of this article, I believe you have a deeper understanding of how to install and use Linux disk cleanup tool Duc, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.