General :: Find Mechanism With Irregular Expression (find Command) Or Perl?

Sep 7, 2010

I have 4 Linux machines with cluster.My target is to find all kind of IP address (xxx.xxx.xxx.xxx) in every file in the linux system remark: need to scan each file in the linux system and verify if the file include IP address if yes need to print the IP as the following

more /etc/inet/file.example1

182.23.2.4
255.255.0.0
10.10.1.1

View 1 Replies


ADVERTISEMENT

General :: Find The Sequence For Signal Handling Mechanism In Kernel?

Apr 28, 2011

I am working on tracing the signal handling mechanism in linux kernel internallly. For that, i build the kernel. Now, i want to trace the signal handling mechanism in the old kernel. I got to about SYSLOG and PRINTK for this. But, how to use these tools exactly in tracing the handling of signals internally ?. Is, there any tool similar to backtrace to do that?. How the call flow is done internally ?

View 1 Replies View Related

Server :: Using Find And Replace Command In Perl Script?

Jun 15, 2011

I have one perl sctipt which generate cfg file with ^M in all the EOL. I need to remove the ^M from the cfg file. How can i remove that from the perl script itself. I have tried the following unix command in perl script,

system("perl -pi -e 's/^M//g' *.cfg");

It doesn't work.

View 5 Replies View Related

General :: Find/grep/wc Command To Find Matching Files - Print Filename And Word Count?

Sep 11, 2009

I am trying to do a find/grep/wc command to find matching files, print the filename and then the word count of a specific pattern per file. Here is my best (non-working) attempt so far:

wc `find . ( -name "*.as" -o -name "*.mxml" ) -exec grep -H HeightResizableList {}` ;

View 10 Replies View Related

General :: Command Line - Use Find To Find Text Files?

Jul 15, 2011

Is there a way to specify to find that I only want text files (and not binary files)? Grep has an option to exclude binary files, so I thought find probably has a similar feature, but I've been unable to find it.

View 2 Replies View Related

Programming :: Find And Replace A String In A File Using Perl Command From Bash Script?

Feb 14, 2011

I wanted to find and replace a string from a perl file. I have written a script in bash which runs the following command.

perl -pi -e "s/$findstring/$replacestring/" testfile
where as $findstring = print F_WC_TMP"$line
";
and $replaceString = $line = join ' ', split ' ', $line; print F_WC_TMP"$line
";

But when I am running the above command, i think it is replacing the $findstring with the above mentioned string and hence it contains a $line, it is looking for the variable $line and not finding the exact string. I am confused about how to search for a string that contains $ in it and replace it with another $string.

View 5 Replies View Related

Ubuntu :: Correct Usage Of Perl Expression In 'rename'-shell Command

Jan 21, 2011

I want to rename some files in one directory and found the command 'rename' most appropriate.

Changing the file extension is easy since there are lot of examples for this.

But now I want to rename my files like this:

'somePrefix_blablabla.ext' --> '0_blablabla.ext'
'somePrefix_blablablablabla.ext' --> '0_blablablablabla.ext'

I DON'T want an incrementation, just the leading prefix '0_'

correct perl expression syntax for this?

View 2 Replies View Related

General :: Find Setuid Files Using FIND Command?

Jan 25, 2009

I know how to search for normal files but can you let me know " How to search for 5 setuid files on the system. Also explain, for each file, why setuid mechanism is necessary for the command to function properly"

View 1 Replies View Related

General :: Find A File In Directories Without Using Find Command?

Aug 3, 2010

am new to linux and trying to find a file in sub directories using find command as:find .-name *.jpg -type fBut I am unable to get the result as find command is not permitted by the server administrator.Is there any way to find files without using find command.

View 14 Replies View Related

General :: Grep Regular Expression To Find Any Two Capital Letters Side By Side?

Jan 8, 2011

How would I use a unix grep regular expression to find any two capital letters side by side and how would I find an expected comma in an expected spot?

View 2 Replies View Related

Programming :: Using Grep And Regular Expression To Find Class References In C++ File?

May 28, 2010

I'm trying to math all class references in a C++ file using grep with regular expression. I'm trying to know if a specific include is usuless or not, so I have to know if there is a refence in cpp. I wrote this RE that searches for a reference from class ABCZ, but unfortunately it isn't working as I espected:

grep -E '^[^(/*)(//)].*[^a-zA-Z]ABCZ[]*[*(<:;,{& ]'
^[^(/*)(//)] don't math comments in the begging of the line ( // or /* )
.* followed by any character

[code]....

Well, I can get patterns like this:

class Test: public ABCZ{
class Test: public ABCZ {
class Test : public ABCZ<T>

[code]....

View 4 Replies View Related

Ubuntu :: Find Command Does Not Find All Files?

Aug 9, 2011

The find command does not seem to find all files in my directory hierarchy. My home directory is automounted from a server. The command to illustrate this is:find | sed -e 's/^.///' | sed -e 's//.*//' | sort -uThe result misses several directories. Likewise, a find of a particular file, like:find . -iname *sample* -printwhere sample_file.txt resides in one of the directories that is missing in the first find command, finds nothing

View 4 Replies View Related

Programming :: Way To Find Core Files In System With Out Using "Find" Command

Jul 30, 2010

Is there any way to find the core files with out using the FIND command?

View 1 Replies View Related

Programming :: Unable To Find The Perl

Mar 9, 2011

Just installed Fedora 14. I wanted to try "Hello World" with perl. But where is it?

Code: [user]@user bin]$ ls

View 1 Replies View Related

Programming :: Perl Can't Find The Readonly.pm

May 18, 2010

I am following a gtk2-perl tutorial, so I wrote the test program, installed gtk2-perl, and got this error:

Code:

Can't locate readonly.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.1 /usr/share/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current .) at ./test.pl line 7. BEGIN failed--compilation aborted at ./test.pl line 7.

I googled readonly.pm, and figured out it's part of some Readonly module.But how do I install it? Preferably using the Arch package manager?

View 10 Replies View Related

Ubuntu :: Bad Interpreter: Can't Find Perl In Synaptic Either

Oct 31, 2010

I downloaded a Perl script from off a page on the Internet, and tried to run it. It displayed its source in the web browser. First of all, I am in the cg-bin containing my cgi file and the file permissions are set to 755. I open the Terminal in this folder and run ls, which lists my file called hello.cgi; I run hello.cgi, and get a not found error, and run ./hello.cgi and get source code less comments:

Code:

me@fast:~/Files/Website/perl-dropdown/cgi-bin$ ls
hello.cgi redir.cgi
me@fast:~/Files/Website/perl-dropdown/cgi-bin$ hello.cgi

[code]....

Next I open my Synaptic and search for perl, so I can reinstall it. I find nothing. I navigate to /usr/bin and eventually find perl and perl5.xx as well.

View 4 Replies View Related

Slackware :: Find Libgd Perl Package?

May 26, 2010

Where I can find libgd perl package for slackware?

View 1 Replies View Related

General :: Don't Get Find Command

Mar 31, 2010

When I run find command with exec option, it just hangs on me. what am I doing wrong?

find /stdlist -type d -mtime 0 -exec cp -r {} joblogs ;

View 7 Replies View Related

Programming :: Find Out If X11 Is Running From Within Perl OR Bash Script?

Mar 17, 2010

I am writing a script based image manipulator but i need to know if X is running so i can tell if i use CACAVIEW to imagemagick DISPLAY command.

View 14 Replies View Related

Programming :: Perl - Counting Files With File - Find

Dec 20, 2010

So this is my code:

Code:

Modification of code I found here. It works, but I don't really know why.

Q1: Why is each filter hit counted only when the conditional is not true?

Q2: I've tried taking the file type, (.old), and put it into a variable for better usability, but then the script fails.

View 14 Replies View Related

General :: How To Know If The Command Find Any Result

Oct 21, 2010

#!/bin/shLOOK_FOR="NTLMAuthenticationFilter"for i in `find ./ -name "*jar"`doecho "Looking in $i ..."grepjar -e $LOOK_FOR $idoneI wrote the script above, and try to find if there any file name LOOK_FOR exist in those jar,my quest is: grepjar -e $LOOK_FOR $ihere how can I check if there are any successful result , and output them ?

View 2 Replies View Related

General :: Difference Between *.xml And *.xml In Find Command?

Nov 1, 2010

What is the difference between *.xml and *.xml in find command in Linux/macThe results of:find . -name *.xml and find . -name *.xml are different. But why?Also, is locate '*.xml' better than find? Which one is the most commonly used?

View 1 Replies View Related

General :: Command To Find Only Mtime?

Aug 12, 2010

I've got a script where I have to parse out the last modified time for a large amount of files. Piping the output for "ls" into "cut" seems to work most of the time, but the output is unpredictable.The "fields" argument doesn't find the date modified columns consistently, and using character count is as well since the output can vary in width depending on the file name

View 3 Replies View Related

General :: Getting The Command To Find Out Users?

May 17, 2010

I want to know the command which will list the local users created by me not system users.

View 6 Replies View Related

General :: Command To Find The SD Card?

Jun 13, 2010

How to find info and contents of the SD card via linux terminal. I found a command "mount"in internet. According to it it's in dev/sdb/.. but I didn't found such. I saw dev/sdc/

View 5 Replies View Related

General :: Command To Find Distribution?

Jan 20, 2011

command to find the Distribution of Linux.

View 7 Replies View Related

General :: Exclude Dir From Find Command

Feb 5, 2011

i have this find command to find modified files and copy them.Code:find $SRC_DIR -type f -ctime -1|xargs -i cp --parents {} $BACKUP_DIR/$DAY/and it works good but it want to exclude files that exist in some folders like $SRC_DIR/cash and $SRC_DIR/woks/tmp

View 3 Replies View Related

General :: Find Out PID Of A Command Which Is In History?

Jun 20, 2011

If someone has done something wrong on a shared linux machine. If i want to find out who is that person or ip from where it is been done what are all the possible ways. 1 possibility I thought was to get the PID of the command and get other details from that PID?

View 4 Replies View Related

General :: Find Most Used Command In Distribution?

Oct 27, 2010

t has been long time since i used the command that used to display the most widely used command in the distribution .It was in following format.(I guess it was a combination of history head sort grep or something like that)

50 ls -ltr
3 neat-tui
1 touch abc

I tried finding the command in google but wasnt able to find it

View 1 Replies View Related

General :: Refine The Find Command?

Jul 12, 2010

Ive tried to rsync from one ~/home on hdd a, to ~/home hdd b, using a live cd, but it returns a load of; eg:

rsync: opendir "/media/a2ab9331-effd-4855-8e0a-6c7f1a9d63b5/home/nnjond/.Skype" failed: Permission denied (13)

So i think i should fresh install and it would be convenient if i knew the refined commands to locate the saved files in /home hdd a, since 02_06_10 (not including all the hidden or deleted files), and then copy to a memory stick using the nautilus gui.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved