Suppose you want to plot your data in the file name 'data.dat' and fit it with linear regression then add the code below in a file say 'plot.gnuplot'
#!/usr/bin/gnuplot
set terminal png
set output 'image.png'
set title 'Plot' font 'Hack,12'
set xlabel 'x-axis with Greek symbol alpha {/Symbol a}' font 'Hack,11'
set ylabel 'y-axis_{subscript}^{superscript}' font 'Hack,11'
set tics font ',9'
f(x) = a + b*x
fit f(x) 'data.dat' via a,b
plot 'data.dat' title 'data points', f(x) title 'fitted curve'
to run the file just run the command in the terminal
gnuplot 'plot.gnuplot'