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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-14-2012, 04:24 AM
|
#1
|
Member
Registered: Aug 2012
Posts: 46
Rep: 
|
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!
|
|
|
08-14-2012, 04:31 AM
|
#2
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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.
|
|
|
08-14-2012, 04:41 AM
|
#3
|
Member
Registered: Aug 2012
Posts: 46
Original Poster
Rep: 
|
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
|
|
|
08-14-2012, 05:39 AM
|
#4
|
Senior Member
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
|
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.
|
|
|
08-14-2012, 05:41 AM
|
#5
|
Member
Registered: Aug 2012
Posts: 46
Original Poster
Rep: 
|
am I the only that finds it useful?
|
|
|
08-14-2012, 05:44 AM
|
#6
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
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)
|
|
|
08-14-2012, 05:53 AM
|
#7
|
Member
Registered: Aug 2012
Posts: 46
Original Poster
Rep: 
|
wow this is brilliant thanks!!
however, text wrapping messes up the lists
is there a parameter to prevent this?
|
|
|
08-14-2012, 12:18 PM
|
#8
|
Member
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572
Rep: 
|
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 09:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|