I want to search a file for a string and then if the string is found I need the line that the string is on - but also the previous two lines from the file (that the pattern will not be found in)
This is on solaris
Can you help? (2 Replies)
Hi,
I'm looking for a single command that will be able tell me which files in a directory don't contain a certain pattern e.g. regular expression
I've tried a combination of ls, xargs and grep but I haven't come up with anything yet. :confused:
I would appreciate any help.
Thanks (2 Replies)
Hi All,
I have two directories as
1) mi/job -> job1.sh, job2.sh, job3.sh
2) mi/sysin -> sysin1, sysin2, sysin3,sysin4
I want to wrrite a script such that it should accept two parameters as directory paths.
$ myscript mi/sysin mi/job.
The script should be able to scan all files... (3 Replies)
I am trying to do some thing like this ..
In a file , if pattern found insert new pattern at the begining of the line containing the pattern.
example:
in a file I have this.
gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin
if i find feedthru_pin want to insert !! at the... (7 Replies)
Here Is a problem I am facing with awk.
Query --> I want to search for a string in a file and print next 15 lines below the matched string.
1.We do not have GNU grep so cannot use grep -A or grep -B commands.
2. Instead of passing the search pattern as a string to awk. I want the awk to... (4 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Hi I want to search pattern in file "S12345678B" which start with S and end with B total length is 10,numeric part 12345678 is variable.
e.g S99001229B and S88226901B.
please help (4 Replies)
Hi I want to search pattern in file "S12345678B" which start with S and end with B total length is 10,numeric part 12345678 is variable.
e.g S99001229B and S88226901B.
please help (2 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT CENTOS
trace-cmd
TRACE-CMD(1)TRACE-CMD(1)NAME
trace-cmd - interacts with Ftrace Linux kernel internal tracer
SYNOPSIS
trace-cmd COMMAND [OPTIONS]
DESCRIPTION
The trace-cmd(1) command interacts with the Ftrace tracer that is built inside the Linux kernel. It interfaces with the Ftrace specific
files found in the debugfs file system under the tracing directory. A COMMAND must be specified to tell trace-cmd what to do.
COMMANDS
record - record a live trace and write a trace.dat file to the
local disk or to the network.
report - reads a trace.dat file and converts the binary data to a
ASCII text readable format.
hist - show a histogram of the events.
options - list the plugin options that are available to *report*
start - start the tracing without recording to a trace.dat file.
stop - stop tracing (only disables recording, overhead of tracer
is still in effect)
extract - extract the data from the kernel buffer and create a trace.dat
file.
reset - disables all tracing and gives back the system performance.
(clears all data from the kernel buffers)
split - splits a trace.dat file into smaller files.
list - list the available plugins or events that can be recorded.
listen - open up a port to listen for remote tracing connections.
restore - restore the data files of a crashed run of trace-cmd record
stack - run and display the stack tracer
check-events - parse format strings for all trace events and return
whether all formats are parseable
OPTIONS -h, --help
Display the help text.
Other options see the man page for the corresponding command.
SEE ALSO trace-cmd-record(1), trace-cmd-report(1), trace-cmd-hist(1), trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-extract(1),
trace-cmd-reset(1), trace-cmd-restore(1), trace-cmd-stack(1), trace-cmd-split(1), trace-cmd-list(1), trace-cmd-listen(1), trace-cmd.dat(5),
trace-cmd-check-events(1)AUTHOR
Written by Steven Rostedt, <rostedt@goodmis.org[1]>
RESOURCES
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
COPYING
Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).
NOTES
1. rostedt@goodmis.org
mailto:rostedt@goodmis.org
06/11/2014 TRACE-CMD(1)