A commandline utility to find files and directories.

learn more… | top users | synonyms (1)

0
votes
1answer
13 views

Clear the dirent cache on Linux

Watch the difference: ryan@DevPC-LX:~/stuff/nana$ time find . -name libnana.a ./libnana.a real 0m0.215s user 0m0.005s sys 0m0.017s ryan@DevPC-LX:~/stuff/nana$ time find . -name libnana.a ...
2
votes
3answers
53 views

Get a script variable into subshell launched by find

Following on from this question I've used the following command in a bash script: find ${svn_root} -maxdepth 2 -type d -exec bash -c 'if svnlook info "$1" &>/dev/null ;then echo"$1" ...
7
votes
5answers
446 views

How do you output the filename in find command while using -exec?

I use the following line to find all sub-directories of the PWD and run svnadmin verify on each directory (I already know that they're Subversion repositories) find ./* -maxdepth 0 -exec svnadmin ...
2
votes
2answers
50 views

How do I pipe the output of find command to ffmpeg as a input

I have a video archive and i need to find the file in the archive and then output of the file must be used as input for ffmpeg. find /mnt/video-archieve -name 'file'.mov | ffmpeg -i - ... I know - ...
1
vote
2answers
39 views

Ideal way to take zip backup

I am trying to zip text, csv files from a folder on a weekly basis. Based on answer given to my earlier question, I got this code working. sudo find . -mtime +7 | sudo zip -m archive-$(date ...
14
votes
2answers
486 views

What's the missing argument to -exec?

I use the following command to clear a directory, of files and directories over 30 days old, and move them to an archive directory which I can delete after a few weeks if nobody asks for their files ...
9
votes
5answers
404 views

Find executable filenames without path

I have a folder with many executables, and I want to omit the path in the results of the find command. this command shows the files I want to see, but it also lists the path; I just want the file ...
2
votes
3answers
56 views

Find all files that contain a given clause in their names

This is a general question but my case is that I have installed (I beleive it got installed!) the gcc arm compiler but I can not find it anywhere in my system. I tried the command below but it returns ...
3
votes
2answers
279 views

How to run multiple Python files by running one terminal code?

For my text-mining project (with an Enron data set), I have this Python script: from glob import glob import fileinput with open('/media/output/inbox.txt', 'w') as out: for line in ...
0
votes
3answers
54 views

Zip files into weekly archive with week number

I am trying to take a weekly archive of a folder to separate zip files. find . -name '*.txt' -ctime +7 -exec zip "archive-$("date+%Y-%U").zip" {} \; I am stuck on how to name the zip file. Any ...
1
vote
5answers
150 views

Find files belonging to a user with size in MB on Ubuntu 12.04 (Precise Pangolin)

I am using this command which is working fine: sudo find / -user web132 -ls But when I am trying like sudo find / -user web132 -ls -lh I am getting a wrong syntax error. How can I get the file ...
0
votes
4answers
33 views

How to use find quietly?

I want to search for all occurences of <searchterm> on my machine. Now when I perform a search like this find / <searchterm> I can see all the paths the search is running through. How ...
1
vote
3answers
55 views

remove pictures from folder

I want to remove all the photos from a folder and keep the remaining files. I searched in the web and I found a tons of solutions like: find . -type f -name "*.jpg" -delete All the photos are ...
10
votes
5answers
673 views

How do I prevent a folder inside of /tmp from being cleaned up?

This question is about Ubuntu 14.10 on my developer laptop. I've got a folder in /tmp that is used by an application to put temporary stuff in there. This application usually makes a temporary folder ...
2
votes
1answer
101 views

Find and Rename recursively in folders, subfolders and multiple files

I'm new with shellscript and I'm having some problems trying to do what I need... I want to 'optimize' all my *.png images and found this so I made the bash as it says with: #!/bin/bash pngnq ...
2
votes
2answers
41 views

How to list all files in a hard disk with 'find'?

I'd like to list all the files in HDD including size, last modified date and absolute path. idea format : [file size] [last modified date] [absolute path] [ filename] I tried: ls -lhR | awk -v ...
0
votes
2answers
60 views

How to select a directory with the highest version?

Let's say I have three directories within my current working directory. Each one refers to a different version of a library/package. I would like to return only the directory with the highest ...
3
votes
3answers
112 views

Move files from specifically named folders / move files up one level

The goals is to move files out of the lowest level folder, back up one directory. This does a great job but moves files higher up the folder hierarchy as well. find . -name '*.jpg' -type f -execdir ...
1
vote
1answer
61 views

Recursively Extract all 7z

I have many 7z archives nested in many subfolders, and want to extract all these archives into the folders in which they reside, then delete the original archives. I have found how to do this, while ...
3
votes
1answer
67 views

How to show all files created on a specific date

On 16/05/2015 at 17:18 I visited a malicious website. And I suspect a drive-by-download, so I want to check my machine to see since that time in order of creation which files have been created or ...
9
votes
2answers
604 views

Piping to “type” command

I want to find out the type of several commands. Is it possible to pipe or xargs a search result from find into the type command in Linux? For example: find . -name anacron | type or find . -name ...
1
vote
1answer
35 views

Search specific word inside document using ssh [duplicate]

Currently i have to analize some big files looking for a espefic word in .css located on my /var/www/ located on ubuntu server (ssh). There a way to make something like Ctrl+f in windows ...
1
vote
2answers
637 views

How can I use “find” in a shell script to search from the current directory?

I want the program to look like this : read a if[ find . name $a ]; then echo "You found the file" else "You haven t found the file" fi
1
vote
1answer
42 views

How to update the multiple files without changing file date?

I have replaced word 'merchant' to 'capital' in files founded in the current directory using following command: find * -type f -exec sed -i -e 's/merchant/capital/g' {} \; but above command will ...
-2
votes
2answers
43 views

Command to list only output files of gcc operation? [closed]

I have a directory with many c programs and some other files. After performing gcc -o output_name filename.c on c files i have respective output files in the same folder. What terminal command and ...
0
votes
0answers
66 views

find only works with sudo?

I've been searching for a while now and I can't find an awnswer to this. Let's assume I created this dir /Desktop/things and I want to find it using find. If I do find . -name things -type d ( and ...
3
votes
2answers
80 views

locate command finds a file's path, but the file does not exist in that path [duplicate]

I have written: locate Origin90SR2DVD.iso And I received the path where that file is located: /home/david/Origin90SR2DVD.iso Then I have written: cd /home/david I have run: ls -lrth And ...
4
votes
2answers
98 views

Why using the '-execdir' action of find command is insecure for directory which is included in the PATH environment variable?

As title shows, why this is insecure to using the combination of -execdir action of find while using -exec is'nt? When I want to run the below command I'm getting the following warning/stop: ...
3
votes
6answers
792 views

command to find files by searching only part of their names?

Say there are files with names: batman.c batwoman.c batgirl.c cricketbat.c What command and how should I use it to list all these files by using the searchtag bat?
2
votes
2answers
34 views

Advanced text replacement

How can I replace a text in all files in all subfolders when my search includes "*" for example I have many text files containing such pattern (some wrong paths that I want to correct) ...
3
votes
3answers
255 views

changing from user to Superuser

How do I change from user to superuser (root)? What command do I use in the Terminal to switch to root? I have tried --help but I get lost with all the listed help. I'm looking for a recent ...
-3
votes
2answers
80 views

What does this mean in my program? -exec ls -s {} [duplicate]

-exec ls -s is part of my program just want to know what does -s {} mean. This is my whole program, I know what it does: find $root -type f -exec ls -s {} \; | sort -n | tail -n 15 >> ...
0
votes
1answer
39 views

Need a script to find files modified in the last three days and exclude all backup folders

I'm trying to set a script to let me know what WordPress files have been modified in the last 3 days, but I get a huge list of every site's backups when I just run: find /var/websites -mtime -1 How ...
4
votes
2answers
288 views

How can I batch rename filenames in the console

I have a great number of files whose name is "img800400_497708.307247.png", and I would like to change all dots (periods) to an underscore using the console. How can I do that?
1
vote
2answers
1k views

“find: missing argument to `-exec'” when using “-exec rm -f {}\”

I run this command: ~/shell_temp$ find . -type f -name "IMAG1806.jpg" -exec rm -f {}\ i got output below: > IMAG1806.jpg Error: find: missing argument to `-exec' what is exact command for ...
9
votes
3answers
1k views

How to list files older than a day with “2015” in filename?

I want to list all the log files which do not belong to today and only the files that contain 2015 in their names. These are the commands I have tried: find . -name 2015 -mtime +1 -exec ls -ltrh ...
1
vote
1answer
254 views

How to rename a file using find command

I am trying to rename a file using find command. I am trying to rename file-a to file-10. To do this I first tried below command: sps@sps-Inspiron-N5110:~$ find ~ -type f -name test-a -exec mv ...
0
votes
1answer
37 views

Pipelining and xargs

I am trying to delete some .class file from a directory. So first I have tired to count the available .class file using the following command (after going to the directory) - $ find . -name *.class ...
-1
votes
1answer
31 views

Find directories and create new sub directory inside each directory found

I need to insert a file to a sub new directory that I will create when find command is executed. # find /home/user*/.dir/anotherdir -maxdepth 1 -type d -iname "*.default" anotherdir/dwwcop9o.default ...
0
votes
1answer
42 views

run command on only local mount points

I have a command to filter files with size > 10 MB but want to run it only on local mount points. Currently I have mounted some remote NFS in my system on /nfs so in my search I don't want to ...
3
votes
2answers
95 views

How to stock all files with the same suffix into a table?

i'm making a little shell script and i want to stock all files with same suffix in a table. i want something like that : path=/home/user/Documents suffix="_suffix.txt" and then a function that ...
0
votes
3answers
81 views

Using find to search for files containing a word

I want to use the find command to find all files on the system that have the word fsck. I tried find / -iname fsck and it started to search files but everything was permission denied. When I try ...
1
vote
6answers
646 views

How to open a found file with vi? Piping 'find' output to vi [duplicate]

I have a file, /home/user/important.txt. To find it, I use: find /home/user -type f -name 'important' Then, I want to open the file in the Vim editor using a pipe. How can I do this? Something ...
2
votes
1answer
37 views

Find the files of a particular user or group

How can I search the files based on the owner or group in command line? Right now I have tried ls -lR, that gives all the details of files in sub directories also, and I needed to manually search ...
3
votes
1answer
68 views

Lubuntu updatedb.locate may scap bind mounted nfs file systems

I noticed that cron.daily that run updatedb.locate was talking very long to complete (if ever completing). I have interrupted last run with find taking more than 16 hours of CPU time. After ...
3
votes
2answers
825 views

Using busybox's find to delete recursively some files

How can I find and delete all .jpg? -delete doesn't seem to work... [/share/Multimedia/Music] # find . -name '*.jpg' -delete BusyBox v1.01 (2015.01.25-18:47+0000) multi-call binary Usage: find ...
0
votes
1answer
40 views

How to find all files with the same extension within a directory in parallel

I want to grep files with a specific extension. I know how to do it using find command as blow: find . -type f -name "*.pptx" I am wondering if I can do above command in parallel (using more CPU). ...
2
votes
2answers
133 views

How to use 'if' inside '-exec' attribute of 'find'?

I have a directory with many pairs of files. Each non-text file has a textual description partner. For example a directory can look like this: a.jpg a.jpg.text b.ogv b.ogv.text cd ef.JpG cd ...
-4
votes
3answers
797 views

find all headers file begin with vowels in /usr/include

I need to find all headers from /usr/include that begin with vowels (a,e,i,o,u) Example: acpi.h aclinux.h ah.h ... I don't know how to do it , I tried something with grep but I didn't make it ...
1
vote
1answer
44 views

Finding files in sub directories

Still a newbie. Using a clean machine, purchased from System 76 with Ubuntu 14.04 LTS installed. Got it mid-May of 2014. Why can't I find files in the current and its subdirectories? I've tried ...