[OpenWrt-Devel] [PATCH] base-files: Enhancements to /etc/profile.

Vittorio G (VittGam) openwrt at vittgam.net
Wed Dec 24 20:28:16 EST 2014


- Update terminal window title with current directory and hostname like on Ubuntu.
- Add an optional colored prompt, in case user wants to enable it.
- Add ll, an useful alias to ls.

Signed-off-by: Vittorio Gambaletta <openwrt at vittgam.net>

diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3dd58e1..cee7faf 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -5,7 +5,10 @@
 export PATH=/usr/bin:/usr/sbin:/bin:/sbin
 export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
 export HOME=${HOME:-/root}
-export PS1='\u@\h:\w\$ '
+export PS1='\[\e]0;\u@\h: \w\a\]\u@\h \w \$ '
+
+# If you want a colored prompt, uncomment the following line:
+#export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;33m\]\u\[\033[01;34m\]@\[\033[01;32m\]\h \[\033[01;31m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
 
 [ -x /bin/more ] || alias more=less
 [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
@@ -14,3 +17,5 @@ export PS1='\u@\h:\w\$ '
 
 [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
 [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+alias ll='ls -alF --color=auto'
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list