We’ll also need execute permissions on the file, like to read a file we’d need read permissions. To execute a file all we need to do is enter the path of the file on the command prompt. Unlike windows, you don’t need a special extension to make a file executable. We could have named it hello.txt, or hello.sh, it’s entirely upto us, the extension mostly doesn’t matter. Note the lack of extension in the filename. > echo '#!/bin/bash' > hello > echo 'echo hi' > hello > cat hello #!/bin/bash echo hi We can use the echo command and redirect its output to create a new file. Let’s see what happens when you try to execute a file. In linux, every file can be an executable. To give a little more context, I think that this question stems from the distinction between executable and non executable files on windows, characterized by the.
0 Comments
Leave a Reply. |