Let's say I have these files on desktop:
aaa.jpg
bbb.jpg
I want to list these two jpg's and output them to a .txt file:
#!/bin/bash
cd ~/Desktop
ls -1 > all.txt
With this code the all.txt
would have the following:
aaa.jpg
bbb.jpg
all.txt
I just want the two jpg's in all.txt
.