General :: Filter Find And Du By Content Of Inner File In Subdirectory?
May 30, 2010
I have the following command that I run on cygwin:
find /cygdrive/d/tmp/* -maxdepth 0 -mtime -150 -type d | xargs du --max-depth=0 > foldersizesreport.csv
I intended to do the following with this command: for each folder under /d/tmp/ that was modified in last 150 days, check its total size including files within it and report it to file foldersizesreport.csv however that is now not good enough for me, as it turns out inside each
/d/tmp/subfolder1/somefile.properties
/d/tmp/subfolder2/somefile.properties
/d/tmp/subfolder3/somefile.properties
/d/tmp/subfolder4/somefile.properties
so as you see inside each subfolderX there is a file named somefile.properties inside it there is a property SOMEPROPKEY=3808612800100 (among other properties) this is the time in millisecond, i need to change the command so that instead of -mtime -150 it will include in the whole calculation only subfolderX that has a file inside them somefile.properties where the SOMEPROPKEY=3808612800100 is the time in millisecond in future, if the value SOMEPROPKEY=23948948 is in past then dont at all include the folderin the foldersizesreport.csv because its not relevant to me.so the result report should be looking like:
/d/tmp/,subfolder1,<itssizein KB>
/d/tmp/,subfolder2,<itssizein KB>
and if subfolder3 had a SOMEPROPKEY=34243234 (time in ms in past) then it would not be in that csv file.so basically I'm looking for:
find /cygdrive/d/tmp/* -maxdepth 0 -mtime -150 -type d | <only subfolders that have in them property in file SOMEPROPKEY=28374874827 - time in ms in future and not in past | xargs du --max-depth=0 > foldersizesreport.csv
View 1 Replies
ADVERTISEMENT
Sep 21, 2011
How to find file by content on linux by command. Example: i want find file contain word "helo" on my computer (OS: LINUX)
View 4 Replies
View Related
Oct 5, 2010
I am using find to search for .tgz files modified more than 7 days ago and delete them.find /directory/ -iname backup*.tgz -daystart -mtime +7 -exec rm -rf {} My problem is that find will go through the content of tarball as well and list all content. I want to only search main tarball and delete it if older than 7 days.
View 4 Replies
View Related
Sep 16, 2011
At the moment I'm doing:
for i in mdx/[0-9][0-9].png; do cp $i ../../d_s_c/images/mdx ; done
But as well as the directory mdx, I also have other directories called ntt, etc.
How can I say 'For everything in a subdirectory, copy it across to the same subdirectory over at at ../../d_s_c/images'?
View 1 Replies
View Related
Aug 25, 2009
I want to write a program to filter web content. I believe that i can write a filter program by usig java however problem is that how can i place this program like "internet -> filter -> web browser" ?
View 4 Replies
View Related
Apr 12, 2011
If you have the value 100 in File1 and the value 5 in File2, how do you write a script to divide the 100 in File1 by the 5 in File2 in Linux Bash Shell?The operating system I am using is Ubuntu 10 and object is to write a script to accomplish this task.
View 5 Replies
View Related
Aug 6, 2010
We have approximately 100 retail locations that will have split vpn tunneling. Intranet traffic will flow over the vpn to the corporate headquarters, voip traffic will tunnel to a regional hub and internet bound traffic will go over the local isp. The retail locations are small with 1-8 users and no enterprise grade equipment (servers, etc). This setup in effect will render our current content filtering solution useless.
The locations will be equipped with Cisco ASA 5505 Firewalls. The original plan was to use a Websense server and the url filtering feature to act as a content filter. I just found out that pricing for Websense was not included in the budget will be a show stopper.There may also be some performance issues with this method. Putting a proxy server at each location is not really an option. We do not have the resources to place a server at each location, plus the users could simply unplug an inline device or go around it. There is minimal supervision at most of these locations.
Ideally, I would like to find a way to use something like Dansguardian with an ldap interface and the url filtering feature of the ASA firewalls. I found a program called n2h2p, but I can find 0 documentation for it. It is also 2 years old with no updates. I also need to be able totrally manage this as trying to keep up with 100 different configurations for 400 users would be virtually impossible for the amount of time I will have available
View 9 Replies
View Related
Apr 12, 2010
I have been assigned a task to implement a free open source content filter having feature of web, email, instant messaging etc. If any one has the information or worked on this type of product please share it.
View 8 Replies
View Related
Feb 3, 2010
I want a mail server that can work just like MDaemon. The reason is, I want to have an email content filter rule that does some thing like this.
1. If the To Header contains "support@thisdomain" then run a program.
What this means is that, there is a program here in the office, and if some one sends an email to the support address, with an attachment of .exe and that person is a customer, then the program should be run. The only thing I need here is if there is a rule or script that can filter email header and run a program.
2. If the Exit Code from a previous 'Run program' rule is in the range of 1 to 100 and if the To Header contains "support@thisdomain" then send note1 "to<email address>" from <$SENDER$" "SUBJECT <AM ...>
and delete this message.
3. If the EXIT CODE from a previous 'Run program' rule is =0 and if the TO HEADER contains "support@thisdomain" then send note1 "to<email address>" from <$SENDER$" "SUBJECT <AM ...>
and delete this message.
View 7 Replies
View Related
Feb 8, 2011
last friday my schools isp enabled iwsva - interscan web security virtual appliance from trendmicro. all traffic is now filtered, and slowed down. videos and other videostreams are now useless. after this we have had serious problems using our netbooks with ubuntu, and upgrading workstations with ubuntu has become very problematic, or almost impossible. i have to run the update process 6-8 times before all packages are updated.
what can i do to document the problem in a good way. the isp tells me that there are no problems, and that it has to be a linux problem. (ever heard that one before?) the ltsp-clients on my debian servers does not have the same problems, maybe because they are using the proxy on this server?
View 5 Replies
View Related
Sep 29, 2010
how to find the latest modified directory. I know that the command 'ls -rtl' gives the latest modified file/directory at the end. But my specific requirement is: If I create two directories named dir1, dir2 in the same order. so now my latest modified directory is "dir2". Now inside each directories, I created a file. Now in the last, I modify the file in "dir1". So overall, the content of dir1 got modified recently. If I use the command 'ls -rtl', this will still show dir2 as latest, as it is created recently. But I want the directory in which any internal content at any sub-hierarchy modified recently. so with what linux command I'll get this latest modified directory (dir1)?
View 3 Replies
View Related
May 27, 2011
I'm using rhel6. Using File Browser Nautilus 2.28.4 I could easily locate any file I'm interested in by it name. I'd like to use this File Browser to locate the file name based on it content e.g. based on some word in the text file. It doesn't work for me that way ... My question: does Nautilus support the search of file based on it content or only based on the name of the file itself?
View 4 Replies
View Related
Nov 10, 2010
i have a file and i want to change the content of file but i also want that md5sum of that file remains same.
View 14 Replies
View Related
Jun 13, 2010
How would i write a script which will add a following content to a file.File Before running script.
Code:
acpi = 1
apic = 1
builder = 'hvm'[code]....
View 3 Replies
View Related
Jan 13, 2010
I have a file called foo with a date string in it - and nothing else in the file
2010.01.13-22:28:28
I want to send this file content to date -s command so I can modify using a cron job.
I tried several ways to pipe the file contents to date command but did not work.
View 4 Replies
View Related
Dec 18, 2010
I have a file clipboard.txt
I do :
Code:
sleep 10s ; echo "focus on the gedit" ; xclip -o clipboard.txt
is not working.
How to make that possible, how?
View 2 Replies
View Related
Jul 16, 2011
I am calling a URL from shell script and passing few argumants,Here i have to pass file content as one argument.How can i pass file content through URL.
eg:
content=`cat /Users/test1.txt`
open http://localhost:8080?filecontent=$content
[code],...
View 1 Replies
View Related
Oct 18, 2010
I was having a discussion with someone who asked me whether a Linux OS has to be rebooted when the hosts file is modified. From personal experience, on Windows I change the file but don't reboot and I've seen others do the same thing. I assume Linux has no exception(s), but is there any reason why a reboot is not required (to at least justify my actions)?
View 2 Replies
View Related
May 26, 2010
I'm trying to find all the files in a specified directory that do NOT end in .archived or .error and are older than 30 mins. Currently I have: Code: find /opt/edi/incoming -type f ! ( -name "*.archived" -name "*.error" ) -cmin 30 But I keep returning files that end in those extensions and I'm not sure if I'm using -cmin correcty? If there is a better way to do this (perl, etc) I'm open to options, this is for a nagios check.
View 2 Replies
View Related
Jun 4, 2010
While saving a file I made a typo and performed the vi command ':w~' instead of ':w!' and I created a root '~' instance in one of my subdirectories. How do I remove this reference without wiping out the entire main /root /~ directory? Do I use unlink()?
View 1 Replies
View Related
Apr 15, 2010
I've a lot of websites (100+ directories) I want to create a unique zip with only public subdirectory.
My structure now is like:
- Site 1
--- app
--- tmp
--- log
--- public
[Code]...
View 4 Replies
View Related
Jul 19, 2010
$ mkdir backup && mv * backup/
mv: cannot move `backup' to a subdirectory of itself, `backup/backup'
Works, but issues a warning. Also exit code is 1.
How to do it properly (but not [much] longer)?
View 2 Replies
View Related
Aug 25, 2010
How Can I Copy Everything in Current Directory to Subdirectory in linux console
View 6 Replies
View Related
Jun 13, 2011
I would like to know how can I get permission to subdirectories of a share other than what main share has. I do not want them to have same share I mean for example I share "sharetest" and it has full access for A and B and C groups but "sharetest/foo1" has read only access for A group and "sharetest/foo2" has read only access for B group and "sharetest/foo3" has read only access for all of them.
View 1 Replies
View Related
Mar 22, 2011
I deleted the snmptrapd.conf from /etc/snmp/ and now I want to see the default content to create that file.. Been searching the web but can't find it.
View 2 Replies
View Related
Jun 14, 2010
I have the following /etc/fstab:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
[Code]....
This is, incidentally, the same message that I see while booting. The error message goes away if I comment out the line in fstab starting with /dev/sdc.
View 1 Replies
View Related
Feb 5, 2010
I have a file, say abc.txt, whit some text lines.The I have a second file, say 123.txt where at a certain point one can read "WORD".I would like to append the whole content of abc.txt (as it appears in abc.txt) in the line after "WORD".
View 1 Replies
View Related
Feb 28, 2011
My employer issues pdf files with everyones work schedules. I copy the content and save it as plain text in a file called unformatted (hope to be able to automate this step someday). Im working on a SED script that reduces unformatted to only display what I want to see and saves the result in a file Iïve named formatted. After that I have to manually copy formatted and save it with that days date as a filename e.g. 2011-02-25 or whatever day is scheduled in the pdf, for use on a mobile device (Nokia N900). I noticed that the date occurs on certain lines in the file so I added a line like:
sed -n 's/^Date: (201[1-9])/([0-1][0-9])/([0-3][0-9]).*/1-2-3/p' < unformatted >theDate
That creates a file theDate with the date in it that I wish to use as the filename for this particular instance. So I would like to skip the file formatted all together and have the sed- script write to a new file using the content of the Date as a filename, but how do I make that happen? And of course it would be more elegant if I could skip the intermediate theDate file as well.
View 4 Replies
View Related
Apr 9, 2009
I am using Mailman to create a mailing list for my company. Our membership database is stored in a MS SQL 2000 server. I have figuired out how to write a batch script to export my email address into a text file.
The file is formatted as so:
Code:
Mailman sync_members scripts needs only email address. How can i use sed and/or awk to filter this file and leave me with just the addresses.
I need a file with each email address, 1 per line. Blank lines are ok.
View 3 Replies
View Related
May 28, 2010
I wanted to copy one file to multiple new files. I have an idea to write a script and do the operation. But here i m looking for any particular command to do this operation.
View 1 Replies
View Related