List newly added files in a directory

hello,
I am looking for a way to output the contents of a directory and all enclosing directories, sorted by date modified. essentially, this command will be run to output sort of a "what's new" in th directory. the root directory is a share point on a server that is already mounted, if that matters.
so far I am using ls -ARt > untitled.txt. this does the job, but doesn't look pretty. is there any way I could make this just list the latest additions to the share and where they are located in the share? i.e. "untitled.txt" in directoy X? or even just list the files, without directories, with the date added?
thanks everyone.

however, i am a little confused at the syntax. when you have a new line in the command, should i hit enter? when i get to the "else" command, it gives me an error
-bash: syntax error near unexpected token `else'
Without seeing what you wrote, it is difficult to analyze. Try posting your code between tags
... your code here ...
also, the file i want to create is what's_new?.txt. would this be in place of "lastaccess.txt"?
the ' and the ? are going to cause problems on the command line. It is really that important to spell it exactly like that?
Single-quote ' is used by the shell to create quoted strings, which look like a single argument ('this is a single argument string'). So are "..." strings, with different behavior, but similar.
Question mark, is a single character wildcard character.
If it is then you are going to have to protect the ' and the ? using double-quotes. Using Tony T1's code, it would look like:
#!/bin/bash
if [ -e "what's_new?.txt" ]; then
find . -type f -neweram "what's_new?.txt"
else
find . -type f
fi
touch "what's_new?.txt"
Note, if you actually took Tony T1's example, and used unprotected what's_new?.txt, then that just might explain why bash got upset as you would have turned
's_new?.txt ]; then find -type -neweram what'
{code}
Into a single argument, and the 'if' statement would have lost the closing ], the semi-colon, and the 'then'. No wonder bash got upset.

Similar Messages

  • List of the Files in a Directory based on Filename filter

    Hi,
    Do any one has an idea about fileName filter Usage.
    Ex: in UNIX: $ ls -l *.java gives the list of the java files in the directory.
    To acheive this we FilenameFilter. please let me know if anyone has any idea about this.
    Regard's
    Kartheek

    All of the answers to these questions, and more, are a mouse-click away. You can't develop a Java application without referring to the core Java API javadoc:
    http://java.sun.com/j2se/1.4.2/docs/api/index.html
    Your current task is to find the following classes and methods, and make sure you understand what they do:
    java.io.File :: list(FilenameFilter filter)
    java.io.FilenameFilter :: accept(File dir, String name)
    java.lang.String :: endsWith(String s)
    Once you get done with those, I'm sure there's a lot more you'll want to look up.
    Good luck.

  • Printservicelookup does not list newly added printer in OAS R2.

    Hi,
    We are using OAS R2 Server and JDK 1.5. In our application we have a scenario where we will display the list of printers configured to the Server. The below is the code we are using to get the list of printers configured in the server.
    Code:
    AttributeSet aset = new HashAttributeSet();
    PrintService[] services = PrintServiceLookup.lookupPrintServices(null,aset);
    The above code works fine to display the existing printers configured in the server. But when ever we add a new printer to the server, it is not listed. We have even restarted the server and the machine after adding the printer,Still it does not display the newly added printer. Any help would be greatly appreciated?
    P.S: The same code works fine in OAS R3 server, after restarting the server it displays the newly added printer.
    Regards,
    Karthik

    I have the same problem. Have you found any solution to this issue?

  • Automatically open newly added files in a folder?

    Hi there.
    I own a Nikon D80 and I want to have the images I take transfered directly to my Mac to be stored and displayed. I found this om flickr: http://www.flickr.com/groups/d80/discuss/72157603787246133/ where a user describes how to automatically add the photos to a folder on the Mac, now all I need is a script that will automatically open the newly imported photos, is it possible to do - and how? (I figured it probably had something to do with automator, but since I don't know anything about coding anything, I need some help).
    The script could either open the pictures as they are added (10 photos taken will result in a total of 10 windows when done) or replace the current showed image (10 photos taken will result in a total of 1 window when done)
    Hope it all makes sence, thanks in advance!

    All I can suggest is peruse the AppleScript forum for possible scripts or post your query there. It's under OS X Technologies. I don't do workflows, so I just pointed you to the basic starting point. Alternatively, post your query to the Flickr forum.

  • Read/Write folder, but newly added files Read Only?

    Our company uses a server to store a shared logo database and work files, and to transfer data from one user to another. At this point, we do not have any need for Read Only on this server; everything should be Read/Write. That's how it was set up initially, and the permissions were propagated. About a year ago, our old XServe crashed and was replaced with a new XServe. I believe our trouble started there, and has since migrated to our Snow Leopard Server: we have several folders where, if an employee uploads a folder and/or file, those files become Read Only. We have to go to the Get Info for that folder and fix the permissions each time. This has to happen up to 20 or so times a day, and I'm the only one who has server access to fix it; it also seems to be affecting more and more folders. I'm not in IT, so this is a little beyond me, but I've been working with IT on this (I'm Mac, he's PC). Can anyone offer a suggestion as to how else we can go about permanently setting the permission to Read/Write on all folders? Server Admin hasn't been successful.
    Thanks!

    Hi
    +"We have to go to the Get Info for that folder and fix the permissions each time"+
    This might be fine for OSX Client but it's not the way to do things on OSX Server. Consider stopping doing this because ultimately you're adding to the problems you're seeing. To reset permissions launch terminal on the server and issue this command:
    sudo chmod -R -N /pathtoshare
    Depending on how much data there is as well as the structure (nested folders within nested folders etc) this may take some time. If you're sharing the Volume (hard drive), don't. Share a folder instead. If you have only one share point which is the name of the drive. Create a folder with the same name and move all the data into that folder. Un-share the drive and Re-share the folder.
    Once the command has ran, repeat for any other share points you may have. When finished launch Server Admin because this is what you should be using. Select the Server name. Click on the Sharing icon. Select Share Points. Select the share point you're interested in and add desired users or groups into the ACL window. Select Read/Write. Don't fiddle with the POSIX permissions. Cick Save. Click on the small gear wheel and select Propagate Permissions. By default ACL will be ticked. You don't tick anything else. Click save/apply and let it do its stuff. Repeat for any other share points you may have.
    Tony

  • How to get mp3s to show in itunes list without adding file or folder

    How do you get downloaded music into the same folder as the itunes library to show up without having to do add folder or file. It seems on the mac they show up but on Windows XP you have to do an individual add of each new folder. The itunes library is on a network share and we download directly into the share. thanks

    You need to do the import/add you mentioned. Doesn't matter if you put where it should go iTunes doesn't know it is there until you tell it.

  • How do you create a podcast list by adding files?

    I have a site that has mp3s, but no podcasting subscription type tools (http://www.emmanuelnyc.org/sermons/index.html)
    I want to download the mp3s then listen to them on my ipod touch.
    How do I create a podcast group and add these files to it? I tried "add folder to library" and "add file to library" and cant' find it anywhere in itunes. Tried searching and searching... no clues.
    any assistance appreciated.

    The page you linked to has only MP3 files. There is no RSS feed (Podcast button), so those files cannot be downloaded "as Podcasts".
    However, if you right-click  any one of them you will see an option to "Save link as..." or "Save file as...", which will then allow you to download and save the MP3 onto your computer. It is not a Podcast, it is simply an MP3 file.
    A Podcast is a file (usually audio or video) that has been downloaded using an RSS feed. It is the process of being downloaded as an RSS feed that defines it as a Podcast. No matter what anyone else tells you, you cannot download an MP3 file and the turn it into a Podcast.
    Since the site provides no method of downloading the files in bulk, or automatically, then you will have to download each one individually. Put them all in one common folder.
    To add them to your iTunes Library, in iTunes, turn on the menu bar using the CTRL+B command. Then, on the File menu is...
    and using Add Folder To Library will allow you to add the files, in that folder, to your Library in one move.
    Now that the files are in your Library, you still cannot "make them appear to be Podcasts". Once again, this is the case - no matter who might tell you otherwise.
    But -
    I'm going to assume that you do not want these files to play when you're listening to your music, especially in shuffle mode. This is often why people want to set these files as Podcasts (and various bodges have been tried in order to try and achieve this end).
    The trick is to set the files to Skip when shuffling and this can be done to all the files at once. Highlight all the files in question and select File/Get Info/Options>Skip when shuffling and change the drop-down to Yes.
    Now, since they are set to skip when shuffling, that's exactly what will happen. It also means that you can start (and play the whole of) each file individually and if the iPod is still in shuffle mode, it will stop at the end of each episode. To play several, or all episodes without pause, simply turn off shuffle and navigate to the first episode. They will then play one after the other.
    By the way, you cannot use the custom podcast feed method that you mentioned. It's simply another bodge.

  • List of files in a directory of app server

    Hi,
    I was trying to get the list of all files in a directory using fm "EPS2_GET_DIRECTORY_LISTING". But the date column is empty in the output table. I also tried fm's
    SUBST_GET_FILE_LIST
    EPS_GET_FILE_ATTRIBUTES
    none of the above is giving date.
    Can anyone tell me a fm which gives date along with other attributes?
    Thanks in Advance.
    Satish

    try get something from the transaction AL11 source code: RSWATCH0 form -> fill_file_list
    Regards,
    Vincent

  • List of all files in directory

    Hi
    I am trying to show list of all files in a directory on my pc.
    Is there any way to this in webdynpro?
    I can not use directory_list_files because I get dump.
    Thanks nitsan

    hi,
    Please find this link on the same -
    List of all files in a directory
    Regards,
    Lekha.

  • List all files in a directory

    How can I list all the files in a directory which has folders and files as well? I just wanna files..
    File dataDir = new File("c:/data/);
    File[] listing = dataDir.listFiles();
    but it list the immediate no of folders in the data directory. Is there a way to get all the files in the subdirectories in data folder and excluding the folders?
    thanks!

    Iterate over the returned array, ignoring those whose isDirectory() returns true.
    Alternatively, you could call listFiles(fileNameFilter) instead, with an implementation of FileNameFilter which rejects File objects whose isDirectory() returns true.

  • Checking List of Specific Files exists in Folder

    Hi all,
    Please  help and advice
    business promises that they drop 10 Different Files with TimeStamp.
    1. QHP_Group_Association_Benefit_Periods_20140117104957
    2. QHP_Out_Of_Pocket_Limit_20140117110805
    10.QHP_Strategy_20140117110230
    I have a requirement where I have to start SSIS process Only if all 10 files are available. If any file is missing Dont start any process.
    Please help me How to check all files needed are available in a Folder using SSIS?
    Thanks
    Kodi

    I would perform this task by using a Script Task the System.IO classes. The task would have access to an SSIS variable that was the directory path. The task would get a listing of the files in the directory. Another Boolean package variable would be set
    to True if all ten file where present. A conditional expression on the workflow using this Boolean variable would control whether execution continued or not.

  • Search through files in a directory

    How do I get a list of the files in a directory? I am aware of JFileChooser but it is not what I am looking. I need to search the contents of the xml files in the directory. I can do this with one file but need to do it with them all.

    // where files in subdirectory \files below the application directory
    File dir = new File(".\\files\\");
      if(dir.exists()){
        File[] list = dir.listFiles();
        for (int i = 0; i < list.length; i++){
          String fileName = list.toString();
    int iPtr = fileName.lastIndexOf("\\");
    int jPtr = fileName.indexOf(".xml",0);
    if (jPtr>-1) {
    String longName = fileName;
    String shortName = fileName.substring(iPtr + 1, jPtr);
    // file name in short name

  • Getting list of files from Unix directory inclding files frm sub-directries

    Hi All,
            I am trying to use Fm 'SUBST_GET_FILE_LIST'  and
    'RZL_READ_DIR_LOCAL' for getting a list of all files in a Unix directory including files from sub-directories.
    In the first case I am getting an Exception called 'Access Error'
    and when I use the 2nd FM, I am not getting any output.
    Is there a special way to use these FMs.
    Kindly help.
    Regds,
    Shweta

    [url http://java.sun.com/developer/JDCTechTips/2003/tt0122.html#1]READING FILES FROM JAVA ARCHIVES (JARS)

  • How to display newly added bookmarks on top of the list in Unsorted Bookmarks? (not in Bookmark Manager window)

    I have hundreds of bookmarks.The Bookmarks Toolbar is filled.I made a shortcut of the "Unsorted Bookmarks" folder and placed it in on the Bookmarks Toolbar.Whenever I click the star to add a bookmark, it adds one to the real Unsorted Bookmarks, which add a copy of that bookmarks into the folder named Unsorted Bookmarks which is on the Bookmarks Toolbar.
    When I click on the Unsorted Bookmarks(both original and shortcut folder), it displays the oldest bookmarks on top, which honestly makes no sense to me because the user has to scroll a lot to get to the newest bookmarks, which are more likely to be used than the old ones that have been sitting there for a long time.Is there any way to sort the bookmarks by a reversed chronological order and display newly added ones on top of the list ?
    I am aware that you can do this in Bookmarks Manager window(called Library?) but it requires too many steps and it's time consuming and not easy to use in general.I'd rather click on the folder on Bookmarks Toolbar to open my bookmarks, but they show old ones on top.
    Thanks !
    hashtag - firstworldproblem

    Hmm, you might need to create a "smart folder" for this. You may have noticed some blue folders in your bookmarks such as "Most Visited" and "Recently Bookmarked". These show the results of a query run against your bookmarks or history (Places database) and you can create your own queries with a little elbow grease.
    So one possibility might be to create a custom "Recently Bookmarked" folder that extends beyond the current limit of 10. I gave the steps for creating a 20-item version of this folder in this post: https://support.mozilla.org/questions/934205#answer-358492
    That example searched ''all'' bookmarks and not specifically Unsorted Bookmarks. To create a new "smart folder" for Unsorted Bookmarks, you could try this:
    (1) Select and copy the following places search query:
    place:queryType=1&folder=UNFILED_BOOKMARKS&folder=UNFILED_BOOKMARKS&sort=12&excludeQueries=1
    ''(For definitions of those parameters and many more, see: [https://developer.mozilla.org/docs/Places_query_URIs])''
    (2) Expand the Bookmarks Menu (e.g., from the toolbar button or menu bar, or in the sidebar or Library dialog), right-click the first bookmark, and choose New Bookmark
    (3) In the Location field, paste the query (Ctrl+v or right-click > Paste)
    (4) In the Name, enter something like Unsorted Desc (for descending order) or the name of your choice. Then click Add.
    (5) Drag the new bookmark to the desired location on the Bookmarks Toolbar. If you are using the menu, click and drag and hover over Bookmarks Toolbar until it expands. Once it is on the toolbar, you can easily move it again to the desired location. During the first move, Firefox will recognize it as a query-type bookmark so that is why I have you create it on the menu and move it to the toolbar.

  • How to list the files in a directory which are recently modififed few mins

    Hi,
    I need command to list the files in a directory which are modified few minutes ago in SunOS. like "find . -cmin 2 -print " which list files that are modified 2 mins ago in Linux platform.
    Thanks in advance.
    sudha85

    The find command that comes with solaris doesnt have the cmin operator. Only mtime whose option is days.
    So install gnu find from sunfreeware which is the same one that comes with linux.

Maybe you are looking for