Create an alias or shortcut command to run programme in ubuntu

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
2












How can we create an alias or shortcut command to run a programme in Ubuntu, I have to start multiple sessions of intelliJ and eclipse, every time I restart my computer I have to got to each directory and start the eclipse from there. I want to have a single command that can be run from terminal from any directory to start these programmes.







share|improve this question




















  • When You execute IntelliJ You'll have an icon of app in sidebar. Just click and hold that icon and move up, it will pin it as an app for future use.
    – num8er
    Nov 10 '17 at 1:21










  • @num8er Thank you for your simple solution, it works only problem is when I exit AndroidStudio or IntelliJ for that matter, I get error "Studio was unable to save some project files,are you sure you want to close this project anyway?Read-only files:/home/xyz/.idea/workspace.xml. Please note that I created this project with root permission before following your suggestion.
    – Navneet Rai
    Nov 10 '17 at 6:12














up vote
2
down vote

favorite
2












How can we create an alias or shortcut command to run a programme in Ubuntu, I have to start multiple sessions of intelliJ and eclipse, every time I restart my computer I have to got to each directory and start the eclipse from there. I want to have a single command that can be run from terminal from any directory to start these programmes.







share|improve this question




















  • When You execute IntelliJ You'll have an icon of app in sidebar. Just click and hold that icon and move up, it will pin it as an app for future use.
    – num8er
    Nov 10 '17 at 1:21










  • @num8er Thank you for your simple solution, it works only problem is when I exit AndroidStudio or IntelliJ for that matter, I get error "Studio was unable to save some project files,are you sure you want to close this project anyway?Read-only files:/home/xyz/.idea/workspace.xml. Please note that I created this project with root permission before following your suggestion.
    – Navneet Rai
    Nov 10 '17 at 6:12












up vote
2
down vote

favorite
2









up vote
2
down vote

favorite
2






2





How can we create an alias or shortcut command to run a programme in Ubuntu, I have to start multiple sessions of intelliJ and eclipse, every time I restart my computer I have to got to each directory and start the eclipse from there. I want to have a single command that can be run from terminal from any directory to start these programmes.







share|improve this question












How can we create an alias or shortcut command to run a programme in Ubuntu, I have to start multiple sessions of intelliJ and eclipse, every time I restart my computer I have to got to each directory and start the eclipse from there. I want to have a single command that can be run from terminal from any directory to start these programmes.









share|improve this question











share|improve this question




share|improve this question










asked Nov 9 '17 at 16:38









Navneet Rai

1112




1112











  • When You execute IntelliJ You'll have an icon of app in sidebar. Just click and hold that icon and move up, it will pin it as an app for future use.
    – num8er
    Nov 10 '17 at 1:21










  • @num8er Thank you for your simple solution, it works only problem is when I exit AndroidStudio or IntelliJ for that matter, I get error "Studio was unable to save some project files,are you sure you want to close this project anyway?Read-only files:/home/xyz/.idea/workspace.xml. Please note that I created this project with root permission before following your suggestion.
    – Navneet Rai
    Nov 10 '17 at 6:12
















  • When You execute IntelliJ You'll have an icon of app in sidebar. Just click and hold that icon and move up, it will pin it as an app for future use.
    – num8er
    Nov 10 '17 at 1:21










  • @num8er Thank you for your simple solution, it works only problem is when I exit AndroidStudio or IntelliJ for that matter, I get error "Studio was unable to save some project files,are you sure you want to close this project anyway?Read-only files:/home/xyz/.idea/workspace.xml. Please note that I created this project with root permission before following your suggestion.
    – Navneet Rai
    Nov 10 '17 at 6:12















When You execute IntelliJ You'll have an icon of app in sidebar. Just click and hold that icon and move up, it will pin it as an app for future use.
– num8er
Nov 10 '17 at 1:21




When You execute IntelliJ You'll have an icon of app in sidebar. Just click and hold that icon and move up, it will pin it as an app for future use.
– num8er
Nov 10 '17 at 1:21












@num8er Thank you for your simple solution, it works only problem is when I exit AndroidStudio or IntelliJ for that matter, I get error "Studio was unable to save some project files,are you sure you want to close this project anyway?Read-only files:/home/xyz/.idea/workspace.xml. Please note that I created this project with root permission before following your suggestion.
– Navneet Rai
Nov 10 '17 at 6:12




@num8er Thank you for your simple solution, it works only problem is when I exit AndroidStudio or IntelliJ for that matter, I get error "Studio was unable to save some project files,are you sure you want to close this project anyway?Read-only files:/home/xyz/.idea/workspace.xml. Please note that I created this project with root permission before following your suggestion.
– Navneet Rai
Nov 10 '17 at 6:12










4 Answers
4






active

oldest

votes

















up vote
6
down vote













The simplest way would be, to start a script that does that for you, I think.



Something like this (the 1st line is necessary, it's not a comment):





#!/bin/bash
echo "Running 1st app..."
$HOME/path_to_1st/app & # this runs an app from user's home directory
# the ampersand makes the app `fork`
# it means it'll start in the background
# and the script will continue to execute
echo "Running eclipse..."
cd directory/project1/
eclipse -param1 -param2 path/to/something &

echo "Running 2nd app..."
cd directory/project2
other_app_executable &


The $HOME variable represents the user's home directory. Mind it's the user who runs the script, not necessarily you.
Save above as startmyapps.sh and change permissions to make it executable:



chmod u+x startmyapps.sh


The u+x means:




  • u - user


  • + - add permission


  • x - executable

To run startmyapps.sh in terminal from any working directory, you can either make an alias pointing to its absolute path (the /home/username/path/to/startmyapps.sh - whole thing; on aliases see the other responses) or you need to put it in $PATH. The most common way would be, to save it in your $HOME/bin/ directory and then add this line at the end of your $HOME/.bashrc (or .zshrc or whatever, depending on the shell you use, AFAIK bash is default in Ubuntu):



export PATH=$PATH:$HOME/bin


meaning:




  • export - make variable available for children of this terminal


  • PATH - work on variable named PATH


  • = - assign it a new value, which is


  • $PATH - the old value


  • : - a separator


  • $HOME/bin - and your newly created bin directory

Extras



As a side note I want to mention its common to work in virtual environments as a way to separate projects and freeze dependencies, e.g. python's way of creating one would be to call python -m venv new_env_name. Usually this environments come with extensions like workon that can activate a given environment for you wherever you are in the directory tree (as in: you don't have to be in your project's directory, just call workon new_env_name). All those extensions do is calling a starting script from new_env_name/bin/activate - so this is where you'd add necessary calls to start your applications.






share|improve this answer


















  • 1




    Might want to background all those executables though.
    – Ignacio Vazquez-Abrams
    Nov 9 '17 at 16:51










  • Good catch, edited.
    – cprn
    Nov 9 '17 at 16:56










  • @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
    – cprn
    Nov 9 '17 at 23:13







  • 1




    Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
    – Navneet Rai
    Nov 10 '17 at 6:37










  • I'll put that in.
    – cprn
    Nov 10 '17 at 15:43

















up vote
4
down vote













  1. To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.


  2. Open any application, for example Eclipse, and check in the System Monitor app to find the name of the command to start that application from the terminal. For example, the command to start Eclipse is eclipse.


  3. Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.



  4. A new little Custom Shortcut window will open up. After where it says Name: type Eclipse. After where it says Command: type eclipse with a lowercase e. Click the Apply button to apply the new keyboard shortcut.



    enter image description here



    The command eclipse can also be customized to open eclipse with custom command line arguments.




  5. Click the Eclipse shortcut that you added to the list of custom shortcuts where it says Disabled, which will make New accelerator... appear after where it says Eclipse instead of Disabled. Press any keyboard shortcut combination to assign it to Eclipse.



    enter image description here



  6. In order to undo an existing keyboard shortcut, click the existing keyboard shortcut in the list of shortcuts and undo it using the Backspace key.






share|improve this answer





























    up vote
    2
    down vote













    You can use the alias command in your .bashrc for simplifying commands (example):



    alias toclip='xclip -sel clip'


    which sens piped output to clipboard using xclip. So for comming closer to your question this could be:



    alias startup='eclipse /path/to/project'


    Or if a single line is not sufficient enough to start all you need you can define a function in your .bashrc (example):



    function extract tar.gz


    This defines for example a function extract which takes any kind of filename and tries to extract it. so to keep it more inline with what you want a small example how it could look like:



    function startup 
    eclipse /path/to/a/AFile
    eclipse /path/to/a/BFile
    eclipse /path/to/a/CFile
    eclipse /path/to/a/DFile



    The good of this approach is that you not have to worry about path variables and so on, you get them this way simply when you start your terminal. The above ones are just examples, you can put whatever you want into your alias or your function as long it is bash compliant.






    share|improve this answer






















    • Also a perfectly valid approach.
      – cprn
      Nov 9 '17 at 16:57






    • 1




      As always there are many ways leading to rome :)
      – Videonauth
      Nov 9 '17 at 17:01






    • 1




      I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
      – TMN
      Nov 9 '17 at 18:58

















    up vote
    0
    down vote













    You can use this command to create shortcut (short link), so simply:



    ln -s /path/to/file /path/to/symlink


    Goodluck!






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403557%2fcreate-an-alias-or-shortcut-command-to-run-programme-in-ubuntu%23new-answer', 'question_page');

      );

      Post as a guest






























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      6
      down vote













      The simplest way would be, to start a script that does that for you, I think.



      Something like this (the 1st line is necessary, it's not a comment):





      #!/bin/bash
      echo "Running 1st app..."
      $HOME/path_to_1st/app & # this runs an app from user's home directory
      # the ampersand makes the app `fork`
      # it means it'll start in the background
      # and the script will continue to execute
      echo "Running eclipse..."
      cd directory/project1/
      eclipse -param1 -param2 path/to/something &

      echo "Running 2nd app..."
      cd directory/project2
      other_app_executable &


      The $HOME variable represents the user's home directory. Mind it's the user who runs the script, not necessarily you.
      Save above as startmyapps.sh and change permissions to make it executable:



      chmod u+x startmyapps.sh


      The u+x means:




      • u - user


      • + - add permission


      • x - executable

      To run startmyapps.sh in terminal from any working directory, you can either make an alias pointing to its absolute path (the /home/username/path/to/startmyapps.sh - whole thing; on aliases see the other responses) or you need to put it in $PATH. The most common way would be, to save it in your $HOME/bin/ directory and then add this line at the end of your $HOME/.bashrc (or .zshrc or whatever, depending on the shell you use, AFAIK bash is default in Ubuntu):



      export PATH=$PATH:$HOME/bin


      meaning:




      • export - make variable available for children of this terminal


      • PATH - work on variable named PATH


      • = - assign it a new value, which is


      • $PATH - the old value


      • : - a separator


      • $HOME/bin - and your newly created bin directory

      Extras



      As a side note I want to mention its common to work in virtual environments as a way to separate projects and freeze dependencies, e.g. python's way of creating one would be to call python -m venv new_env_name. Usually this environments come with extensions like workon that can activate a given environment for you wherever you are in the directory tree (as in: you don't have to be in your project's directory, just call workon new_env_name). All those extensions do is calling a starting script from new_env_name/bin/activate - so this is where you'd add necessary calls to start your applications.






      share|improve this answer


















      • 1




        Might want to background all those executables though.
        – Ignacio Vazquez-Abrams
        Nov 9 '17 at 16:51










      • Good catch, edited.
        – cprn
        Nov 9 '17 at 16:56










      • @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
        – cprn
        Nov 9 '17 at 23:13







      • 1




        Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
        – Navneet Rai
        Nov 10 '17 at 6:37










      • I'll put that in.
        – cprn
        Nov 10 '17 at 15:43














      up vote
      6
      down vote













      The simplest way would be, to start a script that does that for you, I think.



      Something like this (the 1st line is necessary, it's not a comment):





      #!/bin/bash
      echo "Running 1st app..."
      $HOME/path_to_1st/app & # this runs an app from user's home directory
      # the ampersand makes the app `fork`
      # it means it'll start in the background
      # and the script will continue to execute
      echo "Running eclipse..."
      cd directory/project1/
      eclipse -param1 -param2 path/to/something &

      echo "Running 2nd app..."
      cd directory/project2
      other_app_executable &


      The $HOME variable represents the user's home directory. Mind it's the user who runs the script, not necessarily you.
      Save above as startmyapps.sh and change permissions to make it executable:



      chmod u+x startmyapps.sh


      The u+x means:




      • u - user


      • + - add permission


      • x - executable

      To run startmyapps.sh in terminal from any working directory, you can either make an alias pointing to its absolute path (the /home/username/path/to/startmyapps.sh - whole thing; on aliases see the other responses) or you need to put it in $PATH. The most common way would be, to save it in your $HOME/bin/ directory and then add this line at the end of your $HOME/.bashrc (or .zshrc or whatever, depending on the shell you use, AFAIK bash is default in Ubuntu):



      export PATH=$PATH:$HOME/bin


      meaning:




      • export - make variable available for children of this terminal


      • PATH - work on variable named PATH


      • = - assign it a new value, which is


      • $PATH - the old value


      • : - a separator


      • $HOME/bin - and your newly created bin directory

      Extras



      As a side note I want to mention its common to work in virtual environments as a way to separate projects and freeze dependencies, e.g. python's way of creating one would be to call python -m venv new_env_name. Usually this environments come with extensions like workon that can activate a given environment for you wherever you are in the directory tree (as in: you don't have to be in your project's directory, just call workon new_env_name). All those extensions do is calling a starting script from new_env_name/bin/activate - so this is where you'd add necessary calls to start your applications.






      share|improve this answer


















      • 1




        Might want to background all those executables though.
        – Ignacio Vazquez-Abrams
        Nov 9 '17 at 16:51










      • Good catch, edited.
        – cprn
        Nov 9 '17 at 16:56










      • @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
        – cprn
        Nov 9 '17 at 23:13







      • 1




        Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
        – Navneet Rai
        Nov 10 '17 at 6:37










      • I'll put that in.
        – cprn
        Nov 10 '17 at 15:43












      up vote
      6
      down vote










      up vote
      6
      down vote









      The simplest way would be, to start a script that does that for you, I think.



      Something like this (the 1st line is necessary, it's not a comment):





      #!/bin/bash
      echo "Running 1st app..."
      $HOME/path_to_1st/app & # this runs an app from user's home directory
      # the ampersand makes the app `fork`
      # it means it'll start in the background
      # and the script will continue to execute
      echo "Running eclipse..."
      cd directory/project1/
      eclipse -param1 -param2 path/to/something &

      echo "Running 2nd app..."
      cd directory/project2
      other_app_executable &


      The $HOME variable represents the user's home directory. Mind it's the user who runs the script, not necessarily you.
      Save above as startmyapps.sh and change permissions to make it executable:



      chmod u+x startmyapps.sh


      The u+x means:




      • u - user


      • + - add permission


      • x - executable

      To run startmyapps.sh in terminal from any working directory, you can either make an alias pointing to its absolute path (the /home/username/path/to/startmyapps.sh - whole thing; on aliases see the other responses) or you need to put it in $PATH. The most common way would be, to save it in your $HOME/bin/ directory and then add this line at the end of your $HOME/.bashrc (or .zshrc or whatever, depending on the shell you use, AFAIK bash is default in Ubuntu):



      export PATH=$PATH:$HOME/bin


      meaning:




      • export - make variable available for children of this terminal


      • PATH - work on variable named PATH


      • = - assign it a new value, which is


      • $PATH - the old value


      • : - a separator


      • $HOME/bin - and your newly created bin directory

      Extras



      As a side note I want to mention its common to work in virtual environments as a way to separate projects and freeze dependencies, e.g. python's way of creating one would be to call python -m venv new_env_name. Usually this environments come with extensions like workon that can activate a given environment for you wherever you are in the directory tree (as in: you don't have to be in your project's directory, just call workon new_env_name). All those extensions do is calling a starting script from new_env_name/bin/activate - so this is where you'd add necessary calls to start your applications.






      share|improve this answer














      The simplest way would be, to start a script that does that for you, I think.



      Something like this (the 1st line is necessary, it's not a comment):





      #!/bin/bash
      echo "Running 1st app..."
      $HOME/path_to_1st/app & # this runs an app from user's home directory
      # the ampersand makes the app `fork`
      # it means it'll start in the background
      # and the script will continue to execute
      echo "Running eclipse..."
      cd directory/project1/
      eclipse -param1 -param2 path/to/something &

      echo "Running 2nd app..."
      cd directory/project2
      other_app_executable &


      The $HOME variable represents the user's home directory. Mind it's the user who runs the script, not necessarily you.
      Save above as startmyapps.sh and change permissions to make it executable:



      chmod u+x startmyapps.sh


      The u+x means:




      • u - user


      • + - add permission


      • x - executable

      To run startmyapps.sh in terminal from any working directory, you can either make an alias pointing to its absolute path (the /home/username/path/to/startmyapps.sh - whole thing; on aliases see the other responses) or you need to put it in $PATH. The most common way would be, to save it in your $HOME/bin/ directory and then add this line at the end of your $HOME/.bashrc (or .zshrc or whatever, depending on the shell you use, AFAIK bash is default in Ubuntu):



      export PATH=$PATH:$HOME/bin


      meaning:




      • export - make variable available for children of this terminal


      • PATH - work on variable named PATH


      • = - assign it a new value, which is


      • $PATH - the old value


      • : - a separator


      • $HOME/bin - and your newly created bin directory

      Extras



      As a side note I want to mention its common to work in virtual environments as a way to separate projects and freeze dependencies, e.g. python's way of creating one would be to call python -m venv new_env_name. Usually this environments come with extensions like workon that can activate a given environment for you wherever you are in the directory tree (as in: you don't have to be in your project's directory, just call workon new_env_name). All those extensions do is calling a starting script from new_env_name/bin/activate - so this is where you'd add necessary calls to start your applications.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 14 '17 at 16:13

























      answered Nov 9 '17 at 16:43









      cprn

      3441414




      3441414







      • 1




        Might want to background all those executables though.
        – Ignacio Vazquez-Abrams
        Nov 9 '17 at 16:51










      • Good catch, edited.
        – cprn
        Nov 9 '17 at 16:56










      • @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
        – cprn
        Nov 9 '17 at 23:13







      • 1




        Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
        – Navneet Rai
        Nov 10 '17 at 6:37










      • I'll put that in.
        – cprn
        Nov 10 '17 at 15:43












      • 1




        Might want to background all those executables though.
        – Ignacio Vazquez-Abrams
        Nov 9 '17 at 16:51










      • Good catch, edited.
        – cprn
        Nov 9 '17 at 16:56










      • @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
        – cprn
        Nov 9 '17 at 23:13







      • 1




        Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
        – Navneet Rai
        Nov 10 '17 at 6:37










      • I'll put that in.
        – cprn
        Nov 10 '17 at 15:43







      1




      1




      Might want to background all those executables though.
      – Ignacio Vazquez-Abrams
      Nov 9 '17 at 16:51




      Might want to background all those executables though.
      – Ignacio Vazquez-Abrams
      Nov 9 '17 at 16:51












      Good catch, edited.
      – cprn
      Nov 9 '17 at 16:56




      Good catch, edited.
      – cprn
      Nov 9 '17 at 16:56












      @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
      – cprn
      Nov 9 '17 at 23:13





      @Archemar Yeah... Also I never knew shebang can't contain comment, never used one before. But now I copy&pasted this commented version and tried to run it, it didn't. Good catch, fixed.
      – cprn
      Nov 9 '17 at 23:13





      1




      1




      Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
      – Navneet Rai
      Nov 10 '17 at 6:37




      Thank you it is the complete solution i was looking for, works like charm. I just want to add one more info that I came across while following this solution, for new users that $HOME points to the path of home directory of the current user running this startmyapps.sh script
      – Navneet Rai
      Nov 10 '17 at 6:37












      I'll put that in.
      – cprn
      Nov 10 '17 at 15:43




      I'll put that in.
      – cprn
      Nov 10 '17 at 15:43












      up vote
      4
      down vote













      1. To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.


      2. Open any application, for example Eclipse, and check in the System Monitor app to find the name of the command to start that application from the terminal. For example, the command to start Eclipse is eclipse.


      3. Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.



      4. A new little Custom Shortcut window will open up. After where it says Name: type Eclipse. After where it says Command: type eclipse with a lowercase e. Click the Apply button to apply the new keyboard shortcut.



        enter image description here



        The command eclipse can also be customized to open eclipse with custom command line arguments.




      5. Click the Eclipse shortcut that you added to the list of custom shortcuts where it says Disabled, which will make New accelerator... appear after where it says Eclipse instead of Disabled. Press any keyboard shortcut combination to assign it to Eclipse.



        enter image description here



      6. In order to undo an existing keyboard shortcut, click the existing keyboard shortcut in the list of shortcuts and undo it using the Backspace key.






      share|improve this answer


























        up vote
        4
        down vote













        1. To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.


        2. Open any application, for example Eclipse, and check in the System Monitor app to find the name of the command to start that application from the terminal. For example, the command to start Eclipse is eclipse.


        3. Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.



        4. A new little Custom Shortcut window will open up. After where it says Name: type Eclipse. After where it says Command: type eclipse with a lowercase e. Click the Apply button to apply the new keyboard shortcut.



          enter image description here



          The command eclipse can also be customized to open eclipse with custom command line arguments.




        5. Click the Eclipse shortcut that you added to the list of custom shortcuts where it says Disabled, which will make New accelerator... appear after where it says Eclipse instead of Disabled. Press any keyboard shortcut combination to assign it to Eclipse.



          enter image description here



        6. In order to undo an existing keyboard shortcut, click the existing keyboard shortcut in the list of shortcuts and undo it using the Backspace key.






        share|improve this answer
























          up vote
          4
          down vote










          up vote
          4
          down vote









          1. To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.


          2. Open any application, for example Eclipse, and check in the System Monitor app to find the name of the command to start that application from the terminal. For example, the command to start Eclipse is eclipse.


          3. Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.



          4. A new little Custom Shortcut window will open up. After where it says Name: type Eclipse. After where it says Command: type eclipse with a lowercase e. Click the Apply button to apply the new keyboard shortcut.



            enter image description here



            The command eclipse can also be customized to open eclipse with custom command line arguments.




          5. Click the Eclipse shortcut that you added to the list of custom shortcuts where it says Disabled, which will make New accelerator... appear after where it says Eclipse instead of Disabled. Press any keyboard shortcut combination to assign it to Eclipse.



            enter image description here



          6. In order to undo an existing keyboard shortcut, click the existing keyboard shortcut in the list of shortcuts and undo it using the Backspace key.






          share|improve this answer














          1. To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.


          2. Open any application, for example Eclipse, and check in the System Monitor app to find the name of the command to start that application from the terminal. For example, the command to start Eclipse is eclipse.


          3. Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.



          4. A new little Custom Shortcut window will open up. After where it says Name: type Eclipse. After where it says Command: type eclipse with a lowercase e. Click the Apply button to apply the new keyboard shortcut.



            enter image description here



            The command eclipse can also be customized to open eclipse with custom command line arguments.




          5. Click the Eclipse shortcut that you added to the list of custom shortcuts where it says Disabled, which will make New accelerator... appear after where it says Eclipse instead of Disabled. Press any keyboard shortcut combination to assign it to Eclipse.



            enter image description here



          6. In order to undo an existing keyboard shortcut, click the existing keyboard shortcut in the list of shortcuts and undo it using the Backspace key.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 9 '17 at 20:12

























          answered Nov 9 '17 at 17:07









          karel

          704817




          704817




















              up vote
              2
              down vote













              You can use the alias command in your .bashrc for simplifying commands (example):



              alias toclip='xclip -sel clip'


              which sens piped output to clipboard using xclip. So for comming closer to your question this could be:



              alias startup='eclipse /path/to/project'


              Or if a single line is not sufficient enough to start all you need you can define a function in your .bashrc (example):



              function extract tar.gz


              This defines for example a function extract which takes any kind of filename and tries to extract it. so to keep it more inline with what you want a small example how it could look like:



              function startup 
              eclipse /path/to/a/AFile
              eclipse /path/to/a/BFile
              eclipse /path/to/a/CFile
              eclipse /path/to/a/DFile



              The good of this approach is that you not have to worry about path variables and so on, you get them this way simply when you start your terminal. The above ones are just examples, you can put whatever you want into your alias or your function as long it is bash compliant.






              share|improve this answer






















              • Also a perfectly valid approach.
                – cprn
                Nov 9 '17 at 16:57






              • 1




                As always there are many ways leading to rome :)
                – Videonauth
                Nov 9 '17 at 17:01






              • 1




                I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
                – TMN
                Nov 9 '17 at 18:58














              up vote
              2
              down vote













              You can use the alias command in your .bashrc for simplifying commands (example):



              alias toclip='xclip -sel clip'


              which sens piped output to clipboard using xclip. So for comming closer to your question this could be:



              alias startup='eclipse /path/to/project'


              Or if a single line is not sufficient enough to start all you need you can define a function in your .bashrc (example):



              function extract tar.gz


              This defines for example a function extract which takes any kind of filename and tries to extract it. so to keep it more inline with what you want a small example how it could look like:



              function startup 
              eclipse /path/to/a/AFile
              eclipse /path/to/a/BFile
              eclipse /path/to/a/CFile
              eclipse /path/to/a/DFile



              The good of this approach is that you not have to worry about path variables and so on, you get them this way simply when you start your terminal. The above ones are just examples, you can put whatever you want into your alias or your function as long it is bash compliant.






              share|improve this answer






















              • Also a perfectly valid approach.
                – cprn
                Nov 9 '17 at 16:57






              • 1




                As always there are many ways leading to rome :)
                – Videonauth
                Nov 9 '17 at 17:01






              • 1




                I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
                – TMN
                Nov 9 '17 at 18:58












              up vote
              2
              down vote










              up vote
              2
              down vote









              You can use the alias command in your .bashrc for simplifying commands (example):



              alias toclip='xclip -sel clip'


              which sens piped output to clipboard using xclip. So for comming closer to your question this could be:



              alias startup='eclipse /path/to/project'


              Or if a single line is not sufficient enough to start all you need you can define a function in your .bashrc (example):



              function extract tar.gz


              This defines for example a function extract which takes any kind of filename and tries to extract it. so to keep it more inline with what you want a small example how it could look like:



              function startup 
              eclipse /path/to/a/AFile
              eclipse /path/to/a/BFile
              eclipse /path/to/a/CFile
              eclipse /path/to/a/DFile



              The good of this approach is that you not have to worry about path variables and so on, you get them this way simply when you start your terminal. The above ones are just examples, you can put whatever you want into your alias or your function as long it is bash compliant.






              share|improve this answer














              You can use the alias command in your .bashrc for simplifying commands (example):



              alias toclip='xclip -sel clip'


              which sens piped output to clipboard using xclip. So for comming closer to your question this could be:



              alias startup='eclipse /path/to/project'


              Or if a single line is not sufficient enough to start all you need you can define a function in your .bashrc (example):



              function extract tar.gz


              This defines for example a function extract which takes any kind of filename and tries to extract it. so to keep it more inline with what you want a small example how it could look like:



              function startup 
              eclipse /path/to/a/AFile
              eclipse /path/to/a/BFile
              eclipse /path/to/a/CFile
              eclipse /path/to/a/DFile



              The good of this approach is that you not have to worry about path variables and so on, you get them this way simply when you start your terminal. The above ones are just examples, you can put whatever you want into your alias or your function as long it is bash compliant.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 9 '17 at 19:06

























              answered Nov 9 '17 at 16:49









              Videonauth

              1,038718




              1,038718











              • Also a perfectly valid approach.
                – cprn
                Nov 9 '17 at 16:57






              • 1




                As always there are many ways leading to rome :)
                – Videonauth
                Nov 9 '17 at 17:01






              • 1




                I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
                – TMN
                Nov 9 '17 at 18:58
















              • Also a perfectly valid approach.
                – cprn
                Nov 9 '17 at 16:57






              • 1




                As always there are many ways leading to rome :)
                – Videonauth
                Nov 9 '17 at 17:01






              • 1




                I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
                – TMN
                Nov 9 '17 at 18:58















              Also a perfectly valid approach.
              – cprn
              Nov 9 '17 at 16:57




              Also a perfectly valid approach.
              – cprn
              Nov 9 '17 at 16:57




              1




              1




              As always there are many ways leading to rome :)
              – Videonauth
              Nov 9 '17 at 17:01




              As always there are many ways leading to rome :)
              – Videonauth
              Nov 9 '17 at 17:01




              1




              1




              I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
              – TMN
              Nov 9 '17 at 18:58




              I'd have suggested an alias like alias eclipse /path/to/eclipse, as that appears to be more in line with the original question.
              – TMN
              Nov 9 '17 at 18:58










              up vote
              0
              down vote













              You can use this command to create shortcut (short link), so simply:



              ln -s /path/to/file /path/to/symlink


              Goodluck!






              share|improve this answer
























                up vote
                0
                down vote













                You can use this command to create shortcut (short link), so simply:



                ln -s /path/to/file /path/to/symlink


                Goodluck!






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  You can use this command to create shortcut (short link), so simply:



                  ln -s /path/to/file /path/to/symlink


                  Goodluck!






                  share|improve this answer












                  You can use this command to create shortcut (short link), so simply:



                  ln -s /path/to/file /path/to/symlink


                  Goodluck!







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 9 '17 at 16:41









                  Tech. Pro

                  303




                  303



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403557%2fcreate-an-alias-or-shortcut-command-to-run-programme-in-ubuntu%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay