-2

For instance if I wanted to type

$Ctrl+Alt+Delete

and it would return the same as

$reboot

this way when editing custom taskbar launchers we can execute key commands via terminal. Would I write a bash script or is there an editable script where commands such as reboot live? Sorry if this was over your head those of you who down voted for no reason rather than answering.

2 Answers2

1

Well, you could type the following commands. When typing, make CUSTOMCOMMAND what you want the command to be when you type it in the terminal.sudo su, cd /usr/bin, nano CUSTOMCOMMAND. Then, write #!/bin/bash and make a little script of what yo want to happen when you run your command. Then press Ctrl+X when done, answer y, press Enter, and chmod +x CUSTOMCOMMAND. That command should now work, no reboot should be needed. The command might only work for root. You'll have to change the file permissions to fix that.

John Scott
  • 1,472
1

You can add custom Bash commands in your bash profile. From terminal:

echo "custom_command(){ userdir=$(cd ~ && pwd); echo $userdir; }" >> ~/.bash_profile
source ~/.bash_profile

Then try it out from terminal:

custom_command