solrais equivalent of ls -lSr

Posted on 2006-04-03
Last Modified: 2013-12-27
what is the solaris equivalent of ls -lSr

basically i want to:
list files in the current directory by size
list the 10 biggest files in the current directory and in all sub directories.

thx Peewee
Question by:Peewee
    LVL 3

    Accepted Solution

    ls -Rl |sort -rk5|head
    LVL 5

    Author Comment

    hi sheetbird,
    thanks for your answer it does what i'm after.. how do i get the path name of the file to display aswell as the file name..

    LVL 3

    Expert Comment

    getting the path with ls is not possible.  I would suggest that you use a perl script.  Here's a quick hack of another script I wrote that will get the file name and the size

    use Cwd;
    use File::Find;
    sub process_file {
    ($size) = (stat($_))[7];
            my $path = cwd;
            print "$size $path\/$_ \n";
    if (!$ARGV[0]){
            die "I need a Directoy as input \n";
    find(\&process_file, @ARGV);

    Save it as and then you can pipe it to sort as done above

    ./ <targetdir> | sort -nr|head

    The whole thing can be done in perl but I didn't want to spend the time on it if perl is something you don't want to do.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now