Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: How to find files in Ubuntu?

  1. #1
    Join Date
    Oct 2017
    Beans
    21

    How to find files in Ubuntu?

    Hello.
    I installed catfish, fsearch, dolphin, searchmonky, recoll, file search, plasma search. None of these tools finds anything that I am looking for. They display random files or not a single one. Examples:

    1. files modified after 1. Jan 2024: no files found, or in searchmonky: 20 files between 2013 and 2024
    2. *.*: no files found
    3. *: no files found
    4. "": no files found

    How is this possible? I have to go back to Windows just because Ubuntu has no working file search?

  2. #2
    currentshaft Guest

    Re: How to find files in Ubuntu?

    .
    Last edited by currentshaft; September 2nd, 2024 at 12:39 AM.

  3. #3
    Join Date
    Oct 2017
    Beans
    21

    Re: How to find files in Ubuntu?

    Quote Originally Posted by currentshaft View Post
    And you don't need to threaten going back to Windows, no one will care if you do, I promise.
    It is not a threat. It is a fear

    I entered

    Code:
    find . -type f -newerct 2024-01-01
    into all the programs I have but still no results.

  4. #4

    Re: How to find files in Ubuntu?

    Try using this instead of newerct:

    find . -type f -newermt 2024-01-01
    Last edited by euol; August 7th, 2024 at 09:01 AM.
    Have a great day

  5. #5
    Join Date
    Oct 2017
    Beans
    21

    Re: How to find files in Ubuntu?

    Same result, no files found. No matter if I use catfish, fsearch, dolphin, searchmonky, recoll, file search, plasma search ...

  6. #6
    Join Date
    May 2008
    Beans
    4,464
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How to find files in Ubuntu?

    Quote Originally Posted by firesdhgsht View Post
    Same result, no files found. No matter if I use catfish, fsearch, dolphin, searchmonky, recoll, file search, plasma search ...
    Ah, but did you open a terminal and enter the command?

  7. #7
    Join Date
    Oct 2017
    Beans
    21

    Re: How to find files in Ubuntu?

    No, how do I install that "terminal"?

  8. #8
    Join Date
    Mar 2010
    Location
    Been there, meh.
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to find files in Ubuntu?

    There are lots of ways to find things in Linux/Unix. Remember that Linux is always a multi-user system, so if your account doesn't have access to know about the files you are looking for, then no command should display those to you.

    The find command is quite extensive, but the manpage is complex and scary, so just search the web for "Top 50 Linux Find Commands" to see examples. https://www.baeldung.com/linux/find-command might be useful. find scans from the directory you specify in the command. You can specify multiple directories or just use '/' and have it scan everything. Almost any property of a file or directory can be specified in the command, but it does take a little thought to look for exactly what you want. I have about 20 different find commands that get used enough to have memorized over the decades, but often just get everything with the -ls option and use egrep to filter for and remove things in the list returned by find. Because find scans the file system, the performance of the storage will matter. OTOH, the results should be accurate at the time.

    The locate command is bonehead simple when all you know is part of a filename. Locate is part of updatedb and scans the entire file system, building a DB of all files on it that aren't on temporary storage. The DB gets updated daily via cron, but you can force a sudo updatedb to run. locate returns answers nearly immediately since it doesn't have to scan the entire file system, but just a DB. If the files I seek have been on the system longer than 1 day, I'll start with locate.

    Recoll is like a personal google for our computers. It uses helper tools to look inside files for the content. It also creates an indexed DB full of the contents and file properties. Recoll needs to be updated manually. This can be accomplished through the GUI Recoll tool as needed, or you can create a script and run that script automatically via cron daily or weekly or monthly. Recoll indexing is much heavier than locate's indexing, so I run it weekly in the middle of the night. On a system with about 45TB of storage, the recoll index can be large:
    Code:
    $ du -sh recoll-index/
    12G     recoll-index/
    OTOH, searching for stuff based on what's inside is google-fast.

    So, if I wanted to find all the modified files (not directories) in 2024, I'd use find and the mtime option. I think this is the command:
    Code:
    $ find / -type f -mtime -$(date "+%j")
    If I wanted lots of time data along with the filename output, I'd add the -ls option:
    Code:
    $ find / -type f -mtime -$(date "+%j")  -ls
    Another way to to this that is less efficient would be
    Code:
    $ find / -type f   -ls |egrep -w 2024
    However, that will find files with 2024 in line, not just part of the date, so if a file size is 2024 or an inode is numbered 2024, those will be found too.

    egrep -w looks for entire words, but it doesn't count numbers or punctuation, so '4312024' will be found too. Best to use the -mtime option with days ago calculated. Beware that find calculates "days" in a non-intuitive way. Best to carefully read the manpage about that, if you really care.

    You can use explainshell.com to see what each option does if using the actual manpage on your system is scary. However, the local manpage will have documentation for the correct version of the programs on your system. No website will have that exact documentation. Most of the time, commands and options don't change too much, but over 5+ yrs, they do, often adding new options that are more convenient.

    For example, I've been using find for 30 yrs and had never seen the -newerct option. So, I just checked and it isn't in the find command on my 20.04 or 22.04-based systems. So, either that option is a mistake or it is VERY new.

    BTW, Linux/Unix doesn't really care about extensions. That's a common mistake made by people used to non-Unix-based OSes. "*.*" just insists that a file have a '.' in it. It won't find any files without a '.' in the name, which would remove nearly all compiled programs from being found. Use "*" if you want to find all files, or better, don't bother trying to specify any name at all.

    Always remember that Linux names are case-sensitive, so if you don't know the exact case for a filename/directory name, it is best to force a case-insensitive search. That applies to locate, find, grep, egrep, and bash scripts (more things too).

  9. #9
    Join Date
    May 2008
    Beans
    4,464
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How to find files in Ubuntu?

    Quote Originally Posted by firesdhgsht View Post
    No, how do I install that "terminal"?
    Its nigh on impossible to explain but there is a hidden bit of Ubuntu wizardry.
    Press these three keys simultaneously;-
    Code:
    Ctrl Alt T

  10. #10
    Join Date
    Jun 2014
    Beans
    7,811

    Re: How to find files in Ubuntu?

    No, how do I install that "terminal"?
    If you can't manage the suggestion in post 9, if you have a recent Ubuntu installed (you failed to indicate your release version) you should be able to left click on the Activities tab generally shown in the upper left of the Desktop, type in terminal and hit the Enter key. Based on what you have posted, you need to do a lot of reading as this is very basic. You could start with the Desktop Guide at the link below.

    https://help.ubuntu.com/stable/ubuntu-help/

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •