aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-10-11 18:06:24 -0400
committerB. Watson <urchlay@slackware.uk>2026-10-11 18:06:24 -0400
commit36fff4b29d29e0e1d461b6a6f12cef8eda193aa9 (patch)
tree41104d3acb91041a63467b2c4bbfd11d9c56b0dc
parent926f8d0b3638f30078c2ae78068aa8c42fc6f662 (diff)
downloadmisc-scripts-36fff4b29d29e0e1d461b6a6f12cef8eda193aa9.tar.gz
lcd.sh: doc comments.
-rw-r--r--lcd.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/lcd.sh b/lcd.sh
index 1494a10..1cd19ea 100644
--- a/lcd.sh
+++ b/lcd.sh
@@ -1,3 +1,18 @@
+# lcd.sh - "Linked" cd, for people who use multiple terminals.
+
+# Copy me to e.g. ~/.lcd.sh, then in your .bash_profile, .bashrc,
+# or whatever shell startup script you use:
+
+# [ -e ~/.lcd.sh ] && source ~/.lcd.sh
+
+# Log out & back in, or close and restart all your terminal windows.
+
+# Now when you type a cd command in one shell, such as:
+# cd /usr/src/linux-$( uname -r )/Documentation
+# ...you can switch over to another terminal and type:
+# lcd
+# ...and now that terminal is cd'ed to the same directory.
+
cd() {
builtin cd "$@"
pwd > ~/.lcd.dir