It is compelling to type “ls” every time after
1) changing directory
2) copy/remove files
3) program is run; output file is created
etc. etc. …
Here’s a script that runs on an infinite loop that
1) allows type any command as usual (no auto-complete is available)
2) automatically “ls” after every command
# save file as cdls
# chmod 755 cdls
# type "exit" to terminate
while [ 1 ]
do
ls
read shell_command
$shell_command
done
A more useful form of the script is given below
# save as cdls
# chmod 755 cdls
# cp cdls /bin clear
tput cup 24 0
while [ 1 ] do
tput setb 9
tput setf 0
echo --------------------------------------------------------------------------------
ls -F --color=auto
echo [`whoami` `pwd` `date`]$
tput setb 0
tput setf 7
read cmd1
$cmd1
tput cup 24 0
done
Advertisements