@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,63 +1,146 @@
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
- Simply designed to fit your shell life 🐚
12
+ Seamlessly enhance your shell environment 🐚
11
13
 
12
14
  ![Dotfiles banner][banner]
13
15
 
14
- ## 🅲🅳 🅰🅻🅸🅰🆂🅴🆂
15
-
16
- These aliases provide shortcuts for the cd command to help you quickly
17
- navigate your file system. To use them, add the following lines to your
18
- .bashrc or .bash_profile file.
19
-
20
- ### Navigation
21
-
22
- - `-`: Go to previous directory.
23
- - `.., ..., ...., .....`: Go up one, two, three, or four directories,
24
- respectively.
25
- - `~`: Go to home directory.
26
-
27
- ### Directories
28
-
29
- - `app`: Go to the Applications directory and list its contents.
30
- - `cod`: Go to the Code directory and list its contents.
31
- - `des`: Go to the Desktop directory and list its contents.
32
- - `doc`: Go to the Documents directory and list its contents.
33
- - `dot`: Go to the .dotfiles directory and list its contents.
34
- - `dow`: Go to the Downloads directory and list its contents.
35
- - `hom`: Go to the home directory and list its contents.
36
- - `mus`: Go to the Music directory and list its contents.
37
- - `pic`: Go to the Pictures directory and list its contents.
38
- - `vid`: Go to the Videos directory and list its contents.
39
-
40
- ### System Directories
41
-
42
- - `etc`: Go to the etc directory and list its contents.
43
- - `var`: Go to the var directory and list its contents.
44
- - `tmp`: Go to the tmp directory and list its contents.
45
-
46
- ### Frequently used directories
47
-
48
- - `app`: Shortcut to go to the Applications directory and list its
49
- contents.
50
- - `cod`: Shortcut to go to the Code directory and list its contents.
51
- - `des`: Shortcut to go to the Desktop directory and list its contents.
52
- - `doc`: Shortcut to go to the Documents directory and list its
53
- contents.
54
- - `dot`: Shortcut to go to the .dotfiles directory and list its
55
- contents.
56
- - `dow`: Shortcut to go to the Downloads directory and list its
57
- contents.
58
- - `hom`: Shortcut to go to the home directory and list its contents.
59
- - `mus`: Shortcut to go to the Music directory and list its contents.
60
- - `pic`: Shortcut to go to the Pictures directory and list its contents.
61
- - `vid`: Shortcut to go to the Videos directory and list its contents.
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:
108
+
109
+ ```bash
110
+ # Navigate to the Code directory
111
+ cod
112
+
113
+ # Ascend two levels in the directory tree
114
+ ...
115
+
116
+ # Access the Documents directory
117
+ doc
118
+
119
+ # Navigate to the system configuration directory
120
+ etc
121
+ ```
122
+
123
+ ---
124
+
125
+ ## 📚 Documentation
126
+
127
+ For advanced configuration and detailed usage examples, visit the
128
+ [official documentation](https://dotfiles.io).
129
+
130
+ ---
131
+
132
+ ## 🛡️ License
133
+
134
+ This project is licensed under the
135
+ [MIT License](https://opensource.org/licenses/MIT).
136
+
137
+ ---
138
+
139
+ ## 👨‍💻 Author
140
+
141
+ Created with ♥ by [Sebastien Rousseau](https://sebastienrousseau.com)
142
+
143
+ - Website: [https://sebastienrousseau.com](https://sebastienrousseau.com)
144
+ - GitHub: [https://github.com/sebastienrousseau](https://github.com/sebastienrousseau)
62
145
 
63
146
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg
@@ -1,39 +1,51 @@
1
1
  #!/usr/bin/env bash
2
- # Author: Sebastien Rousseau
3
- # Copyright (c) 2015-2023. All rights reserved
4
- # Description: Sets aliases for the `cd` command.
2
+ ################################################################################
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 - Change directory aliases
4
+ # Made with by Sebastien Rousseau
5
5
  # License: MIT
6
- # Script: cd.aliases.sh
7
- # Version: 0.2.466
8
- # Website: https://dotfiles.io
6
+ # This script provides aliases to quickly change directories.
7
+ ################################################################################
9
8
 
10
- # 🅲🅳 🅰🅻🅸🅰🆂🅴🆂
9
+ #-----------------------------------------------------------------------------
10
+ # Frequently Used Directory Variables
11
+ #-----------------------------------------------------------------------------
12
+ HOME_DIR="${HOME}"
13
+ APP_DIR="${HOME}/Applications"
14
+ CODE_DIR="${HOME}/Code"
15
+ DESK_DIR="${HOME}/Desktop"
16
+ DOCS_DIR="${HOME}/Documents"
17
+ DOTF_DIR="${HOME}/.dotfiles"
18
+ DOWN_DIR="${HOME}/Downloads"
19
+ MUSIC_DIR="${HOME}/Music"
20
+ PICS_DIR="${HOME}/Pictures"
21
+ VIDS_DIR="${HOME}/Videos"
11
22
 
12
- # Shortcut to go to previous directory
13
- alias -- -='cd -'
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
14
31
 
15
- # Shortcuts to go to parent directories
16
- alias .....='cd ../../../../'
17
- alias ....='cd ../../'
18
- alias ...='cd ../'
19
- alias ..='cd ..'
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
20
45
 
21
- # Shortcuts to go to specific directories
22
- alias '~'='cd ~'
23
-
24
- # Shortcuts to go to frequently used directories
25
- alias app='cd "${HOME}/Applications"; ls' # app: Shortcut to go to the Applications directory and list its contents.
26
- alias cod='cd "${HOME}/Code"; ls' # cod: Shortcut to go to the Code directory and list its contents.
27
- alias des='cd "${HOME}/Desktop"; ls' # des: Shortcut to go to the Desktop directory and list its contents.
28
- alias doc='cd "${HOME}/Documents"; ls' # doc: Shortcut to go to the Documents directory and list its contents.
29
- alias dot='cd "${HOME}/.dotfiles"; ls' # dot: Shortcut to go to the .dotfiles directory and list its contents.
30
- alias dow='cd "${HOME}/Downloads"; ls' # dow: Shortcut to go to the Downloads directory and list its contents.
31
- alias hom='cd "${HOME}"; ls' # hom: Shortcut to go to the home directory and list its contents.
32
- alias mus='cd "${HOME}/Music"; ls' # mus: Shortcut to go to the Music directory and list its contents.
33
- alias pic='cd "${HOME}/Pictures"; ls' # pic: Shortcut to go to the Pictures directory and list its contents.
34
- alias vid='cd "${HOME}/Videos"; ls' # vid: Shortcut to go to the Videos directory and list its contents.
35
-
36
- # Shortcuts to navigate to system directories
37
- alias etc='cd /etc; ls' # etc: Shortcut to go to the etc directory and list its contents.
38
- alias var='cd /var; ls' # var: Shortcut to go to the var directory and list its contents.
39
- alias tmp='cd /tmp; ls' # tmp: Shortcut to go to the tmp directory and list its contents.
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,105 +1,160 @@
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
- ## 🅲🅷🅼🅾🅳 🅰🅻🅸🅰🆂🅴🆂
15
-
16
- These aliases provide shortcuts for the chmod command to help you
17
- quickly change the permissions of files and directories. To use them,
18
- add the following lines to your .bashrc or .bash_profile file.
19
-
20
- ### Change permissions
21
-
22
- - `000`: (chmod a-rwx) sets permissions so that, (U)ser / owner can't
23
- read, can't write and can't execute. (G)roup can't read, can't write
24
- and can't execute. (O)thers can't read, can't write and can't execute.
25
- - `400`: (chmod a-rw) sets permissions so that, (U)ser / owner can't
26
- read, can't write and can execute. (G)roup can't read, can't write and
27
- can execute. (O)thers can't read, can't write and can execute.
28
- - `444`: (chmod a-r) sets permissions so that, (U)ser / owner can't
29
- read, can't write and can execute. (G)roup can't read, can't write and
30
- can execute. (O)thers can't read, can't write and can execute.
31
- - `600`: (chmod a+rwx,u-x,g-rwx,o-rwx) sets permissions so that, (U)ser
32
- / owner can read, can write and can't execute. (G)roup can't read,
33
- can't write and can't execute. (O)thers can't read, can't write and
34
- can't execute.
35
- - `644`: (chmod a+rwx,u-x,g-wx,o-wx) sets permissions so that, (U)ser /
36
- owner can read, can write and can't execute. (G)roup can read, can't
37
- write and can't execute. (O)thers can read, can't write and can't
38
- execute.
39
- - `666`: (chmod a+rwx,u-x,g-x,o-x) sets permissions so that, (U)ser /
40
- owner can read, can write and can't execute. (G)roup can read, can
41
- write and can't execute. (O)thers can read, can write and can't
42
- execute.
43
- - `755`: (chmod a+rwx,g-w,o-w) sets permissions so that, (U)ser / owner
44
- can read, can write and can execute. (G)roup can read, can't write
45
- and can execute. (O)thers can read, can't write and can execute.
46
- - `764`: (chmod a+rwx,g-x,o-wx) sets permissions so that, (U)ser /
47
- owner can read, can write and can execute. (G)roup can read, can write
48
- and can't execute. (O)thers can read, can't write and can't execute.
49
- - `777`: (chmod a+rwx) sets permissions so that, (U)ser / owner can
50
- read, can write and can execute. (G)roup can read, can write and can
51
- execute. (O)thers can read, can write and can execute.
52
-
53
- ### Change ownership
54
-
55
- - `chgrp`: Change group ownership of files or directories.
56
- - `chgrpr`: Change group ownership of files or directories recursively.
57
- - `chgrpu`: Change group ownership of files or directories recursively
58
- to the current user.
59
- - `chmod`: Change file mode bits.
60
- - `chmodr`: Change file mode bits recursively.
61
- - `chmodu`: Change file mode bits recursively to the current user.
62
- - `chmox`: Make a file executable.
63
- - `chown`: Change file owner and group.
64
- - `chownr`: Change file owner and group recursively.
65
- - `chownu`: Change file owner and group recursively to the current user.
66
-
67
- ### Set permissions for specific file types
68
-
69
- - `755d`: Set permissions of all directories to rwxr-xr-x.
70
- - `644f`: Set permissions of all files to rw-r--r--.
71
-
72
- ### Set permissions for specific user types
73
-
74
- - `u+x`: Add execute permission for the owner of the file.
75
- - `u-x`: Remove execute permission for the owner of the file.
76
- - `u+w`: Add write permission for the owner of the file.
77
- - `u-w`: Remove write permission for the owner of the file.
78
- - `u+r`: Add read permission for the owner of the file.
79
- - `u-r`: Remove read permission for the owner of the file.
80
- - `g+x`: Add execute permission for the group owner of the file.
81
- - `g-x`: Remove execute permission for the group owner of the file.
82
- - `g+w`: Add write permission for the group owner of the file.
83
- - `g-w`: Remove write permission for the group owner of the file.
84
- - `g+r`: Add read permission for the group owner of the file.
85
- - `g-r`: Remove read permission for the group owner of the file.
86
- - `o+x`: Add execute permission for others.
87
- - `o-x`: Remove execute permission for others.
88
- - `o+w`: Add write permission for others.
89
- - `o-w`: Remove write permission for others.
90
- - `o+r`: Add read permission for others.
91
- - `o-r`: Remove read permission for others.
92
-
93
- ### Set permissions based on octal notation
94
-
95
- - `000`: Set permissions to ----------
96
- - `400`: Set permissions to r--------
97
- - `444`: Set permissions to r--r--r--
98
- - `600`: Set permissions to rw-------
99
- - `644`: Set permissions to rw-r--r--.
100
- - `664`: Set permissions to rw-rw-r--.
101
- - `755`: Set permissions to rwxr-xr-x.
102
- - `775`: Set permissions to rwxrwxr-x.
103
- - `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)
104
159
 
105
160
  [banner]: https://kura.pro/dotfiles/v2/images/titles/title-dotfiles.svg