It is currently Wed Jun 28, 2017 9:41 am


Unix sort/find commands together

All versions of Linux, Mac OS and Unix

Moderator: PCguy

Unix sort/find commands together

Postby jabaharazeb » Fri Sep 05, 2003 3:46 pm

I need to do the following two things, the man pages are not helping me. I know how to create a script file, it's the commands that are the problem:

1. Write a script files named lsize that lists the largest 5 files in the directory (do NOT print the contents of the files), sorted by their size. You might want to use pipe, and the unix utility sort. The script file should use the command ls to obtain the size of the file.

2. Use the command find and write a script named FindExample that create a file named ExecutableSize in the home directory. This file (ExecutableSizes) contains a line describing the full path (including the name) and the number of words, character and lines, of all the files that were modified in the last 10 days, their name starts with the character 'a', and in one of the subdirectory of the directory which which FindExample was executed (other files should be ignored).

Any help is greaty appreciated.
User avatar
jabaharazeb
Newbie
Newbie
 
Posts: 1
Joined: Fri Sep 05, 2003 1:00 am

Thanks given:0
Thanks received:0
Top

Return to Linux, Mac and Unix

Who is online

Users browsing this forum: No registered users and 1 guest

cron