10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have file contents
/tmp/x/abc.txt
/home/bin/backup/sys/a.log
I need this output:
/tmp/x/
/home/bin/backup/sys/
Can somebody please help me out
Please use CODE tags as required by forum rules! (3 Replies)
Discussion started by: jhonnyrip
3 Replies
2. UNIX for Dummies Questions & Answers
Hello friends, I have a question.
Sometimes I have to search for an entry in a file that is repeated thousands of times. Can you tell me how to search so that i get limited results?
For example:
file: myfile.txt
grep "hello world" myfile.txt
this above grep will generate 5000... (4 Replies)
Discussion started by: DallasT
4 Replies
3. Shell Programming and Scripting
This one is a bit too challenging for me... Hopefully you guys can help.
Let's say I have a log file called:
"$MW_HOME/user_projects/domains/IDMDomain/servers/wls_ods?/logs/wls_ods1-diagnostic.log"
In this log file I want to search for "DIP-10219". When I execute this
$ cat... (7 Replies)
Discussion started by: exm
7 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I'm trying to get lines from a file using identifiers in the first two columns. I have used:
cat MasterFile.txt | grep -f Pattern.txt
and the lines I want display on screen. If I try to put them in a file the file is created but stays empty:
cat MasterFile.txt | grep -f Pattern.txt... (14 Replies)
Discussion started by: FGPonce
14 Replies
5. UNIX Desktop Questions & Answers
hey , i m trying to figure out how to do the following :
i got a text file the looks like so:
1031
1031
1031
1031
1031
1031
1031
1031
16500
16500
16500
16500
1031
1031 (4 Replies)
Discussion started by: boaz733
4 Replies
6. UNIX Desktop Questions & Answers
How would I grep for password file entry without using
grep 'username' /etc/passwd?
perhaps with who?
I want to create alias that will find the password file entry regardless of the user who is using it.
Thanks (4 Replies)
Discussion started by: alis
4 Replies
7. UNIX for Dummies Questions & Answers
How would I grep for password file entry without using
grep 'username' /etc/passwd?
perhaps with who?
I want to create alias that will find the password file entry regardless of the user who is using it.
I am trying to get the same exact line from the file entry like:
Name : Password : UserID... (7 Replies)
Discussion started by: alis
7 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
is there a way to extract the line number of an occurrence using grep?
I know that with the -n option it prints out the line number as well.
I would like to assign the line number to a variable.
Thanks,
Sarah (5 Replies)
Discussion started by: f_o_555
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
Is there any way of using grep (this may be done in awk, not sure?) that I can stop grep'n a file once I have found the first occurrence of my search string. Looking through grep man pages
-q will exit without printing the lines after the first match, but I need the output.
I have... (5 Replies)
Discussion started by: nhatch
5 Replies
10. Shell Programming and Scripting
Hi, I have a file that looks like this
dasdjasdjoasjdoasjdoa SYN dakspodkapsdka
asdasdasdasdasdasdasd SYN sdfsdfsdfsdfdf
shfishifhsdifhsidhfif fsdfsdfsdfsdfs
sdfsdfsdfsdsdfsdfsdff cercercercerce
sdasdajsdoajsodasodoo FIN dasdaskdpasdda... (4 Replies)
Discussion started by: hcclnoodles
4 Replies