Describe what this line of code would do


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Describe what this line of code would do
# 1  
Old 10-12-2006
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  
Old 10-12-2006
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  
Old 10-12-2006
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  
Old 10-16-2006
and don't forget redirect any errors to /dev/null. Although not too sure what errors you might get in the first place
# 5  
Old 10-16-2006
Thanks

Thanks for the response. The redirect would take care of any error messages generated if one was not logged on as root.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Not sure how to describe it but how to format this list so that it print the 1st field once only

Hi, Not sure how to describe the problem. But basically, I have this file listing here app01_app.test.com.ph|PROGRAM=SQL Developer|HOST=AKL0TS100|USER=Admtest01|HOST=10.111.12.23| app02_app.test.com.ph|PROGRAM=D:\interface\apps\bin32\batch.exe|HOST=AKL0TS100|USER=Admtest09|HOST=10.111.12.35|... (3 Replies)
Discussion started by: newbie_01
3 Replies

2. UNIX for Advanced & Expert Users

Can someone describe the process of pre-emption in UNIX?

I never understood what exactly it is that preempts a process in a preemptive multitasking system. For example, round-robin, SRTF, or preemptive priority-based algorithms. I understand how the algorithm works, but what exactly triggers the preemption? I know in the case of round-robin... (4 Replies)
Discussion started by: Ultrix
4 Replies

3. Shell Programming and Scripting

please describe me some simple command

Hi everyone I'm new here and I don't know some command of unix, please help by describe me how it work, I study unix command by myself and can't search exactly means so...Thanks :D sqlplus -s /nolog @${SQLFILE} ${file_type} >> ${OUTPUT_FILE} date "+%Y%m%d%H%M%S" $/usr/bin/echo "INFO : $1"... (2 Replies)
Discussion started by: zound617
2 Replies

4. Solaris

can someone describe

What is openboot prompt is this some kind of shell , and where is located :p (2 Replies)
Discussion started by: solaris_user
2 Replies

5. UNIX for Advanced & Expert Users

DEscribe this command

Hi all. can you please tell me (root) NOPASSWD: ALL what this command means (1 Reply)
Discussion started by: mindtee_abhi
1 Replies

6. Shell Programming and Scripting

special question, hard to describe in few words...

dear coders, i need some inspiration again... there is something what i always wanted to know... how to code following: value 1: __________ value 2: __________ important: when my "script" starts the display has to be cleared and two lines are shown (see above), the cursor has to be... (2 Replies)
Discussion started by: pseudocoder
2 Replies

7. Shell Programming and Scripting

I'm not sure how I would describe this

Some software, when you install it, prompts you for variables, such as the username for the software, or the password you are setting for the software's root account. I would like to know if it is possible to do such a thing, and if yes, how? basically, I would like my installer script to prompt... (3 Replies)
Discussion started by: Bakes
3 Replies

8. Solaris

Describe the parameters of iostat,vmstat and mpstat

Hi, I am trying to take the Statistics of the machine during load.Can someone explian the parameters of iostat: tty sd1 sd2 sd3 sd4 cpu tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id vmstat: kthr ... (1 Reply)
Discussion started by: grrajeish
1 Replies

9. What is on Your Mind?

Knowing the half will get you into trouble - describe your disasters

Curious, what did you do? (3 Replies)
Discussion started by: benefactr
3 Replies

10. UNIX for Dummies Questions & Answers

describe unix commands in english

the following unix command ls | grep'?cw1' | wc -l converting it to english is it going to be like list the result of the search '?cw1' in number of lines is that correct ? (4 Replies)
Discussion started by: props
4 Replies
Login or Register to Ask a Question