The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
grep unix.com with google



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-29-2009
Registered User
 

Join Date: Nov 2009
Location: Bolton, Manchester
Posts: 11
Question Problems with find & -size

Hi I am trying to find files over a size given by the user.

this is what I have so far


Code:
echo "Enter a pathname to check (example = /home/jsk1gcc/testwork): "
read input
echo "Enter a the size (examples = 100k, 10M, 1G): "   
read size
find $input -size +$size
echo
echo "Hit the Enter key to continue"
read junk;;

Nothing happens. When something like /var or /etc is inputted for the pathname the command works.
though a full pathname including the user does not.

I am logged on as this user, would I need to be root for this to work maybe?
OR
is there something wrong with the code. Any help would be great.

Jade.
  #2 (permalink)  
Old 11-29-2009
TonyFullerMalv's Avatar
Registered User
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 932
Unless the users home directory is group owned by a group you are also in and is group readable and accessible or the user's home directory is world readable you won't be able to do this as yourself, to test try cd'ing into the user's home directory and cat'ing say .profile, .kshrc, .bashrc or .cshrc.
You could do it as root as long as the home directory is not NFS mounted and the NFS server has not given your NFS client root access.
  #3 (permalink)  
Old 11-29-2009
Registered User
 

Join Date: Mar 2008
Posts: 1,342
No file big enough? Diectory is a link?

See if you get anything from this command. It looks for files (not directories or other types) larger than one character, following any links. It also has the "-print" switch because some versions of find don't output anything to terminal unless specify.


Code:
find /home/jsk1gcc/testwork -type f -follow -size +1c -print

Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find with file size and show the size rpraharaj84 Shell Programming and Scripting 3 10-06-2009 02:42 PM
Find problems candyzouk Shell Programming and Scripting 6 03-26-2009 11:40 PM
how do I find the size of..... davidtymon Shell Programming and Scripting 1 02-11-2009 02:21 AM
command to find out total size of a specific file size (spread over the server) abhinov SUN Solaris 3 08-08-2007 07:48 AM
find the file by size rooh UNIX for Dummies Questions & Answers 1 08-16-2001 08:21 AM



All times are GMT -4. The time now is 10:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0