aboutsummaryrefslogtreecommitdiff
path: root/bash/README.md
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2025-12-16 13:27:11 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2025-12-16 13:27:11 -0500
commit5a41da5881a11ba3fdc3890c342aa3b7eb53e0cf (patch)
tree92b7f7af29ed4a9dcc0eab33490c6225cce9b14a /bash/README.md
parent856e361d56c201cbb1b1521c8b93b747163b1376 (diff)
add initial version (incomplete)
Diffstat (limited to 'bash/README.md')
-rw-r--r--bash/README.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/bash/README.md b/bash/README.md
new file mode 100644
index 0000000..7262dbf
--- /dev/null
+++ b/bash/README.md
@@ -0,0 +1,64 @@
+# Notes for using bash as root
+
+You can copy the gentoo color script to the root user:
+
+```sh
+sudo cp ~/dotfiles/bash/dot-config/bash/gentoo-color.bash /root/.gentoo-color.bash
+sudo cp /etc/skel/.bash_profile /root/
+```
+
+and set its `bashrc` as follows:
+
+```bash
+#
+# /root/.bashrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+source "$HOME"/.gentoo-color.bash
+
+ls()
+{
+ if ((gentoo_color > 0)); then
+ command ls --color=auto "$@"
+ else
+ command ls "$@"
+ fi
+}
+
+# coreutils
+alias cp='cp -riv'
+alias la='ls -la'
+alias ll='ls -lah'
+alias l='ls -l'
+alias ls='ls -p -hN --group-directories-first'
+alias mkdir='mkdir -pv'
+alias mv='mv -iv'
+alias rm='rm -iv'
+alias ..='echo "cd .."; cd ..'
+alias ...='echo "cd ../.."; cd ../..'
+
+alias SS='systemctl'
+alias p='pacman'
+alias v='nvim'
+
+lf()
+{
+ export LF_CD_FILE=/tmp/.lfcd-root-$$
+ command lf "$@"
+ if [ -s "$LF_CD_FILE" ]; then
+ local DIR
+ DIR="$(realpath "$(cat "$LF_CD_FILE")")"
+ if [ "$DIR" != "$PWD" ]; then
+ echo "cd to $DIR"
+ cd "$DIR" || exit
+ fi
+ command rm "$LF_CD_FILE"
+ fi
+ unset LF_CD_FILE
+}
+
+bind '"\C-o":"\C-ulf\C-m"'
+```