@sebastienrousseau/dotfiles 0.2.468 β 0.2.469
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/Makefile +126 -43
- package/dist/bin/constants.d.ts +2 -2
- package/dist/bin/constants.d.ts.map +1 -1
- package/dist/bin/constants.js +1 -1
- package/dist/filesizes.txt +146 -144
- package/dist/lib/README.md +79 -5
- package/dist/lib/aliases/README.md +44 -42
- package/dist/lib/aliases/archives/README.md +120 -34
- package/dist/lib/aliases/archives/archives.aliases.sh +106 -149
- package/dist/lib/aliases/cd/README.md +119 -38
- package/dist/lib/aliases/cd/cd.aliases.sh +37 -59
- package/dist/lib/aliases/chmod/README.md +146 -95
- package/dist/lib/aliases/chmod/chmod.aliases.sh +71 -55
- package/dist/lib/aliases/clear/README.md +2 -2
- package/dist/lib/aliases/clear/clear.aliases.sh +4 -4
- package/dist/lib/aliases/configuration/README.md +2 -2
- package/dist/lib/aliases/configuration/configuration.aliases.sh +3 -6
- package/dist/lib/aliases/default/README.md +2 -2
- package/dist/lib/aliases/default/default.aliases.sh +3 -3
- package/dist/lib/aliases/dig/README.md +2 -2
- package/dist/lib/aliases/dig/dig.aliases.sh +4 -4
- package/dist/lib/aliases/disk-usage/README.md +2 -2
- package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
- package/dist/lib/aliases/editor/README.md +2 -2
- package/dist/lib/aliases/editor/editor.aliases.sh +4 -4
- package/dist/lib/aliases/find/README.md +2 -2
- package/dist/lib/aliases/find/find.aliases.sh +4 -4
- package/dist/lib/aliases/gcloud/README.md +2 -2
- package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
- package/dist/lib/aliases/git/README.md +2 -2
- package/dist/lib/aliases/git/git.aliases.sh +3 -3
- package/dist/lib/aliases/gnu/README.md +2 -2
- package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
- package/dist/lib/aliases/heroku/README.md +2 -2
- package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
- package/dist/lib/aliases/interactive/README.md +2 -2
- package/dist/lib/aliases/interactive/interactive.aliases.sh +3 -3
- package/dist/lib/aliases/list/README.md +112 -23
- package/dist/lib/aliases/list/list.aliases.sh +130 -84
- package/dist/lib/aliases/macOS/README.md +2 -2
- package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
- package/dist/lib/aliases/make/README.md +2 -2
- package/dist/lib/aliases/make/make.aliases.sh +3 -3
- package/dist/lib/aliases/mkdir/README.md +2 -2
- package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
- package/dist/lib/aliases/npm/README.md +2 -2
- package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
- package/dist/lib/aliases/permission/README.md +2 -2
- package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
- package/dist/lib/aliases/pnpm/README.md +2 -2
- package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
- package/dist/lib/aliases/ps/README.md +2 -2
- package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
- package/dist/lib/aliases/python/python.aliases.sh +141 -0
- package/dist/lib/aliases/rsync/README.md +2 -2
- package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
- package/dist/lib/aliases/rust/README.md +165 -44
- package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
- package/dist/lib/aliases/subversion/README.md +2 -2
- package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
- package/dist/lib/aliases/sudo/README.md +2 -2
- package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
- package/dist/lib/aliases/tmux/README.md +2 -2
- package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
- package/dist/lib/aliases/update/README.md +2 -2
- package/dist/lib/aliases/update/update.aliases.sh +307 -66
- package/dist/lib/aliases/uuid/README.md +2 -2
- package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
- package/dist/lib/aliases/wget/README.md +2 -2
- package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
- package/dist/lib/aliases.sh +2 -2
- package/dist/lib/configurations/README.md +2 -2
- package/dist/lib/configurations/bash/bashrc +163 -35
- package/dist/lib/configurations/curl/curlrc +3 -6
- package/dist/lib/configurations/default/color.sh +3 -3
- package/dist/lib/configurations/default/constants.sh +4 -4
- package/dist/lib/configurations/default/editor.sh +3 -3
- package/dist/lib/configurations/default/prompt.sh +20 -11
- package/dist/lib/configurations/input/inputrc +3 -3
- package/dist/lib/configurations/nano/nanorc +3 -3
- package/dist/lib/configurations/profile/profile +3 -3
- package/dist/lib/configurations/prompt/prompt.sh +81 -0
- package/dist/lib/configurations/tmux/default +3 -3
- package/dist/lib/configurations/tmux/display +3 -3
- package/dist/lib/configurations/tmux/linux +3 -3
- package/dist/lib/configurations/tmux/navigation +3 -3
- package/dist/lib/configurations/tmux/panes +3 -3
- package/dist/lib/configurations/tmux/theme +4 -4
- package/dist/lib/configurations/tmux/tmux +3 -3
- package/dist/lib/configurations/vim/vimrc +191 -71
- package/dist/lib/configurations/wget/wgetrc +3 -3
- package/dist/lib/configurations/zsh/zshrc +3 -4
- package/dist/lib/configurations.sh +19 -7
- package/dist/lib/functions/README.md +68 -54
- package/dist/lib/functions/apihealth.sh +277 -0
- package/dist/lib/functions/apilatency.sh +157 -0
- package/dist/lib/functions/apiload.sh +165 -0
- package/dist/lib/functions/backup.sh +143 -0
- package/dist/lib/functions/cdls.sh +52 -6
- package/dist/lib/functions/curlheader.sh +66 -10
- package/dist/lib/functions/curlstatus.sh +64 -7
- package/dist/lib/functions/curltime.sh +56 -14
- package/dist/lib/functions/encode64.sh +87 -7
- package/dist/lib/functions/environment.sh +65 -25
- package/dist/lib/functions/extract.sh +79 -27
- package/dist/lib/functions/freespace.sh +55 -9
- package/dist/lib/functions/genpwd.sh +93 -29
- package/dist/lib/functions/goto.sh +59 -8
- package/dist/lib/functions/hexdump.sh +96 -0
- package/dist/lib/functions/hiddenfiles.sh +77 -0
- package/dist/lib/functions/hostinfo.sh +92 -21
- package/dist/lib/functions/hstats.sh +69 -5
- package/dist/lib/functions/httpdebug.sh +109 -5
- package/dist/lib/functions/kebabcase.sh +61 -0
- package/dist/lib/functions/keygen.sh +188 -25
- package/dist/lib/functions/last.sh +106 -5
- package/dist/lib/functions/logout.sh +114 -6
- package/dist/lib/functions/lowercase.sh +49 -17
- package/dist/lib/functions/matrix.sh +205 -30
- package/dist/lib/functions/mount_read_only.sh +3 -3
- package/dist/lib/functions/myproc.sh +3 -3
- package/dist/lib/functions/prependpath.sh +3 -3
- package/dist/lib/functions/ql.sh +3 -3
- package/dist/lib/functions/rd.sh +3 -3
- package/dist/lib/functions/remove_disk.sh +3 -3
- package/dist/lib/functions/ren.sh +68 -8
- package/dist/lib/functions/sentencecase.sh +63 -0
- package/dist/lib/functions/showhiddenfiles.sh +3 -3
- package/dist/lib/functions/size.sh +6 -5
- package/dist/lib/functions/snakecase.sh +61 -0
- package/dist/lib/functions/stopwatch.sh +3 -3
- package/dist/lib/functions/sysinfo.sh +145 -0
- package/dist/lib/functions/titlecase.sh +65 -0
- package/dist/lib/functions/uppercase.sh +51 -19
- package/dist/lib/functions/view-source.sh +3 -3
- package/dist/lib/functions/vscode.sh +3 -3
- package/dist/lib/functions/whoisport.sh +3 -3
- package/dist/lib/functions/zipf.sh +3 -3
- package/dist/lib/functions.sh +21 -7
- package/dist/lib/history.sh +36 -88
- package/dist/lib/paths/README.md +52 -0
- package/dist/lib/paths/custom.paths.sh +40 -0
- package/dist/lib/paths/default.paths.sh +37 -0
- package/dist/lib/paths.sh +27 -14
- package/dist/scripts/backup.sh +3 -3
- package/dist/scripts/banner.sh +3 -3
- package/dist/scripts/build.sh +3 -3
- package/dist/scripts/clean.sh +3 -3
- package/dist/scripts/compile.sh +3 -3
- package/dist/scripts/copy.sh +3 -3
- package/dist/scripts/dotfiles.sh +3 -3
- package/dist/scripts/download.sh +3 -3
- package/dist/scripts/help.sh +3 -3
- package/dist/scripts/ssh.sh +3 -3
- package/dist/scripts/unpack.sh +3 -3
- package/package.json +10 -10
- package/dist/lib/aliases/jekyll/README.md +0 -41
- package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
- package/dist/lib/functions/filehead.sh +0 -4
- package/dist/lib/functions/hidehiddenfiles.sh +0 -14
- package/dist/lib/paths/ant/ant.paths.sh +0 -15
- package/dist/lib/paths/default/default.paths.sh +0 -19
- package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
- package/dist/lib/paths/java/java.paths.sh +0 -19
- package/dist/lib/paths/maven/maven.paths.sh +0 -18
- package/dist/lib/paths/node/node.paths.sh +0 -15
- package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
- package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
- package/dist/lib/paths/python/python.paths.sh +0 -36
- package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
- package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
package/dist/lib/README.md
CHANGED
|
@@ -1,12 +1,86 @@
|
|
|
1
|
-
<!-- markdownlint-disable MD033 MD041 MD043 -->
|
|
2
|
-
|
|
3
1
|
<img
|
|
4
2
|
src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
|
|
5
3
|
alt="dotfiles logo"
|
|
6
|
-
width="
|
|
4
|
+
width="66"
|
|
7
5
|
align="right"
|
|
8
6
|
/>
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
# Dotfiles Shell Configuration Scripts
|
|
9
|
+
|
|
10
|
+
Simply designed to fit your shell life π
|
|
11
|
+
|
|
12
|
+
![Dotfiles banner][banner]
|
|
13
|
+
|
|
14
|
+
This repository includes various scripts to enhance your shell experience, manage configurations, and customize behavior. The scripts are organized and detailed below.
|
|
15
|
+
|
|
16
|
+
## π Scripts List
|
|
17
|
+
|
|
18
|
+
<!-- markdownlint-disable MD013-->
|
|
19
|
+
|
|
20
|
+
### Alias Management
|
|
21
|
+
|
|
22
|
+
| Script | Description | Usage |
|
|
23
|
+
| :---------------- | :----------------------------------------------- | :----------------------------- |
|
|
24
|
+
| `aliases.sh` | Manage and load custom shell aliases. | `source aliases.sh` |
|
|
25
|
+
|
|
26
|
+
#### Features
|
|
27
|
+
|
|
28
|
+
- **Remove All Aliases:** Clears all existing aliases in the current shell environment.
|
|
29
|
+
- **Load Custom Aliases:** Sources alias definitions from a specified directory within `.dotfiles`.
|
|
30
|
+
|
|
31
|
+
### Configuration Management
|
|
32
|
+
|
|
33
|
+
| Script | Description | Usage |
|
|
34
|
+
| :---------------- | :----------------------------------------------- | :----------------------------- |
|
|
35
|
+
| `configurations.sh` | Load custom shell configurations. | `source configurations.sh` |
|
|
36
|
+
|
|
37
|
+
#### Features
|
|
38
|
+
|
|
39
|
+
- **Custom Configurations:** Loads shell-specific configurations from the `.dotfiles` directory.
|
|
40
|
+
- **Error Handling:** Reports missing configuration files or sourcing issues.
|
|
41
|
+
|
|
42
|
+
### Function Management
|
|
43
|
+
|
|
44
|
+
| Script | Description | Usage |
|
|
45
|
+
| :---------------- | :----------------------------------------------- | :----------------------------- |
|
|
46
|
+
| `functions.sh` | Load custom executable functions. | `source functions.sh` |
|
|
47
|
+
|
|
48
|
+
#### Features
|
|
49
|
+
|
|
50
|
+
- **Custom Functions:** Sources user-defined functions from the `.dotfiles/lib/functions` directory.
|
|
51
|
+
- **Directory Check:** Ensures the functions directory exists before sourcing.
|
|
52
|
+
|
|
53
|
+
### History Management
|
|
54
|
+
|
|
55
|
+
| Script | Description | Usage |
|
|
56
|
+
| :---------------- | :----------------------------------------------- | :----------------------------- |
|
|
57
|
+
| `history.sh` | Manage and configure shell history behavior. | `source history.sh` |
|
|
58
|
+
|
|
59
|
+
#### Features
|
|
60
|
+
|
|
61
|
+
- **Clear History:** Clears the history file and removes duplicates.
|
|
62
|
+
- **List History:** Displays shell history with enhanced formatting.
|
|
63
|
+
- **History Configuration:** Sets up shell-specific history options for Bash and Zsh.
|
|
64
|
+
|
|
65
|
+
### Path Management
|
|
66
|
+
|
|
67
|
+
| Script | Description | Usage |
|
|
68
|
+
| :---------------- | :----------------------------------------------- | :----------------------------- |
|
|
69
|
+
| `paths.sh` | Load custom path configurations. | `source paths.sh` |
|
|
70
|
+
|
|
71
|
+
#### Features
|
|
72
|
+
|
|
73
|
+
- **Load Paths:** Adds directories to the shell `PATH` variable from `.dotfiles/lib/paths`.
|
|
74
|
+
- **Error Reporting:** Alerts the user if the paths directory is missing.
|
|
75
|
+
|
|
76
|
+
### Usage
|
|
77
|
+
|
|
78
|
+
| Command | Description |
|
|
79
|
+
| :-------------------------- | :--------------------------------------- |
|
|
80
|
+
| `source <script>.sh` | Apply the respective script configuration.|
|
|
81
|
+
| `echo $PATH` | Verify the current `PATH`. |
|
|
82
|
+
| `h` or `history` | Access custom history management. |
|
|
83
|
+
|
|
84
|
+
<!-- markdownlint-enable MD013-->
|
|
11
85
|
|
|
12
|
-
|
|
86
|
+
[banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
|
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
<!-- markdownlint-disable MD033 MD041 MD043 -->
|
|
2
|
-
|
|
3
1
|
<img
|
|
4
2
|
src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
|
|
5
3
|
alt="dotfiles logo"
|
|
6
|
-
width="
|
|
4
|
+
width="66"
|
|
7
5
|
align="right"
|
|
8
6
|
/>
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Dotfiles (v0.2.468)
|
|
8
|
+
# Dotfiles (v0.2.469)
|
|
13
9
|
|
|
14
10
|
Simply designed to fit your shell life π
|
|
15
11
|
|
|
16
12
|
![Dotfiles banner][banner]
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
14
|
+
This repository contains a structured set of directories and scripts to manage various shell configurations, aliases, and utilities. Below is the organized directory structure with detailed descriptions.
|
|
15
|
+
|
|
16
|
+
## π§ Directory List
|
|
17
|
+
|
|
18
|
+
<!-- markdownlint-disable MD013-->
|
|
19
|
+
|
|
20
|
+
| Directory | Description | Link |
|
|
21
|
+
| :-------------- | :----------------------------------------------- | :------------------------ |
|
|
22
|
+
| `archives` | Compress and extract files and directories. | [View README](archives/README.md) |
|
|
23
|
+
| `cd` | Navigate the file system. | [View README](cd/README.md) |
|
|
24
|
+
| `chmod` | Change file and directory permissions. | [View README](chmod/README.md) |
|
|
25
|
+
| `clear` | Clear the terminal screen. | [View README](clear/README.md) |
|
|
26
|
+
| `configuration` | Manage dotfiles and shell configurations. | [View README](configuration/README.md) |
|
|
27
|
+
| `default` | Set up default shell aliases and configurations. | [View README](default/README.md) |
|
|
28
|
+
| `dig` | Query DNS name servers. | [View README](dig/README.md) |
|
|
29
|
+
| `disk-usage` | Display disk usage information. | [View README](disk-usage/README.md) |
|
|
30
|
+
| `editor` | Configure default text editors. | [View README](editor/README.md) |
|
|
31
|
+
| `find` | Search files and directories using `find`. | [View README](find/README.md) |
|
|
32
|
+
| `gcloud` | Manage Google Cloud SDK tools. | [View README](gcloud/README.md) |
|
|
33
|
+
| `git` | Manage Git aliases and configurations. | [View README](git/README.md) |
|
|
34
|
+
| `gnu` | Manage GNU core utilities. | [View README](gnu/README.md) |
|
|
35
|
+
| `heroku` | Manage Heroku CLI. | [View README](heroku/README.md) |
|
|
36
|
+
| `interactive` | Configure interactive shell behavior. | [View README](interactive/README.md) |
|
|
37
|
+
| `list` | List files and directories. | [View README](list/README.md) |
|
|
38
|
+
| `macOS` | Manage macOS-specific shell settings. | [View README](macOS/README.md) |
|
|
39
|
+
| `make` | Manage GNU Make aliases and utilities. | [View README](make/README.md) |
|
|
40
|
+
| `mkdir` | Create directories with custom options. | [View README](mkdir/README.md) |
|
|
41
|
+
| `npm` | Manage Node.js package manager aliases. | [View README](npm/README.md) |
|
|
42
|
+
| `permission` | Configure file and directory permissions. | [View README](permission/README.md) |
|
|
43
|
+
| `pnpm` | Manage pnpm package manager aliases. | [View README](pnpm/README.md) |
|
|
44
|
+
| `ps` | Manage process status commands. | [View README](ps/README.md) |
|
|
45
|
+
| `python` | Configure Python aliases and utilities. | [View README](python/README.md) |
|
|
46
|
+
| `rsync` | Configure rsync for efficient file transfers. | [View README](rsync/README.md) |
|
|
47
|
+
| `rust` | Manage Rust programming tools and configurations.| [View README](rust/README.md) |
|
|
48
|
+
| `subversion` | Configure Subversion (SVN) version control. | [View README](subversion/README.md) |
|
|
49
|
+
| `sudo` | Manage superuser operations. | [View README](sudo/README.md) |
|
|
50
|
+
| `tmux` | Configure tmux terminal multiplexer. | [View README](tmux/README.md) |
|
|
51
|
+
| `update` | Update dotfiles and related configurations. | [View README](update/README.md) |
|
|
52
|
+
| `uuid` | Generate UUIDs for various use cases. | [View README](uuid/README.md) |
|
|
53
|
+
| `wget` | Manage wget command-line tool. | [View README](wget/README.md) |
|
|
54
|
+
|
|
55
|
+
<!-- markdownlint-enable MD013-->
|
|
54
56
|
|
|
55
57
|
[banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
|
|
@@ -1,59 +1,145 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD033 MD041 MD043 -->
|
|
2
|
-
|
|
3
2
|
<img
|
|
4
3
|
src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
|
|
5
4
|
alt="dotfiles logo"
|
|
6
|
-
width="
|
|
5
|
+
width="66"
|
|
7
6
|
align="right"
|
|
8
7
|
/>
|
|
9
|
-
|
|
10
8
|
<!-- markdownlint-enable MD033 MD041 -->
|
|
11
9
|
|
|
12
|
-
# Dotfiles (v0.2.
|
|
10
|
+
# Dotfiles (v0.2.469)
|
|
13
11
|
|
|
14
12
|
Simply designed to fit your shell life π
|
|
15
13
|
|
|
16
14
|
![Dotfiles banner][banner]
|
|
17
15
|
|
|
18
|
-
##
|
|
16
|
+
## π
°ππ
²π
·π
Έπ
π
΄ π
°π
½π
³ π
²π
Ύπ
Όπ
Ώππ
΄πππ
Έπ
Ύπ
½ π
°π
»π
Έπ
°ππ
΄π
|
|
17
|
+
|
|
18
|
+
This module provides comprehensive tools for handling various archive and
|
|
19
|
+
compression formats.
|
|
20
|
+
|
|
21
|
+
### Universal Extract Function
|
|
22
|
+
|
|
23
|
+
The `extract` command automatically handles various archive formats:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
extract archive.tar.gz # Automatically detects format and extracts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Supported formats:
|
|
30
|
+
|
|
31
|
+
- `.tar.bz2`, `.tbz2`
|
|
32
|
+
- `.tar.gz`, `.tgz`
|
|
33
|
+
- `.tar.xz`
|
|
34
|
+
- `.tar.zst`
|
|
35
|
+
- `.tar`
|
|
36
|
+
- `.bz2`
|
|
37
|
+
- `.gz`
|
|
38
|
+
- `.rar`
|
|
39
|
+
- `.zip`
|
|
40
|
+
- `.Z`
|
|
41
|
+
- `.7z`
|
|
42
|
+
- `.zst`
|
|
43
|
+
- `.xz`
|
|
44
|
+
- `.lz4`
|
|
45
|
+
|
|
46
|
+
### Large File Compression
|
|
47
|
+
|
|
48
|
+
The `compress_large` function handles large file compression with streaming:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
compress_large gz largefile.dat # Creates largefile.dat.gz
|
|
52
|
+
compress_large xz data.bin output.xz # Specific output name
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Supported formats: `gz`, `bz2`, `xz`, `zst`, `lz4`
|
|
56
|
+
|
|
57
|
+
### Archive Tools
|
|
58
|
+
|
|
59
|
+
#### 7-Zip Aliases
|
|
60
|
+
|
|
61
|
+
- `a7z` - Create 7z archive
|
|
62
|
+
- `x7z` - Extract 7z archive
|
|
63
|
+
- `l7z` - List contents
|
|
64
|
+
- `t7z` - Test integrity
|
|
65
|
+
|
|
66
|
+
#### Tar Aliases
|
|
67
|
+
|
|
68
|
+
- `ctar` - Create tar archive
|
|
69
|
+
- `xtar` - Extract tar archive
|
|
70
|
+
- `ltar` - List contents
|
|
71
|
+
- `ctgz` - Create tar.gz archive
|
|
72
|
+
- `xtgz` - Extract tar.gz archive
|
|
73
|
+
- `ctbz` - Create tar.bz2 archive
|
|
74
|
+
- `xtbz` - Extract tar.bz2 archive
|
|
75
|
+
- `ctxz` - Create tar.xz archive
|
|
76
|
+
- `xtxz` - Extract tar.xz archive
|
|
77
|
+
- `ctzst` - Create tar.zst archive
|
|
78
|
+
- `xtzst` - Extract tar.zst archive
|
|
79
|
+
|
|
80
|
+
#### Zip Aliases
|
|
81
|
+
|
|
82
|
+
- `czip` - Create zip archive
|
|
83
|
+
- `xzip` - Extract zip archive
|
|
84
|
+
- `lzip` - List contents
|
|
85
|
+
|
|
86
|
+
### Compression Tools
|
|
87
|
+
|
|
88
|
+
#### Gzip
|
|
89
|
+
|
|
90
|
+
- `cgz` - Compress with gzip
|
|
91
|
+
- `xgz` - Extract gzip
|
|
92
|
+
|
|
93
|
+
#### Bzip2
|
|
94
|
+
|
|
95
|
+
- `cbz` - Compress with bzip2
|
|
96
|
+
- `xbz` - Extract bzip2
|
|
97
|
+
|
|
98
|
+
#### XZ
|
|
99
|
+
|
|
100
|
+
- `cxz` - Compress with xz
|
|
101
|
+
- `xxz` - Extract xz
|
|
102
|
+
|
|
103
|
+
#### Zstandard
|
|
104
|
+
|
|
105
|
+
- `czst` - Compress with zstd
|
|
106
|
+
- `xzst` - Extract zstd
|
|
107
|
+
|
|
108
|
+
#### LZ4
|
|
19
109
|
|
|
20
|
-
|
|
21
|
-
|
|
110
|
+
- `clz4` - Compress with lz4
|
|
111
|
+
- `xlz4` - Extract lz4
|
|
22
112
|
|
|
23
|
-
|
|
113
|
+
### Features
|
|
24
114
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* pigz
|
|
33
|
-
* tar
|
|
34
|
-
* xz
|
|
35
|
-
* zstd
|
|
36
|
-
* zip
|
|
115
|
+
- Automatic format detection
|
|
116
|
+
- Tab completion for the extract command
|
|
117
|
+
- Error handling with helpful messages
|
|
118
|
+
- Large file support with streaming
|
|
119
|
+
- Archive integrity checking
|
|
120
|
+
- Content listing
|
|
121
|
+
- Cross-platform compatibility
|
|
37
122
|
|
|
38
|
-
|
|
39
|
-
quickly by using simple commands. Here are examples for each operation:
|
|
123
|
+
### Usage Examples
|
|
40
124
|
|
|
41
|
-
|
|
42
|
-
|
|
125
|
+
```bash
|
|
126
|
+
# Extract any supported archive
|
|
127
|
+
extract archive.tar.gz
|
|
43
128
|
|
|
44
|
-
|
|
129
|
+
# Create a tar.gz archive
|
|
130
|
+
ctgz output.tar.gz folder/
|
|
45
131
|
|
|
46
|
-
|
|
132
|
+
# List contents of a zip file
|
|
133
|
+
lzip archive.zip
|
|
47
134
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* Enhanced portability with updates to support a wider range of archive formats
|
|
51
|
-
and systems.
|
|
135
|
+
# Compress a large file
|
|
136
|
+
compress_large xz largefile.dat
|
|
52
137
|
|
|
53
|
-
|
|
54
|
-
|
|
138
|
+
# Create a 7z archive with maximum compression
|
|
139
|
+
a7z a -mx=9 archive.7z files/
|
|
55
140
|
|
|
56
|
-
|
|
57
|
-
|
|
141
|
+
# Test archive integrity
|
|
142
|
+
t7z archive.7z
|
|
143
|
+
```
|
|
58
144
|
|
|
59
145
|
[banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
|
|
@@ -1,157 +1,114 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# π
³π
Ύππ
΅π
Έπ
»π
΄π
|
|
5
|
-
# Script: archives.aliases.sh
|
|
6
|
-
# Version: 0.2.468
|
|
7
|
-
# Author: @wwdseb
|
|
8
|
-
# Copyright (c) 2015-2024. All rights reserved
|
|
9
|
-
# Description:
|
|
10
|
-
# This script defines aliases for common archive operations. It provides
|
|
11
|
-
# shortcuts for compressing and extracting various types of archive files.
|
|
12
|
-
# Website: https://dotfiles.io
|
|
2
|
+
# π
³π
Ύππ
΅π
Έπ
»π
΄π - Archive and Compression Management
|
|
3
|
+
# Made with β₯ by Sebastien Rousseau
|
|
13
4
|
# License: MIT
|
|
14
|
-
################################################################################
|
|
15
|
-
|
|
16
|
-
# π
°ππ
²π
·π
Έπ
π
΄π π
°π
»π
Έπ
°ππ
΄π
|
|
17
|
-
|
|
18
|
-
## Check for existence of archive programs
|
|
19
|
-
if type 7z &> /dev/null; then
|
|
20
|
-
alias compress_7z='7z a'
|
|
21
|
-
alias extract_7z='7z x'
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
if type tar &> /dev/null; then
|
|
25
|
-
alias compress_tar='tar -cvf'
|
|
26
|
-
alias extract_tar='tar -xvf'
|
|
27
|
-
alias compress_tar_gzip='tar -zcvf'
|
|
28
|
-
alias extract_tar_gzip='tar -zxvf'
|
|
29
|
-
alias compress_tar_bzip2='tar -cvjf'
|
|
30
|
-
alias extract_tar_bzip2='tar -xvjf'
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
if type jar &> /dev/null; then
|
|
34
|
-
alias compress_jar='jar -cvf'
|
|
35
|
-
alias extract_jar='jar -xvf'
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
if type xz &> /dev/null; then
|
|
39
|
-
alias compress_xz='tar -cvJf'
|
|
40
|
-
alias extract_xz='tar -xvJf'
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
if type zip &> /dev/null; then
|
|
44
|
-
alias compress_zip='zip -r'
|
|
45
|
-
alias extract_zip='unzip'
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
if type zstd &> /dev/null; then
|
|
49
|
-
alias compress_zstd='zstd -zcvf'
|
|
50
|
-
alias extract_zstd='zstd -zxvf'
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
if type gzip &> /dev/null; then
|
|
54
|
-
alias compress_gzip='gzip -cv'
|
|
55
|
-
alias extract_gzip='gzip -dv'
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
if type bzip2 &> /dev/null; then
|
|
59
|
-
alias compress_bzip2='bzip2 -zkvf'
|
|
60
|
-
alias extract_bzip2='bzip2 -dkvf'
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
if type lzop &> /dev/null; then
|
|
64
|
-
alias compress_lzop='lzop -cv'
|
|
65
|
-
alias extract_lzop='lzop -dv'
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
if type lz4 &> /dev/null; then
|
|
69
|
-
alias compress_lz4='lz4 -zcv'
|
|
70
|
-
alias extract_lz4='lz4 -dcv'
|
|
71
|
-
fi
|
|
72
|
-
|
|
73
|
-
if type pigz &> /dev/null; then
|
|
74
|
-
alias compress_pigz='pigz -zkvf'
|
|
75
|
-
alias extract_pigz='pigz -dkvf'
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
# π
³π
΄π
΅π
΄π
½ππ
Έπ
π
΄ π
²π
Ύπ
³π
Έπ
½π
Ά
|
|
79
|
-
|
|
80
|
-
# Ensure valid arguments are passed
|
|
81
|
-
function compress_file() {
|
|
82
|
-
local archive_type="$1"
|
|
83
|
-
case "${archive_type}" in
|
|
84
|
-
7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
|
|
85
|
-
alias "compress_${archive_type}" "${archive_type} -cvf"
|
|
86
|
-
;;
|
|
87
|
-
*)
|
|
88
|
-
echo "Unsupported archive type: ${archive_type}"
|
|
89
|
-
return 1
|
|
90
|
-
;;
|
|
91
|
-
esac
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function extract_file() {
|
|
95
|
-
local archive_type="$1"
|
|
96
|
-
case "${archive_type}" in
|
|
97
|
-
7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
|
|
98
|
-
alias "extract_${archive_type}" "${archive_type} -xvf"
|
|
99
|
-
;;
|
|
100
|
-
*)
|
|
101
|
-
echo "Unsupported archive type: ${archive_type}"
|
|
102
|
-
return 1
|
|
103
|
-
;;
|
|
104
|
-
esac
|
|
105
|
-
}
|
|
106
5
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
6
|
+
#-----------------------------------------------------------------------------
|
|
7
|
+
# Extract Function
|
|
8
|
+
#-----------------------------------------------------------------------------
|
|
9
|
+
# Archive and Compression Management
|
|
10
|
+
|
|
11
|
+
extract() {
|
|
12
|
+
if [ -z "$1" ]; then
|
|
13
|
+
echo "Usage: extract <archive_file>"
|
|
14
|
+
return 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ ! -f "$1" ]; then
|
|
18
|
+
echo "Error: '$1' is not a valid file"
|
|
19
|
+
return 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
case "$1" in
|
|
23
|
+
*.tar.bz2|*.tbz2) tar xvjf "$1" ;;
|
|
24
|
+
*.tar.gz|*.tgz) tar xvzf "$1" ;;
|
|
25
|
+
*.tar.xz) tar xvJf "$1" ;;
|
|
26
|
+
*.tar.zst) tar --zstd -xvf "$1" ;;
|
|
27
|
+
*.tar) tar xvf "$1" ;;
|
|
28
|
+
*.bz2) bunzip2 "$1" ;;
|
|
29
|
+
*.gz) gunzip "$1" ;;
|
|
30
|
+
*.rar) unrar x "$1" ;;
|
|
31
|
+
*.zip) unzip "$1" ;;
|
|
32
|
+
*.Z) uncompress "$1" ;;
|
|
33
|
+
*.7z) 7z x "$1" ;;
|
|
34
|
+
*.zst) unzstd "$1" ;;
|
|
35
|
+
*.xz) unxz "$1" ;;
|
|
36
|
+
*.lz4) lz4 -d "$1" ;;
|
|
37
|
+
*) echo "Error: '$1' cannot be extracted" && return 1 ;;
|
|
38
|
+
esac
|
|
119
39
|
}
|
|
120
40
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
41
|
+
#-----------------------------------------------------------------------------
|
|
42
|
+
# Compress Function
|
|
43
|
+
#-----------------------------------------------------------------------------
|
|
44
|
+
compress_large() {
|
|
45
|
+
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
46
|
+
echo "Usage: compress_large <format> <input_file> [output_file]"
|
|
47
|
+
return 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
local format="$1"
|
|
51
|
+
local input="$2"
|
|
52
|
+
local output="${3:-${input}.${format}}"
|
|
53
|
+
|
|
54
|
+
if [ ! -f "$input" ]; then
|
|
55
|
+
echo "Error: '$input' is not a valid file"
|
|
56
|
+
return 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
case "$format" in
|
|
60
|
+
gz) gzip -c "$input" > "$output" ;;
|
|
61
|
+
bz2) bzip2 -c "$input" > "$output" ;;
|
|
62
|
+
xz) xz -c "$input" > "$output" ;;
|
|
63
|
+
zst) zstd -c "$input" > "$output" ;;
|
|
64
|
+
lz4) lz4 -c "$input" > "$output" ;;
|
|
65
|
+
*) echo "Error: Unsupported format '$format'" && return 1 ;;
|
|
66
|
+
esac
|
|
67
|
+
echo "Compressed '$input' to '$output'"
|
|
132
68
|
}
|
|
133
69
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
70
|
+
#-----------------------------------------------------------------------------
|
|
71
|
+
# Aliases
|
|
72
|
+
#-----------------------------------------------------------------------------
|
|
73
|
+
# 7-Zip Aliases
|
|
74
|
+
alias a7z='7z a' # Create 7z archive
|
|
75
|
+
alias x7z='7z x' # Extract 7z archive
|
|
76
|
+
|
|
77
|
+
# Tar Aliases
|
|
78
|
+
alias ctar='tar -cvf' # Create tar archive
|
|
79
|
+
alias xtar='tar -xvf' # Extract tar archive
|
|
80
|
+
alias ltar='tar -tvf' # List tar archive contents
|
|
81
|
+
alias ctgz='tar -zcvf' # Create tar.gz archive
|
|
82
|
+
alias xtgz='tar -zxvf' # Extract tar.gz archive
|
|
83
|
+
alias ctbz='tar -jcvf' # Create tar.bz2 archive
|
|
84
|
+
alias xtbz='tar -jxvf' # Extract tar.bz2 archive
|
|
85
|
+
alias ctxz='tar -Jcvf' # Create tar.xz archive
|
|
86
|
+
alias xtxz='tar -Jxvf' # Extract tar.xz archive
|
|
87
|
+
alias ctzst='tar --zstd -cvf' # Create tar.zst archive
|
|
88
|
+
alias xtzst='tar --zstd -xvf' # Extract tar.zst archive
|
|
89
|
+
|
|
90
|
+
# Zip Aliases
|
|
91
|
+
alias czip='zip -r' # Create zip archive
|
|
92
|
+
alias xzip='unzip' # Extract zip archive
|
|
93
|
+
alias lzip='unzip -l' # List zip archive contents
|
|
94
|
+
|
|
95
|
+
# Gzip Aliases
|
|
96
|
+
alias cgz='gzip -cv' # Compress with gzip
|
|
97
|
+
alias xgz='gzip -dv' # Extract gzip
|
|
98
|
+
|
|
99
|
+
# Bzip2 Aliases
|
|
100
|
+
alias cbz='bzip2 -zk' # Compress with bzip2
|
|
101
|
+
alias xbz='bzip2 -dk' # Extract bzip2
|
|
102
|
+
|
|
103
|
+
# XZ Aliases
|
|
104
|
+
alias cxz='xz -z' # Compress with xz
|
|
105
|
+
alias xxz='xz -d' # Extract xz
|
|
106
|
+
|
|
107
|
+
# Zstd Aliases
|
|
108
|
+
alias czst='zstd -z' # Compress with zstd
|
|
109
|
+
alias xzst='zstd -d' # Extract zstd
|
|
110
|
+
|
|
111
|
+
# LZ4 Aliases
|
|
112
|
+
alias clz4='lz4 -zc' # Compress with lz4
|
|
113
|
+
alias xlz4='lz4 -dc' # Extract lz4
|
|
143
114
|
|
|
144
|
-
# Set better defaults in case archive programs are missing
|
|
145
|
-
set_alias compress_bz2 bzip2 '-zkvf'
|
|
146
|
-
set_alias compress_lz4 lz4 '-zcv'
|
|
147
|
-
set_alias compress_lzma xz '-zcvf'
|
|
148
|
-
set_alias compress_lzo lzop '-cv'
|
|
149
|
-
set_alias compress_pgz pigz '-zkvf'
|
|
150
|
-
set_alias compress_tbz2 tar '-cvjf'
|
|
151
|
-
set_alias compress_tgz tar '--use-compress-program=pigz -cvf'
|
|
152
|
-
set_alias compress_tgz tar '-zcvf'
|
|
153
|
-
set_alias compress_tlzo tar '--lzip -cvf'
|
|
154
|
-
set_alias compress_txz tar '-cvJf'
|
|
155
|
-
set_alias compress_tzst tar '--zstd -cvf'
|
|
156
|
-
set_alias compress_zlib gzip '-cv'
|
|
157
|
-
set_alias compress_zstd zstd '-zcvf'
|