echo '#!bin/bash' > filename # works with and without extention, if you want extention do filename.sh chmod +x filename