Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [find]

A commandline utility to find files and directories.

0
votes
2answers
31 views

I used the find command without specifying a directory

I used this command without specifying a directory: sudo find -type d -exec chmod 755 {} \ What could have happened? I was in the /var/www/html folder. Did it change any permissions outside the /var/...
1
vote
0answers
25 views

I have noticed that sometimes my HD is spinning and spinning running “find command” on Xubuntu 16.04.5

When I start my laptop the HD is spinning executing find command without reason, I tried to clean saved sessions, looking in startup programs if there is any command using find command, but I couldn't ...
0
votes
2answers
44 views

Terminal only shows > symbol when I enter this find command [duplicate]

I want to delete all .ppm and .png files under current directory. So after checking some web pages about the usage of "find" command on the Internet, I typed the command below: find . -type f \( -...
-1
votes
1answer
29 views

find entries but remind permission denied

I attempt to find any entries containing "thunderbird" to delete them me@algorithms:~$ sudo find / -iregex ".*thunderbird.*" | grep Permission find: ‘/run/user/1000/gvfs’: Permission denied but find ...
0
votes
2answers
40 views

Copy only images in a specific directory ignoring the sub-directories in it

Excuse me for my Bad english.I want to copy only images(.png) present inside a specific directory(serenity) ignoring the sub-directories(datatables, images..etc,) in that, to another directory. ...
1
vote
0answers
22 views

Delete file with a likely name [duplicate]

I have a folder which contain .srt and .txt files inside /var/www/myvideo folder with filename like this: /var/www/myvideo/course1/module1/dasa22.en.srt /var/www/myvideo/course1/module1/dasa22.en....
1
vote
2answers
33 views

Search recursively for all files with a .sql extension and pass them to mysql as argument

Given: Directory tree that contains files with .sql extension. Requred Find them all recursively and pass found files one by one to mysql client as: mysql < ./dir/subdir/subsubdir/schema.sql ...
3
votes
1answer
309 views

Can't find files older than 1 day

I want to find all files beginning by backup* older that 1 day in a folder. I do: find /home/mypc/backup* -mtime +1 But I am getting an empty list. Where am I wrong?
0
votes
1answer
42 views

How to create inside each directory a .txt file that is called as the directory with find command

I have to do it with the find command. Now i have this: sudo find /home/jesus/ -type d -exec touch {}/folder.txt \; I want that inside each directory is created a file that starts with the same name ...
3
votes
3answers
157 views

Returning the MD5-hash of all files in a directory to a .txt file with file name [duplicate]

I have a directory of pictures. I need the MD5-hash of each file in that directory and the name of the file placed into a .txt document. This file is to be read at a later time to reference the MD5 ...
2
votes
1answer
21 views

find and -exec with multiple parameters

I have a command to encrypt (codecrypt) files like this example: ccr -aer john -R file.txt > file.txt.ccr I'd like to do a loop with several files, so I came up with this: for a in *.txt; do ccr ...
1
vote
0answers
35 views

How can I add a command-line option to a favourited application? [duplicate]

I have a 4k display, so by default Spotify is incredibly zoomed out. To fix this, I had a look at this post, which recommends adding a command line option. This works when I launch Spotify through the ...
0
votes
0answers
32 views

Help using FIND to find a specific file with an owner and permissions specified

in this SUID thread I have some to a grinding halt, with nil success. I need to find a file that is owned by the user Linux, has a SUID set and has user execute permissions set. The file is called ...
2
votes
1answer
158 views

Help with find command to identify SUID file please?

I am doing an online course and could do with some help please. Please see the image below. I am using find to locate a file with the SUID bit set. The question asks "What is the contents of the file ...
1
vote
1answer
100 views

how to use find in scp command

I would like to use scp command fo transfer some files from remote server to local machine. The problem I have is to find the files and then direct them to scp command. I don't want to generate an ssh-...
3
votes
2answers
99 views

Double file extension with FFmpeg

I'm trying to get FFmpeg to go through all files and sub-folders under the path I run the command in, to convert any MKV file to an MP4 container instead. I've got the below command working but the ...
0
votes
0answers
17 views

using find and cat command for merging text files orderly [duplicate]

I have a main directory and its sub-directories as; main_directory == main_directory 0001 0102 0203 ... == first order sub_directories 001 002 003 ... == second order sub_directories I use below ...
0
votes
0answers
39 views

Using the find command in Krunner

I am a big fan of krunner. But eversince I came across it I have been disappointed by its search function. When I am searching for a specific expression I normally use: find . -iname '*heavymetal*' ...
1
vote
1answer
32 views

What is the command to list the files of specific extension within the range of file size and with depth of file search?

I tried using the following command but it is not working. sudo find / -type f -iname "*.ttx" -size +5k 2>/dev/null | grep -E '^/?([^/]+/?){0,3}$' I am using 2>/dev/null to avoid error ...
1
vote
0answers
39 views

Slow performance of find

I have a process that creates many nested directories and files in output directory. Right now the directory has 67,000 files which does not sound much. I have a cleanup cron job setup exactly like ...
1
vote
2answers
47 views

Delete Small Folders Under 50 MB With Spaces in Name

How do I delete all folders in a directory that are under 50 MB total in size? The directories have spaces and special characters in their names, but no line feeds. There could be sub-directories ...
9
votes
5answers
594 views

Find the number of files for each extension in a directory

I want to count the number of files for each extension in a directory as well as the files without extension. I have tried a few options, but I haven't found a working solution yet: find "$folder" -...
2
votes
1answer
43 views

for loop find how to recursive directories and whitespaces [duplicate]

I am trying to write a script to check video file codec (using ffprobe), and encode them accordingly (with HandBrakeCLI). Directory mp4 >> Sub-Directory >> mp4 >> >> Sub-sub ...
6
votes
3answers
688 views

How can I recursively find a directory by name and delete its contents (including all sub-directories and files) while keeping the directory itself?

Given: I have a tree structure with folders EmptyMe on different levels EmptyMe directories contain sub-directories and files Required: Empty contents of EmptyMe directories (inlcuding their sub-...
-1
votes
1answer
118 views

find: paths must precede expression: `{}' [duplicate]

$ find '/media/andy/MAXTOR_SDB1/Ubuntu_Mate_18.04/'* -mtime +5 {} \; find: paths must precede expression: `{}'
1
vote
1answer
33 views

Explain find command with options

I am fairly new to more complex linux commands and this one has a bunch of options and flags that I have never seen and piecing these together just won't click in my brain. find /external-disk/...
3
votes
1answer
75 views

Is it possible to show all found results together in the LibreOffice Writer?

In MS Word you can Ctrl+F to search a typographical object (sign(s), letter(s), word(s)). A full list of the results is displayed in the left pane (search-engine style: enumerated, with context, and ...
1
vote
2answers
37 views

Finding all .ODTs, zipping them and bringing them to the desktop

I want to find all the .ODTs in my $HOME directory, zip them and bring the zip file to the desktop. By doing find -type f -iname "*.odt", I get: ./Programmierung/Hash bang.odt ./Schreibtisch/Alles/...
0
votes
1answer
74 views

Why does unicode in a file name cause 'find' to add input to the terminal?

So I have the following file with a strange unicode name. When I do a find command on the file it will print input to the terminal. Look for the 62;c at the bottom of the output. Why does this ...
3
votes
1answer
55 views

Find images higher than a specific resolution in a Linux directory

This is a follow-up question from my previous question asked here. I need to find and log the path to all jpeg images in sub directories with a resolution higher than a specific number (e.g. higher ...
7
votes
1answer
953 views

Find images in a Linux directory based on their resolution

I would like to scan all images in a linux directory (recursively within sub-folders), and find those with resolution higher than a specific threshold (e.g. say those with resolutions at least 800x600 ...
0
votes
3answers
81 views

Search for multiple patterns from a file using find command [duplicate]

There is an option to use grep -f MY_FILE to let it search for patterns taken from a file, instead of being specified directly on the command line. Is there an option to do something similar with the ...
1
vote
2answers
25 views

Find substring in file

I have a file with text like following: {name: "Jon", kids: [{i: 1, n: "tyrell"}, {i: 2, n: "angela"}, {i: 3, n: "elliot"}] what I want to achieve is delete every string with ":i" so in this case ...
0
votes
1answer
57 views

Generate a separate .md5 file for each file in a directory, while SKIPPING existing ones

I got say 4TB of millions of files. I think if I can produce a single .md5 for each file, it would be nice. I read Generate a separate .md5 file for each .fastq file in a directory? and modified to ...
0
votes
1answer
82 views

what does this command do?find command with options

but a question what does this command do? I know find command but about options no,like expression in quotation and also -exec and ... find /var -name "[0-9]*test[A-Z]" -exec {} /root/{}';'
2
votes
1answer
113 views

Rsync replacement

After spending time trying to make rsync work, I decided to use something else. I have a tree of files at /home that I want to backup to a 64G USB stick once a day, using the same tree structure, but ...
0
votes
1answer
21 views

How to restrict the “find” command to a physical drive?

Often I go looking for something and resort to running find / -name ... But when there are multiple network drives mounted it can take forever. There doesn't appear to be any parameter to restrict ...
5
votes
4answers
629 views

find a file with “find” and show the size of the file [duplicate]

How can I find a file at the same time view the size of the file? ERROR: I tried this command, but I only got the size and details of other files. find -name "*.conf" | ls -l
0
votes
2answers
51 views

How to find in different kinds of files

I'm working on a Ubuntu Windows app on my Windows-10 PC, the result of uname -a is the following: Linux DOMINIQUEDS 4.4.0-17134-Microsoft #48-Microsoft Fri Apr 27 18:06:00 PST 2018 x86_64 x86_64 ...
2
votes
1answer
53 views

find grep exec, result

If I run the following command find ./dir -type f -newermt 2017-04-01 ! -newermt 2018-06-30 -printf "%TY/%Tm/%Td %TH:%TM:%.2TS %p\n" -exec grep -E -l "pattern" {} \; | sort -n; will return this: ...
-1
votes
1answer
42 views

how to find & delete folder with a certain with find

I have a drive with daily backups (twice a day) and need to delete a folder in each backup which is pretty deep into a folder structure. /mnt/backup/backup/[yymmdd_hhmm/backup-clients/[username]/ ...
0
votes
1answer
41 views

List file number and size (directory and sub-directory)

I need to list the number of files (hidden AND visible) on a hard drive, including those in subfolders. Looking for a simple command for this please? This is separate from my previous question where ...
1
vote
0answers
191 views

Where can I find default noisy color backgrounds?

I'm using Ubuntu 18.04 LTS version. I want to change login screen background to as like my lock screen background. I know how to change login screen background but I can't find the default color ...
0
votes
2answers
258 views

Find all files with specific mime type

I copied huge number of (Android SDK) files from a shared directory to my system. Now all files which their MIME types are application/x-shellscript or application/x-executable, seems that are not ...
2
votes
1answer
114 views

Improve initial use of `find` performance time

I'm working on a project to find all the .tar installation files on my system using the command: time find / -type f \( -name "*.tar" -o -name "*.tar.*" \) 2>/dev/null | wc The first time it runs ...
14
votes
7answers
3k views

How can I count files with a particular extension, and the directories they are in?

I want to know how many regular files have the extension .c in a large complex directory structure, and also how many directories these files are spread across. The output I want is just those two ...
1
vote
2answers
3k views

Save the result of find as a variable in a shell script [duplicate]

I want to find the path to a file, and save that output to a variable in a shell script. Specifically, in the bash shell, if I write GCC_VERSION="find *-gcc" Then echo ${GCC_VERSION} Prints ...
0
votes
4answers
1k views

Find multiple word-patterns in files

I have around 50000 files (.txt) and more items in filesdir folder.The values: 'fax', 'phone', 'address' are presented in different configurations in these files. I need to find all files which ...
0
votes
0answers
36 views

Find phrase in list of files [duplicate]

Trying to find all files in current directory and sub directories that contains phrase hello. According to my understanding this should work: find -follow | cat | grep "hello" Firs of all I'm trying ...
-1
votes
1answer
100 views

How can I find a file whose name fits a particular pattern using `find`?

I'm learning Ubuntu in University and the task is find a file in the command line with the following instruction: file should start with letter g filename should have only 3 characters file extension ...