Sponsored Content
Special Forums Windows & DOS: Issues & Discussions win2008R2 using gnu grep/awk to find only the I instance out of the command Post 302662475 by nextreme on Tuesday 26th of June 2012 03:16:11 PM
Old 06-26-2012
output that I need to get would be this:
Code:
0  B  06/11/2012 13:03:39             STANDARD             I  \\virttsm\f$\FILES1
0  B  06/11/2012 13:03:39             STANDARD             I  \\virttsm\f$\FILES2
0  B  06/11/2012 13:03:39             STANDARD             I  \\virttsm\f$\FILES3
0  B  06/11/2012 13:03:39             STANDARD             I  \\virttsm\f$\FILES4

Where I need to key off of that damn (I). No changes, but grep just can't get er done...

Code:
0  B  06/11/2012 13:55:09             STANDARD             A  \\virttsm\f$\db001
0  B  06/11/2012 16:08:16             STANDARD             A  \\virttsm\f$\FILES
0  B  06/11/2012 13:03:39             STANDARD             I  \\virttsm\f$\FILES
0  B  06/11/2012 13:55:09             STANDARD             A  \\virttsm\f$\db001

---------- Post updated at 03:16 PM ---------- Previous update was at 03:14 PM ----------

Quote:
Originally Posted by Corona688
Code:
awk '$1 >= 0 { print $6 }'


this does not work...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find command with Grep

I need to find for a particular string in my /opt file system. find . -exec grep "10000" {} \; I tried this command, it works ok but I want not to search in the logs folder I have in my filesystem as it takes lot of time. SO can I exclude one or more than on directory or sub directories from... (10 Replies)
Discussion started by: venu_nbk
10 Replies

2. UNIX for Dummies Questions & Answers

grep, find or awk?

Since I found this very helpful forum and friendly people, I have a small request. I use AIX Unix and would like to know if there's a simple way how to do a kind of compare between two files. Should I use some grep, find or awk? I have 2 text files, let's name them file1 and file2. What I... (4 Replies)
Discussion started by: netrom
4 Replies

3. UNIX for Dummies Questions & Answers

| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax

Hello, I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide. ls -aLl /bin | grep "\(x\)" Which works, just highlights 'x' where ever, when ever. I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies

4. Shell Programming and Scripting

awk - find first instance of string after NR==10

How do I use awk to find the NR of first instance of a specific string after eg NR==10? I need to find the first instance of the word "class" after a specific NR. (2 Replies)
Discussion started by: locoroco
2 Replies

5. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

6. Shell Programming and Scripting

grep second instance of same string

Hi all, i am new to unix scripting in ksh or any shell for that matter. I have downloaded a xml file from a website and saved on my local harddrive. inside the xml, the same tag is listed multiple times. <title>Tonight</title> <title>Thursday</title> <title>Friday</title>... (6 Replies)
Discussion started by: scubasteve39
6 Replies

7. Shell Programming and Scripting

grep for a string until instance of a space

Hey guys, I'm having a bit of trouble getting this to work using either sed or grep. It's possible awk might be the ticket I need as well, but my regulat expression skills aren't quite up to the task for doing this. I'm looking to grep for the string ERROR from the following log up until any... (6 Replies)
Discussion started by: terrell
6 Replies

8. Shell Programming and Scripting

How can I just grep one instance of a word in the file

I want to grep some information out of the dmidecode but when I type dmidecode | grep Memory I get several instances of the word. Is there a way I can just choose which instance I want to display? (8 Replies)
Discussion started by: jcnewton13
8 Replies

9. UNIX for Advanced & Expert Users

Grep the only instance name

Hi, I want to get the only application name from the server. Ex: if i give $ ps -ef | grep bw. It will show all BW process with entire path. It will little confuse to list out the process. Can anyone have syntax to get only the instance name. I need this for be, hawk,ems also. Please... (2 Replies)
Discussion started by: ckchelladurai
2 Replies

10. Shell Programming and Scripting

One instance of comparing grep and awk

Hi. In thread https://www.unix.com/shell-programming-and-scripting/267833-grouping-counting.html rovf and I had a mini-discussion on grep and awk. Here is a demo script that compares the awk and grep approaches for this single problem: #!/usr/bin/env bash # @(#) s2 Demonstrate group... (1 Reply)
Discussion started by: drl
1 Replies
QSTAT(1)						User Contributed Perl Documentation						  QSTAT(1)

NAME
qstat - display job/partition information in a familiar pbs format SYNOPSIS
qstat [-f] [-a|-i|-r] [-n [-1]] [-G|-M] [-u user_list] [-? | --help] [--man] [job_id...] qstat -Q [-f] qstat -q DESCRIPTION
The qstat command displays information about jobs. OPTIONS
-a Displays all jobs in a single-line format. See the STANDARD OUTPUT section for format details. -i Displays information about idle jobs. This includes jobs which are queued or held. -f Displays the full information for each selected job in a multi-line format. See the STANDARD OUTPUT section for format details. -G Display size information in gigabytes. -M Show size information, disk or memory in mega-words. A word is considered to be 8 bytes. -n Displays nodes allocated to a job in addition to the basic information. -1 In combination with -n, the -1 option puts all of the nodes on the same line as the job id. -r Displays information about running jobs. This includes jobs which are running or suspended. -u user_list Display job information for all jobs owned by the specified user(s). The format of user_list is: user_name[,user_name...]. -? | --help brief help message --man full documentation STANDARD OUTPUT
Displaying Job Status If the -a, -i, -f, -r, -u, -n, -G, and -M options are not specified, the brief single-line display format is used. The following items are displayed on a single line, in the specified order, separated by white space: the job id the job name the job owner the cpu time used the job state C - Job is completed after having run E - Job is exiting after having run. H - Job is held. Q - job is queued, eligible to run or routed. R - job is running. T - job is being moved to new location. W - job is waiting for its execution time (-a option) to be reached. S - job is suspended. the queue that the job is in If the -f option is specified, the multi-line display format is used. The output for each job consists of the header line: Job Id: job identifier followed by one line per job attribute of the form: attribute_name = value If any of the options -a, -i, -r, -u, -n, -G or -M are specified, the normal single-line display format is used. The following items are displayed on a single line, in the specified order, separated by white space: the job id the job owner the queue the job is in the job name the session id (if the job is running) the number of nodes requested by the job the number of cpus or tasks requested by the job the amount of memory requested by the job either the cpu time, if specified, or wall time requested by the job, (in hh:mm) the job state The amount of cpu time or wall time used by the job (in hh:mm) EXIT STATUS
On success, qstat will exit with a value of zero. On failure, qstat will exit with a value greater than zero. perl v5.14.2 2012-04-10 QSTAT(1)
All times are GMT -4. The time now is 10:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy