bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Last modified files with owner / time / permissions


From: lexton
Subject: Last modified files with owner / time / permissions
Date: Wed, 10 Sep 2008 12:11:16 -0700 (PDT)

Hi,

Below is a bash script that prints out the files that have been modified in
the last 5 days.

>From what I read it is not good to use ls -la in the manner I use below. 
Could I run this by just using the find command with additional arguments? 
I still need to be able to print everything that the ls -la command gives me

 - file owner and group
 - time stamp
 - permissions set

----------------------------

#!/bin/bash
# note run above line with -x for debug mode
PATH=/usr/bin:/bin; export PATH
{ # disk space left
  df -h;
  echo "----";
  # last logins to system
  last;
  # last 5 days of file modications sorted by the 9th column ( file path )
  echo "---- Last 5 Days ----";
  ls -lt $( find /websites/path/ -type f -mtime -5 ) | sort -k 9;
  echo "---- Full List ----";
  ls -lt /websites/path/*;
}  | mail -s 'dev info' mail@mail.com
-- 
View this message in context: 
http://www.nabble.com/Last-modified-files-with-owner---time---permissions-tp19419342p19419342.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]