LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-08-2018, 04:15 AM   #1
debkumar
LQ Newbie
 
Registered: Oct 2018
Posts: 1

Rep: Reputation: Disabled
What is output in theory only for the below commands


#cat /etc/fstab |egrep -i ""
#cat /etc/fstab |egrep -i "/"
# /opt/gs-utils/inq -hba

Last edited by debkumar; 10-08-2018 at 06:14 AM. Reason: Question update
 
Old 10-08-2018, 04:42 AM   #2
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
I invite you to enter:
Code:
man egrep
You will find what option "-i" stands for and what its purpose is (see "Matching Control" section).

NB1: as egrep is the same as grep -E, you may find your answers with:
Code:
man grep
as well...

NB2:
Code:
egrep ""
will return each line as your pattern is empty.

NB3: as is, your commands will return nothing as they are prefixed with '#' (sign to indicate a comment).

Last edited by l0f4r0; 10-08-2018 at 04:47 AM.
 
1 members found this post helpful.
Old 10-08-2018, 07:16 AM   #3
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 279

Rep: Reputation: 100Reputation: 100
Why don't you try the first 2 yourself ? They just read file, do not change anything, no risk.

The third one, I don't know what it is.

And as said by l0f4r0, if those commands are in a script, they are commented, nothing will happen.
 
Old 10-08-2018, 07:22 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I don't really like if you modify the original post after the first answer. That may lead to conflicts...
I don't know if you [want to] use it as root (that is your #) or those lines are commented and/or copied from somewhere. Can you please add some more details. Is this your homework?
 
Old 10-08-2018, 08:00 AM   #5
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,489

Rep: Reputation: Disabled
Likely to be homework as it's a first post, & all about one command.
 
Old 10-08-2018, 08:06 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yeah, I was going to ask what number is that one?
if you got a liunx box, then try issuing the command to give you a good idea on what that answer should be....
Code:
userx@manjaroieo:~
$ cat /etc/fstab |egrep -i "/"
# /etc/fstab: static file system information.
UUID=9314724d-c954-4d76-aedf-4e0cb17c2705 /              ext4    defaults,noatime,discard 0 1
UUID=ffb281eb-7a82-45f7-b444-9d37e0dfd6bb /home          ext4    defaults,noatime 0 2
UUID=47E540DF2714E6A5                     /media/ntfs1   ntfs    defaults,noatime 0 2
UUID=eb3b4090-d341-4f20-927d-c5414254b767 /media/data1   ext4    defaults,noatime 0 2
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0


then loop it up
$ man egrep

looking to see what that '-i' does, and figuring out what does the pattern in the quotes do..

then experiment with it

userx@manjaroieo:~
$ cat /etc/fstab |egrep -i "UUID"
# be used with UUID= as a more robust way to name devices that works even if
UUID=9314724d-c954-4d76-aedf-4e0cb17c2705 /              ext4    defaults,noatime,discard 0 1
UUID=ffb281eb-7a82-45f7-b444-9d37e0dfd6bb /home          ext4    defaults,noatime 0 2
UUID=47E540DF2714E6A5                     /media/ntfs1   ntfs    defaults,noatime 0 2
UUID=eb3b4090-d341-4f20-927d-c5414254b767 /media/data1   ext4    defaults,noatime 0 2

Last edited by BW-userx; 10-08-2018 at 08:12 AM.
 
Old 10-09-2018, 01:40 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
also, useless use of cat.
Code:
egrep -i "/" /etc/fstab
does the same (but doesn't really make sense).
 
  


Reply



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
Search commands esm03 Linux - Newbie 8 06-27-2006 02:04 AM
Beagle error message when trying to search files Kevin Tough Fedora 1 05-23-2006 06:52 PM
simple search commands in linux t3___ Linux - Newbie 6 06-08-2004 01:16 PM
basic linux commands... search? Mytherall Linux - Newbie 1 02-23-2004 06:52 AM
Search Program error message ZhiYi Linux - General 1 03-09-2003 08:43 AM

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

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