i can use
ls|grep \.py$
to list all ends with .py file,but it's seems hard for me to grep all .py & .txt & .tar.gz file once
any one could give me a hand
i can use
ls|grep \.py$
to list all ends with .py file,but it's seems hard for me to grep all .py & .txt & .tar.gz file once
any one could give me a hand
No need external commands. Use the shell(bash/ksh)
shopt -s nullglob
for file in *.{txt,tar,gz,py}
do
echo "$file"
done