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 10-17-2005, 08:03 PM   #1
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Rep: Reputation: 0
Help on Homework... Cant find .bashrc


I have a homework assignment due soon and I am completly stuck... it says i have to make a copy of my .bashrc file but ive been searching for it for a while but haven't found it... I've searched in multiple directories for it and i cant find anything on it. Below is a what my homework says to do... Any suggestions will help - thanks


-------------------------------Homework----------------------------------

CS-140 Fall 2005 Assignment 3: customizing the shell



Modify (or create) a copy of your .bashrc file as described below. Submit the file to the assignment 3 dropbox in D2L. The assignment is due Tuesday, October 18th, by 11:59pm.

Assignment: Customizing the Shell

The Assignment
This assignment is more free-form than previous ones. You'll be asked to make 3 different types of modifications to your .bashrc file, but you will have some discretion as to which specific changes to make.


Copy your .bashrc file
You could make inadvertent changes to your .bashrc file that hinder your ability to work in UNIX. It’s good to do your work on a copy of the .bashrc file first. Remember that files with a period at the beginning of their name are invisible. A good name for the copy might be "cs140_bashrc". If no .bashrc, create a new, empty file named cs140_bashrc.


Open the copy of the .bashrc file
The file may contain many lines of text that make no sense to you. You should leave these, and just add lines to the end of the copy of your .bashrc file.


Change the Prompt
You should set the prompt to display something other than the default. For full credit, the prompt should include the current working directory, user name, or other PS1 format string.


Set the History
You should tell the shell to keep 140 commands in its history, and echo the command you used to do this to the screen.


Alias
Alias at least 3 commands that will make your life easier. One common alias for DOS users is to alias dir to be recognized as some form of ls. You could make more descriptive names for other commands, like wordcount for wc.


Testing
You can see the effects of your changes to the copy of the .bashrc file immediately by using the command “source <file name>”. This causes the shell to run <file name> immediately.


Preparing Your Assignment
Submit the modified copy of your .bashrc file to the assignment 3 dropbox in D2L. If you wish, you can replace your existing .bashrc file with the modified version using the mv command.


---------------------------------End-------------------------------------
 
Old 10-17-2005, 08:09 PM   #2
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
the dot "." in front of .bashrc means its hidden and thus you must be looking for hidden files.
 
Old 10-17-2005, 08:15 PM   #3
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Original Poster
Rep: Reputation: 0
ya.. i looked through the hidden one also, but i didnt find it... i saw .cshrc .bash_history ect.
 
Old 10-17-2005, 08:18 PM   #4
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
I would assume then(I am no guru)that if you loked in your home dir and didn't find it...did you try the
locate
find
whereis
commands?
If not found, according to your instructions you are to create one.
 
Old 10-17-2005, 08:22 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,142

Rep: Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345
Per the rules:
Do not expect LQ members to do your homework - you will learn much more by doing it yourself.

http://www.linuxquestions.org/rules.php
 
Old 10-17-2005, 08:26 PM   #6
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I looked again but no luck... i realize that it says if its not there then i have to create one, but doesn't the .bashrc file have set variables and values that are only in the .bashrc file... and if i created one where do i get the script for it
 
Old 10-17-2005, 08:30 PM   #7
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Original Poster
Rep: Reputation: 0
im not expecting anyone to do it for me... i just want to know how to find it. once i find it ill do the rest myself
 
Old 10-17-2005, 08:49 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,142

Rep: Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345
BTW what distribution / version of linux are you running?
 
Old 10-17-2005, 08:52 PM   #9
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Original Poster
Rep: Reputation: 0
The Cd says Mandrake Linux 8.2
 
Old 10-17-2005, 09:15 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,142

Rep: Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345Reputation: 5345
Do you have a .bash_profile file?
 
Old 10-17-2005, 09:29 PM   #11
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I finished it all but i keep getting a syntax error when i try testing it... heres the code i added, any suggestions to fix it...

PS1="\w"
HISTSIZE="140"
alias dir='ls'
alias wordcount='wc'
alias remove='rm'
 
Old 10-17-2005, 09:39 PM   #12
maravillasc
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Nevermind.. i fixed it..... thanks alot for the help
 
  


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
I can't find .bashrc in slackware ngan_yine Slackware 12 12-11-2019 09:50 AM
making alias, can't find .bashrc file djgerbavore Slackware 10 07-23-2004 08:23 AM
where could i find the file bashrc Paxmaster Linux - Software 4 07-15-2004 01:47 PM
Is this a valid command? find ./ -name bash.bashrc | cat davidas Linux - Newbie 11 04-06-2004 02:16 AM
HELP !!!can't find my .bashrc deadhead Slackware 4 11-03-2003 11:16 AM

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

All times are GMT -5. The time now is 10:06 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
Open Source Consulting | Domain Registration