|
want only file names (not whole path) in shell script
hi i wrote following script,
#!/usr/bin/sh
for index in `ls /tmp/common/*.txt`
do
echo "$index"
done
here index is giving full path but in my program i want only file names (not along with whole path)
Eg. if in /tmp/common files are a.txt and b.txt den out should be a.txt b.txt
and not like ==> /tmp/common/a.txt /tmp/common/b.txt
any knows how to do it?
|