@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,65 +1,146 @@
1
1
  <!-- markdownlint-disable MD033 MD041 MD043 -->
2
-
3
2
  <img
4
3
  src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
5
- alt="dotfiles logo"
6
- width="261"
4
+ alt="Dotfiles logo"
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
- Designed to seamlessly enhance your shell environment 🐚
12
+ Seamlessly enhance your shell environment 🐚
15
13
 
16
14
  ![Dotfiles banner][banner]
17
15
 
18
- ## 🅲🅳 🅰🅻🅸🅰🆂🅴🆂
16
+ ---
17
+
18
+ ## 🚀 Introduction
19
+
20
+ This repository includes a robust set of shell aliases and scripts designed to
21
+ streamline your command-line experience. The `cd` aliases script simplifies
22
+ filesystem navigation with:
23
+
24
+ - **Dynamic error handling**
25
+ - **Automatic directory listing**
26
+ - **Customizable paths for frequent directories**
27
+
28
+ ---
29
+
30
+ ## 🛠️ Features
31
+
32
+ ### 🌟 Navigation Shortcuts
33
+
34
+ | Alias | Description |
35
+ |------------------|--------------------------------------|
36
+ | `-` | Switch to the previous directory |
37
+ | `..`, `...` | Ascend one or two levels in the tree |
38
+ | `....`, `.....` | Ascend three or four levels |
39
+ | `hom` | Navigate to the home directory (`~`) |
40
+
41
+ ---
42
+
43
+ ### 📂 Custom Directory Access
44
+
45
+ Quickly access frequently used directories with predefined shortcuts. You can
46
+ customize these paths to fit your needs:
47
+
48
+ | Alias | Directory Path | Description |
49
+ |-------|--------------------------|------------------------|
50
+ | `app` | `${HOME}/Applications` | Applications directory |
51
+ | `cod` | `${HOME}/Code` | Code directory |
52
+ | `des` | `${HOME}/Desktop` | Desktop directory |
53
+ | `doc` | `${HOME}/Documents` | Documents directory |
54
+ | `dot` | `${HOME}/.dotfiles` | Dotfiles directory |
55
+ | `dow` | `${HOME}/Downloads` | Downloads directory |
56
+ | `mus` | `${HOME}/Music` | Music directory |
57
+ | `pic` | `${HOME}/Pictures` | Pictures directory |
58
+ | `vid` | `${HOME}/Videos` | Videos directory |
59
+
60
+ ---
61
+
62
+ ### 🔧 System Directories
63
+
64
+ Effortlessly navigate to critical system directories:
65
+
66
+ | Alias | Directory Path | Description |
67
+ |-------|----------------|--------------------------------|
68
+ | `etc` | `/etc` | System configuration directory |
69
+ | `var` | `/var` | Variable files directory |
70
+ | `tmp` | `/tmp` | Temporary files directory |
71
+
72
+ ---
73
+
74
+ ### ⚙️ Enhanced Customization
75
+
76
+ - **Dynamic Directory Paths**: Customize aliases through environment variables
77
+ - **Error Handling**: Provides clear messages for invalid directories
78
+ - **Optional Directory Listing**: Automatically lists contents after navigation
79
+ - **Tab Completion**: Supports custom tab completion for aliases
80
+
81
+ ---
82
+
83
+ ## 📦 Installation
84
+
85
+ 1. **Clone the repository**:
86
+
87
+ ```bash
88
+ git clone https://github.com/sebastienrousseau/dotfiles.git
89
+ ```
90
+
91
+ 1. **Source the script in your shell configuration**:
92
+
93
+ ```bash
94
+ echo 'source /path/to/dotfiles/cd.sh' >> ~/.bashrc
95
+ ```
96
+
97
+ 1. **Reload your shell**:
98
+
99
+ ```bash
100
+ source ~/.bashrc
101
+ ```
102
+
103
+ ---
104
+
105
+ ## 🧑‍💻 Usage
106
+
107
+ Here are some examples of how you can use the `cd` aliases:
19
108
 
20
- This set of `cd` command aliases provides an intuitive and efficient way to
21
- navigate your filesystem. Incorporating dynamic error handling, optional
22
- directory listing, and customization for an improved command-line experience.
109
+ ```bash
110
+ # Navigate to the Code directory
111
+ cod
23
112
 
24
- ### Setup
113
+ # Ascend two levels in the directory tree
114
+ ...
25
115
 
26
- To use these aliases, integrate the script into your `.bashrc` or `.bash_profile`.
116
+ # Access the Documents directory
117
+ doc
27
118
 
28
- ### Navigation Shortcuts
119
+ # Navigate to the system configuration directory
120
+ etc
121
+ ```
29
122
 
30
- * `-`: Go to the previous directory.
31
- * `..`, `...`, `....`, `.....`: Ascend one to four levels in the directory tree.
32
- * `~`: Navigate to the home directory.
123
+ ---
33
124
 
34
- ### Custom Directory Access
125
+ ## 📚 Documentation
35
126
 
36
- Leverage aliases for quick access to frequently visited directories:
127
+ For advanced configuration and detailed usage examples, visit the
128
+ [official documentation](https://dotfiles.io).
37
129
 
38
- * `app`: Applications directory
39
- * `cod`: Code directory
40
- * `des`: Desktop directory
41
- * `doc`: Documents directory
42
- * `dot`: Dotfiles directory
43
- * `dow`: Downloads directory
44
- * `mus`: Music directory
45
- * `pic`: Pictures directory
46
- * `vid`: Videos directory
130
+ ---
47
131
 
48
- ### System Directories
132
+ ## 🛡️ License
49
133
 
50
- Quickly access system directories:
134
+ This project is licensed under the
135
+ [MIT License](https://opensource.org/licenses/MIT).
51
136
 
52
- * `etc`: System configuration (`/etc`)
53
- * `var`: Variable files (`/var`)
54
- * `tmp`: Temporary files (`/tmp`)
137
+ ---
55
138
 
56
- ### Enhanced Customization
139
+ ## 👨‍💻 Author
57
140
 
58
- Customize directory paths through environment variables to suit your system's
59
- structure and preferences. Use concise aliases (`app`, `cod`, `des`, etc.) for
60
- efficient navigation.
141
+ Created with by [Sebastien Rousseau](https://sebastienrousseau.com)
61
142
 
62
- For a detailed guide on configuring and using these aliases, plus additional
63
- information on each command, visit our [documentation](https://dotfiles.io).
143
+ - Website: [https://sebastienrousseau.com](https://sebastienrousseau.com)
144
+ - GitHub: [https://github.com/sebastienrousseau](https://github.com/sebastienrousseau)
64
145
 
65
146
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
@@ -1,56 +1,15 @@
1
1
  #!/usr/bin/env bash
2
-
3
2
  ################################################################################
4
- # 🅳🅾🆃🅵🅸🅻🅴🆂
5
- # Author: Sebastien Rousseau
6
- # Copyright: 2015-2024. All rights reserved
7
- # Description: Enhanced `cd` command aliases with checks, functions, and customization.
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Change directory aliases
4
+ # Made with ♥ by Sebastien Rousseau
8
5
  # License: MIT
9
- # Script: cd.aliases.sh
10
- # Version: 0.2.468
11
- # Website: https://dotfiles.io
12
-
13
- # Usage:
14
- # Customize directory paths via variables and use aliases to navigate.
15
- # Example: `cod` to go to the Code directory, `..` to go up one directory.
16
-
17
- # Configuration
18
- DOC_DIR="${HOME}/Documents"
19
- VID_DIR="${HOME}/Videos"
20
- # Add more configurable paths here
21
-
22
- # Check if directory exists and change to it, listing contents optionally
23
- change_directory() {
24
- local path="$1"
25
-
26
- if [[ -d "${path}" ]]; then
27
- cd "${path}" || exit # Exit if cd fails
28
- else
29
- echo "Directory '${path}' does not exist."
30
- fi
31
- }
32
-
33
- # Parent Directory Shortcuts
34
- alias -- -='cd -'
35
- alias ..='cd ..'
36
- alias ...='cd ../..'
37
- alias ....='cd ../../..'
38
- alias .....='cd ../../../..'
39
-
40
- # Home Directory Shortcut
41
- alias hom='change_directory "${HOME}" true'
42
-
43
- # Frequently Used Directories
44
- alias doc='change_directory "$DOC_DIR" true' # Documents
45
- alias vid='change_directory "$VID_DIR" true' # Videos
46
- # Define more aliases like the above for other directories
47
-
48
- # System Directories (consider checks for system-specific paths)
49
- alias etc='change_directory "/etc" true'
50
- alias var='change_directory "/var" true'
51
- alias tmp='change_directory "/tmp" true'
6
+ # This script provides aliases to quickly change directories.
7
+ ################################################################################
52
8
 
53
- # Frequently Used Directories with Improved Error Handling and Customization
9
+ #-----------------------------------------------------------------------------
10
+ # Frequently Used Directory Variables
11
+ #-----------------------------------------------------------------------------
12
+ HOME_DIR="${HOME}"
54
13
  APP_DIR="${HOME}/Applications"
55
14
  CODE_DIR="${HOME}/Code"
56
15
  DESK_DIR="${HOME}/Desktop"
@@ -61,13 +20,32 @@ MUSIC_DIR="${HOME}/Music"
61
20
  PICS_DIR="${HOME}/Pictures"
62
21
  VIDS_DIR="${HOME}/Videos"
63
22
 
64
- # Define functions for each alias with checks and optional ls
65
- alias app='change_directory "$APP_DIR" true' # Applications
66
- alias cod='change_directory "$CODE_DIR" true' # Code
67
- alias des='change_directory "$DESK_DIR" true' # Desktop
68
- alias doc='change_directory "$DOCS_DIR" true' # Documents
69
- alias dot='change_directory "$DOTF_DIR" true' # Dotfiles
70
- alias dow='change_directory "$DOWN_DIR" true' # Downloads
71
- alias mus='change_directory "$MUSIC_DIR" true' # Music
72
- alias pic='change_directory "$PICS_DIR" true' # Pictures
73
- alias vid='change_directory "$VIDS_DIR" true' # Videos
23
+ #-----------------------------------------------------------------------------
24
+ # Parent Directory Shortcuts
25
+ #-----------------------------------------------------------------------------
26
+ alias -- -='cd -' # Go to the previous directory
27
+ alias ..='cd ..' # Go up one level
28
+ alias ...='cd ../..' # Go up two levels
29
+ alias ....='cd ../../..' # Go up three levels
30
+ alias .....='cd ../../../..' # Go up four levels
31
+
32
+ #-----------------------------------------------------------------------------
33
+ # Home and Frequently Used Directories
34
+ #-----------------------------------------------------------------------------
35
+ alias app="cd ${APP_DIR} && ls -lh --group-directories-first" # Applications
36
+ alias cod="cd ${CODE_DIR} && ls -lh --group-directories-first" # Code
37
+ alias des="cd ${DESK_DIR} && ls -lh --group-directories-first" # Desktop
38
+ alias doc="cd ${DOCS_DIR} && ls -lh --group-directories-first" # Documents
39
+ alias dot="cd ${DOTF_DIR} && ls -lh --group-directories-first" # Dotfiles
40
+ alias dow="cd ${DOWN_DIR} && ls -lh --group-directories-first" # Downloads
41
+ alias hom="cd ${HOME_DIR} && ls -lh --group-directories-first" # Home Directory
42
+ alias mus="cd ${MUSIC_DIR} && ls -lh --group-directories-first" # Music
43
+ alias pic="cd ${PICS_DIR} && ls -lh --group-directories-first" # Pictures
44
+ alias vid="cd ${VIDS_DIR} && ls -lh --group-directories-first" # Videos
45
+
46
+ #-----------------------------------------------------------------------------
47
+ # System Directories
48
+ #-----------------------------------------------------------------------------
49
+ [[ -d "/etc" ]] && alias etc="cd /etc && ls -lh --group-directories-first" # System configuration
50
+ [[ -d "/var" ]] && alias var="cd /var && ls -lh --group-directories-first" # Variable data
51
+ [[ -d "/tmp" ]] && alias tmp="cd /tmp && ls -lh --group-directories-first" # Temporary files
@@ -1,109 +1,160 @@
1
1
  <!-- markdownlint-disable MD033 MD041 MD043 -->
2
-
3
2
  <img
4
3
  src="https://kura.pro/dotfiles/v2/images/logos/dotfiles.svg"
5
- alt="dotfiles logo"
6
- width="261"
4
+ alt="Dotfiles logo"
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
- ## 🅲🅷🅼🅾🅳 🅰🅻🅸🅰🆂🅴🆂
19
-
20
- These aliases provide shortcuts for the chmod command to help you
21
- quickly change the permissions of files and directories. To use them,
22
- add the following lines to your .bashrc or .bash_profile file.
23
-
24
- ### Change permissions
25
-
26
- - `000`: (chmod a-rwx) sets permissions so that, (U)ser / owner can't
27
- read, can't write and can't execute. (G)roup can't read, can't write
28
- and can't execute. (O)thers can't read, can't write and can't execute.
29
- - `400`: (chmod a-rw) sets permissions so that, (U)ser / owner can't
30
- read, can't write and can execute. (G)roup can't read, can't write and
31
- can execute. (O)thers can't read, can't write and can execute.
32
- - `444`: (chmod a-r) sets permissions so that, (U)ser / owner can't
33
- read, can't write and can execute. (G)roup can't read, can't write and
34
- can execute. (O)thers can't read, can't write and can execute.
35
- - `600`: (chmod a+rwx,u-x,g-rwx,o-rwx) sets permissions so that, (U)ser
36
- / owner can read, can write and can't execute. (G)roup can't read,
37
- can't write and can't execute. (O)thers can't read, can't write and
38
- can't execute.
39
- - `644`: (chmod a+rwx,u-x,g-wx,o-wx) sets permissions so that, (U)ser /
40
- owner can read, can write and can't execute. (G)roup can read, can't
41
- write and can't execute. (O)thers can read, can't write and can't
42
- execute.
43
- - `666`: (chmod a+rwx,u-x,g-x,o-x) sets permissions so that, (U)ser /
44
- owner can read, can write and can't execute. (G)roup can read, can
45
- write and can't execute. (O)thers can read, can write and can't
46
- execute.
47
- - `755`: (chmod a+rwx,g-w,o-w) sets permissions so that, (U)ser / owner
48
- can read, can write and can execute. (G)roup can read, can't write
49
- and can execute. (O)thers can read, can't write and can execute.
50
- - `764`: (chmod a+rwx,g-x,o-wx) sets permissions so that, (U)ser /
51
- owner can read, can write and can execute. (G)roup can read, can write
52
- and can't execute. (O)thers can read, can't write and can't execute.
53
- - `777`: (chmod a+rwx) sets permissions so that, (U)ser / owner can
54
- read, can write and can execute. (G)roup can read, can write and can
55
- execute. (O)thers can read, can write and can execute.
56
-
57
- ### Change ownership
58
-
59
- - `chgrp`: Change group ownership of files or directories.
60
- - `chgrpr`: Change group ownership of files or directories recursively.
61
- - `chgrpu`: Change group ownership of files or directories recursively
62
- to the current user.
63
- - `chmod`: Change file mode bits.
64
- - `chmodr`: Change file mode bits recursively.
65
- - `chmodu`: Change file mode bits recursively to the current user.
66
- - `chmox`: Make a file executable.
67
- - `chown`: Change file owner and group.
68
- - `chownr`: Change file owner and group recursively.
69
- - `chownu`: Change file owner and group recursively to the current user.
70
-
71
- ### Set permissions for specific file types
72
-
73
- - `755d`: Set permissions of all directories to rwxr-xr-x.
74
- - `644f`: Set permissions of all files to rw-r--r--.
75
-
76
- ### Set permissions for specific user types
77
-
78
- - `u+x`: Add execute permission for the owner of the file.
79
- - `u-x`: Remove execute permission for the owner of the file.
80
- - `u+w`: Add write permission for the owner of the file.
81
- - `u-w`: Remove write permission for the owner of the file.
82
- - `u+r`: Add read permission for the owner of the file.
83
- - `u-r`: Remove read permission for the owner of the file.
84
- - `g+x`: Add execute permission for the group owner of the file.
85
- - `g-x`: Remove execute permission for the group owner of the file.
86
- - `g+w`: Add write permission for the group owner of the file.
87
- - `g-w`: Remove write permission for the group owner of the file.
88
- - `g+r`: Add read permission for the group owner of the file.
89
- - `g-r`: Remove read permission for the group owner of the file.
90
- - `o+x`: Add execute permission for others.
91
- - `o-x`: Remove execute permission for others.
92
- - `o+w`: Add write permission for others.
93
- - `o-w`: Remove write permission for others.
94
- - `o+r`: Add read permission for others.
95
- - `o-r`: Remove read permission for others.
96
-
97
- ### Set permissions based on octal notation
98
-
99
- - `000`: Set permissions to ----------
100
- - `400`: Set permissions to r--------
101
- - `444`: Set permissions to r--r--r--
102
- - `600`: Set permissions to rw-------
103
- - `644`: Set permissions to rw-r--r--.
104
- - `664`: Set permissions to rw-rw-r--.
105
- - `755`: Set permissions to rwxr-xr-x.
106
- - `775`: Set permissions to rwxrwxr-x.
107
- - `777`: Set permissions to rwxrwxrwx.
16
+ ---
17
+
18
+ ## 🚀 Introduction
19
+
20
+ This script provides an enhanced set of shortcuts and functions for the
21
+ `chmod` command, making it easier to manage file and directory permissions.
22
+ With features like input validation, recursive confirmation, and user-friendly
23
+ aliases, you can efficiently customize permissions for files and directories.
24
+
25
+ ---
26
+
27
+ ## 🛠️ Features
28
+
29
+ ### 🌟 Permission Aliases
30
+
31
+ Quickly apply common permission settings with pre-defined aliases:
32
+
33
+ | Alias | Permissions | Description |
34
+ |--------------|------------------|-------------------------------------------|
35
+ | `chmod_000` | `----------` | No permissions for anyone |
36
+ | `chmod_400` | `r--------` | Read-only for the owner |
37
+ | `chmod_444` | `r--r--r--` | Read-only for everyone |
38
+ | `chmod_600` | `rw-------` | Read/write for the owner |
39
+ | `chmod_644` | `rw-r--r--` | Read/write for the owner, read-only other |
40
+ | `chmod_666` | `rw-rw-rw-` | Read/write for everyone |
41
+ | `chmod_755` | `rwxr-xr-x` | Full owner, read/execute for others |
42
+ | `chmod_764` | `rwxrw-r--` | Full owner, read/write for the group, |
43
+ | `chmod_777` | `rwxrwxrwx` | Full permissions for everyone |
44
+
45
+ ---
46
+
47
+ ### 🔧 Recursive Confirmation for Permissions
48
+
49
+ The `change_permission` function allows you to recursively apply permissions
50
+ with a confirmation prompt, displaying the number of items affected:
51
+
52
+ ```bash
53
+ change_permission 755 /path/to/directory -R
54
+ ```
55
+
56
+ ---
57
+
58
+ ### 📂 User, Group, and Others Shortcuts
59
+
60
+ Fine-tune permissions for specific user groups (owner, group, or others):
61
+
62
+ | Alias | Description |
63
+ |---------------|--------------------------------------------|
64
+ | `chmod_u+x` | Add execute permission for the owner |
65
+ | `chmod_u-x` | Remove execute permission for the owner |
66
+ | `chmod_u+w` | Add write permission for the owner |
67
+ | `chmod_u-w` | Remove write permission for the owner |
68
+ | `chmod_u+r` | Add read permission for the owner |
69
+ | `chmod_u-r` | Remove read permission for the owner |
70
+ | `chmod_g+x` | Add execute permission for the group |
71
+ | `chmod_g-x` | Remove execute permission for the group |
72
+ | `chmod_g+w` | Add write permission for the group |
73
+ | `chmod_g-w` | Remove write permission for the group |
74
+ | `chmod_g+r` | Add read permission for the group |
75
+ | `chmod_g-r` | Remove read permission for the group |
76
+ | `chmod_o+x` | Add execute permission for others |
77
+ | `chmod_o-x` | Remove execute permission for others |
78
+ | `chmod_o+w` | Add write permission for others |
79
+ | `chmod_o-w` | Remove write permission for others |
80
+ | `chmod_o+r` | Add read permission for others |
81
+ | `chmod_o-r` | Remove read permission for others |
82
+
83
+ ---
84
+
85
+ ### 📄 Custom Aliases for File Types
86
+
87
+ Set permissions for specific file types with ease:
88
+
89
+ | Alias | Description |
90
+ |--------------|----------------------------------------------------|
91
+ | `chmod_755d` | Set permissions of all directories to `rwxr-xr-x` |
92
+ | `chmod_644f` | Set permissions of all files to `rw-r--r--` |
93
+
94
+ ---
95
+
96
+ ## 📦 Installation
97
+
98
+ 1. Clone this repository:
99
+
100
+ ```bash
101
+ git clone https://github.com/sebastienrousseau/dotfiles.git
102
+ ```
103
+
104
+ 2. Source the script in your shell configuration file:
105
+
106
+ ```bash
107
+ echo 'source /path/to/dotfiles/chmod.sh' >> ~/.bashrc
108
+ ```
109
+
110
+ 3. Reload your shell:
111
+
112
+ ```bash
113
+ source ~/.bashrc
114
+ ```
115
+
116
+ ---
117
+
118
+ ## 🧑‍💻 Usage
119
+
120
+ Here are some examples of how to use the `chmod` aliases and functions:
121
+
122
+ - Apply common permissions:
123
+
124
+ ```bash
125
+ chmod_644 /path/to/file
126
+ chmod_755 /path/to/directory
127
+ ```
128
+
129
+ - Modify user, group, or others' permissions:
130
+
131
+ ```bash
132
+ chmod_u+x /path/to/script
133
+ chmod_g-w /path/to/file
134
+ chmod_o+r /path/to/file
135
+ ```
136
+
137
+ - Recursively set permissions with confirmation:
138
+
139
+ ```bash
140
+ change_permission 755 /path/to/directory -R
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 🛡️ License
146
+
147
+ This project is licensed under the
148
+ [MIT License](https://opensource.org/licenses/MIT). See the `LICENSE` file for
149
+ more information.
150
+
151
+ ---
152
+
153
+ ## 👨‍💻 Author
154
+
155
+ Created with ♥ by [Sebastien Rousseau](https://sebastienrousseau.com)
156
+
157
+ - Website: [https://sebastienrousseau.com](https://sebastienrousseau.com)
158
+ - GitHub: [https://github.com/sebastienrousseau](https://github.com/sebastienrousseau)
108
159
 
109
160
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg