Custom command

Forum rules
Before you post please read how to get help

Custom command

Postby dox_drum on Sun Feb 26, 2012 11:40 pm

dear community,
I've added a couple of commands to my .bash_aliases file, however, I'd love to be able to running them via Alt+F2. Is this possible?

THX.
DOX
dox_drum
Level 1
Level 1
 
Posts: 19
Joined: Wed Jan 11, 2012 8:36 am

Linux Mint is funded by ads and donations.
 

Re: Custom command

Postby vanDoom on Sun Feb 26, 2012 11:54 pm

You can make your own commands by adding text files into the /bin directory and then making them executable. Here is an example:

Code: Select all
cd /bin
sudo nano mynewcommand


Type your command instructions, such as changing to directory and launching a program

cd /usr/local/matlab/R2012/bin
./matlab


Save and exit.

Now make it executable

Code: Select all
sudo chmod -c o+x matlab


Here is more infor on BASH scripting if your interested, and the man page on chmod is pretty good. http://tldp.org/LDP/abs/html/
User avatar
vanDoom
Level 1
Level 1
 
Posts: 47
Joined: Sun Feb 26, 2012 7:25 pm
Location: USA

Re: Custom command

Postby dox_drum on Thu Mar 01, 2012 9:29 am

Thank you very much vanDoom! I'll give it a try and let you know my results!

vanDoom wrote:You can make your own commands by adding text files into the /bin directory and then making them executable. Here is an example:

Code: Select all
cd /bin
sudo nano mynewcommand


Type your command instructions, such as changing to directory and launching a program

cd /usr/local/matlab/R2012/bin
./matlab


Save and exit.

Now make it executable

Code: Select all
sudo chmod -c o+x matlab


Here is more infor on BASH scripting if your interested, and the man page on chmod is pretty good. http://tldp.org/LDP/abs/html/
dox_drum
Level 1
Level 1
 
Posts: 19
Joined: Wed Jan 11, 2012 8:36 am


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 4 guests