@sebastienrousseau/dotfiles 0.2.466 → 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.
Files changed (184) hide show
  1. package/README.md +19 -15
  2. package/dist/Makefile +126 -43
  3. package/dist/bin/backup.js.map +1 -1
  4. package/dist/bin/constants.d.ts +2 -2
  5. package/dist/bin/constants.d.ts.map +1 -1
  6. package/dist/bin/constants.js +1 -1
  7. package/dist/bin/dotfiles.d.ts +2 -2
  8. package/dist/bin/dotfiles.d.ts.map +1 -1
  9. package/dist/bin/dotfiles.js +1 -2
  10. package/dist/bin/dotfiles.js.map +1 -1
  11. package/dist/bin/download.d.ts +2 -2
  12. package/dist/bin/download.d.ts.map +1 -1
  13. package/dist/bin/download.js +1 -2
  14. package/dist/bin/download.js.map +1 -1
  15. package/dist/bin/index.js +1 -1
  16. package/dist/bin/index.js.map +1 -1
  17. package/dist/filesizes.txt +161 -161
  18. package/dist/lib/README.md +83 -5
  19. package/dist/lib/aliases/README.md +49 -43
  20. package/dist/lib/aliases/archives/README.md +126 -37
  21. package/dist/lib/aliases/archives/archives.aliases.sh +112 -152
  22. package/dist/lib/aliases/cd/README.md +138 -55
  23. package/dist/lib/aliases/cd/cd.aliases.sh +45 -33
  24. package/dist/lib/aliases/chmod/README.md +151 -96
  25. package/dist/lib/aliases/chmod/chmod.aliases.sh +103 -69
  26. package/dist/lib/aliases/clear/README.md +8 -4
  27. package/dist/lib/aliases/clear/clear.aliases.sh +57 -28
  28. package/dist/lib/aliases/configuration/README.md +8 -4
  29. package/dist/lib/aliases/configuration/configuration.aliases.sh +53 -30
  30. package/dist/lib/aliases/default/README.md +8 -4
  31. package/dist/lib/aliases/default/default.aliases.sh +99 -86
  32. package/dist/lib/aliases/dig/README.md +8 -4
  33. package/dist/lib/aliases/dig/dig.aliases.sh +4 -4
  34. package/dist/lib/aliases/disk-usage/README.md +8 -4
  35. package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
  36. package/dist/lib/aliases/editor/README.md +8 -4
  37. package/dist/lib/aliases/editor/editor.aliases.sh +4 -4
  38. package/dist/lib/aliases/find/README.md +8 -4
  39. package/dist/lib/aliases/find/find.aliases.sh +4 -4
  40. package/dist/lib/aliases/gcloud/README.md +8 -4
  41. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
  42. package/dist/lib/aliases/git/README.md +8 -4
  43. package/dist/lib/aliases/git/git.aliases.sh +3 -3
  44. package/dist/lib/aliases/gnu/README.md +8 -4
  45. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
  46. package/dist/lib/aliases/heroku/README.md +8 -4
  47. package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
  48. package/dist/lib/aliases/interactive/README.md +29 -17
  49. package/dist/lib/aliases/interactive/interactive.aliases.sh +15 -18
  50. package/dist/lib/aliases/list/README.md +118 -25
  51. package/dist/lib/aliases/list/list.aliases.sh +130 -84
  52. package/dist/lib/aliases/macOS/README.md +8 -4
  53. package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
  54. package/dist/lib/aliases/make/README.md +8 -4
  55. package/dist/lib/aliases/make/make.aliases.sh +3 -3
  56. package/dist/lib/aliases/mkdir/README.md +8 -4
  57. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
  58. package/dist/lib/aliases/npm/README.md +8 -4
  59. package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
  60. package/dist/lib/aliases/permission/README.md +8 -4
  61. package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
  62. package/dist/lib/aliases/pnpm/README.md +8 -4
  63. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
  64. package/dist/lib/aliases/ps/README.md +8 -4
  65. package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
  66. package/dist/lib/aliases/python/python.aliases.sh +141 -0
  67. package/dist/lib/aliases/rsync/README.md +8 -4
  68. package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
  69. package/dist/lib/aliases/rust/README.md +171 -46
  70. package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
  71. package/dist/lib/aliases/subversion/README.md +8 -4
  72. package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
  73. package/dist/lib/aliases/sudo/README.md +8 -4
  74. package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
  75. package/dist/lib/aliases/tmux/README.md +8 -4
  76. package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
  77. package/dist/lib/aliases/update/README.md +8 -4
  78. package/dist/lib/aliases/update/update.aliases.sh +307 -66
  79. package/dist/lib/aliases/uuid/README.md +8 -4
  80. package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
  81. package/dist/lib/aliases/wget/README.md +8 -4
  82. package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
  83. package/dist/lib/aliases.sh +42 -12
  84. package/dist/lib/configurations/README.md +8 -4
  85. package/dist/lib/configurations/bash/bashrc +163 -35
  86. package/dist/lib/configurations/curl/curlrc +3 -6
  87. package/dist/lib/configurations/default/color.sh +3 -3
  88. package/dist/lib/configurations/default/constants.sh +4 -4
  89. package/dist/lib/configurations/default/editor.sh +3 -3
  90. package/dist/lib/configurations/default/prompt.sh +20 -11
  91. package/dist/lib/configurations/input/inputrc +3 -3
  92. package/dist/lib/configurations/nano/nanorc +3 -3
  93. package/dist/lib/configurations/profile/profile +3 -3
  94. package/dist/lib/configurations/prompt/prompt.sh +81 -0
  95. package/dist/lib/configurations/tmux/default +3 -3
  96. package/dist/lib/configurations/tmux/display +3 -3
  97. package/dist/lib/configurations/tmux/linux +3 -3
  98. package/dist/lib/configurations/tmux/navigation +3 -3
  99. package/dist/lib/configurations/tmux/panes +3 -3
  100. package/dist/lib/configurations/tmux/theme +4 -4
  101. package/dist/lib/configurations/tmux/tmux +3 -3
  102. package/dist/lib/configurations/vim/vimrc +191 -71
  103. package/dist/lib/configurations/wget/wgetrc +3 -3
  104. package/dist/lib/configurations/zsh/zshrc +11 -12
  105. package/dist/lib/configurations.sh +39 -9
  106. package/dist/lib/functions/README.md +73 -55
  107. package/dist/lib/functions/apihealth.sh +277 -0
  108. package/dist/lib/functions/apilatency.sh +157 -0
  109. package/dist/lib/functions/apiload.sh +165 -0
  110. package/dist/lib/functions/backup.sh +143 -0
  111. package/dist/lib/functions/cdls.sh +52 -6
  112. package/dist/lib/functions/curlheader.sh +66 -10
  113. package/dist/lib/functions/curlstatus.sh +64 -7
  114. package/dist/lib/functions/curltime.sh +56 -14
  115. package/dist/lib/functions/encode64.sh +87 -7
  116. package/dist/lib/functions/environment.sh +65 -25
  117. package/dist/lib/functions/extract.sh +79 -27
  118. package/dist/lib/functions/freespace.sh +55 -9
  119. package/dist/lib/functions/genpwd.sh +93 -29
  120. package/dist/lib/functions/goto.sh +59 -8
  121. package/dist/lib/functions/hexdump.sh +96 -0
  122. package/dist/lib/functions/hiddenfiles.sh +77 -0
  123. package/dist/lib/functions/hostinfo.sh +92 -21
  124. package/dist/lib/functions/hstats.sh +69 -5
  125. package/dist/lib/functions/httpdebug.sh +109 -5
  126. package/dist/lib/functions/kebabcase.sh +61 -0
  127. package/dist/lib/functions/keygen.sh +188 -25
  128. package/dist/lib/functions/last.sh +106 -5
  129. package/dist/lib/functions/logout.sh +114 -6
  130. package/dist/lib/functions/lowercase.sh +49 -17
  131. package/dist/lib/functions/matrix.sh +205 -30
  132. package/dist/lib/functions/mount_read_only.sh +3 -3
  133. package/dist/lib/functions/myproc.sh +3 -3
  134. package/dist/lib/functions/prependpath.sh +3 -3
  135. package/dist/lib/functions/ql.sh +3 -3
  136. package/dist/lib/functions/rd.sh +3 -3
  137. package/dist/lib/functions/remove_disk.sh +3 -3
  138. package/dist/lib/functions/ren.sh +68 -8
  139. package/dist/lib/functions/sentencecase.sh +63 -0
  140. package/dist/lib/functions/showhiddenfiles.sh +3 -3
  141. package/dist/lib/functions/size.sh +6 -5
  142. package/dist/lib/functions/snakecase.sh +61 -0
  143. package/dist/lib/functions/stopwatch.sh +3 -3
  144. package/dist/lib/functions/sysinfo.sh +145 -0
  145. package/dist/lib/functions/titlecase.sh +65 -0
  146. package/dist/lib/functions/uppercase.sh +51 -19
  147. package/dist/lib/functions/view-source.sh +3 -3
  148. package/dist/lib/functions/vscode.sh +3 -3
  149. package/dist/lib/functions/whoisport.sh +3 -3
  150. package/dist/lib/functions/zipf.sh +3 -3
  151. package/dist/lib/functions.sh +41 -10
  152. package/dist/lib/history.sh +68 -83
  153. package/dist/lib/paths/README.md +52 -0
  154. package/dist/lib/paths/custom.paths.sh +40 -0
  155. package/dist/lib/paths/default.paths.sh +37 -0
  156. package/dist/lib/paths.sh +40 -11
  157. package/dist/scripts/backup.sh +3 -3
  158. package/dist/scripts/banner.sh +3 -3
  159. package/dist/scripts/build.sh +3 -3
  160. package/dist/scripts/clean.sh +3 -3
  161. package/dist/scripts/compile.sh +3 -3
  162. package/dist/scripts/copy.sh +3 -3
  163. package/dist/scripts/dotfiles.sh +3 -3
  164. package/dist/scripts/download.sh +3 -3
  165. package/dist/scripts/help.sh +3 -3
  166. package/dist/scripts/ssh.sh +3 -3
  167. package/dist/scripts/unpack.sh +3 -3
  168. package/package.json +10 -9
  169. package/dist/lib/aliases/jekyll/README.md +0 -37
  170. package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
  171. package/dist/lib/configurations/tmux/vi +0 -9
  172. package/dist/lib/functions/filehead.sh +0 -4
  173. package/dist/lib/functions/hidehiddenfiles.sh +0 -14
  174. package/dist/lib/paths/ant/ant.paths.sh +0 -15
  175. package/dist/lib/paths/default/default.paths.sh +0 -19
  176. package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
  177. package/dist/lib/paths/java/java.paths.sh +0 -19
  178. package/dist/lib/paths/maven/maven.paths.sh +0 -18
  179. package/dist/lib/paths/node/node.paths.sh +0 -15
  180. package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
  181. package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
  182. package/dist/lib/paths/python/python.paths.sh +0 -36
  183. package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
  184. package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
@@ -1,8 +1,86 @@
1
- # Dotfiles aliases
1
+ <img
2
+ src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
3
+ alt="dotfiles logo"
4
+ width="66"
5
+ align="right"
6
+ />
2
7
 
3
- <!-- markdownlint-disable MD033 MD041 -->
8
+ # Dotfiles Shell Configuration Scripts
4
9
 
5
- <img src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
6
- alt="dotfiles logo" width="261" align="right" />
10
+ Simply designed to fit your shell life 🐚
7
11
 
8
- <!-- markdownlint-enable MD033 MD041 -->
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-->
85
+
86
+ [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
@@ -1,51 +1,57 @@
1
- <!-- markdownlint-disable MD033 MD041 -->
1
+ <img
2
+ src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
3
+ alt="dotfiles logo"
4
+ width="66"
5
+ align="right"
6
+ />
2
7
 
3
- <img src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
4
- alt="dotfiles logo" width="261" align="right" />
5
-
6
- <!-- markdownlint-enable MD033 MD041 -->
7
-
8
- # Dotfiles (v0.2.466)
8
+ # Dotfiles (v0.2.469)
9
9
 
10
10
  Simply designed to fit your shell life 🐚
11
11
 
12
12
  ![Dotfiles banner][banner]
13
13
 
14
- - [Archives](archives/README.md) - Compress and extract files and
15
- directories in various formats on a Unix-based system.
16
- - [Cd](cd/README.md) - Navigate the file system.
17
- - [Chmod](chmod/README.md) - Change the permissions of files and
18
- directories.
19
- - [Clear](clear/README.md) - Clear the terminal screen.
20
- - [Configuration](configuration/README.md) - Configure the dotfiles.
21
- - [Default](default/README.md) - Manage the default shell.
22
- - [Dig](dig/README.md) - Query DNS name servers.
23
- - [Disk Usage](disk-usage/README.md) - Display the disk usage of files
24
- and directories.
25
- - [Editor](editor/README.md) - Manage the default text editor.
26
- - [Find](find/README.md) - Search for files and directories.
27
- - [gCloud](gcloud/README.md) - Manage the Google Cloud SDK.
28
- - [Git](git/README.md) - Manage the Git version control system.
29
- - [GNU](gnu/README.md) - Manage the GNU core utilities.
30
- - [Heroku](heroku/README.md) - Manage the Heroku CLI.
31
- - [Interactive](interactive/README.md) - Manage the interactive shell.
32
- - [Jekyll](jekyll/README.md) - Manage the Jekyll static site generator.
33
- - [List](list/README.md) - List files and directories.
34
- - [macOS](macos/README.md) - Manage the macOS operating system.
35
- - [make](make/README.md) - Manage the GNU make utility.
36
- - [mkdir](mkdir/README.md) - Create directories.
37
- - [npm](npm/README.md) - Manage the Node.js package manager.
38
- - [permission](permission/README.md) - Manage the file permissions.
39
- - [pnpm](pnpm/README.md) - Manage the pnpm package manager.
40
- - [ps](ps/README.md) - Manage the process status.
41
- - [rsync](rsync/README.md) - Manage the rsync file transfer utility.
42
- - [rust](rust/README.md) - Manage the Rust programming language.
43
- - [subversion](subversion/README.md) - Manage the Subversion version
44
- control system.
45
- - [sudo](sudo/README.md) - Manage the superuser.
46
- - [tmux](tmux/README.md) - Manage the tmux terminal multiplexer.
47
- - [update](update/README.md) - Help users update the dotfiles.
48
- - [uuid](uuid/README.md) - Help users generate UUIDs.
49
- - [wget](wget/README.md) - Manage the wget utility.
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-->
50
56
 
51
57
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
@@ -1,56 +1,145 @@
1
- <!-- markdownlint-disable MD033 MD041 -->
2
-
3
- <img src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
4
- alt="dotfiles logo" width="261" align="right" />
5
-
1
+ <!-- markdownlint-disable MD033 MD041 MD043 -->
2
+ <img
3
+ src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
4
+ alt="dotfiles logo"
5
+ width="66"
6
+ align="right"
7
+ />
6
8
  <!-- markdownlint-enable MD033 MD041 -->
7
9
 
8
- # Dotfiles (v0.2.466)
10
+ # Dotfiles (v0.2.469)
9
11
 
10
12
  Simply designed to fit your shell life 🐚
11
13
 
12
14
  ![Dotfiles banner][banner]
13
15
 
14
- ## 🅰🆁🅲🅷🅸🆅🅴🆂 🅰🅻🅸🅰🆂🅴🆂
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
15
109
 
16
- This code provides a set of command aliases to help users compress and
17
- extract files and directories in various formats on a Unix-based system.
110
+ - `clz4` - Compress with lz4
111
+ - `xlz4` - Extract lz4
18
112
 
19
- The following compression formats are supported:
113
+ ### Features
20
114
 
21
- - 7z
22
- - bzip2
23
- - gzip
24
- - jar
25
- - lz4
26
- - lzma
27
- - lzo
28
- - pigz
29
- - tar
30
- - xz
31
- - zstd
32
- - 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
33
122
 
34
- These aliases enable users to compress or extract files and directories
35
- quickly by using simple commands.
123
+ ### Usage Examples
36
124
 
37
- For example:
125
+ ```bash
126
+ # Extract any supported archive
127
+ extract archive.tar.gz
38
128
 
39
- - `c7z` can be used to compress a whole directory (including
40
- subdirectories) to a 7z file.
41
- - `e7z` can be used to extract a whole directory (including
42
- subdirectories) from a 7z file.
129
+ # Create a tar.gz archive
130
+ ctgz output.tar.gz folder/
43
131
 
44
- Similarly, there are aliases for compressing and extracting files and
45
- directories in all supported formats.
132
+ # List contents of a zip file
133
+ lzip archive.zip
46
134
 
47
- The aliases are designed to be easy to remember and use, and they should
48
- make the compression and extraction process much simpler for users.
135
+ # Compress a large file
136
+ compress_large xz largefile.dat
49
137
 
50
- Please note that some of the compression formats may require additional
51
- software to be installed on your system.
138
+ # Create a 7z archive with maximum compression
139
+ a7z a -mx=9 archive.7z files/
52
140
 
53
- Enjoy the convenience of quickly compressing and extracting files and
54
- directories with these command aliases!
141
+ # Test archive integrity
142
+ t7z archive.7z
143
+ ```
55
144
 
56
145
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
@@ -1,154 +1,114 @@
1
1
  #!/usr/bin/env bash
2
-
3
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
- # Made with ♥ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2023. All rights reserved
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Archive and Compression Management
3
+ # Made with by Sebastien Rousseau
6
4
  # License: MIT
7
- # Script: archives.aliases.sh
8
- # Version: 0.2.466
9
- # Website: https://dotfiles.io
10
-
11
- # 🅰🆁🅲🅷🅸🆅🅴🆂 🅰🅻🅸🅰🆂🅴🆂
12
- if command -v 7z &>/dev/null; then
13
- # Compress a whole directory (including subdirectories) to a 7z file.
14
- alias c7z='7z a'
15
- # Extract a whole directory (including subdirectories) from a 7z file.
16
- alias e7z='7z x'
17
- fi
18
-
19
- if command -v tar &>/dev/null; then
20
- # Compress a file to a bzip2 file.
21
- alias cbzip2='tar -cvjf'
22
- # Compress a whole directory (including subdirectories) to a tar file.
23
- alias ctar='tar -cvf'
24
- # Extract a whole directory (including subdirectories) from a tar
25
- # file.
26
- alias etar='tar -xvf'
27
- # Compress a file to a gzip file.
28
- alias cgzip='tar -zcvf'
29
- # Compress a whole directory (including subdirectories) to an xz file.
30
- alias cxz='tar -cvJf'
31
- # Extract a file from a bzip2 file.
32
- alias ebzip2='tar -xvjf'
33
- # Extract a file from a gzip file.
34
- alias egzip='tar -xvzf'
35
- # Extract a whole directory (including subdirectories) from an xz
36
- # file.
37
- alias exz='tar -xvJf'
38
- fi
39
-
40
- if command -v jar &>/dev/null; then
41
- # Compress a whole directory (including subdirectories) to a jar file.
42
- alias cjar='jar -cvf'
43
- # Extract a whole directory (including subdirectories) from a jar
44
- # file.
45
- alias ejar='jar -xvf'
46
- fi
47
-
48
- if command -v xz &>/dev/null; then
49
- # Compress a whole directory (including subdirectories) to an xz file.
50
- alias cxz2='xz -zcvf'
51
- # Extract a whole directory (including subdirectories) from an xz
52
- # file.
53
- alias exz2='xz -zxvf'
54
- fi
55
-
56
- if command -v zip &>/dev/null; then
57
- # Compress a whole directory (including subdirectories) to a zip file.
58
- alias czip='zip -r'
59
- # Extract a whole directory (including subdirectories) from a zip
60
- # file.
61
- alias ezip='unzip'
62
- fi
63
-
64
- if command -v zstd &>/dev/null; then
65
- # Compress a whole directory (including subdirectories) to a zstd file.
66
- alias czstd='zstd -zcvf'
67
- # Extract a whole directory (including subdirectories) from a zstd
68
- # file.
69
- alias ezstd='zstd -zxvf'
70
- fi
71
-
72
- # Compress a file to a lzma file.
73
- if command -v xz &>/dev/null; then
74
- alias clzma='xz -zcvf'
75
- alias elzma='xz -zxvf'
76
- fi
77
-
78
- # Compress a file to a z file.
79
- if command -v gzip &>/dev/null; then
80
- alias czlib='gzip -cv'
81
- alias ezlib='gzip -dv'
82
- fi
83
-
84
- # Compress a file to a bz2 file.
85
- if command -v bzip2 &>/dev/null; then
86
- alias cbz2='bzip2 -zkvf'
87
- alias ebz2='bzip2 -dkvf'
88
- fi
89
-
90
- # Compress a file to a lzo file.
91
- if command -v lzop &>/dev/null; then
92
- alias clzo='lzop -cv'
93
- alias elzo='lzop -dv'
94
- fi
95
-
96
- # Compress a file to a lz4 file.
97
- if command -v lz4 &>/dev/null; then
98
- alias clz4='lz4 -zcv'
99
- alias elz4='lz4 -dcv'
100
- fi
101
-
102
- # Compress a file to a zst file.
103
- if command -v zstd &>/dev/null; then
104
- alias czst='zstd -zcv'
105
- alias ezst='zstd -dcv'
106
- fi
107
-
108
- # Compress a file to a pigz file.
109
- if command -v pigz &>/dev/null; then
110
- alias cpgz='pigz -zkvf'
111
- alias epgz='pigz -dkvf'
112
- fi
113
-
114
- # Compress a whole directory (including subdirectories) to a tar.bz2
115
- # file.
116
- if command -v tar &>/dev/null && command -v bzip2 &>/dev/null; then
117
- alias ctbz2='tar -cvjf'
118
- alias etbz2='tar -xvjf'
119
- fi
120
-
121
- # Compress a whole directory (including subdirectories) to a tar.lzma
122
- # file.
123
- if command -v tar &>/dev/null && command -v xz &>/dev/null; then
124
- alias ctlzma='tar --lzma -cvf'
125
- alias etlzma='tar --lzma -xvf'
126
- fi
127
-
128
- # Compress a whole directory (including subdirectories) to a tar.gz
129
- # file.
130
- if command -v tar &>/dev/null && command -v gzip &>/dev/null; then
131
- alias ctgz='tar -zcvf'
132
- alias etgz='tar -zxvf'
133
- fi
134
-
135
- # Compress a whole directory (including subdirectories) to a tar.lzo
136
- # file.
137
- if command -v tar &>/dev/null && command -v lzop &>/dev/null; then
138
- alias ctlzo='tar --lzip -cvf'
139
- alias etlzo='tar --lzip -xvf'
140
- fi
141
-
142
- # Compress a whole directory (including subdirectories) to a tar.zst
143
- # file.
144
- if command -v tar &>/dev/null && command -v zstd &>/dev/null; then
145
- alias ctzst='tar --zstd -cvf'
146
- alias etzst='tar --zstd -xvf'
147
- fi
148
-
149
- # Compress a whole directory (including subdirectories) to a tar.pgz
150
- # file.
151
- if command -v tar &>/dev/null && command -v pigz &>/dev/null; then
152
- alias ctpgz='tar --use-compress-program=pigz -cvf'
153
- alias etpgz='tar --use-compress-program=pigz -xvf'
154
- fi
5
+
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
39
+ }
40
+
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'"
68
+ }
69
+
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
114
+