Programming :: Locate A File By It's Contents?

Jul 16, 2011

A long time ago I wrote a short essay about the 'federal' 'reserve' board. I don't remember it's name or format. I think it's somewhere on my rather large hard discs (to of them divided into various partitions).I'm trying to write a command line that will find it based on a quote that is in it: "our fathers brought forth"I have tried various configurations of grep, and or combining grep with find, but I'm getting nowhere. I really don't understand the syntax of either command, or how they work together, and the examples that I can find are really no help at all.

View 6 Replies


ADVERTISEMENT

Programming :: Append Contents Of One File To Another Existing File?

Nov 17, 2008

I have two files list1.cfg and list2.cfg both files contains differentrecords details like

List1.cfg
NAME1:25:C:NAME LINE1:
NAME2:25:C:NAME LINE2:
CITY:25:C:City:

[code]....

Now I want to append contents list2.cfg to list1.cfg(It ispposible using cat list2.cfg >>list1.cfg) but I want to check if content of (record) in list2.cfg is present in list1.cfg then dont append it otherwise append it.

View 1 Replies View Related

Programming :: Read The Contents Of A File?

Jan 11, 2010

I am trying to read the contents of a file into something else. I have a file.txt that I am working with, I want to read the file and take the data and run some commands with the data that it read. So if it read www.yahoo.com I want to be able to nslookup. Does that make sense? I have been trying to use the read command but that does not seem to work. I even was trying to read filename | > filename to see if I could even read any of the data at all. Nothing is working.

View 8 Replies View Related

Programming :: Check If File Contents In Another File?

Nov 4, 2009

i am trying to write a bash script. i have a text file called comp2.tmp which has a list of items in it

example comp2.tmp

Code:

filename.pdf
filename2.zip
filename3.ttf
and so on

I have another text file called comp1.tmp which should have the same list of files in it, but does not look as pretty

example comp1.tmp

Code:
someothertext here ...... 10/30/2009 ...... filename.pdf
=========================------------------==============
othertextagain .......... 09/28/2008 ...... filename2.zip
========================------------------===============
bunchmoretext ........... 04/12/2005 ....... filename3.ttf
and so on

i would like to check if the filenames listed in comp2.tmp exists in comp1.tmp

View 3 Replies View Related

Programming :: Watching File Contents Continously?

May 27, 2010

want to watch the file continoulsy for any newly written data to file.Presently i am periodically opening the file and checking for the newly updated contents.Is there something like refresing the file descriptor, since open is a system call, calling it many times may affect performance. Does the tail program opens file multiple times to check for the updated contents when used with -f option.Can some one explain or give some links on how the filedescriptors remembers its end contents while some other programs keeps updating the file.

View 5 Replies View Related

Programming :: Bash Script To Locate A Specific File?

Jun 14, 2010

I'm new to bash scripting and I've searched around the forums and Internet for this but haven't had any luck. I've found similar things but not what I need. What I need to do is write a simple script that uses what the user inputs to locate and display where a file is. I would prefer to use locate instead of find since I know that the person I am writing this for has locate on her machine (my mom, who is just beginning with Linux).I'm writing the script to make things easier for her while she learns In this particular part of the script I would like to be able to have the script prompt to enter the file she is searching for, read the her input and then display for her where the file is. I realize it would in most cases be much simpler just to teach her how to use locate, but she is very impatient and this is just a part of the script I will be writing, but I can't figure out how to do this.

View 6 Replies View Related

Programming :: BASH: Listing Contents Of .zip File Into An Array?

May 18, 2010

I want to list the contents of a zip file amd put each entry into an array. I've been doing

[code]....

View 4 Replies View Related

Programming :: Read Text File (Distribute Its Contents)

Jan 22, 2011

How can read the file /var/etc/allInOne.cfg and distribute its contents on multiple cfg files using C language. /var/etc/allInOne.cfg contain the data and the path of each text file.

The source file "/var/etc/allInOne.cfg "look like this:
line1
line2
...
line10
filePath:/var/etc/file1.cfg
line12
line13
...
line14
filePath:/var/etc/file2.cfg
linen
..
filePath:/var/etc/filen.cfg
the result will be :

The expected result is:
/var/etc/file1.cfg will contain line1 to line10
/var/etc/file2.cfg will contain line 12 to line13
/var/etc/filen.cfg will contain linen to linen-1

View 13 Replies View Related

Programming :: Insert A Comment In Html File Based On Its Contents?

Jun 10, 2010

I have multiple HTML files in a folder. there is a <h2> tag like this:

Code:

<h2>some text</h2>

in each file. I want to write a shell script/batch file to add this tag in <head> section of each file:

Code:

<!-- TITLE= "same text from h2 tag" -->

Note that <h2>some text</h2> in some files has 1 or more linebreaks and so I couldn't capture tag content using a simple grep or...
for example:

<h2>first part of text
second line of text</h2>

The line break shouldn't be shown in <!-- TITLE= "same text from h2 tag" -->. The script has to capture tag content & skip line breaks.

View 3 Replies View Related

Software :: Check The Contents Of A Text File For A Specific String And Remove It From The File From The Command Prompt?

Oct 14, 2010

I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.

View 4 Replies View Related

Software :: Overwrite The Contents Of A File Without Changing The File Size?

Jul 12, 2010

We have some large files with sampling data in it. Don't want to delete these files. But want to quickly overwrite the file with 0s and/or 1s and preserve the original file size.

View 3 Replies View Related

General :: Replacing A String In A File With The Contents Of Another File?

Jun 15, 2010

I would like to know how I can replace a string in one file with the complete contents of another life.

View 10 Replies View Related

General :: Grep The Contents Of A File With Another File?

Sep 25, 2010

someone once told me that use can pass a file to grep and use that to search the contents of another file. if that is the case I'm not entirely sure why the following isn't working for me.

Code:

[root@LCENT01:~]#grep -i id_rsa.pub .ssh/authorized_keys
[root@LCENT01:~]#cat id_rsa.pub >> .ssh/authorized_keys
[root@LCENT01:~]#grep -i id_rsa.pub .ssh/authorized_keys

View 3 Replies View Related

Programming :: Get The Contents Of A Directory In C++?

Dec 27, 2010

How to get the contents of a directory in C++?I know about opendir(), but I wonder if there is a C++ way (that uses classes and exceptions).

View 1 Replies View Related

Programming :: Error - Can't Locate DataAccess.pm In @INC

Oct 3, 2010

Quote:

1: #!/usr/bin/perl -w
2:
3: use CGI;
4: use CGI::Carp qw(fatalsToBrowser);

[code]....

DataAccess.pm is placed into /home/savio/myperlprograms, but I have following errors:

Quote:

Can't locate DataAccess.pm in @INC (@INC contains: /home/savio/myperlprograms /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/lib/cgi-bin/login.cgi line 7.
BEGIN failed--compilation aborted at /usr/lib/cgi-bin/login.cgi line 7.

View 3 Replies View Related

Programming :: CD/DVD Contents Are Not Auto Refreshing ?

Jun 28, 2011

When I eject CD from CDROM by pushing eject button(mounted on CDROM) it still shows CD and it's contents in nautilus file browser. If I replaced the CD it still shows contents of older CD. If I eject CD manually by file browser then there is no such issue. I know this is the kernel issue because this issue has come after updating my kernel from linux 2.6.33 to linux-netbook-2.6.35. I am using MeeGo. I want to know which kernel parameter(or module) I have to add.

View 7 Replies View Related

Programming :: Php Scripts Cant Locate Filenames With Spaces?

Apr 13, 2011

I have a fresh dedicated server that im currently configuring and needed a little help if I may ask.The problem is that i'm having a file naming issue. for example from the web I can access any file that does not have spaces of any type. ex/music/musicfile.mp3this works fine and my php script can locate itBut the problem is when I try to access a file that has spaces.ex/music/The Eagles - Hotel California.mp3my php script can't seem to locate any files like this with spaces but doesn't have a problem locating the files with no spaces.

I also took a look at the directory within shell. I did notice that files that have spaces are showing up in this formatt in shell.#/home/~username/public_html/music/The Eagles - Hotel California.mp3In shell , i'm assuming that unix/linux maybe adds a backslash before spaces. But when I FTP to this same directoy, the filename look normal and at windows standard. how could I correctly access these types of files within my php scrits? or would I need to have all uploaded files renamed so that spaces are replaced with underscores maybe?

View 4 Replies View Related

Server :: Can't Locate Pm File?

Aug 24, 2010

Software error:

Can't locate Class/Template.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8

[code]....

View 3 Replies View Related

Debian Programming :: Installing Vmime But Apt-get Cannot Locate Packages

Aug 25, 2015

I have 32-bit Debian 8 and am trying to install Vmime [URL] .....

apt-get cannot locate these packages:

apt-get install vmime0
apt-get install libvmime-dev

I have an issue raised on Vmime's Github page too [URL] .....

View 1 Replies View Related

Ubuntu :: Add Or Locate The Usb-serial.h File?

Jan 1, 2010

I am trying to get the ti_usb_3410_5052.ko driver installed but it gives a an error saying that "cannot locate the usb-serial.h file." Kindly let me know how to over come this problem. I saw in this forum about a patch but it is not working.

View 2 Replies View Related

Red Hat / Fedora :: How To Locate Words In A File

Jul 6, 2010

I am using Oracle Enterprise Linux version 4 update 7.

Sometimes I have to access large files with thousands of lines in them and I would like to locate a particultar word. e.g.

vi /etc/passwd.

The contents of file passwd are displayed.I want to find a username of joe assuming the passwd file is 2000 lines long.

I would like to use a linux command that will locate joe and highlight in the passwd file as to where word joe is.

Is there a linux command that can do this?

View 5 Replies View Related

Programming :: How To List Contents Of Directory And Exclude Any Subdirectories

Aug 2, 2010

I'm having trouble figuring out how to list the contents of a directory and exclude any subdirectories.

View 5 Replies View Related

Programming :: C Scanf Arbitrarily Deletes Contents Of Another Variable?

Oct 3, 2009

I am in the process of writing a program that plays the game mancala. I wanted to create a function that requires the player to choose a number between one and six, should be simple right? I kept having problems, so I started testing stuff out.

Code:

#include <stdio.h>
#include <stdlib.h>
short move();

[code]....

I am using gcc version 4.3.2 (Debian 4.3.2-1.1). On a whim, I tried something else out; when I change the 'short' variables to 'int' , the problem seems to dissapear.... I tried changing the format string in the scanf statement from "%d" to "%u" which is listed as the appropriate string for the 'short' type, still no luck.

View 13 Replies View Related

Programming :: Locate The Tables In Versys The House Demographic Information?

Apr 28, 2010

I am trying to locate the tables in Versys the house demographic information, does anyone know the path?

View 1 Replies View Related

General :: Ubuntu - Can't See Contents Of File

Jul 29, 2010

In Ubuntu 10.04, there is a certain file that appears highlighted in terminal. When I try to cat the file, it says there is no such file or directory. How can I see what's in this file? Is this a symbolic link?

View 1 Replies View Related

Ubuntu :: Print Out The Contents Of A File?

Feb 24, 2010

how do I print out the contents of a file?

View 4 Replies View Related

Ubuntu :: How To Delete The Contents Of This File.

Mar 23, 2010

/root/.local/share/Trash/files/I have a tar backup file in there and can't get rid of it. I've tried from root with Nautilus, the files disappear for a couple of seconds and then reappear.

View 7 Replies View Related

Ubuntu :: Way To View The Contents Of A .dsk File?

Apr 30, 2010

EDIT:SOlved, I'm trying to figure out how to delete this

View 1 Replies View Related

Ubuntu :: Touch Contents Into A File?

Sep 1, 2011

I know that I can do something along the lines of

Code:
touch /var/www/index.html | echo "echo some contents" >> /var/www/index.html
but would like to do this without having to specify the directory again with echo, and maybe even use linebreaks / tabs on the echo in. Anyone know a neat one liner?

View 6 Replies View Related

General :: Listing Of Zip File Contents Using C?

Oct 20, 2009

how to do the listing of zip file contents using C?

View 1 Replies View Related







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