5

Lets say I wanted to create a .txt file that had some commands in it. Then from .txt file the contents are extracted to the terminal. Is this even possible and does it have to be a .txt file? oh and I am running 12.04

4

it can be done. Just cd to the directory of the file in the terminal and type chmod +x commands.txt, and then ./commands.txt runs commands in the file

No, it need not be .txt, extension doesn't matter

3

You can also put one command per line in the text file (e.g. my_commands.txt), and then run them all as:

source my_commands.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.