pipe command

current dir :
/home/sales

ls -l

abc.txt 17th aug
bcd .txt 16t oct
-------
------
Total files : 100

if i want to move only those files dated 17 aug into another sub directory /home/sales/texas

how do i pipe the result of 'ls' command to a 'mv' command

There are more elaborate ways of doing this, but something like (assuming that the /home/sales/texas directory exists)

cd /home/sales
# you'll probably have to edit the grep here, you should be
# matching the date exactly as it appears in ls -l output
# You might also need to change the awk field - it should be 
# whatever column contains your filenames
for file in $(ls -l ./ | grep "Aug 17" | awk '{print $9}')
do
  mv $file ./sales/texas/$file
done

Not the most elegant solution, but as a quick hack it'll do the trick.

Cheers
ZB