LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   advanced ls (https://www.linuxquestions.org/questions/linux-newbie-8/advanced-ls-4175421985/)

unixor 08-14-2012 04:24 AM

advanced ls
 
hello!

I would like with a command similar to ls, to display the contents (with their details) in two columns, one sorted by name and the other sorted by date created, modified, etc

is it possible?

thanks!

pixellany 08-14-2012 04:31 AM

I don't understand the sorting you have in mind---please show a sample of the normal output from "ls -l", and then what you want it to look like after sorting.

Before trying to get fancy, be sure to read thru the man page for ls---to see all the options available.

unixor 08-14-2012 04:41 AM

there is sorting per filename (alphabetically)
there is also sorting per date that each file was created

different ls parameters output each of these sortings

what I want is by typing ls command once (with some parameters maybe) to output at the same time the file list in two versions (one next to the other), one sorted by name, the other sorted by ctime

hope it's clearer now

zhjim 08-14-2012 05:39 AM

You could use a shell script for this and alias this to a an, yeah, alias.
Ruff idead.
Do the two ls commands and have the output redirect to files. After this use diff with side-by-side view or I can't recall the name. But there should be a programm that lets you view files side by side.

unixor 08-14-2012 05:41 AM

am I the only that finds it useful?

Tinkster 08-14-2012 05:44 AM

Quote:

am I the only that finds it useful?
I fail to see how the request as such is useful, but ...
Code:

paste <(ls -l) <(ls -ltr)

unixor 08-14-2012 05:53 AM

wow this is brilliant thanks!!

however, text wrapping messes up the lists

is there a parameter to prevent this?

devnull10 08-14-2012 12:18 PM

Use a wider terminal or truncate some of the output (can be done with the cut command)


All times are GMT -5. The time now is 01:25 PM.