0

I recently had the following questions:

  • What is the full path name of bash?
  • What is the base process of Linux?

I couldn't answer these.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

3

The base process in linux is named init and has the PID 1 If you are on Linux, you can install the command pstree to have a tree view of the process, or using the command ps -eF. See also Wikipedia: init

bash is probably (depending on your distribution) in /bin/bash or /usr/bin/bash

To identify the path of a command an easy thing to use is the command:

type bash
#you can also usee (but not recommanded)
whereis bash
command -v bash  

It will read your path (or try to guess) and gives you several path where you can find the file bash

Kiwy
  • 9,534
  • 1
    Most probably not /usr/bin/bash but /bin/bash – grebneke Feb 07 '14 at 11:44
  • Yes you're both right... End of the week tired.. coffee... really sorry. – Kiwy Feb 07 '14 at 11:48
  • /usr/bin/bash is not that uncommon (Arch Linux for example), but yes, it depends on the distribution. – l0b0 Feb 07 '14 at 12:51
  • To find out the full path you can also run 'which bash'. That should show the path that will be executed when you run just 'bash' – brm Feb 07 '14 at 13:59
  • We shouldn't be recommending the use of which or whereis. If you're using Bash it should be type. http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then – slm Feb 07 '14 at 14:11
  • @slm does the answer appears more precise ;-) (the wich wheris ... article is very long) – Kiwy Feb 07 '14 at 14:21
  • Yes thanks for the edit, I encourage you to read it. You can read it in multiple goes if only to help you when answer Q's here that deal w/ which. We get enough of them so it's good to link that Q&A to help educate others. I was a long time which user and it's hard to disassociate the name from my memory now. – slm Feb 07 '14 at 14:23
  • Why are which and whereis bad? (doh - then I opened the link - ignore me) – symcbean Feb 07 '14 at 14:58