General :: Find The Directory With Latest Modified Content?

Sep 29, 2010

how to find the latest modified directory. I know that the command 'ls -rtl' gives the latest modified file/directory at the end. But my specific requirement is: If I create two directories named dir1, dir2 in the same order. so now my latest modified directory is "dir2". Now inside each directories, I created a file. Now in the last, I modify the file in "dir1". So overall, the content of dir1 got modified recently. If I use the command 'ls -rtl', this will still show dir2 as latest, as it is created recently. But I want the directory in which any internal content at any sub-hierarchy modified recently. so with what linux command I'll get this latest modified directory (dir1)?

View 3 Replies


ADVERTISEMENT

Ubuntu :: Find Last Modified File In Current Directory And All Subdirectories?

May 28, 2010

I need to write a script that is given a directory as an argument, and it prints the last modified file from that directory and all its subdirectories.

for example:

$ newest /usr/etc
--> /usr/etc/httpd/httpd May 28 12:16

If I had to do it only for the current dir, it would be easy...I'd probably use "ls -lt" and then show only the first line...

View 1 Replies View Related

General :: Find Will Go Through The Content Of Tarball As Well And List All Content

Oct 5, 2010

I am using find to search for .tgz files modified more than 7 days ago and delete them.find /directory/ -iname backup*.tgz -daystart -mtime +7 -exec rm -rf {} My problem is that find will go through the content of tarball as well and list all content. I want to only search main tarball and delete it if older than 7 days.

View 4 Replies View Related

General :: Find And Sort Results By Date Modified

Jun 7, 2011

so I was wondering how I could do a simple find which would order the results by most recently modified. Here is the current fine I am using. (I am doing a shell escape in php, so that is the reasoning for the variables. find '$dir' -name '$str'* -print | head -10

How could I have this order the search by most recently modified. (Note I do not want it to sort 'after' the search, but rather find the results based on what was most recently modified)

View 4 Replies View Related

General :: Find All Files Modified In Date Range

Apr 30, 2010

I need to know all files modified within a date and time range.E.g: All modified files between 20 April 2010, 1100-1200 Hrs."find / -mtime +10 ! -mtime +11" :: this i found for date but how to include time as well.

View 2 Replies View Related

General :: Compare Directory Content That Has Since Been Updated?

Jul 20, 2011

We copied the directories/files from one filesys1 to filesys2 and since that initial copy have further added more directories/files to filesys2 from another source. How can we compare filesys1 to filesys2 to make sure all files/directories were copied successfully to filesys2? I would like a way to check filesys1 against filesys2 and only show/output when something is missing from filesys2 that exists in filesys1 and not report the additional/extra directroies/files that have been copied to filesys2.

View 3 Replies View Related

General :: Comparing All The Files In A Directory By Content?

Sep 18, 2010

I wish to compare all the files in a directory....comparing is by content. And same files should be printed...

echo "program : $0"
cd $1
for a in *
do

[code]....

This logic did not give the correct result...

View 5 Replies View Related

General :: Use Wget To Move Content From One Directory To Another?

Sep 21, 2010

I am new to linux and wget...what would be the syntax to use wget to move content from one local directory to an svn repository (svn commit)? For instance if i have a directory c:\dir1, and i want to move it's content onto an SVN repo...is this possible using wget? If so, how do I get this done?

View 2 Replies View Related

General :: Find File By Content On System?

Sep 21, 2011

How to find file by content on linux by command. Example: i want find file contain word "helo" on my computer (OS: LINUX)

View 4 Replies View Related

General :: Filter Find And Du By Content Of Inner File In Subdirectory?

May 30, 2010

I have the following command that I run on cygwin:

find /cygdrive/d/tmp/* -maxdepth 0 -mtime -150 -type d | xargs du --max-depth=0 > foldersizesreport.csv

I intended to do the following with this command: for each folder under /d/tmp/ that was modified in last 150 days, check its total size including files within it and report it to file foldersizesreport.csv however that is now not good enough for me, as it turns out inside each

/d/tmp/subfolder1/somefile.properties
/d/tmp/subfolder2/somefile.properties
/d/tmp/subfolder3/somefile.properties
/d/tmp/subfolder4/somefile.properties

so as you see inside each subfolderX there is a file named somefile.properties inside it there is a property SOMEPROPKEY=3808612800100 (among other properties) this is the time in millisecond, i need to change the command so that instead of -mtime -150 it will include in the whole calculation only subfolderX that has a file inside them somefile.properties where the SOMEPROPKEY=3808612800100 is the time in millisecond in future, if the value SOMEPROPKEY=23948948 is in past then dont at all include the folderin the foldersizesreport.csv because its not relevant to me.so the result report should be looking like:

/d/tmp/,subfolder1,<itssizein KB>
/d/tmp/,subfolder2,<itssizein KB>

and if subfolder3 had a SOMEPROPKEY=34243234 (time in ms in past) then it would not be in that csv file.so basically I'm looking for:

find /cygdrive/d/tmp/* -maxdepth 0 -mtime -150 -type d | <only subfolders that have in them property in file SOMEPROPKEY=28374874827 - time in ms in future and not in past | xargs du --max-depth=0 > foldersizesreport.csv

View 1 Replies View Related

General :: Delete All Files In A Directory Except The 7 Latest Ones?

Dec 4, 2010

Here is how i am isolating the 7 latest files

Code:
ls -ltr | tail -7

is there a way to give that negated list to the rm command? or should i be using the find command with an exec {}?

View 14 Replies View Related

Red Hat / Fedora :: How To Find Out Who Has Modified/edited A File

Jan 27, 2011

I use RadHat Linu5.We usually log in to LINUX via putty (remote). Very often many people use the same user and password to log in.I wonder how to tell who has edited/modified a file?

View 9 Replies View Related

Software :: Find Out Who Has Modified / Edited A File?

Jan 27, 2011

I use RadHat Linu5.

We usually log in to LINUX via putty (remote). Very often many people use the same user and password to log in.

how to tell who has edited/modified a file?

View 9 Replies View Related

Programming :: Script To Find Out Modified Date For Particular File

Jul 9, 2010

I am new to Scripting. I am trying to find out particular file is modified in last one hour or not in script and then if that file is modified in last one hour i need to copy that file to another directory.Can any one please provide me how to check the file is modified in one hour or not?

View 3 Replies View Related

General :: Find Directory Older Than X And Mv Directory With Sub Files Command?

Jul 13, 2011

I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively

View 4 Replies View Related

General :: Find Threads And Posts Sorted With The Latest First?

Jan 3, 2011

How do you find your threads and posts sorted with the latest first?

View 1 Replies View Related

General :: Processing Script That Find Latest Version Of Each File

Mar 5, 2011

I want to write a script. I have the basic form working... but I would like to add some advanced features. I have a list of .zip files that have a version number in the filename (i.e. sudoku-134.zip, sudoku-176.zip, sudoku-203.zip, etc). I would like to have a script that will find the latest version of each game, and unzip it. I want the next to latest version left untouched. But anything older, I would like the unzipped folder deleted (But leave the .zip file)

Here's what I have so far:
Code:
#!/bin/bash
cd /var/www/vhosts/server.com/httpsdocs/games/$1
for file in `ls *.zip`; do
if [ -d ${file%.*} ]; then
echo
else
mkdir ${file%.*}
cd ${file%.*}
unzip ../$file > /dev/null
cd ..
echo 'date' $file >> /var/www/vhosts/games4roku.com/private/$1.log
fi
done
I can call the script with "game-unzip public" to unzip all the public games.

Here's my files:
Code:
sudoku-134.zip
sudoku-134/
sudoku-176.zip
sudoku-176/
When I add the latest version, sudoku-203.zip, I want it to unzip it to ./sudoku-203/ and rm -rf sudoku-134

View 2 Replies View Related

General :: Dividing Content Of One File By Content Of Another?

Apr 12, 2011

If you have the value 100 in File1 and the value 5 in File2, how do you write a script to divide the 100 in File1 by the 5 in File2 in Linux Bash Shell?The operating system I am using is Ubuntu 10 and object is to write a script to accomplish this task.

View 5 Replies View Related

Debian Configuration :: Content Of Www Directory

Feb 26, 2016

I had directory inside www that is gone. I am not sure if I removed it my mistake somehow or there is something weird going on. How would I track down what happened to this directory?

View 2 Replies View Related

Server :: View Directory Content In Apache?

Aug 26, 2010

I want to view directory content in apache server, for that i configure apache server, but i don't know how to enable autoindxing module, only apache test page is opening when i open my web site.

View 9 Replies View Related

Networking :: Find The Default Content Of Snmptrapd.conf ?

Mar 22, 2011

I deleted the snmptrapd.conf from /etc/snmp/ and now I want to see the default content to create that file.. Been searching the web but can't find it.

View 2 Replies View Related

General :: Does The Latest Ubuntu Download (.iso File) Contain Latest Fixes

Aug 5, 2011

If I go to the website and download the ISO file is it the exact same one that was released in April or will it contain the latest patches (e.g. security fixes, etc) that have been release since then? If it doesn't I suppose I'll have to download the entire ISO file, install the OS, and then have another couple hundred MB to download which is not what I'd prefer.

View 2 Replies View Related

General :: Find And Copy In The Same Directory

Sep 1, 2010

I installed a new music application. It reads covers.jpg as the cover of the album, however, my covers files where named album. I dont want to rename, I want to make a copy of album.jpg and if possible as well rename it to covers.jpg. The file has to be in the same folder that it currently is. I have looked around to see how I can do this but have not been able to.

View 14 Replies View Related

General :: Cannot Find Zipfile Directory

Feb 22, 2010

zipinfo: cannot find zipfile directory in one of /home/jimmy/Downloads/GenuineCheck (1).exe or /home/jimmy/Downloads/GenuineCheck (1).exe.zip, and cannot find /home/jimmy/Downloads/GenuineCheck (1).exe.ZIP, period

What does this mean I am not able to download anything

View 1 Replies View Related

General :: Find A Particular String From A Directory

Jul 27, 2011

I want to search a particular string in a directory , that directory contains N number of subdirectories, and files and my requirement is inside the directory and subdirectory what are the files contains particular string like "TBone" i want to display that files. Is it possible to do that..

View 8 Replies View Related

General :: Find And Replace Command For Whole Directory

Aug 17, 2011

Is there any command in Linux which will find a particular word in all the files in a given directory and the folders below and replace it with a new word?

View 4 Replies View Related

General :: Find Current Thunar Directory From CLI?

Apr 20, 2011

Is it possible to find out the directory Thunar is currently displaying from the command line? I will only have one instance of Thunar open at one time.

View 3 Replies View Related

General :: Find Number Of Files In A Directory?

Feb 22, 2010

i need to know how to find number of files in a directory? is there any system calls in fedora 12.And i need to know how to perform a operation if the that count increases by one?

View 14 Replies View Related

General :: Find Files In A Directory That Contain Numbers?

Mar 1, 2011

I am trying find files in a directory that contain numbers. I have tried ls /etc *[0-9]* but that doesn't work. If I cd to /etc and run ls *[0-9]* it almost works but it also includes results from within files. My last thought was to try: find /etc [0-9] -type f but this does not work either. My second problem is that I am trying to get list of files in a directory that were changed less than 10 hours ago, using grep, while leaving out directories. I am completely stuck with the second problem.

View 8 Replies View Related

General :: Can't Emacs On Mac OS X Find Information Directory Node / Why Is So?

Feb 15, 2010

The default Emacs on Mac OS X, 22.1, appears to have some problems with the info/help stuff.

When you hit C+h i, it says:

Can't find the Info directory node.

It works in AquaEmacs, but I downloaded the 23 version of emacs precompiled binaries from here and I still have the same problem.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved