LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Finding files with terminal (https://www.linuxquestions.org/questions/fedora-35/finding-files-with-terminal-208031/)

joeman3429 07-21-2004 05:59 PM

Finding files with terminal
 
first off, i use and prefer KDE for various reasons(even though i have only had fedora for 2 days...). My problem is, the find files utility in the start menu freezes whenever i try to search in any folder besides /root. I like to search for files, i'm sure you all do too, so i'm kinda stuck because i don't want to use gnome (it's find file program works fine btw).

i'm wondering if i can use gnome's find program, or could someone show me how to use the 'find' command in the terminal, i have no idea how to use it. all i want to do is search for a file, like "find [insert part of filename here]" and have it display the findings.

thanks for anything:)

ps: oh, and i might as well ask while i'm here, how do i make it so i boot into KDE by default, thanks

Lansing_Banda 07-21-2004 06:11 PM

The terminal command works like this

find <starting point> <filename>

so to start at root and find a file called bunny.tgz

find / bunny.tgz

There yah go and good luck.

::edit::
And to change your default wm, make a file in your root directory called '.xinitrc' and in it put this:

Code:


#!/bin/bash
    exec startkde

And that should fix that as well

joeman3429 07-21-2004 07:13 PM

ok, 2 problems:

1.when i type "find / bunny.tgz" it list everyhting on my computer, everything

2. i make the file and named it and put the code in it, so i rebooted. it keeps logging me into the failsafe terminal , its been doing that since i intalled fedora. And when i choose default login or whatever its called, it logs me into gnome. its done that since installation too.
did i do something wrong?

seabass55 07-21-2004 09:55 PM

you can also use locate instead of find

joeman3429 07-22-2004 03:31 AM

it does the same thing with locate too

seabass55 07-22-2004 07:22 AM

locate <filename>

OEP 07-22-2004 02:32 PM

To find files in the terminal, I usually try:

find <start-point> | grep <filename>

or locate if you prefer:

locate | grep <filename>

I don't know why I use grep, it just has always worked better for me.

And to get KDE to be your default Desktop, you can try:

switchdesk "KDE"

Some users don't have switchdesk installed, though.

joeman3429 07-22-2004 03:45 PM

thanks for switchdesk, it worked, but i can't get the find thing to work

lets say i have a folder called "music", i keep music in there if it isn't obvious, and i want to search for my led zeppelin songs. i cd to that folder and then type
find ./ zepp

it lists everything in that folder then outputs at the end:
find: zepp: No such file or directory

i know for a fact i have filenames that have "zepp" in them
am i just missing something?

prissed 07-22-2004 03:59 PM

try find <start point> -name <search string>
Code:

find / -name bunny*

linux-goot 07-22-2004 07:02 PM

Before using locate , you need to create a database of filenames for locate to use.

As su, type in updatedb. Once you get your prompt back, just type in locate <filename>.

From what I've experienced, locate will then search all directories and display path and filenames meeting your search parameters.

Vincent_Vega 07-22-2004 09:13 PM

Yes, that's what 'locate' does but it may find a lot of files so use it in conjunction with 'less' or redirect it to a file for viewing.
Ex:
locate *.mp3 | less
or
locate *.jpg >results_filename

If you're looking for your personal files you can use 'find' much easier:
find ~ -name *mp3 | less

Hope that helps!


All times are GMT -5. The time now is 08:31 PM.