nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Linux searching for files in the server

This is a discussion on Linux searching for files in the server within the Getting started tutorials forums, part of the Linux Getting Started category; Hello folks. This is my first tutorial. For new Linux sys admin (or user ) like me searching file is ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2006, 03:02 PM
Senior Member
User
 
Join Date: Jun 2005
Posts: 137
Thanks: 21
Thanked 4 Times in 3 Posts
Rep Power: 5
jerry is on a distinguished road
Default Linux searching for files in the server

Hello folks.

This is my first tutorial.

For new Linux sys admin (or user ) like me searching file is a hard task. You can use find command to search any file.

Find command

Syntax
find /path/to/search -name "file-name"

Examples
Search myfile.txt :
Code:
find  / -name "myfile.txt"
Search all .conf (configuration file)
Code:
find  / -name "*.conf" | more
Or send list to /tmp/files.txt
Code:
find  / -name "*.conf" > /tmp/files.txt
Search for files which are writable by anybody:
Code:
find / -perm /220
Search for files in your /etc directory which have been modified in the last 24 hours
Code:
find /etc -mtime 0
Find all *.tmp file and remove all the files:
Code:
find . -type f -name ˜*.tmp" -exec rm '{}' \;
Locate command
Syntax:
locate use to list files in databases that match a pattern.

Find abc.txt file:
Code:
locate abc.txt
Hope this helps.
Reply With Quote
  #2 (permalink)  
Old 06-20-2006, 06:12 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

Jerry, quick and dirty work. Keep it up. You can see more find command stuff:

http://www.cyberciti.biz/nixcraft/vi...with-find.html
http://www.cyberciti.biz/faqs/2006/0...s-owned-by.php
http://www.cyberciti.biz/nixcraft/vi...s-based-on.php
http://www.cyberciti.biz/faqs/2006/0...move-files.php
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Searching Tutorial for setup Postfix SMTP-AUTH satimis Mail Servers 1 06-05-2009 07:04 AM
script for FTP'ing 8 differnt server for pulling the files vishal_titre Shell scripting 0 08-17-2007 07:09 PM
script for uploading files to a FTP server marinm Shell scripting 7 01-02-2006 08:35 PM
searching for bad words script marinm Shell scripting 1 02-03-2005 05:32 PM


All times are GMT +5.5. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38