Never type ls Again

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

cdls_usage.JPG

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s