Create an alias or shortcut command to run programme in ubuntu
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
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.
ubuntu
add a comment |Â
up vote
2
down vote
favorite
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.
ubuntu
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
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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.
ubuntu
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.
ubuntu
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
add a comment |Â
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
add a comment |Â
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 permissionx
- 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 terminalPATH
- work on variable namedPATH
=
- assign it a new value, which is$PATH
- the old value:
- a separator$HOME/bin
- and your newly createdbin
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.
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
add a comment |Â
up vote
4
down vote
To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.
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
.Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.
A new little Custom Shortcut window will open up. After where it says Name: type
Eclipse
. After where it says Command: typeeclipse
with a lowercase e. Click the Apply button to apply the new keyboard shortcut.The command
eclipse
can also be customized to open eclipse with custom command line arguments.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.
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.
add a comment |Â
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.
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 likealias eclipse /path/to/eclipse
, as that appears to be more in line with the original question.
â TMN
Nov 9 '17 at 18:58
add a comment |Â
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!
add a comment |Â
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 permissionx
- 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 terminalPATH
- work on variable namedPATH
=
- assign it a new value, which is$PATH
- the old value:
- a separator$HOME/bin
- and your newly createdbin
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.
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
add a comment |Â
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 permissionx
- 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 terminalPATH
- work on variable namedPATH
=
- assign it a new value, which is$PATH
- the old value:
- a separator$HOME/bin
- and your newly createdbin
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.
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
add a comment |Â
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 permissionx
- 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 terminalPATH
- work on variable namedPATH
=
- assign it a new value, which is$PATH
- the old value:
- a separator$HOME/bin
- and your newly createdbin
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.
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 permissionx
- 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 terminalPATH
- work on variable namedPATH
=
- assign it a new value, which is$PATH
- the old value:
- a separator$HOME/bin
- and your newly createdbin
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.
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
add a comment |Â
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
add a comment |Â
up vote
4
down vote
To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.
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
.Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.
A new little Custom Shortcut window will open up. After where it says Name: type
Eclipse
. After where it says Command: typeeclipse
with a lowercase e. Click the Apply button to apply the new keyboard shortcut.The command
eclipse
can also be customized to open eclipse with custom command line arguments.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.
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.
add a comment |Â
up vote
4
down vote
To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.
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
.Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.
A new little Custom Shortcut window will open up. After where it says Name: type
Eclipse
. After where it says Command: typeeclipse
with a lowercase e. Click the Apply button to apply the new keyboard shortcut.The command
eclipse
can also be customized to open eclipse with custom command line arguments.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.
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.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.
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
.Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.
A new little Custom Shortcut window will open up. After where it says Name: type
Eclipse
. After where it says Command: typeeclipse
with a lowercase e. Click the Apply button to apply the new keyboard shortcut.The command
eclipse
can also be customized to open eclipse with custom command line arguments.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.
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.
To add a custom keyboard board shortcut open System Settings and select Keyboard -> Shortcuts tab -> Custom Shortcuts.
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
.Click the + button in the lower left corner of the Shortcuts pane to add a new keyboard shortcut.
A new little Custom Shortcut window will open up. After where it says Name: type
Eclipse
. After where it says Command: typeeclipse
with a lowercase e. Click the Apply button to apply the new keyboard shortcut.The command
eclipse
can also be customized to open eclipse with custom command line arguments.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.
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.
edited Nov 9 '17 at 20:12
answered Nov 9 '17 at 17:07
karel
704817
704817
add a comment |Â
add a comment |Â
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.
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 likealias eclipse /path/to/eclipse
, as that appears to be more in line with the original question.
â TMN
Nov 9 '17 at 18:58
add a comment |Â
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.
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 likealias eclipse /path/to/eclipse
, as that appears to be more in line with the original question.
â TMN
Nov 9 '17 at 18:58
add a comment |Â
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.
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.
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 likealias eclipse /path/to/eclipse
, as that appears to be more in line with the original question.
â TMN
Nov 9 '17 at 18:58
add a comment |Â
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 likealias 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
add a comment |Â
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!
add a comment |Â
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!
add a comment |Â
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!
You can use this command to create shortcut (short link), so simply:
ln -s /path/to/file /path/to/symlink
Goodluck!
answered Nov 9 '17 at 16:41
Tech. Pro
303
303
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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