LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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


Closed Thread
  Search this Thread
Old 12-20-2016, 07:25 PM   #1
dash3815
LQ Newbie
 
Registered: Dec 2016
Posts: 6

Rep: Reputation: Disabled
linux Consider the concept of regular expression.


a) find all jpg files from the entire file system. Hint: use the command find -name.

b) find all lines beginning with a or j, from all the files in the current directory. Hint: use grep.

c). find all the lines beginning with the character a and end with one or more occurrences of the character o, followed by n, from all the files in the current directory. Hint: use egrep with meta symbols, ?, *, +, etc.
 
Old 12-20-2016, 07:27 PM   #2
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hint: Do your own work.

What have you tried so far?
 
Old 12-20-2016, 07:30 PM   #3
dash3815
LQ Newbie
 
Registered: Dec 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
linux

im really new who this whole linux thing. taking a while for me to get it. do you know what to do or answer to the question


Quote:
Originally Posted by Sefyir View Post
Hint: Do your own work.

What have you tried so far?
 
Old 12-20-2016, 07:53 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,160

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Read the rules - we won't do your homework. We will help if you have problems after trying.
Check the manpage for each hint you were given (man grep) - use q (for quit) to exit the manpage.
 
1 members found this post helpful.
Old 12-20-2016, 08:13 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,799

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by dash3815 View Post
im really new who this whole linux thing. taking a while for me to get it. do you know what to do or answer to the question
Yes...the answer is "Don't post your homework questions and ask for a handout"...again...as you have in your OTHER two threads, where you were told the EXACT SAME THING.

AGAIN...we will help you, but YOU, PERSONALLY have to show us what work/effort/ideas you have put into finding the answers.
 
Old 12-20-2016, 09:17 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Pay attention in class. Use the books and materials provided. Ask the instructor for help after class. Ask your classmates for a study group time and location.

The point of being in school is to learn how to learn. Going to a forum and asking for exact answers to questions isn't going to help you in the long run. Especially if those answers are very easy to find answers to with a quick 'man find' or 'man grep' or 'find --help' or 'grep --help' or google 'linux find all jpg files'.

Wish you the best of luck with class though.
 
Old 12-21-2016, 01:16 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,702
Blog Entries: 19

Rep: Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502
Quote:
Originally Posted by dash3815 View Post
a) find all jpg files from the entire file system. Hint: use the command find -name.

b) find all lines beginning with a or j, from all the files in the current directory. Hint: use grep.

c). find all the lines beginning with the character a and end with one or more occurrences of the character o, followed by n, from all the files in the current directory. Hint: use egrep with meta symbols, ?, *, +, etc.
Every one of these questions comes with a hint on how to solve it. So how can you say you don't know what to do? I've never seen such bone idleness!
 
Old 12-21-2016, 01:30 AM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,855

Rep: Reputation: 1149Reputation: 1149Reputation: 1149Reputation: 1149Reputation: 1149Reputation: 1149Reputation: 1149Reputation: 1149Reputation: 1149
I've just checked all the threads started by this particular member - they're all related to homework! Where's their work ethic?
 
Old 12-21-2016, 02:33 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,702
Blog Entries: 19

Rep: Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502Reputation: 4502
Oh for God's sake! Just blacklist him.
 
Old 12-21-2016, 07:25 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,799

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by ferrari View Post
I've just checked all the threads started by this particular member - they're all related to homework! Where's their work ethic?
You can't bring that up...it's apparently a bad/racist/bigoted/mean/insert-derogatory-word-here thing to mention. I always remember something I heard years ago: people will be exactly as lazy and stupid as the folks around them LET THEM BE.

We all worked with folks before, and the lazy ones on the team only got away with it, if the other team members pulled him along. Once folks stop doing such things, the lazy person will whinge and complain about how "no one helps them"...and one of two things happens:
  • They leave
  • They actually learn, become productive, and contribute
Either way: problem solved. My experience has been about a 70-30 split. But that 30% that learns turn out to be some of the best folks.
 
Old 12-21-2016, 07:53 AM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,706
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
When I was in college (never mind, you young whippersnappers ...!), they spoke of "computer anxiety" and I didn't believe it until I saw it for myself. Those were the days of timesharing terminals, and one student came into our office in tears, saying that the computer wasn't working. So, I went to help her.

She had arranged the area around her terminal like a surgeon's booth, with the homework instructions, her BASIC program written out on the coding-form that she had dutifully purchased, and the terminal. I walked up, reached behind the terminal to the power switch and turned it on ... and she said: "Stop. Thank you." She fairly shushed me out of the room. You can deduce what had happened by now, and so did she. I wouldn't steal her (remaining) pride for anything. I just smiled and said, "okay, you know where our offices are," and left the room.

- - - - -

As far as this student is concerned: there is only one way to learn how to do this sort of thing, and you might in due time find that it is not the line of work for you. In the meantime, it is much harder than it looks(!) because you are learning a skill. And, as others have said, "learning how to learn this sort of thing." With practice it can become second-nature but in the short term it will feel like someone has hit you in the face with an ice-cold iron skillet.

"Over here is a collection of useful software tools, sitting in a tool box. Over there is a list of tasks that you are to do, somehow using one or more of these tools. (The instructor gives you a hint, at this point, but won't do so later ...)

There is nothing deterministic about this assignment. I'm sure that the student would be well-schooled (ahem ...) in tackling the problem if it had been presented as a multiple-choice test in which he already knew that one of the five possible answers given on the page was the right one and that the other four were wrong. Thanks to our "No Child Left Behind" (sic) [non-]educational system, he'd be able to find the answer by an experienced process of elimination ... knowing that the teacher would, if necessary, give him the correct answer in order to keep her job.

But that's not what a computer professional does for a living. A computer professional, even more than "writing software," uses tools, and selects the proper tool to use (Tim Toady: "TMTOWTDI == there's more than one way to do it™"). Having decided how to use the tool(s) to perform the task, s/he also must verify that the result is entirely complete and correct. It's considerably harder than it looks.

Last edited by sundialsvcs; 12-21-2016 at 08:01 AM.
 
Old 12-21-2016, 11:50 AM   #12
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,534

Rep: Reputation: Disabled
To learn, you need to read, hints are given in each question.
Read the man page for each of those programs, & you will find your answer.
 
Old 12-21-2016, 11:53 AM   #13
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,885
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
 
  


Closed Thread


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 shell script for regular expression in expect command rahulevince Linux - Newbie 2 07-09-2016 11:01 AM
[SOLVED] Is there a command that can match a string with regular expression in linux ? 915086731 Linux - General 13 08-22-2011 02:45 AM
Regular Expression 0.o Programming 3 06-09-2009 02:28 AM
regular expression Ammad Linux - General 5 08-01-2008 07:41 AM
Anyone know regular expression? ahhua Linux - Software 1 12-04-2003 08:13 AM

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

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