Problems with find & -size


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problems with find & -size
# 1  
Old 11-29-2009
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. Smilie

Jade.
# 2  
Old 11-29-2009
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  
Old 11-29-2009
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

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FIND: Combining -size & -prune

I am having an issue adding the -size test to my find command. I am trying to find all files smaller than 250mb, that are not in .snapsnot or man directories. What i started with find . -xdev -type d \( -name man -o -name .snapshot \) -prune -o -type f What I have tried..unsuccessfully... (4 Replies)
Discussion started by: nitrobass24
4 Replies

2. Shell Programming and Scripting

Using Grep & find & while read line in a script

Hello people! I would like to create one script following this stage I have one directory with 100 files File001 File002 ... File100 (This is the format of content of the 100 files) 2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0 then I have one... (0 Replies)
Discussion started by: Abv_mx81
0 Replies

3. Shell Programming and Scripting

echo & sed problems

I need a script to to instert the following line into my postfix master.cf file: flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}if I use echo I get the line truncated: :~ echo flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}... (3 Replies)
Discussion started by: barrydocks
3 Replies

4. UNIX for Dummies Questions & Answers

nohup & mpiexec problems

Hi everyone - I'm trying to start a run of LAMMPS (which takes an input file) with mpiexec on multiple processors. I want to combine this with nohup so that I can log off the node. I've used the syntax below successfully on one cluster, but it doesn't work on the new one I'm using. Any... (0 Replies)
Discussion started by: erin85
0 Replies

5. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

6. Shell Programming and Scripting

find with file size and show the size

Hi All... is the below command be modified in sucha way that i can get the file size along with the name and path of the file the below command only gives me the file location which are more than 100000k...but I want the exact size of the file also.. find / -name "*.*" -size +100000k ... (3 Replies)
Discussion started by: rpraharaj84
3 Replies

7. Shell Programming and Scripting

find & dirname:problems with white spaces in Directories

Hi all, my problem: (little extract from my bash-script) I want to move each file (.mov) from one directory (and many Subdirectories) to another directory (only one); after moving i want to create hardlinks to the old directories. Thatīs no problem, but now: source-directories... (4 Replies)
Discussion started by: tubian
4 Replies

8. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

9. UNIX for Advanced & Expert Users

UFSDUMP & UFSRESTORE problems

Hi, guys ! I need some expert help on following problem: When trying to restore content of a machine using another backup machine using Ufsdump/Ufsrestore, it worked on /local1, but when attemting to do the same on /local2,/local3 and /local4, I get permission problems. Running superuser does... (9 Replies)
Discussion started by: DGoubine
9 Replies

10. UNIX for Dummies Questions & Answers

Mandrake & size

Hi all, Thanks to Merlin & Djtrippin for comments in another thread. Does anyone know of any issues with harddrive size and Mandrake 9.0? I have installed Mandrake (like a dream) on a 10gb drive but it refuses to go beyond the partition check on my 80gb unit. The 80 is new and I have... (5 Replies)
Discussion started by: onestepto
5 Replies
Login or Register to Ask a Question