[SOLVED] "Find" command not finding a folder that I know exists
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"Find" command not finding a folder that I know exists
I'm having trouble with the "find" command. I had a folder on my desktop, deleted it by accident, and so I restored it from the "trash" gui. Then I used the gui to perform a find command on that folder, I specified the desktop directory, and it can't find the folder (it's right in front of me!) For testing purposes, I even created a folder called "testing 123" on my desktop, used the gui find feature, and it found that folder.
When something goes to the trash bin, and is restored, does it confuse linux?
I tried running "find" by command line, and it still returned no results. But when I used the "find" command on that "testing 123 folder", it found it.
I can't understand why the find command can't detect this folder when it's right there on my desktop. Thanks, Matt
Please specify the actual name of the 'restored' dir and show the cli cmd you used and it's output - exactly.
Ie please copy and paste, instead of describing.
Please specify the actual name of the 'restored' dir and show the cli cmd you used and it's output - exactly.
Ie please copy and paste, instead of describing.
most probably there is a hidden char somewhere (or something similar happened). How did you create that original dir?
You need to accept: find is correct, the name you passed to find is not identical to the real name.
most probably there is a hidden char somewhere (or something similar happened). How did you create that original dir?
You need to accept: find is correct, the name you passed to find is not identical to the real name.
That folder I created in the Lubuntu gui desktop by right-clicking, create new folder. But I have a lot of folders where there are brackets in the filenames.
Quote:
Originally Posted by lvm_
Square brackets are special regex characters, they must be escaped: "\[1080p\]"
Now I know how to find files. I was backing up some folders/contents and in a hurry, and I dragged a folder to the wrong directory that I didn't recall where. Then I'm thinking, I have a 1.8gb file wasting valuable space somewhere on my solid state hard drive. Now I'm able to find that file and delete it.
When working on *nix of any sort , avoid using whitespace or any kind of bracket/parentheses in a file name ie [] or () or {}.
Also other 'special' chars/punctuation - you'll thank us later
When working on *nix of any sort , avoid using whitespace or any kind of bracket/parentheses in a file name ie [] or () or {}.
Also other 'special' chars/punctuation - you'll thank us later
Personally I use dashes and dots in file names.
I want to ask though, why does my Debian 11 (Cinnamon) does use brackets () and space when duplicating files.
Example: someFile > someFile (copy)
I want to ask though, why does my Debian 11 (Cinnamon) does use brackets () and space when duplicating files.
Why shouldn't it?
It's a good idea to avoid non-printing characters and newlines, but any other characters are generally either a non-issue or not a big deal.
There can be specific situations where it makes life easier to constrain filenames for that context, and it's probably worth limiting filenames to characters that one's keyboards can produce, but it's not the case that people need to never use spaces or symbols.
Quote:
Originally Posted by LinuxEmachine
Then I'm thinking, I have a 1.8gb file wasting valuable space somewhere on my solid state hard drive. Now I'm able to find that file and delete it.
Yeah, dots/dashes/hyphens are fine - especially for multi-word filenames.
The effect you are getting ie blah(copy) is because you can't have 2 identically named files (or dirs or symlinks ... etc) in the same dir, so if you don't specify a different name, the GUI app (!) will attempt to create something related/meaningful for you.
Note that in the shell it simply says
Code:
cp t.t t.t
cp: 't.t' and 't.t' are the same file
ie it'll refuse.
What you're seeing is an artefact of the particular GUI program you are running.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.