LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 02: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, 02:36 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
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, 02:41 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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, 02: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, 02:48 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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, 10:14 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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 10:15 PM.
 
  


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


All times are GMT -5. The time now is 02:11 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration