LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-14-2012, 05:24 AM   #1
unixor
Member
 
Registered: Aug 2012
Posts: 46

Rep: Reputation: Disabled
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!
 
Old 08-14-2012, 05:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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.
 
Old 08-14-2012, 05:41 AM   #3
unixor
Member
 
Registered: Aug 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
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
 
Old 08-14-2012, 06:39 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
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.
 
Old 08-14-2012, 06:41 AM   #5
unixor
Member
 
Registered: Aug 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
am I the only that finds it useful?
 
Old 08-14-2012, 06:44 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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)
 
Old 08-14-2012, 06:53 AM   #7
unixor
Member
 
Registered: Aug 2012
Posts: 46

Original Poster
Rep: Reputation: Disabled
wow this is brilliant thanks!!

however, text wrapping messes up the lists

is there a parameter to prevent this?
 
Old 08-14-2012, 01:18 PM   #8
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 548

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'advanced' if brownie_cookie Linux - Newbie 8 04-21-2011 11:02 AM
Advanced fsck? hadimotamedi Linux - Newbie 3 01-29-2010 08:30 AM
which advanced modules to take up? cheers_to_life General 5 05-14-2008 12:04 PM
Advanced Kickstart DaSoul Red Hat 2 08-07-2005 10:23 PM
Better buying "advanced linux prog" or "unix advanced prog" Dominik Programming 3 12-31-2003 02:11 PM


All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration