2020-08-26 18:49:43 +00:00
# Czkawka
2020-09-07 07:06:12 +00:00
Czkawka is simple, fast and easy to use alternative to Fslint, written in Rust.
2020-08-26 18:49:43 +00:00
It is in very early development, so most of the functions aren't added and doesn't work.
2020-09-04 21:09:11 +00:00
This is my first ever project in Rust so probably a lot of things are written in the most optimal way.
2020-08-26 18:49:43 +00:00
## Done
2020-09-01 20:48:20 +00:00
- Rich instruction with examples - CLI(`cargo run --bin czkawka_cli`)
2020-09-11 13:52:06 +00:00
- GTK Frontend(Still WIP) - (`cargo run --bin czkawka_gui`)
- Orbtk Frontend(Still very early WIP) - (`cargo run --bin czkawka_gui_orbtk`)
- Duplicated file finding
2020-09-07 07:06:12 +00:00
- Including and excluding directories(absolute paths)
- Option to remove all except newest, oldest and one oldest or newest
2020-08-30 12:00:22 +00:00
- Fast(by size) or accurate(by hash) file checking
2020-09-11 13:52:06 +00:00
- Empty folders finding
2020-09-01 20:48:20 +00:00
- Advanced empty files finding(finds and remove folders which contains only empty folders)
- Option to remove all files
2020-08-26 18:49:43 +00:00
## TODO
2020-09-01 20:48:20 +00:00
- Comments - a lot of things should be described
- Tests
- Github CI
- Unit tests(if available)
2020-08-30 15:18:04 +00:00
- Duplicated file finding - CLI
- saving results to file
2020-08-30 12:00:22 +00:00
- support for * when excluding files and folders
2020-09-03 15:33:43 +00:00
- Finding files with debug symbols
2020-08-27 07:42:37 +00:00
- Support for showing only duplicates with specific extension, name(Regex support needed)
2020-08-30 15:18:04 +00:00
- Maybe windows support, but this will need some refactoring in code
2020-09-03 19:46:22 +00:00
- Translation support
2020-09-09 19:32:23 +00:00
- Add support for fast searching based on checking only first ~1MB of file.
2020-08-26 18:49:43 +00:00
2020-09-07 07:06:12 +00:00
## Usage and requirements
Rustc 1.46 works fine(not sure about a minimal version)
GTK 3.18 - for GTK backend
2020-09-01 20:48:20 +00:00
For now only Linux(and probably also macOS) is supported
2020-09-07 07:06:12 +00:00
- Install requirements for GTK
2020-09-01 17:34:39 +00:00
```
apt install -y libgtk-3-dev
```
2020-09-07 07:06:12 +00:00
2020-09-01 17:34:39 +00:00
- Download source
```
2020-09-01 20:48:20 +00:00
git clone https://github.com/qarmin/czkawka.git
2020-09-01 17:34:39 +00:00
cd czkawka
```
2020-09-05 18:26:10 +00:00
- Run GTK GUI(Still WIP)
2020-09-01 17:34:39 +00:00
```
cargo run --bin czkawka_gui
```
2020-09-07 16:14:02 +00:00
![GUI GTK ](https://user-images.githubusercontent.com/41945903/92405256-80854600-f135-11ea-92db-b3dd3569d8fd.png )
2020-09-05 18:26:10 +00:00
- Run alternative Orbtk GUI(Still WIP)
```
cargo run --bin czkawka_gui_orbtk
```
2020-09-07 16:14:02 +00:00
![GUI Orbtk ](https://user-images.githubusercontent.com/41945903/92405241-7b27fb80-f135-11ea-9fc4-5ebc2b76b011.png )
2020-09-01 17:34:39 +00:00
- Run CLI
2020-09-01 20:48:20 +00:00
```
cargo run --bin czkawka_cli
```
2020-09-07 16:14:02 +00:00
![CLI ](https://user-images.githubusercontent.com/41945903/92405265-824f0980-f135-11ea-8f9e-d2692c27a6be.png )
2020-09-01 17:34:39 +00:00
2020-09-03 15:33:43 +00:00
## How it works?
### Duplicate Finder
2020-09-07 07:06:12 +00:00
The only required parameter for checking duplicates is included folders `-i` . This parameter validates provided folders - which must have absolute path(without ~ and other similar symbols at the beginning), not contains *(wildcard), be dir(not file or symlink), exists. Later same things are done with excluded folders `-e` .
2020-09-05 18:26:10 +00:00
2020-09-03 15:33:43 +00:00
Next, this included and excluded folders are optimized due to tree structure of file system:
- Folders which contains another folders are combined(separately for included and excluded) - `/home/pulpet` and `/home/pulpet/a` are combined to `/home/pulpet`
2020-09-07 07:06:12 +00:00
- Included folders which are located inside excluded ones are delete - Included folder `/etc/tomcat/` is deleted because excluded folder is `/etc/`
- Non existed directories are being removed
2020-09-03 15:33:43 +00:00
- Excluded path which are outside include path are deleted - Exclude path `/etc/` is removed if included path is `/home/`
If after optimization there is no include folders, then program ends with non zero value(TODO, this should be handled by returning value).
2020-09-05 18:26:10 +00:00
2020-09-07 07:06:12 +00:00
Next with provided by user minimal size of checked size `-s` , program checks recursively(TODO should be an option to turn off a recursion) included folders and checks files by sizes and put it files with same sizes to different boxes.
2020-09-03 15:33:43 +00:00
Next boxes which contains only one element are removed because files inside are not duplicated.
2020-09-05 18:26:10 +00:00
Next by default also is checked hash to be sure that files with equal size are identical.
2020-09-07 07:06:12 +00:00
## Speed
Since Czkawka is written in Rust and aims to be a faster alternative for written in Python - FSlint we need to compare speed of this two tools.
I checked my home directory without any folder exceptions(I removed all directories from FSlint advanced tab) which contained 379359 files and 42445 folders and 50301 duplicated files in 29723 groups which took 450,4 MB.
First run reads file entry and save it to cache so this step is mostly limited by disk performance, and with second run cache helps it so searching is a lot of faster.
2020-09-09 19:32:23 +00:00
Duplicate Checker(Version 0.1)
2020-09-07 17:16:09 +00:00
2020-09-07 07:06:12 +00:00
| App| Executing Time |
|:----------:|:-------------:|
| Fslint (First Run)| 140s |
| Fslint (Second Run)| 23s |
| Czkawka CLI Release(First Run) | 128s |
| Czkawka CLI Release(Second Run) | 8s |
2020-09-09 19:32:23 +00:00
| App| Idle Ram | Max Operational Ram Usage |
|:----------:|:-------------:|:-------------:|
| Fslint | | |
| Czkawka CLI Debug | |
| Czkawka CLI Release | |
| Czkawka GUI Debug | |
| Czkawka GUI Release | |
2020-09-07 17:16:09 +00:00
Empty folder finder
| App| Executing Time |
|:----------:|:-------------:|
| Fslint | |
| Czkawka CLI Debug | |
| Czkawka CLI Release | |
2020-09-07 14:07:29 +00:00
Differences should be more visible when using slower processor or faster disk.
2020-09-03 15:33:43 +00:00
2020-08-26 18:49:43 +00:00
## License
2020-09-04 21:09:11 +00:00
Code is distributed under MIT license.