@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.
Files changed (172) hide show
  1. package/README.md +5 -5
  2. package/dist/Makefile +126 -43
  3. package/dist/bin/constants.d.ts +2 -2
  4. package/dist/bin/constants.d.ts.map +1 -1
  5. package/dist/bin/constants.js +1 -1
  6. package/dist/filesizes.txt +146 -144
  7. package/dist/lib/README.md +79 -5
  8. package/dist/lib/aliases/README.md +44 -42
  9. package/dist/lib/aliases/archives/README.md +120 -34
  10. package/dist/lib/aliases/archives/archives.aliases.sh +106 -149
  11. package/dist/lib/aliases/cd/README.md +119 -38
  12. package/dist/lib/aliases/cd/cd.aliases.sh +37 -59
  13. package/dist/lib/aliases/chmod/README.md +146 -95
  14. package/dist/lib/aliases/chmod/chmod.aliases.sh +71 -55
  15. package/dist/lib/aliases/clear/README.md +2 -2
  16. package/dist/lib/aliases/clear/clear.aliases.sh +4 -4
  17. package/dist/lib/aliases/configuration/README.md +2 -2
  18. package/dist/lib/aliases/configuration/configuration.aliases.sh +3 -6
  19. package/dist/lib/aliases/default/README.md +2 -2
  20. package/dist/lib/aliases/default/default.aliases.sh +3 -3
  21. package/dist/lib/aliases/dig/README.md +2 -2
  22. package/dist/lib/aliases/dig/dig.aliases.sh +4 -4
  23. package/dist/lib/aliases/disk-usage/README.md +2 -2
  24. package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
  25. package/dist/lib/aliases/editor/README.md +2 -2
  26. package/dist/lib/aliases/editor/editor.aliases.sh +4 -4
  27. package/dist/lib/aliases/find/README.md +2 -2
  28. package/dist/lib/aliases/find/find.aliases.sh +4 -4
  29. package/dist/lib/aliases/gcloud/README.md +2 -2
  30. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
  31. package/dist/lib/aliases/git/README.md +2 -2
  32. package/dist/lib/aliases/git/git.aliases.sh +3 -3
  33. package/dist/lib/aliases/gnu/README.md +2 -2
  34. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
  35. package/dist/lib/aliases/heroku/README.md +2 -2
  36. package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
  37. package/dist/lib/aliases/interactive/README.md +2 -2
  38. package/dist/lib/aliases/interactive/interactive.aliases.sh +3 -3
  39. package/dist/lib/aliases/list/README.md +112 -23
  40. package/dist/lib/aliases/list/list.aliases.sh +130 -84
  41. package/dist/lib/aliases/macOS/README.md +2 -2
  42. package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
  43. package/dist/lib/aliases/make/README.md +2 -2
  44. package/dist/lib/aliases/make/make.aliases.sh +3 -3
  45. package/dist/lib/aliases/mkdir/README.md +2 -2
  46. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
  47. package/dist/lib/aliases/npm/README.md +2 -2
  48. package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
  49. package/dist/lib/aliases/permission/README.md +2 -2
  50. package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
  51. package/dist/lib/aliases/pnpm/README.md +2 -2
  52. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
  53. package/dist/lib/aliases/ps/README.md +2 -2
  54. package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
  55. package/dist/lib/aliases/python/python.aliases.sh +141 -0
  56. package/dist/lib/aliases/rsync/README.md +2 -2
  57. package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
  58. package/dist/lib/aliases/rust/README.md +165 -44
  59. package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
  60. package/dist/lib/aliases/subversion/README.md +2 -2
  61. package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
  62. package/dist/lib/aliases/sudo/README.md +2 -2
  63. package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
  64. package/dist/lib/aliases/tmux/README.md +2 -2
  65. package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
  66. package/dist/lib/aliases/update/README.md +2 -2
  67. package/dist/lib/aliases/update/update.aliases.sh +307 -66
  68. package/dist/lib/aliases/uuid/README.md +2 -2
  69. package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
  70. package/dist/lib/aliases/wget/README.md +2 -2
  71. package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
  72. package/dist/lib/aliases.sh +2 -2
  73. package/dist/lib/configurations/README.md +2 -2
  74. package/dist/lib/configurations/bash/bashrc +163 -35
  75. package/dist/lib/configurations/curl/curlrc +3 -6
  76. package/dist/lib/configurations/default/color.sh +3 -3
  77. package/dist/lib/configurations/default/constants.sh +4 -4
  78. package/dist/lib/configurations/default/editor.sh +3 -3
  79. package/dist/lib/configurations/default/prompt.sh +20 -11
  80. package/dist/lib/configurations/input/inputrc +3 -3
  81. package/dist/lib/configurations/nano/nanorc +3 -3
  82. package/dist/lib/configurations/profile/profile +3 -3
  83. package/dist/lib/configurations/prompt/prompt.sh +81 -0
  84. package/dist/lib/configurations/tmux/default +3 -3
  85. package/dist/lib/configurations/tmux/display +3 -3
  86. package/dist/lib/configurations/tmux/linux +3 -3
  87. package/dist/lib/configurations/tmux/navigation +3 -3
  88. package/dist/lib/configurations/tmux/panes +3 -3
  89. package/dist/lib/configurations/tmux/theme +4 -4
  90. package/dist/lib/configurations/tmux/tmux +3 -3
  91. package/dist/lib/configurations/vim/vimrc +191 -71
  92. package/dist/lib/configurations/wget/wgetrc +3 -3
  93. package/dist/lib/configurations/zsh/zshrc +3 -4
  94. package/dist/lib/configurations.sh +19 -7
  95. package/dist/lib/functions/README.md +68 -54
  96. package/dist/lib/functions/apihealth.sh +277 -0
  97. package/dist/lib/functions/apilatency.sh +157 -0
  98. package/dist/lib/functions/apiload.sh +165 -0
  99. package/dist/lib/functions/backup.sh +143 -0
  100. package/dist/lib/functions/cdls.sh +52 -6
  101. package/dist/lib/functions/curlheader.sh +66 -10
  102. package/dist/lib/functions/curlstatus.sh +64 -7
  103. package/dist/lib/functions/curltime.sh +56 -14
  104. package/dist/lib/functions/encode64.sh +87 -7
  105. package/dist/lib/functions/environment.sh +65 -25
  106. package/dist/lib/functions/extract.sh +79 -27
  107. package/dist/lib/functions/freespace.sh +55 -9
  108. package/dist/lib/functions/genpwd.sh +93 -29
  109. package/dist/lib/functions/goto.sh +59 -8
  110. package/dist/lib/functions/hexdump.sh +96 -0
  111. package/dist/lib/functions/hiddenfiles.sh +77 -0
  112. package/dist/lib/functions/hostinfo.sh +92 -21
  113. package/dist/lib/functions/hstats.sh +69 -5
  114. package/dist/lib/functions/httpdebug.sh +109 -5
  115. package/dist/lib/functions/kebabcase.sh +61 -0
  116. package/dist/lib/functions/keygen.sh +188 -25
  117. package/dist/lib/functions/last.sh +106 -5
  118. package/dist/lib/functions/logout.sh +114 -6
  119. package/dist/lib/functions/lowercase.sh +49 -17
  120. package/dist/lib/functions/matrix.sh +205 -30
  121. package/dist/lib/functions/mount_read_only.sh +3 -3
  122. package/dist/lib/functions/myproc.sh +3 -3
  123. package/dist/lib/functions/prependpath.sh +3 -3
  124. package/dist/lib/functions/ql.sh +3 -3
  125. package/dist/lib/functions/rd.sh +3 -3
  126. package/dist/lib/functions/remove_disk.sh +3 -3
  127. package/dist/lib/functions/ren.sh +68 -8
  128. package/dist/lib/functions/sentencecase.sh +63 -0
  129. package/dist/lib/functions/showhiddenfiles.sh +3 -3
  130. package/dist/lib/functions/size.sh +6 -5
  131. package/dist/lib/functions/snakecase.sh +61 -0
  132. package/dist/lib/functions/stopwatch.sh +3 -3
  133. package/dist/lib/functions/sysinfo.sh +145 -0
  134. package/dist/lib/functions/titlecase.sh +65 -0
  135. package/dist/lib/functions/uppercase.sh +51 -19
  136. package/dist/lib/functions/view-source.sh +3 -3
  137. package/dist/lib/functions/vscode.sh +3 -3
  138. package/dist/lib/functions/whoisport.sh +3 -3
  139. package/dist/lib/functions/zipf.sh +3 -3
  140. package/dist/lib/functions.sh +21 -7
  141. package/dist/lib/history.sh +36 -88
  142. package/dist/lib/paths/README.md +52 -0
  143. package/dist/lib/paths/custom.paths.sh +40 -0
  144. package/dist/lib/paths/default.paths.sh +37 -0
  145. package/dist/lib/paths.sh +27 -14
  146. package/dist/scripts/backup.sh +3 -3
  147. package/dist/scripts/banner.sh +3 -3
  148. package/dist/scripts/build.sh +3 -3
  149. package/dist/scripts/clean.sh +3 -3
  150. package/dist/scripts/compile.sh +3 -3
  151. package/dist/scripts/copy.sh +3 -3
  152. package/dist/scripts/dotfiles.sh +3 -3
  153. package/dist/scripts/download.sh +3 -3
  154. package/dist/scripts/help.sh +3 -3
  155. package/dist/scripts/ssh.sh +3 -3
  156. package/dist/scripts/unpack.sh +3 -3
  157. package/package.json +10 -10
  158. package/dist/lib/aliases/jekyll/README.md +0 -41
  159. package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
  160. package/dist/lib/functions/filehead.sh +0 -4
  161. package/dist/lib/functions/hidehiddenfiles.sh +0 -14
  162. package/dist/lib/paths/ant/ant.paths.sh +0 -15
  163. package/dist/lib/paths/default/default.paths.sh +0 -19
  164. package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
  165. package/dist/lib/paths/java/java.paths.sh +0 -19
  166. package/dist/lib/paths/maven/maven.paths.sh +0 -18
  167. package/dist/lib/paths/node/node.paths.sh +0 -15
  168. package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
  169. package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
  170. package/dist/lib/paths/python/python.paths.sh +0 -36
  171. package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
  172. package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
@@ -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="261"
4
+ width="66"
7
5
  align="right"
8
6
  />
9
7
 
10
- <!-- markdownlint-enable MD033 MD041 -->
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
- # Dotfiles aliases
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="261"
4
+ width="66"
7
5
  align="right"
8
6
  />
9
7
 
10
- <!-- markdownlint-enable MD033 MD041 -->
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
- - [Archives](archives/README.md) - Compress and extract files and
19
- directories in various formats on a Unix-based system.
20
- - [Cd](cd/README.md) - Navigate the file system.
21
- - [Chmod](chmod/README.md) - Change the permissions of files and
22
- directories.
23
- - [Clear](clear/README.md) - Clear the terminal screen.
24
- - [Configuration](configuration/README.md) - Configure the dotfiles.
25
- - [Default](default/README.md) - Manage the default shell.
26
- - [Dig](dig/README.md) - Query DNS name servers.
27
- - [Disk Usage](disk-usage/README.md) - Display the disk usage of files
28
- and directories.
29
- - [Editor](editor/README.md) - Manage the default text editor.
30
- - [Find](find/README.md) - Search for files and directories.
31
- - [gCloud](gcloud/README.md) - Manage the Google Cloud SDK.
32
- - [Git](git/README.md) - Manage the Git version control system.
33
- - [GNU](gnu/README.md) - Manage the GNU core utilities.
34
- - [Heroku](heroku/README.md) - Manage the Heroku CLI.
35
- - [Interactive](interactive/README.md) - Manage the interactive shell.
36
- - [Jekyll](jekyll/README.md) - Manage the Jekyll static site generator.
37
- - [List](list/README.md) - List files and directories.
38
- - [macOS](macos/README.md) - Manage the macOS operating system.
39
- - [make](make/README.md) - Manage the GNU make utility.
40
- - [mkdir](mkdir/README.md) - Create directories.
41
- - [npm](npm/README.md) - Manage the Node.js package manager.
42
- - [permission](permission/README.md) - Manage the file permissions.
43
- - [pnpm](pnpm/README.md) - Manage the pnpm package manager.
44
- - [ps](ps/README.md) - Manage the process status.
45
- - [rsync](rsync/README.md) - Manage the rsync file transfer utility.
46
- - [rust](rust/README.md) - Manage the Rust programming language.
47
- - [subversion](subversion/README.md) - Manage the Subversion version
48
- control system.
49
- - [sudo](sudo/README.md) - Manage the superuser.
50
- - [tmux](tmux/README.md) - Manage the tmux terminal multiplexer.
51
- - [update](update/README.md) - Help users update the dotfiles.
52
- - [uuid](uuid/README.md) - Help users generate UUIDs.
53
- - [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-->
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="261"
5
+ width="66"
7
6
  align="right"
8
7
  />
9
-
10
8
  <!-- markdownlint-enable MD033 MD041 -->
11
9
 
12
- # Dotfiles (v0.2.468)
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
- This code provides a set of command aliases to help users compress and
21
- extract files and directories in various formats on a Unix-based system.
110
+ - `clz4` - Compress with lz4
111
+ - `xlz4` - Extract lz4
22
112
 
23
- The following compression formats are supported:
113
+ ### Features
24
114
 
25
- * 7z
26
- * bzip2
27
- * gzip
28
- * jar
29
- * lz4
30
- * lzma
31
- * lzo
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
- These aliases enable users to compress or extract files and directories
39
- quickly by using simple commands. Here are examples for each operation:
123
+ ### Usage Examples
40
124
 
41
- * To compress a directory to a 7z file: `compress_7z <archive_name.7z> <directory>`
42
- * To extract from a 7z file: `extract_7z <archive_name.7z>`
125
+ ```bash
126
+ # Extract any supported archive
127
+ extract archive.tar.gz
43
128
 
44
- Similar commands apply for all supported formats, ensuring ease of use.
129
+ # Create a tar.gz archive
130
+ ctgz output.tar.gz folder/
45
131
 
46
- **New Features:**
132
+ # List contents of a zip file
133
+ lzip archive.zip
47
134
 
48
- * Defensive coding practices ensure aliases are only defined if the required
49
- archive programs are present, improving the script's robustness.
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
- Please note that some of the compression formats may require additional
54
- software to be installed on your system.
138
+ # Create a 7z archive with maximum compression
139
+ a7z a -mx=9 archive.7z files/
55
140
 
56
- Enjoy the convenience of quickly compressing and extracting files and
57
- directories with these command aliases!
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
- # Handle large files by piping outputs
108
- function compress_large_file() {
109
- local archive_type="$1"
110
- case "${archive_type}" in
111
- 7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
112
- alias "compress_${archive_type}" "${archive_type} -cvf -"
113
- ;;
114
- *)
115
- echo "Unsupported archive type: ${archive_type}"
116
- return 1
117
- ;;
118
- esac
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
- function extract_large_file() {
122
- local archive_type="$1"
123
- case "${archive_type}" in
124
- 7z|tar|jar|xz|zip|zstd|gzip|bzip2|lzop|lz4|pigz)
125
- alias "extract_${archive_type}" "${archive_type} -xvf -"
126
- ;;
127
- *)
128
- echo "Unsupported archive type: ${archive_type}"
129
- return 1
130
- ;;
131
- esac
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
- function set_alias() {
137
- local program="$1"
138
- local flags="$2"
139
- # shellcheck disable=SC2250,SC2139
140
- alias "compress_$program"="${program} ${flags}"
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'