Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Help with script

    echo type first file name
    read x
    echo type second file name
    read y
    a=$(stat -c%s $x)
    b=$(stat -c%s $y)
    if '[' "$a" -gt "$b" ']'
    echo "File $x larger "
    elif  '[' "$b" -gt "$a" ']'
    echo "File $y larger "
    echo "Both files are equal"
    This is script which compares file sizes and shows which is bigger. The question is. How i can make script search for files in whole hard disk not only in directory in which i work.

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    Sorry, but as you've already had pointed out to you, homework questions are not allowed. You perhaps want to take a look at the man page for the 'find' command, or ask your tutor.
    Linux user #126863 - see

Posting Permissions

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