1,105,340 Community Members

Sorting list of files?

Member Avatar
Posting Whiz in Training
265 posts since Mar 2011
Reputation Points: 10 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]

Any idea how to solve an old exercice?

The linux command ls -alR produce informations about files contained in the current directory and
its subdirectories. You can save its output by using redirections (in the file output in the following

ls -alr > output
The exercice is to write a perl which take as input a file generated by the previous command and displays:

  1. The sorted list of all owners (without duplicates) according their name

  2. A sorted list of all filenames for which several files exists with the same filename (you should display the number of occurences too).

  3. A sorted list of files according their size.

  4. A sorted list of files according the last writing time .

Member Avatar
Posting Whiz in Training
221 posts since Apr 2012
Reputation Points: 40 [?]
Q&As Helped to Solve: 38 [?]
Skill Endorsements: 0 [?]

Hi tony75,
How would you write it please?

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: