How Do I Run a Text File in Linux?
Contents Right Click on the Text File, Select Properties, Select Permission, Mark the “Let This File Be Executed” Text Box. Now You Can Execute It Just by...
Contents
Right click on the text file, select properties, select permission, mark the “Let this file be executed” text box. Now you can execute it just by double clicking on the file. You can also do it from the console like this: sh ec2-env-setup.
How do I run a .TXT file in Linux?
Here is an example:
- $cd /tmp.
- $mkdir run.
- $cd run.
- $nano text. txt.
- #!/usr/bin/env perl.
- print “Hello Worldn”;
- ^x to save file.
- $chmod +x text. txt.
Must Read
How do I run a file in Linux command line?
Steps to write and execute a script
- Open the terminal. Go to the directory where you want to create your script.
- Create a file with . sh extension.
- Write the script in the file using an editor.
- Make the script executable with command chmod +x <fileName>.
- Run the script using ./<fileName>.