If I have a text file with a separate command on each line how would I make terminal run each line as a command? I just don\'t want to have to copy and paste 1 line at a tim
You can use something like this:
for i in `cat foo.txt`
do
sudo $i
done
Though if the commands have arguments (i.e. there is whitespace in the lines) you may have to monkey around with that a bit to protect the whitepace so that the whole string is seen by sudo as a command. But it gives you an idea on how to start.