0

Where does the terminal command (reboot) live? If I wanted to change it to "rebooot" or "rbt" what would I need to do?

Without creating a separate bash script for a completely separate command.

c0rp
  • 10,010

3 Answers3

2

You can find where most executables are using "which":

~$ which reboot

/sbin/reboot

You can make an alias using "alias":

~$ alias rbt="reboot"
1

Reboot is an init script in /etc/init.d and the binary is in /sbin. You can create a custom bash command and name it rbt to do the same thing as reboot.

echo "rbt(){ reboot }" >> ~/.bash_profile
source ~/.bash_profile
1

If you want it to work in all shells, create a link (it's system wide and shell independant):

ln -s $(which reboot) /bin/rbt

This creates a link from where the executable reboot lays to /bin/rbt. When typing rbt in a shell reboot is executed instead.

chaos
  • 28,186