LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-18-2013, 11:39 AM   #1
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Rep: Reputation: Disabled
Combining du output with ls


Hey all. About daily, I check my machines' disk usage with du -shx /path/to/directory/* but it would be nice to also see the date as in with ls. Is there a way to combine the two somehow so that I don't have to keep scrolling up to see which file/directory was created on X date?
 
Old 10-18-2013, 11:57 AM   #2
danielbmartin
Senior Member
 
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,484

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Originally Posted by loadedmind View Post
Hey all. About daily, I check my machines' disk usage with du -shx /path/to/directory/* but it would be nice to also see the date as in with ls. Is there a way to combine the two somehow so that I don't have to keep scrolling up to see which file/directory was created on X date?
Perhaps this is what you seek:
Code:
du -shx --time /path/to/directory/*
Daniel B. Martin
 
1 members found this post helpful.
Old 10-18-2013, 03:14 PM   #3
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 506

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by danielbmartin View Post
du -shx --time /path/to/directory/*
After checking man pages...

Code:
$ du -shx --time test/*
2.2M	2013-10-19 00:39	test/abcd.txt

$ du -shx --time --time-style=iso test/*
2.2M	2013-10-19	test/abcd.txt

$ du -shx --time --time-style='+%Y-%B-%d' test/*
2.2M	2013-October-19	test/abcd.txt

//And similar to ls -l
$ du -shx --time --time-style='+%b %d' test/*
2.2M	Oct 19	test/abcd.txt
 
Old 10-18-2013, 03:58 PM   #4
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Awesome, thanks!
 
  


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
Combining two scripts sanaz Linux - Newbie 3 03-27-2013 08:25 PM
Combining Screenshots?? How??? Sliceman Linux - Software 1 06-06-2006 02:36 PM
RH-Firewall combining johnnydangerous Fedora 6 02-07-2005 07:00 AM
Combining Files GameboyHippo Linux - Newbie 4 09-25-2003 02:38 PM
combining music output chr15t0 Linux - General 0 06-08-2003 11:50 AM


All times are GMT -5. The time now is 06:46 AM.

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