LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-15-2012, 01:24 PM   #1
dannyboy02
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Rep: Reputation: Disabled
bash Linux login file


Please help,... when using Pico how can I open and edit the bash Linux login file (stored in your Linux root directory). I would like to add the new commands for items listed below.


a) display contents of a directory => mycd

b) display date and time => mydt

c) logoff => myexit
 
Old 06-15-2012, 01:36 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
you ought to read man bash about how to add functions like mycd, mydt or myexit and also about the login process and what does the "linux login file" mean. see here: http://www.thegeekstuff.com/2008/10/...d-bash_logout/







__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
Old 06-15-2012, 01:41 PM   #3
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
Why would you want to add a "mycd" alias that just does the same thing as the built in "ls"? Similarly, why would you want to add a "mydt" alias that just does the same thing as "date"? Wouldn't it be easier to just learn the built in commands, especially since "ls" is half the number of characters as "mycd"?
 
Old 06-15-2012, 01:45 PM   #4
dannyboy02
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
well its for an assignment, Linux is new to me, im trying to see exactly what i need to do, but im pretty clueless on this one....help is appreciated = )
 
Old 06-15-2012, 01:48 PM   #5
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
In that case...

The bash login file is generally ~/.bashrc, though it can vary from distribution to distribution. You should be able to find more info with "man bash"
"alias" is probably the command that you're looking for. As above, you can find info on how to use it with "man bash".
 
Old 06-18-2012, 09:14 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
You need to bookmark/read this http://rute.2038bug.com/index.html.gz, & bookmark/use this http://linux.die.net/man/ to research 'alias' ...
See also login file '.bash_profile'

One last hint : if a filename begin with the '.' char, then it will not show up using the (bare) ls cmd; you'll need the -a switch as well.

Last edited by chrism01; 06-18-2012 at 09:15 PM.
 
  


Reply



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
Linux Bash - Is it even possible to login into multiple email accounts? gqchynaboy Programming 2 02-03-2010 02:11 PM
How can i bypass login password screen in linux Bash neo141 Linux - Newbie 5 05-15-2009 03:16 AM
how can i use bash-file with Linux caomeisanhao Linux - Security 2 03-08-2005 05:07 AM
At the bash prompt, how do I login to Mandrake Linux? PDASquare Linux - Newbie 2 11-20-2003 07:57 PM
systemwide bash login shell cleanup file markus1982 Linux - General 2 05-10-2003 08:35 AM

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

All times are GMT -5. The time now is 09:46 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