I want an alias that produce folowing result:
$cd /home/ok
[clear screen]
/home/ok
total 452K
-rwx--x--x 1 user gigl 16K Oct 1 14:08 ok0
drwx------ 5 user gigl 0 Oct 1 14:02 ok1
drwx------ 5 user gigl 0 Oct 1 13:59 ok2
drwx------ 9 user gigl 0 Oct 1 14:01 ok3
-rw------- 1 user gigl 32 Sep 30 14:36 ok4
I did a script like
$cat ~/.cd.sh
#!/bin/bash
cd $1 && clear && pwd && ls -lh --color=auto
But it does not change the current dir. This is probably because in the script it will change the dir but when it goes back to bash I'm back in the dir I executed the script.
Any idea ?
Thanks, from answers I got something like that working great:
alias ls="clear && pwd && ls -lh --color=auto"
cd() { builtin cd "$1" && ls; }