0

I am working on a SUSE linux box 3.0.101-0.35-default. I want to know if this is possible to move all the commands in the /bin to the /sbin folder, will all the commands will work normally under root user after this

Abhinav

1 Answers1

0

is it possible to move all the commands in the /bin to the /sbin folder,

Yes, nothing stops you from moving the command. Or copying them and then deleting them afterwards.

That is not to say that you will end up with a working system after you have done this. If some scripts use hardcoded paths to /bin/ then those scripts will fail.

will all the commands will work normally under root user after this

Just moving them to another path which is in the search PATH for root will not result in any problems. It also has no advantages and it probably means that the commands are not in the default search path for normal users. (Which they can solve by editing their path variable or by explicitly using the new location).

But for the uid 0 (root, toor, admin, ...) account nothing should actually change.


Update. I just installed OpenSuse and actually tested it with the example command you gave in the comments. (uname).

VMware with OpenSuse and actual commands used

As you can see uname is not installed in /bin by default. Instead it was found in /usr/bin/. Other than that copying it to /sbin/ succeeds and the command works just fine when I start it from the new location.


I also tested it with a command from /bin/ (as per title), and that also works as expected.

Screenshot of the terminal, continued with the next commands

Hennes
  • 65,142
  • Thanks.... i tired this by making a copy of su to sup from /bin and then moved it to the /sbin , but when ran there tthis new sup to , it is saying command unknown – Abhinav Oct 09 '15 at 05:39
  • From which shell did you try that? If you did that without starting a new shell then you might need the rehash or harsh -r command. (Also see http://superuser.com/questions/490983/how-to-rehash-executables-in-path-with-bash). – Hennes Oct 09 '15 at 13:28
  • Hi Team , When i tried moving commands they are not working. I copied the uname from /bin to /sbin but the command doesn't work after words. Although after copying it back to the /bin , the command is working fine – Abhinav Oct 14 '15 at 08:43
  • It works for me, on a freshly installed OpenSuse installation. (See screenshots). NB: Do not forget to get permission to write to /sbin/ – Hennes Oct 14 '15 at 14:55
  • Thanks Hennes ... its working !!! . I did man for rehash first & got no info. Later it worked fine thanks for you help !!! – Abhinav Oct 15 '15 at 13:34