LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help with this question (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-with-this-question-4175549051/)

nwtotech 07-27-2015 09:22 AM

Need help with this question
 
Go to this existing directory "/var/log", create a log file called "texas.log". Make the following entries in the file and save it:
Dallas
Austin
Houstin

can some one help with this question.

schneidz 07-27-2015 09:36 AM

Welcome to LQ! We'd very much like to help, but your current thread makes that difficult. Please visit http://www.linuxquestions.org/questi...#faq_lqwelcome for some additional information on how you can help us help you. If you have any questions or need additional clarification, just let us know.

nwtotech 07-27-2015 09:45 AM

Thanks , the question is in existing directory " /var/log " create a log file call texas.log include the following entries in the file, dallas,austin,houstin and safe it .how do i go about the commands to this , creating the file ,and making the entries in the file and safe it.

schneidz 07-27-2015 09:48 AM

i would run:
Code:

vi /var/log/texas.log
type in the lines i want. then save it.

rokytnji 07-27-2015 10:06 AM

might need to be root or sudo in terminal to write to var maybe?

Code:

harry@biker1:~$ cat /var/log/texas.log
Pecos
Balmorreh
Terlingua
Austin
Dallas
Houstin
Luckenbach
Uvalde
Presidio
Ft Hancock
Esperanza
##more to come at a location near you##
harry@biker1:~$


jdkaye 07-27-2015 10:42 AM

Is this homework by any chance? Can you tell us what you have tried so far and where you got stuck.
jdk

fatmac 07-27-2015 01:04 PM

...or even
Code:

echo "Dallas\nAustin\nHoustin" >> texas.log

nwtotech 07-27-2015 01:25 PM

Thanks to you all, i think i got a lead.
i did ...
cd /var/log
ls
touch texas.log
ls
but where i got real lost is to make the entries dallas,austin ,houstin in the file created.
Thanks for the lead will try to do it again.

Habitual 07-27-2015 02:07 PM

Code:

vi /var/log/texas.log
do the needful and exit vi.
Do you know how to exit and save a file in vi?

suicidaleggroll 07-27-2015 02:52 PM

Quote:

Originally Posted by nwtotech (Post 5396951)
Thanks to you all, i think i got a lead.
i did ...
cd /var/log
ls
touch texas.log
ls
but where i got real lost is to make the entries dallas,austin ,houstin in the file created.
Thanks for the lead will try to do it again.

It's a text file, so open it up in a text editor and add whatever you want. vi, pico, nano, gedit, kate...all are text editors, pick one, there are tons of choices.

This sounds like it's homework...


All times are GMT -5. The time now is 04:00 PM.