LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-14-2014, 04:39 PM   #1
fatou
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Rep: Reputation: Disabled
how to add alias to my profile ?


Hello,

I'm running Red Hat Enterprise Linux Server release 6.2 (Santiago).
How to copy this directory "/home/cs/tools" to my $PATH please ?

Fatou
 
Old 04-14-2014, 04:57 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Stick
Code:
export PATH=$PATH:/home/cs/tools
in one of your startup scripts, ~/.bashrc or ~/.bash_profile typically, assuming you use bash.
 
Old 04-14-2014, 05:47 PM   #3
fatou
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks Skick,

Not sure which kind of profile I'm using, so here sending some output with errors:

1- -bash-4.1$ cat .bashrc
cat: .bashrc: Too many levels of symbolic links


2- -bash-4.1$ cat ~/.bash_profile
cat: /home/akonan/.bash_profile: No such file or directory


3- bash-4.1$ cat ~/.profile shows files and aliases.
so I guess I use .profile

Isn't it ?
 
Old 04-14-2014, 05:53 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
It looks like you're using a different shell. What is the output of
Code:
echo $0
and
Code:
echo $SHELL
?
 
Old 04-14-2014, 05:55 PM   #5
fatou
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
-bash-4.1$ echo $0
-bash

==
-bash-4.1$ echo $SHELL
/bin/bash
 
Old 04-14-2014, 06:03 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Odd

Well you should be able to use .profile

Just add it in .profile, then close your terminal and open a new one (or logout and back in if connecting through ssh), and
Code:
echo $PATH
to make sure it's there.

Some login files only take effect when you fully log out and back in, so that may be necessary if you're using the computer locally rather than logging in remotely (.bash_profile is that way, not sure about .profile).
 
Old 04-14-2014, 06:03 PM   #7
fatou
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Then I have this homework to do:

===
2) create a ~/.testme to store your login and password

chmod 700 ~/.testme as you put your password clear, better to keep it safe

put the 2 lines in the file:

USER=MYTESTLOGIN

PASSWD="My password" (put it between double quotes, don't use quotes in your password)

How to create that ~/.testme file and its content ?
 
Old 04-14-2014, 06:05 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You can use any text editor of your choice. Popular options are kate, gedit, emacs, vi (vim), pico, or nano. The last 3 are command line, the first 3 are GUI (actually emacs can go either way).
 
Old 04-14-2014, 06:09 PM   #9
fatou
LQ Newbie
 
Registered: Apr 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Looks like it's there

==
-bash-4.1$ echo $PATH

/client64/bin:/home/cs/tools
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add new alias nasridine Linux - Newbie 3 02-18-2010 11:47 AM
alias in /etc/profile not working samogensen Linux - Server 1 07-05-2007 08:50 PM
Add Second Gateway for Alias ETH0 linchat Linux - Networking 2 01-06-2006 04:10 PM
alias in /etc/profile Smokey Slackware 13 08-24-2004 03:16 PM
add an alias gubak Linux - Networking 3 08-12-2004 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration