The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Describe the parameters of iostat,vmstat and mpstat grrajeish SUN Solaris 1 05-21-2008 02:39 AM
Knowing the half will get you into trouble - describe your disasters benefactr What's on Your Mind? 3 04-25-2008 12:48 PM
how to get return code in one line bluemoon1 Shell Programming and Scripting 6 09-13-2007 10:09 PM
describe unix commands in english props UNIX for Dummies Questions & Answers 4 12-16-2003 10:45 PM
using command line input in C code vannie High Level Programming 2 02-28-2002 03:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-12-2006
NickNine NickNine is offline
Registered User
  
 

Join Date: Oct 2006
Location: Tennessee
Posts: 3
Describe what this line of code would do

I am confused about what this line of code would do. I understand all the pieces but not the final outcome. Anyone that could help?

find / -type f -xdev -mtime 0 -size 100000 -exec ls -lht {} /; 2>/dev/null
  #2 (permalink)  
Old 10-12-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Code:
find / -type f -xdev -mtime 0 -size 100000 -exec ls -lht {} /; 2>/dev/null
Well, first of all, the command would fail, you have to replace the /; with \; for it to run.
Code:
find / -type f -xdev -mtime 0 -size 100000 -exec ls -lht {} \; 2>/dev/null
What the command would do is, find in the / filesystem, all entities (shall I say) that are plain files (-type f), not descending into directories that contain other mounted filesystems (-xdev), that were modified today - 0 days ago (-mtime 0), that are of size 100000 512 byte blocks (-size 100000), and execute the command 'ls -lht' on each file that has been found (-exec).

Cheers.
  #3 (permalink)  
Old 10-12-2006
NickNine NickNine is offline
Registered User
  
 

Join Date: Oct 2006
Location: Tennessee
Posts: 3
Thanks Blowtorch

Thanks I could break down the parts but it was bothering me that I could not figure out what it was doing.
  #4 (permalink)  
Old 10-16-2006
creedog creedog is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 8
and don't forget redirect any errors to /dev/null. Although not too sure what errors you might get in the first place
  #5 (permalink)  
Old 10-16-2006
NickNine NickNine is offline
Registered User
  
 

Join Date: Oct 2006
Location: Tennessee
Posts: 3
Thanks

Thanks for the response. The redirect would take care of any error messages generated if one was not logged on as root.
Closed Thread

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 On




All times are GMT -4. The time now is 07:59 AM.


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