LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PC to Linux??'s File System (https://www.linuxquestions.org/questions/linux-newbie-8/pc-to-linux-s-file-system-417762/)

kenzdad 02-20-2006 07:29 PM

PC to Linux??'s File System
 
I have noticed that some programs/tools will let you execute a command when a some action is detected. If I want to run a program at startup in MSW, all i have to do is put the.exe in the startup folder. How do i do this in Linux? Where do i find the ".exe" in Linux and what is the syntax that linux is looking for?

nadroj 02-20-2006 08:28 PM

to run a command/program automatically, edit/create the file /etc/rc.d/rc.local (make sure its executable) and add the commands there.

in linux, windows .exe's dont work.. in linux, an '.exe' is some script or program that is allowed to be executed, regardless of exention.

KimVette 02-20-2006 08:34 PM

Well, if he wants to run it automagically in X, that is not how to do it. What you do is tell us which desktop environment you're running and we can tell you where to place the symbolic link (or an application link, either will work). E.g., if you're running KDE with the kwin window manager, you would place the link in ~./kde/autostart

kenzdad 02-20-2006 08:49 PM

KimVette...I'm running Gnome.

nadroj...what would the syntax be for command line execution?

nadroj 02-20-2006 08:59 PM

well if u want to do it when the computer starts, then the solution i provided will achieve this..
the syntax is just the path to the program/script you want to execute. ie:
Code:

/path/to/programFile
if not, and most likely, you want it to start after you log in to Xwindows (your GUI/desktop) then the other solution provided will do this. substitute their example (kde) for your case (gnome). im sure this is the method your looking for

edit:
in gnome, look for a 'sessions' tab or button in the control center.. there should be some simple way to do startup applications in there with the GUI. look at the documentation for your version of gnome at the official site, at gnome.org

kenzdad 02-21-2006 12:39 AM

thanx for the help, this is exactly the reason why i switched to Linux :) No support is available like this for windows.

Dtsazza 02-21-2006 07:45 AM

It's probably worth mentioning that though the syntax to run an executable is basically the same as it is in Window's command prompt, Linux won't automatically search the current directory for an unqualified filename. That is, if you're in /home/foo and you want to run the executable /home/foo/bar, you can't just type 'bar'. Doing this will cause Linux to look through the directories in your PATH (environment variable) for the file bar.

So in this situation you can either give the full name of the file (i.e. type '/home/foo/bar'), or use the period, which means "my current working directory": './bar'.

That trips a lot of people up at first.

kenzdad 02-21-2006 02:09 PM

good to know. how would i setup my home directory, or a sub directory of home, as the default location for command line execution?

nadroj 02-21-2006 02:10 PM

search here or any search engine for how to modify/export the $PATH variable

it usually involves editing a file in your home directory, to make the changes permanent

mbreith 02-21-2006 04:49 PM

Usually /home/yourname/bin is already in your search path. Just make a directory called "bin" in your home folder and put executables or links to executables there.

Code:

echo $PATH
will tell you all of the directories on the search path.


All times are GMT -5. The time now is 04:07 AM.