Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sometimes I log in without connecting to the network. Now to connect to the network after the fact, I tried to run rc.inet1 but I get an error. However, it does run successfully during startup. The script does have execute permissions. What am I missing?
Code:
bash-3.1# ls -l rc.inet1
-rwxr-xr-x 1 root root 9437 2008-12-07 23:53 rc.inet1
bash-3.1# rc.inet1
bash: rc.inet1: command not found
Are you acting as root? Also you would need to do the full path and a switch, in Slackware 13 the full path is "/etc/rc.d/rc.inet1". You can use the following switches "start; stop; restart". So in your case the process would be the following:
Code:
su
/etc/rc.d/rc.inet1 start
ping google.com
Pinging is just a quick test to see if you are online or not after starting the service.
Just wondering, so is it typical in Linux to not use the present working directory? Is it always recommended to use the full path or at least explicitly specify the directory?
Just wondering, so is it typical in Linux to not use the present working directory? Is it always recommended to use the full path or at least explicitly specify the directory?
Regards,
Ash.
You don't have to include the full path if you are in the file's current directory, I just did it in the example for future reference and because that way you could just open the shell and run the command without changing directories.
is it typical in Linux to not use the present working directory?
Yes, it's a security issue, especially for root. If someone manages to get their own prog into your home dir (where you normally login), then they can substitute a trojan for eg the 'ls' cmd and own you. This goes double for root obviously.
Normally, you'd give either an absolute path (eg /etc/rc.d/rc.inet1) if you are some completely unrelated dir (or it's a cron entry) or you can use a 'relative' path eg ./rc.inet1 if you are in the /etc/rc.d/ dir.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.