Convert Textile files to Markdown with a shell script


Written by Alan Vardy
Tagged with  linux

Oh no! You have a ton of textile files which look like they are going the way of Betamax, and you wish that they were Markdown instead! Shell scripting to the rescue!

Install pandoc

sudo apt install pandoc

Navigate to your directory where the files are in the terminal of your choice and create your script file.

‘’’bash cd your/file/directory touch chmod +x gedit ‘’’

Get a list of your filenames

find -name "*.textile"

And make your shell script using this as a template:


filenames=(file1 file2 file3 file4)

for i in ${filenames[@]}; do
        pandoc ${i}.textile -o ${i}.markdown


Save and run your converter


Move your old textile files (I’m going to call them posts) into an old_posts directory

mkdir old_posts
mv *.textile old_posts

And you are done!

Related Posts