LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help on Homework... Cant find .bashrc (https://www.linuxquestions.org/questions/linux-newbie-8/help-on-homework-cant-find-bashrc-374091/)

maravillasc 10-17-2005 08:03 PM

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-------------------------------------

lord-fu 10-17-2005 08:09 PM

the dot "." in front of .bashrc means its hidden and thus you must be looking for hidden files.

maravillasc 10-17-2005 08:15 PM

ya.. i looked through the hidden one also, but i didnt find it... i saw .cshrc .bash_history ect.

lord-fu 10-17-2005 08:18 PM

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.

michaelk 10-17-2005 08:22 PM

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

maravillasc 10-17-2005 08:26 PM

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

maravillasc 10-17-2005 08:30 PM

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

michaelk 10-17-2005 08:49 PM

BTW what distribution / version of linux are you running?

maravillasc 10-17-2005 08:52 PM

The Cd says Mandrake Linux 8.2

michaelk 10-17-2005 09:15 PM

Do you have a .bash_profile file?

maravillasc 10-17-2005 09:29 PM

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'

maravillasc 10-17-2005 09:39 PM

Nevermind.. i fixed it..... thanks alot for the help


All times are GMT -5. The time now is 02:53 AM.