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
  • 9,820
  • 3
  • 38
  • 60
  • Read http://askubuntu.com/questions/74746/create-shortcut-from-command and http://askubuntu.com/questions/1414/how-to-create-a-permanent-alias – c0rp Oct 17 '14 at 05:47

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"
user162988
  • 71
  • 1
  • 3
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
  • If you use alias, you'll also want to put that into your bash_profile, otherwise it will not be available next time you reboot. – Brandon Johnson Oct 17 '14 at 04:57
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
  • 27,506
  • 12
  • 74
  • 77