Search Results

Search found 47335 results on 1894 pages for 'find'.

Page 8/1894 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Bash script to find a directory, list it's contents and sub-folders info

    - by lithiumion
    Hi I want to write a script that will: 1- locate folder "store" on a *nix filesystem 2- move into that folder 3- print list of contents with last modification date 4- calculate sub-folders size This folder's absolute path changes from server to server, but the folder name remains the same always. There is a config file that contains the correct path to that folder though, but it doesn't give absolute bath to it. Sample Config: Account ON DIR-Store /hdd1 Scheduled YES ?According to the config file the absolute path would be "/hdd1/backup/store/" I need the script to grep the "/hdd1" or anything beyond the word "Config-Store", add "/backup/store/" to it, move into folder "store", print list of it's contents, and calculate sub-folders size. Until now I manually edit the script on each server to reflect the path to the "store" folder. Here is a sample script: #!/bin/bash echo " " echo " " echo "Moving Into Directory" cd /hdd1/backup/store/ echo "Listing Directory Content" echo " " ls -alh echo "*******************************" sleep 2 echo " " echo "Calculating Backup Size" echo " " du -sh store/* echo "********** Done! **********" I know I could use grep cat /etc/store.conf | grep DIR-Store Just don't know how to get around selecting the path, adding the "/backup/store/" and moving ahead. Any help will be appreciated

    Read the article

  • How do I find and replace 'whole words only', in Microsoft Word?

    - by user277816
    I want to be able to find and replace eat with Eat in Microsoft Word 2007. However, I don’t want to replace every occurrence of eat such as those that can be found inside other words such as great and meat. I have tried doing this using the regular Find and Replace tool, but I get words with capital letters in the middle. Is there a way I can just replace eat with Eat if it only exists on its own?

    Read the article

  • Find which config file Apache uses to find virtual host

    - by eje211
    I have a rather complicated Apache setup: some config files have to be manually written and some have to be automatically generated. So far, I've had no problems. But now, I've just tried to set a site at: newsubdomain.mydomain.com and Apache directs it to the data for: www.someotherdomain.com I've looking into all the many config files and can't find anything wrong. All is pointing where it should and no definitions, as far as I can tell, overlap. So what I'm wondering is: is there a way to see which config files or config instructions Apache is using to match a URL to a directory? Tanks.

    Read the article

  • How can I use '{}' to redirect the output of a command run through find's -exec option?

    - by pkaeding
    I am trying to automate an svnadmin dump command for a backup script, and I want to do something like this: find /var/svn/* \( ! -name dir -prune \) -type d -exec svnadmin dump {} > {}.svn \; This seems to work, in that it looks through each svn repository in /var/svn, and runs svnadmin dump on it. However, the second {} in the exec command doesn't get substituted for the name of the directory being processed. It basically just results a single file named {}.svn. I suspect that this is because the shell interprets > to end the find command, and it tries redirecting stdout from that command to the file named {}.svn. Any ideas?

    Read the article

  • Using Windows Explorer, how to find file names starting with a dot (period), in 7 or Vista?

    - by Chris W. Rea
    I've got a MacBook laptop in the house, and when Mac OS X copies files over the network, it often brings along hidden "dot-files" with it. For instance, if I copy "SomeUtility.zip", there will also be copied a hidden ".SomeUtility.zip" file. I consider these OS X dot-files as useless turds of data as far as the rest of my network is concerned, and don't want to leave them on my Windows file server. Let's assume these dot-files will continue to happen. i.e. Think of the issue of getting OS X to stop creating those files, in the first place, to be another question altogether. Rather: How can I use Windows Explorer to find files that begin with a dot / period? I'd like to periodically search my file server and blow them away. I tried searching for files matching ".*" but that yielded – and not unexpectedly – all files and folders. Is there a way to enter more specific search criteria when searching in Windows Explorer? I'm referring to the search box that appears in the upper-right corner of an Explorer window. Please tell me there is a way to escape my query to do what I want? (Failing that, I know I can map a drive letter and drop into a cygwin prompt and use the UNIX 'find' command, but I'd prefer a shiny easy way.)

    Read the article

  • Using Windows Explorer, how to find file names starting with a dot (period), in 7 or Vista?

    - by Chris W. Rea
    I've got a MacBook laptop in the house, and when Mac OS X copies files over the network, it often brings along hidden "dot-files" with it. For instance, if I copy "SomeUtility.zip", there will also be copied a hidden ".SomeUtility.zip" file. I consider these OS X dot-files as useless turds of data as far as the rest of my network is concerned, and don't want to leave them on my Windows file server. Let's assume these dot-files will continue to happen. i.e. Think of the issue of getting OS X to stop creating those files, in the first place, to be another question altogether. Rather: How can I use Windows Explorer to find files that begin with a dot / period? I'd like to periodically search my file server and blow them away. I tried searching for files matching ".*" but that yielded – and not unexpectedly – all files and folders. Is there a way to enter more specific search criteria when searching in Windows Explorer? I'm referring to the search box that appears in the upper-right corner of an Explorer window. Please tell me there is a way to escape my query to do what I want? (Failing that, I know I can map a drive letter and drop into a cygwin prompt and use the UNIX 'find' command, but I'd prefer a shiny easy way.)

    Read the article

  • Iterables.find and Iterators.find - instead of throwing exception, get null

    - by mjlee
    I'm using google-collections and trying to find the first element that satisfies Predicate if not, return me 'null'. Unfortunately, Iterables.find and Iterators.find throws NoSuchElementException when no element is found. Now, I am forced to do Object found = null; if ( Iterators.any( newIterator(...) , my_predicate ) { found = Iterators.find( newIterator(...), my_predicate ) } I can surround by 'try/catch' and do the same thing but for my use-cases, I am going to encounter many cases where no-element is found. Is there a simpler way of doing this?

    Read the article

  • Why does string::find return size_type and not an iterator?

    - by dehmann
    In C++, why does string::find return size_type and not an iterator? It would make sense because functions like string::replace or string::insert take iterators as input, so you could find some character and immediately pass the returned iterator to replace, etc. Also, std::find returns an iterator -- why is std::string::find different?

    Read the article

  • How do I find all files and directories writable by a specific user?

    - by Pistos
    Under Linux, how can I find all the files and directories that are writable (or, actually, not writable) by a particular user? Edit: To clarify, I meant under a particular subdir, not systemwide. And yes, that means all the permutations and combinations of user, group and world writability that would allow that user to write. I know what the question entails semantically, I was hoping for a one- or few-liner to execute to get a list of these files.

    Read the article

  • Capturing output of find . -print0 into a bash array

    - by Idris
    Using find . -print0 seems to be the only safe way of obtaining a list of files in bash due to the possibility of filenames containing spaces, newlines, quotation marks etc. However, I'm having a hard time actually making find's output useful within bash or with other command line utilities. The only way I have managed to make use of the output is by piping it to perl, and changing perl's IFS to null: find . -print0 | perl -e '$/="\0"; @files=<>; print $#files;' This example prints the number of files found, avoiding the danger of newlines in filenames corrupting the count, as would occur with: find . | wc -l As most command line programs do not support null-delimited input, I figure the best thing would be to capture the output of find . -print0 in a bash array, like I have done in the perl snippet above, and then continue with the task, whatever it may be. How can I do this? This doesn't work: find . -print0 | ( IFS=$'\0' ; array=( $( cat ) ) ; echo ${#array[@]} ) A much more general question might be: How can I do useful things with lists of files in bash?

    Read the article

  • Cat all files in a directory, with a specific file at the beginning an end...?

    - by Aeisor
    Is there a way to cat all files in a given directory, but with a particular file at the beginning and end? For example, say I have: file1.js, file2.js, file3.js, file4.js, file5.js -- Effectively I would like to cat file2.js file*.js file3.js > /var/www/output.js I've tried a few variations of these find ! -name "file2.js" ! -name "file3.js" -type f -exec cat file2.js {} file3.js > /var/www/js/output.js \; find ! -name "file2.js" ! -name "file3.js" -type f | xargs -I files cat file2.js files file3.js > /var/www/output.js but the best I can get out of it is file2.js added before and file3.js added after all other files (multiple times) I know I could specify the files in the order I wanted manually, but this is not maintainable (I'm expecting, potentially 100 files). I have looked through man cat, as well as a handful of websites devoted to xargs, find and cat to no avail. Thanks in advance.

    Read the article

  • Search and Browse Database Objects with Oracle SQL Developer

    - by thatjeffsmith
    I was tempted to throw in another Dora the Explorer Map reference here, but I came to my senses.Having trouble finding something? Maybe you’re just getting older? I know I am. But still, it’d be nice if my favorite database tool could help me out a bit. Hmmm, what’s this ‘Find Database Object‘ thing over here…sounds like a search mechanism of some sort? You can access this panel from the ‘View‘ menu. It’s a good bit down the screen, so I don’t blame you if you haven’t seen it before. It makes finding ‘stuff’ in your database so much easier. Let’s say I want to find my ‘beer’ objects. I simply need to type my search string and the context (in this case I want it to search EVERYTHING), and hit enter. The search results are listed below and clicking on an object automatically opens it! I know it seems very simple, but I get asked this question a LOT. It will even search through your PL/SQL code! Finding too much? Be sure to toggle off the ‘%’ wildcard check box before doing a search. Working on a Project? I bet you use common column names, or codes, throughout your tables. You could take advantage of this knowledge and use the Find Database Object panel as a substitute connection tree or schema browser. Working on your HR project and want to look at your employee objects? Do a column search for your column ID/key. Sometimes thinking outside the box actually works! Don’t be afraid to tackle a problem from a weird angle, or re-purpose your tools. I do it all the time And I drive the developers nuts trying to do things with the tools they were never designed to do. But I digress. Back to your coding!

    Read the article

  • React to a modified directory

    - by Ghanshyam Rathod
    In linux everything is considered as file, Now if I want to find only folders/directories not the files then how can i do that? I am getting all the modified files with the following command. find /Users/ghanshyam -type f -mmin -5 -print My goal is to generate the log file with all the modified/access folders. Here two options are available. create a module and call every time when a folder is modified (this one is bit difficult because I need to check particular event) create a cron task that will run after every 5 minutes. cron task will execute shell script and generate the log entries with the modified folders. Do you have any other option to do this task ?

    Read the article

  • Ruby on Rails: How to find all items with a hash that contain a specific value...

    - by kingjeffrey
    Suppose I have three models: Student, SchoolClass, and DayOfWeek. There is a HABTM relationship between Student and SchoolClass, and between SchoolClass and DayOfWeek. What I'd like to do is find all school classes belonging to a given student that meet on Monday. Now I suppose I could do something like: @student = Student.find(:student_id) @student_classes = @student.school_classes.find(:all) @student_classes_on_monday = Array.new @student_classes.each do |student_class| if student_class.day_of_week.include?("Monday") @student_classes_on_monday << student_class end end But there has to be a more elegant way. Can you help me find it?

    Read the article

  • UNIX find for finding file names NOT ending in specific extensions?

    - by Cristi Diaconescu
    Is there a simple way to recursively find all files in a directory hierarchy, that do not end in a list of extensions? E.g. all files that are not *.dll or *.exe UNIX/GNU find, powerful as it is, doesn't seem to have an exclude mode (or I'm missing it), and I've always found it hard to use regular expressions to find things that don't match a particular expression. I'm in a Windows environment (using the GnuWin32 port of most GNU tools), so I'm equally open for Windows-only solutions.

    Read the article

  • Is there any ways to extend the search (find-in-files) capability of WinRAR?

    - by akjain
    WinRAR is good at searching for a string in text files(java, xml, txt etc.) within an archive and it supports multiple archive formats. (rar, 7zip, winzip etc) Is there some way to extend this feature (by means of plug-ins etc) to search within Pdf & office files (doc, ppt), Or any other similar unzip tool which has this feature? (Extracting the entire archive & searching using Windows search is always one option)

    Read the article

  • Is there a find and replace application with multiple rules?

    - by Joe
    I'm looking for a search and replace tool that takes a list of rules and either a file (or directory) and runs those rules on the files. I have a bunch of different things that need to be changed in many files, and I'd like to be able to run all the rules in one shot. I was hoping I could put the rules separate file, and use the same set of rules over and over again. Does such a tool exist?

    Read the article

  • I just recursively chmod'd everything under / to 750. Any tips?

    - by Ouairz
    I won't be the first and I won't be the last, I suppose. While playing around with the find command, I made a whoops and it would appear that instead of changing the permissions of the ~/web directory to 750, it changed the permissions of the entire filesystem (/) to 750, however I'm not certain, but any attempt to investigate is thwarted by Permission denied messages. For everything. This was the offending command: sudo find ~/web . type d -exec chmod 750 {} If I'm not mistaken, the Ubuntu team disabled root logins as a safety precaution so I'm out of ideas. I'm (obviously) a total newbie when it comes to file permissions so I was wondering if anyone had some good or even some bad advice to share. I've mentally prepped myself to losing everything on the computer which is only of mild consequence, since I have backups, but I did do a bit of work on this box over the week and it would be a shame to lose it all due to a boneheaded mistake. If you are reading this message, ask yourself, have you backed up any of your work recently? Thanks in advance for any insights. Feel free to scold me for using sudo carelessly

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >