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.
1. In short, /bin/bash is the path to an executable. The bash executable is a command interpreter using a simple terminal line interface. It is also very easy to use script files that contain command lines to create simple applications.
2. Not much. The shutdown command provides more flexibility than the poweroff command. Most distributions have the poweroff command linked to the shutdown command - which in turn may be linked to yet another. But the purpose of the power off is the same as "shutdown -P -h now", and if the shutdown (which may be a script) will use the name it was invoked by to identify a predefined set of options. It is also possible that the poweroff is linked to a "halt" utility - which should only be used for emergencies, as the halt utility directly is intended to halt the system immediately. On Slakware, the halt utility (or poweroff) will first verify that the system is in single user mode before halting/poweroff the system - instead, it will invoke the shutdown utility with the appropriate options to gracefully shutdown the system, then either halt or power off.
To be a bit more specific, the first line of a script file that is marked as executable should/must start with "#!" followed by the path to the program (or script even) that is to interpret the contents.
This is not, however, a property of a script - it is the property of the kernel validating a file for execution - and when the "#!" is found, using the rest of the line interpreted as the command (with options) to interpret the file.
Every system has a root directory which holds all files and sub directories. Root is give the symbol /. Bin is a subdirectory called simply as bin and if given together with root as /bin. bash is executable file located in bin directory. So it's refered as /bin/bash. The / acts as separator for directories and files.
As for commands shutdown poweroff halt just use safe ones for now. And if you want to know more details you can read their man pages by:
It is also possible that the poweroff is linked to a "halt" utility - which should only be used for emergencies, as the halt utility directly is intended to halt the system immediately.
Well, then I guess I should stop using "halt -p" to shutdown my Debian system.
It can depend on the system. Some will check to see if it is already in single user mode, THEN it will halt.
If it is in multi-user mode then it will shutdown the system gracefully.
But it is always better to not depend on that - it causes some bad habits that can cause problems in a multi-vendor site (and not just Linux either - UNIX can also have variations).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.