Questions tagged [find]

A commandline utility to find files and directories.

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

chmod setting using find command not working

root@VM01:~# find /var/log -type f | xargs chmod g-wx,o-rwx chmod: cannot access '/var/log/journal/11a7df635f034e01b3405209ca9f4260/system.journal': No such file or directory it is working without ...
user avatar
  • 101
0 votes
1 answer
29 views

Compress PDF recursively - Find PDF in directories and subdirectories and execute script

I want to execute a script on each PDF in all subdirectories but I have a problem with filenames containing spaces. I've searched a lot and this post seems to be a solution but I don't find a way to ...
user avatar
  • 103
0 votes
1 answer
44 views

Moving contents of a directory to another

I want to move all the contents including files and sub directories from /home/storage_new/nidhal/foldertest/ to /home/storage_new/nidhal/foldertest1/. When I use the command ... while true; do ...
user avatar
1 vote
1 answer
42 views

VLC how to play all files that contain specific word

I would like to play all files in all subdirectories that contain specific term. I tried it using: find . -type f | grep Song | vlc I think I might be misunderstanding how | works, because it doesn't ...
user avatar
  • 11
-1 votes
1 answer
46 views

How do I search for a certain folder located inside the root directory?

I'm specifically looking for the command equivalent of sudo find / -name filename for searching folders instead of files in the terminal. Suggestions with a better set of commands for achieving the ...
user avatar
  • 143
2 votes
1 answer
108 views

Using "find" command with "-mtime" and "-exec rm -rf" Deletes More Files than Expected [closed]

I am testing with the following command line to delete older files on Ubuntu 18.04: sudo find /media/Archive -type f -mtime +463 -exec rm -rf {} \; Currently the /Archive folder has files from 2021 ...
user avatar
0 votes
0 answers
25 views

Display files that have additional rights for group and others that the user does not have

I have a problem to solve for a university class I am taking. I need a command that lists files in a directory that have a group or others permission that is set, but it is not set for the owner (such ...
user avatar
1 vote
0 answers
45 views

Find files from timestamps

I have a lot of files, of which I need to show only those created in the last 3 hours, and sort this list by date. I tried to do it with the following command: find /root/shell/copy/ \( -type f -mmin +...
user avatar
  • 11
0 votes
0 answers
40 views

Use locate (or find) command to locate files on Windows partition from Ubuntu

I use the locate command quite heavily to search for files on my system and I think it works quite well for me. I am now on a system with a double partition (Windows and Ubuntu) and I would like also ...
user avatar
  • 252
0 votes
0 answers
19 views

about wirelss connection

I bought laptop a few days ago and I have ubuntu system in this device. Device can not find any Wi-Fi adapter, does anybody can help me?
user avatar
0 votes
2 answers
41 views

finding directories and files

I understand that I can find directories with a specific pattern using: find . -type d -name "tmp_*" I understand that I can find files with a directory using: find . -type f -name "tmp....
user avatar
1 vote
1 answer
117 views

Where does Kubuntu/KDE keep references to themes?

I hope this message finds you well. I've attempted to remove a desktop theme via System Settings > Workspace Theme > Desktop Theme. Clicking the 'Remove Theme' button removes the theme from the ...
user avatar
-2 votes
1 answer
57 views

Getting the total size of my five largest files in bash

I am trying to get the total size of my five largest files found in a directory but I am not getting du to work on my list. I have two ways of finding and sorting, the five largest files. #!/bin/bash ...
user avatar
  • 1
0 votes
2 answers
44 views

How to delete a list of filenames without path that are matched in multiple subdirectories?

How to delete a list of filenames without path that are matched in multiple subdirectories? Delete_list.txt may contain (each filename is per line): a.jpg b.jpg c.jpg These files may exists in ...
user avatar
0 votes
1 answer
122 views

grep base on specific date

I have a file somewhere on my linux hard drive which I know was created in November, 2007. I have tried find and grep . Nov ?? 2007 in MANY combinations with no success. What am I missing?
user avatar
  • 115
2 votes
2 answers
210 views

Find all files with given extension in subfolders, and add substring corresponding to subfolder

I have numerous txt files, scattered across different folders. - case1 | - 0.25 | - case1.txt - 0.35 | _ case1.txt - 0.30 | _ case1.txt -...
user avatar
  • 255
0 votes
1 answer
388 views

Shell script to delete all files of certain type in different folders, except 10 latest

First of all, please excuse my poor english. I am trying to write a shell script to clean up some files of certain type in my backup folders. I need to remove files of certain type, except 10 newest ...
user avatar
2 votes
1 answer
63 views

Rename some files to their own name + something else

I have a directory like Photo and I want to change the names of the directories inside it -> to what they are, but without it [www.faraDa...] like the first one that I change by mv command. but I ...
user avatar
0 votes
3 answers
292 views

How to list all ASCII files present in a directory?

I want to list all ASCII files that are without extensions(.txt) in my present working directory(home). I started with the ls command in the terminal but i don't know what i should put in the options ...
user avatar
  • 143
0 votes
1 answer
37 views

LibreOffice: indent all lines starting with italic via find/replace

I have a huge text, and I would like to indent all lines which start with italic text, via find/replace. I tried using ^ and italic via the format button, but then the search string is not found. If I ...
user avatar
  • 1
0 votes
1 answer
58 views

Find command from left to right and attach ID

I am trying to match MRI files with their volume files. Background: Link to files: https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=68550661#68550661171ba531fc374829b21d3647e95f532c ...
user avatar
2 votes
1 answer
133 views

why is output different of counting files?

I just want to count all the files in a directory. I used two method what I found: tree /home/bkp Whit this method the output is 2177879 file. find /home/bkp -type f | wc -l And with that one is ...
user avatar
0 votes
0 answers
78 views

Output of find | xargs not redirecting to log file

I'm developing a Bash script which cleans up old data files periodically, and right now everything works except for the log file I'm trying to generate so I can see what it did. The structure I'm ...
user avatar
1 vote
2 answers
82 views

How to find subdirectory named "qt5/plugins"

I need to find the Qt plugins directory, and I've spent an hour looking for a way to find directory names that include a /. There is a ton of 'qt' and if 'qt/plugins' is wrong, I'll need a different ...
user avatar
6 votes
1 answer
901 views

My `find` command in script does not find files and directories with spaces in their names

Some time ago I wrote a script that moves files and directories from Downloads to .Downloads if they are older than 3 days, and delete them from this directory after 30 days. It is working just fine, ...
user avatar
1 vote
1 answer
46 views

Searching for and deleting files with a certain extension or ending with a number

I'd like my script to find a certain file type and delete it. I know that find path/to/directory/ -type f -name '*.ext' -delete will find and delete all files with the extension. Now I'd also like to ...
user avatar
  • 15
2 votes
1 answer
148 views

Delete files not matching pattern using xargs

The following command is from https://www.tecmint.com/xargs-command-examples/ the example #9. It is to delete files not matching *gz from current directory. $ find . -type f -not -name '*gz' -print0 | ...
user avatar
  • 123
2 votes
1 answer
849 views

find -exec rm -r print delete

I am trying to delete terabytes worth of folders and would like to see that things are actually being deleted. Currently, the command find . -name "labelled_point_clouds" -type "d" ...
user avatar
  • 1,072
0 votes
3 answers
78 views

How do I find folders without a certain name?

I'm trying to find a lot of folders, all without a certain bracket. They're movie folders, like so: Zombie Flesh Eaters (1979) [tmdb-7219] Zombieland (2009) [tmdb-19908] Zombieland Double Tap (2019) [...
user avatar
1 vote
0 answers
34 views

Geany - how to disable mark option in find function?

I pressed mark but now I have no idea how to disable it. And I can not google this. Just closing the window doesn't help.
user avatar
  • 341
8 votes
2 answers
464 views

Search for file by the name it had before being renamed

I have some hundreds of thousands of files, personal stuff like photos, videos and documents gathered and stored during the years. Most of them are organized by type, dates and topics... But some (...
user avatar
1 vote
1 answer
108 views

Find command shows the files are present but not found inside the directory

I tried search a files using following find command find . -type f -mtime +18 -name '*[-.]20[0-9][0-9\-]*' -exec basename {} \; I can see the files output like . handh2.access.20210429.bz2 handh2....
user avatar
1 vote
1 answer
143 views

Rename file names with a parent directory name

I want to rename my files recursively, ending with *.fna.gz with the parent directory two-step-up i.e. "Aspergillus_neoniger". You can see the subdirectories details in this image tree ...
user avatar
  • 43
-1 votes
3 answers
1k views

How to change/remove the file extensions of a group of files

I have a bunch of .txt files in a directory, and I want to be able to find these files and strip the extension from the file name. I can find the files using: $ find . -maxdepth 1 -type f -name "*...
user avatar
  • 3,168
5 votes
1 answer
579 views

Remove and replace all Slashes from Filenames recursively

I want to rename every File in a folder-subsystem that contains a slash to be replaced with an underscore Current filenames example: Hello/there.txt File/name.jpg to Hello_there.txt File_name.jpg ...
user avatar
1 vote
1 answer
127 views

How to use the "find" command to find files bigger than 1MB, and execute a chosen command on each file?

I'm trying to write a script that will find all files bigger than 1MB, and one at a time ask the user what to do with each file: delete, compress, or skip. So far this is what I have got: find / -type ...
user avatar
  • 11
0 votes
2 answers
69 views

Trying to find files beggining with a number

For my school, I need to search all the files who start with a numeric. Ive tried searching on the web before but didnt find any answer. I need to use the find command. The question is: Are there any ...
user avatar
2 votes
2 answers
11k views

Where is pip config file on Ubuntu 20.04.2 LTS?

I have searched everywhere and I can not find the config file on Ubuntu Ubuntu 20.04.2 LTS with only pip3 installed do I have to make one? The below commands return null: locate pip.conf or locate ...
user avatar
  • 274
0 votes
0 answers
192 views

Using find to edit multiple files in multiple directories (that are in consistent form)

what I a trying to do is to use find to edit/replace string in multiple files with same name in multiple directories with consistent form multiple files: status1_cap multiple directories: /home/user/...
user avatar
1 vote
0 answers
32 views

Using find with -delete but not scanning a backup disk mounted in /media

I need to find all directories named ABC in /, but I want find to ignore (not scan) the path /media. I've tried a few ways, as I found on the Internet, but none are working properly. My latest three ...
user avatar
0 votes
2 answers
88 views

Find the list of immediate next directory from the given location for reaching a destination file?

We can find the full absolute path of a destination file using find keyword. In my case, I need the list of all immediate next directory to my given location which can lead me to my program log file ...
user avatar
0 votes
1 answer
167 views

Finding Apache files

I'm using a newly installed Ubuntu 18:04 and am new to Unix systems, but very experienced in Windows I've carefully followed an instruction set to install the LAMP files and Apache has been running ...
user avatar
  • 31
3 votes
2 answers
642 views

Find files with certain text within certain date range

I have a folder with huge number of files and I want to extract files present with certain text XYZ created within a date range. I found this to search files within a date range, but unsure how to ...
user avatar
  • 33
1 vote
2 answers
100 views

Cronjob: Deleting the oldest file with at least 50GB while keeping 2 files in the directory

I have a backup script running that creates a ~300GB backup file to a backup folder daily. In that backup folder are some files that are smaller (less than 50GB) as well. Using a cronjob I want to to ...
user avatar
  • 13
0 votes
1 answer
35 views

find command to search for logs

I need to search logs only in a, b ,c, d, e, f directories and not in the subdirectories The command I use: find . -name "*.log" | xargs rm which deletes important logs inside these ...
user avatar
-1 votes
1 answer
148 views

sh -c '...' sh {} not working when using if statement and having ' in the filename

I have the following simplified script: find /home/cas/plex-media/series/ -type f ! -name "*.srt" -exec sh -c ' file=$1 if [ if-statement using $file ]; then echo "true&...
user avatar
  • 530
0 votes
2 answers
95 views

Linux Command [Requirement] [duplicate]

Can anyone tell me what this command means? I've seen it in a tutorial but can't get it well. find . -type f | xargs file
user avatar
1 vote
1 answer
54 views

why is find on my bind mount not working

I'm running lubuntu 20.04. In /etc/fstab I mount my Debian-home filesystem and from that a bind mount for an folder. cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to ...
user avatar
  • 4,196
0 votes
1 answer
118 views

find files grep result then sort by file datetime modification

I have the following files **file_01.sh** abc bla bla function pause(){ bla foo function juliet(){ foo **file_02.sh** abc bla bla function pause(){ bla bla bla jjdjdjd foo function charlie(...
user avatar
  • 63
0 votes
1 answer
34 views

Find files that are installed by a package [duplicate]

I have Ubuntu 16.04. Recently I downloaded a Nintendo DS emulator (DesmuME) with sudo apt install desmume. It seemed like I installed it successfully, but if try to search for the file desmume it ...
user avatar

1
2 3 4 5
13