0
votes
0answers
22 views

linux + mount to target directory from local dir problem [closed]

in my Linux machine I run the following command under from /usr/cti/APPS directory cd /usr/cti/APPS mount -t nfs $server:$target_dir /mnt I want to show something very interesting I can run ...
5
votes
1answer
42 views

Can “find” command preserve access-time

I'm running the following command which is supposed to find specific directories according to their Access-Time metadata detail however for some reason the find command changes the access time of ...
2
votes
2answers
88 views

How to get directories and and subdirectories count fastest way?

I want to get the number of directories and sub directories.I tried following command which takes very long time . I tried waiting about an hour to finish the command. commands I used $ find . -type ...
6
votes
4answers
719 views

How to find a file in Linux with its path?

I am trying to find settings.xml file in my Ubuntu machine. I have no clue where it is, and which directory it is in. I tried using this - ls -R | grep settings.xml But it doesn't show me the ...
4
votes
2answers
95 views

In Linux Fedora, How can I select files to move by time interval

How can I select and move files that were written in a specified time interval, such as 1530 to 1730 local time on a recent date? Background: I use Linux Fedora 12, and I have made my first, and long ...
4
votes
3answers
348 views

Using find command to find folder ignoring case

I would like to know if a particular folder is present or not. I used the following command find /mnt/md0/ -maxdepth 1 -name 'dcn'||'DCN' I want to know if folder name is DCN or dcn . How would I ...
0
votes
2answers
109 views

Deleting large number of files

I'm writing a script to delete large number of files in linux. The script will run every two minutes in crontab. I tried using the find /mnt/md0/capture/DCN/ -maxdepth 1 -type f -name "*.pcap" ...
1
vote
1answer
72 views

How to FILTER the files with filename and then DELETE the OLDEST file from there? [duplicate]

I create and keep the following automated backup files e.g.: fruits_29-12-2013.gz fruits_30-12-2013.gz fruits_31-12-2013.gz sweets_01-12-2013.gz sweets_02-12-2013.gz sweets_03-12-2013.gz .. ...
4
votes
4answers
223 views

Locating files and displaying their owner

I have to search for a specific file type on a storage unit and also want to know their owners. With locate '*.txt' >> result.txt I find all files I'm looking for but I'm missing the owner this ...
4
votes
4answers
870 views

What is the most efficient way to move a large number of files that reside in a single directory?

CentOS 5.x I apologize if this is a repeat question. I've seen a lot of similar questions (regarding deleting files) but not exactly the same scenario. I have a directory containing hundreds of ...
4
votes
2answers
110 views

Linux splitting array into separate variables

I've been programming on MVS for years and recently have been using Linux so my Linux skills are not that great yet but I understand development concepts well. What I'm trying to do is to read a ...
4
votes
3answers
121 views

What is the difference between [.]* and '.*' for command 'find -name'?

My goal is to find all files or directories in a filesystem that start with a dot (.), for example .gnupg. So I came up with the command: find -name '.*' Checking on the Internet, I saw some hints ...
5
votes
5answers
2k views

Faster way to delete large number of files

I have a directory where lots of cached files are getting generated very quickly. Since these are very small files, it is consuming all my inodes very quickly. Currently I am running the following ...
2
votes
1answer
280 views

ksh:Get files created on specific date in directory [duplicate]

I want get the files that were created on specific date in a directory > ll total 36 -rw-rw-r-- 1 tak tak 212 Oct 08 07:06 name.log -rw-rw-r-- 1 tak tak 494 ...
5
votes
5answers
12k views

Why does find -mtime +1 only return files older than 2 days?

CentOS 5.9 I'm struggling to wrap my mind around why the find interprets file modification times the way it does. Specifically, I don't understand why the -mtime +1 doesn't show files less than 48 ...
2
votes
2answers
573 views

How can I filter those “Permission denied” from find output? [duplicate]

I started using sed recently. One handy way I use it is to ignore unimportant lines of a log file: tail -f example.com-access.log | sed '/127.0.0.1/d;/ELB-/d;/408 0 "-" "-"/d;' But when I try to ...
0
votes
1answer
380 views

How does -exec actually work

I am confused on the -exec command. E.g. in this case: find . -type f -name "*.c" -exec cat {} \;>all_c_files.txt It seems that I get cat file1 file2 file3 ... fileN While in this case: ...
0
votes
2answers
132 views

Why are there empty lines in the output of my command?: find ~/x/y/ | shuf > ~/Desktop/z.txt

As it turns out the reason for this problem was one filename with several newlines. (No idea how that happened.) find ~/x/y/ | shuf > ~/Desktop/z.txt This command works pretty much as expected ...
3
votes
1answer
313 views

How can I efficiently dereference all symlinks in `find` *output* filenames?

I need paths to be both fully resolved and relative to a given directory. This must be done efficiently, since the number of paths is often greater than 100,000. Situation: I have directories which ...
2
votes
1answer
177 views

How to keep track of which files are currently growing in directory

I have a local filesystem which is exported rw with nfs (very big xfs partition). Somewhere (I cannot determine who or what remote process) files are being written, created new or updated appending ...
1
vote
3answers
4k views

List all files in a directory recursively but exclude directories themselves

Simple question, I'm running the following find command: find . -type d \( -path ./.git -o -path ./log -o -path ./public -o -path ./tmp \) -prune -o -print To list all the files in my directory, ...
1
vote
2answers
837 views

Find all directories, in which user has access to search and echo this directories in shell

I need to find all directories, in which user has access to search(command find) and echo this directories in shell. USER is read from ksh. for example: read user I know, if user want to use find ...
2
votes
3answers
1k views

`solaris + xargs command for solaris

the command find /tmp -name 'core*' -type f -print0 | xargs -0 works fine on Linux, but xargs -0 option is not legal on Solaris what is the equivalent option ( xargs? ) for Solaris 10 second ...
1
vote
1answer
128 views

questions on find and grep

With respect to the following find command-line find . -type f -exec grep -l strings {} \; I do not understand the usage of -exec and {} \.
1
vote
4answers
1k views

Checking if a file exists in several directories

I've been working on this far too long and need some help. I need a script that will look at files in a directory and see if it exists in one of several directories. I need something like this: for ...
1
vote
3answers
2k views

Linux: Does find | xargs grep have limitations?

I've historically performed something like: find . 2>/dev/null | xargs grep -i something_to_find 2>/dev/null If my pwd is barfoo (/foo/bar/baz/foofoo/foobar/foobaz/barfoo) it finds matches. ...
2
votes
1answer
158 views

How to find files compared to the time of a specific file

How can I search for files that were modified or changed 5 minutes before and 5 minutes after, a certain file. I have tried mint@mint ~/Desktop $ touch -t 201210101315 /tmp/timestamp mint@mint ...
5
votes
2answers
4k views

how can I recursively delete empty directories in my home directory? [duplicate]

Possible Duplicate: How to remove all empty directories in a subtree? I create directories very often, scattered over my home directory, and I find it very hard to locate and delete them. ...
2
votes
2answers
121 views

How to generate folder ownership lists for each user?

I'd like to generate several separate lists for each user in Ubuntu. The lists contains the files and folders belong to each user. Using the command following list me all the users in the system: ...
4
votes
1answer
7k views

Find a file in lots of zip files (like find command for directories) [duplicate]

Possible Duplicate: Find recursively all archive files of diverse archive formats and search them for file name patterns I need to search for a file in all zip files in a directory. Is ...
1
vote
1answer
4k views

What is the command to find a jar file in a particular folder?

What is the command to find a jar file in a particular folder? Say I want to find log4j.jar in the /dev directory, what command should I use?
15
votes
1answer
12k views

How to skip “permission denied” errors when running find in Linux? [duplicate]

Possible Duplicate: How do I remove “permission denied” printout statements from the find program? When I run this command in Linux (SuSE): find / -name ant I get many error ...
4
votes
1answer
647 views

Which order does find command use to print out

What order does the find command use to print out a list of files? Is this order different across different Linux distributions or versions?
2
votes
4answers
1k views

Open file found with 'find' command

This is probably an easy one, but I can't figure it out and it's pretty much not searchable. In a folder hierarchy I have exactly one file of type xyz. I want to find that file and open it with a ...
6
votes
6answers
11k views

How to search for a word in entire content of a directory in linux

need to search for something in entire content I am trying: find . | xargs grep word I get error: xargs: unterminated quote How to achieve this?
3
votes
2answers
3k views

How to find a writable file owned by root?

How can I find a file on my hard drive created by root that has write permissions?
2
votes
3answers
111 views

How to find every file that includes a given function?

I am trying to list all of the files that include a function, e.g., matrixCal. How can I to do this in linux?
2
votes
1answer
46 views

Explain the output of -D rates in GNU find

I did ~/pythonsource1/python2.6-2.6.5$ find -D rates . -type d and got Predicate success rates after completion: [need type] -type d [0.4] [280/4350=0.0643678] -a [0.4] [280/4350=0.0643678] ...
8
votes
4answers
5k views

Finding a substring in files across subdirectories with a single built-in command?

In Windows, if I wanted to find a string across all files in all subdirectories, I would do something like findstr /C:"the string" /S *.h However, in Linux (say, Ubuntu) I have found no other way ...
1
vote
2answers
261 views

Perl find and replace is writing every file

Here's the test script I'm running matt@server:~ $ cat test.sh #!/bin/bash mkdir test cd test echo "has the string foo" > yes.txt echo "hasn't the string" > no.txt ls -l --time-style=full-iso ...
7
votes
7answers
1k views

Open a file given by the result of a command in vim

I find myself doing the following almost every day Run a find (find -name somefile.txt) Open the result in vim The problem is I have to copy and paste the result of the find into the vim command. ...
5
votes
4answers
3k views

find-command for certain subdirectories

Let's say I have a directory dir with three subdirectories dir1 .. dir3. And inside I have many files and other subdirectories. I'd like to search for a file inside, say with a *.c ending, but I'd ...