Create a shortcut to launch a terminal command

I am mining with my CPU and to start the mining I have to do to my folder where the cpuminer program is located and then type

./cpuminer -c cpuminer-conf.json.cryptonight

Is there a way I can shorten this to just open the terminal and type “cpumine” for example?

Write a script for moving to the folder and launching running the command. Then create an alias for running the script in your .bashrc file. After that just go into your distros keyboard shortcut manager, and setup a keyboard shortcut. If you need any help with anyone of these steps just watch some youtube vids, and if you still help with something just ask.

A script isn’t needed, it can all be done in an Alias

in your .bashrc add (assuming your using bash)

alias cpumine='cd_to_folder  && ./cpuminer -c cpuminer-conf.json.cryptonight'

obviously change cd_to_folder to cd ‘to your correct path’ and in a terminal type in cpumine and it will change folders and run the command.

3 Likes

That is a fair point.