Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need help with a newbie issue... it's just a basic thing, but it is not working. I have installed R (in Trisquel 4, a gnome ubuntu-like distro), a software that must be used from the terminal. Therefore, I want to create a shortcut to it, to avoid typing the whole route to the program: i.e. just typing R and that the program starts...
So, here is what I did:
Code:
sudo ln /bin/R-2.11.1./bin/R R
But when I type "R", it doesn't start.
Before you ask, yes, the folder is called "R-2.11.1." and the installation was succesfull because I have tried it and it works.
If I type
Code:
/bin/R-2.11.1./bin/R
, it does run...
So... where is my mistake? Do I need to move the shortcut somewhere else?
Well, thanks for your replies and ideas!! I'm not at my Linux computer right now, but when I come back home I'll give it a try!! I'll post later again! Thanks!
Well, thanks for your replies and ideas!! I'm not at my Linux computer right now, but when I come back home I'll give it a try!! I'll post later again! Thanks!
You could setup a .bashrc & .bash_profile for your user;
Code:
sample .bash_profile;
Code:
~$ cat .bash_profile
# .bash_profile
#08-30-06 12:21
#
# Source .bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
Code:
sample .bashrc;
:~$ cat .bashrc
#.bashrc
#08-30-06 12:20
# Add bin to path
export PATH="$PATH:/sbin:/usr/sbin:$HOME/bin"
#export PATH="$PATH:$HOME/bin"
# Dynamic resizing
shopt -s checkwinsize
# Custom prompt
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#08-29-06 11:40
if [ `id -un` = root ]; then
PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
else
PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
fi
#
# Add color
eval `dircolors -b`
# User defined aliases
alias cls='clear'
alias clls='clear; ls'
alias ll='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias na='nano'
alias web='links -g -download-dir ~/ www.google.com'
#new User Alias for 'cruzdelsur'
alias uR='/bin/R-2.11.1./bin/R'
#08-29-06 11:50
#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
trap "rm -f ~$LOGNAME/.bash_history" 0
#The older KSH-style form
# trap 0 rm -f ~$LOGNAME/.bash_history
I need help with a newbie issue... it's just a basic thing, but it is not working. I have installed R (in Trisquel 4, a gnome ubuntu-like distro), a software that must be used from the terminal. Therefore, I want to create a shortcut to it, to avoid typing the whole route to the program: i.e. just typing R and that the program starts...
What you probably want then is called an "alias", you should check the docs for your shell to discover how to set up an alias for a given command, in bash you just put the right command on your ~/.bashrc and/or ~/.bash_profile depending on what do you exactly want. "man bash" will give you more info about that.
Code:
alias r='/path/to/R'
Then just run "r" after restarting your shell.
Quote:
So, here is what I did:
Code:
sudo ln /bin/R-2.11.1./bin/R R
But when I type "R", it doesn't start.
Before you ask, yes, the folder is called "R-2.11.1." and the installation was succesfull because I have tried it and it works.
If I type
Code:
/bin/R-2.11.1./bin/R
, it does run...
You are assuming that the current directory will be in your search $PATH, but that's not true in Linux for security reasons (unlike in DOS).
Quote:
So... where is my mistake? Do I need to move the shortcut somewhere else?
Thanks guys!
You either use an alias, or put the link into a directory that's in your path, or just add /bin/bin (weird path by the way) to your $PATH, that way you can run 'R' directly without needing any intermediaries.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.