Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
0answers
8 views

Finding sub-directories inside directories with same name using find and xargs [closed]

Possible Duplicate: Finding subdirectories inside all directories with the same name I want to run a command line to achieve following 3 steps: find all directories named "inc" under a ...
2
votes
4answers
35 views

Finding subdirectories inside all directories with the same name

I want to run a command to: Find all directories named "inc" under a folder "X". List all the subdirectories under each "X/.../inc/". Redirect the output to a file named "list" I tried various ...
8
votes
5answers
4k views

Unix/Linux find and sort by date modified

so I was wondering how I could do a simple find which would order the results by most recently modified. Here is the current fine I am using. (I am doing a shell escape in php, so that is the ...
0
votes
3answers
104 views

Location of files on Unix whose file names and contents each match a regular expression

I want to search for file names with a regular expression, and grep it using regex. I tried this: find . -name co_on*eruo* | xargs grep '0LF2C Comdty(.*)20111022(.*)' But it doesn't work. What am ...
-1
votes
3answers
75 views

Only output part after last “/” with find

This command: find ./ -name "mybinaryrpm-1.0.24-1.1.i586.rpm" gives the output: ./DirectoryName/SubDirectory/mybinaryrpm-1.0.24-1.1.i586.rpm but I only want the output: ...
0
votes
2answers
52 views

grep doesn't produce the correct output when run on find command

My task was to print the number of files in the current directory without using ls and wc commands. I had typed the following lines in the script: #!/bin/bash find . -maxdepth 1 -type f \( ! -iname ...
1
vote
3answers
293 views

Find words in many files

I am looking for this struct messages_sdd_t and I need to search through a lot of *.c files to find it. However, I can't seen to find a match as I want to exclude all the words 'struct' and ...
4
votes
2answers
3k views

How to Combine find and grep for a complex search? ( GNU/linux, find, grep )

I'm trying to do a text search in some files that share a similar directory structure, but are not in the same directory tree, in GNU/Linux. I have a web server with many sites that share the same ...
0
votes
1answer
48 views

Find and move hidden files from sub-directories with batch file not working

I'm trying to use this batch file to find and move files... but it does not work on hidden files. What's missing? @echo off setlocal set root=E:\backup set dest=E:\Tmp for /f "delims=" %%f in ('dir ...
1
vote
2answers
32 views

How can I clear the contents of every file in a subdirectory without changing ownership / permissions?

I can find the list of files using something like: find /path/to/files -type f And I can clear the contents of a single file with any of: > filename echo -n > filename cat /dev/null > ...
2
votes
3answers
1k views

Using find and tar with files with special characters in the name

I want to archive all .ctl files in a folder, recursively. tar -cf ctlfiles.tar `find /home/db -name "*.ctl" -print` The error message : tar: Removing leading `/' from member names tar: ...
1
vote
3answers
60 views

Using `find` for multiple file extensions

I am using the following command for counting the lines of text in JAVA files: find . -name '*.java' | xargs wc -l How can I modify the find command parameters to match more than one file ...
0
votes
1answer
73 views

Using find -mmin to find files with modification time in the future

I can use find . -mmin -5 to find files changed in last 5 minutes. However if I try to find files with modification time in the future by giving negative number find refuses to do it: find . -mmin ...
4
votes
3answers
98 views

how to limit find command's output used with option -print0

I'd like to limit output of find command. In the past I used to use for this ls command, e.g: ls *tgz|head -100|xargs -i mv "{}" ../ but I got to know that the result may be unpredictable if name ...
1
vote
1answer
50 views

What `find` command deletes everything in a directory except for CVS folders?

I have a dir: $ tree . |-- CVS | |-- Entries | |-- Entries.Log | |-- Repository | `-- Root |-- dirA | |-- CVS | | |-- Entries | | |-- Repository | | `-- Root | |-- file1 | ...

1 2 3 4 5 19
15 30 50 per page