• Post Reply Bookmark Topic Watch Topic
  • New Topic

Launch files from cmd line  RSS feed

 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for a command that would helpme launch any file on Linux..
e.g " cmd/c + filename " works on windows.

Thanks in advance for the help !
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The closest UNIX equivalent to cmd/c is "sh -c", I suppose. The argument to "sh -c" is an entire command line, which is interpreted and executed.

sh -c filename

If you just have a shell script to execute, without anything fancy, you can just use "sh":

sh filename

Or you can make the shell script executable (only need to do that once) and then execute it directly:

chmod +x filename
./filename
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!