Sponsored Content
Full Discussion: Find last 2 days files.
Top Forums Shell Programming and Scripting Find last 2 days files. Post 302473214 by saluja.deepak on Friday 19th of November 2010 07:58:55 AM
Old 11-19-2010
Question Find last 2 days files.

Need to cpy those files which are created or modified in last 2 days.

Code:
 
bash$ ll -lrt
total 184
drwxr-xr-x   2 ons   dce             256 Oct 12 06:58 files
-rw-r--r--   1 ons   dce            4313 Oct 14 06:06 cab.ksh
-rw-r--r--   1 ons   dce               6 Oct 14 07:03 Code.txt
-rw-r--r--   1 ons   dce               8 Oct 14 07:23 Code1.txt
-rw-r--r--   1 ons   dce              28 Oct 14 07:28 diff.txt
-rw-r--r--   1 ons   dce             341 Oct 25 02:20 DS.1287677000.820.log
-rw-r--r--   1 ons   dce             348 Oct 25 02:21 DS.1287153156.329.log
-rw-r--r--   1 ons   dce            3106 Oct 25 02:23 DS.1287578250.7.log
-rw-r--r--   1 ons   dce            5925 Oct 25 02:24 DS.1287504078.200.log
-rw-r--r--   1 ons   dce             700 Oct 25 02:24 DS.1287423026.261.log
-rw-r--r--   1 ons   dce             367 Oct 25 02:25 DS.1287163063.587.log
-rw-r--r--   1 ons   dce             349 Oct 25 02:25 DS.1287083779.160.log
-rw-r--r--   1 ons   dce              95 Oct 26 08:49 files.TXT
-rw-r--r--   1 ons   dce              79 Oct 27 05:15 files1.TXT
-rw-r--r--   1 ons   dce              99 Oct 27 08:30 one.TXT
-rw-r--r--   1 ons   dce             156 Oct 27 08:38 two.TXT
-rw-r--r--   1 ons   dce            4981 Oct 29 03:35 t
-rw-r--r--   1 ons   dce            5394 Nov 02 02:15 new
drwxrwxrwx   2 ons   dce            4096 Nov 06 03:00 backup
 
 
bash$ find . -type f -atime +2 
 
find /ons/sam/ -atime -2 | find /ons/sam/ -name 'DS*' | whereis DS* | cp DS* /ons/sam/new

I want only last 2 days file, started with DS* but when i ran above command its gving all files name.

Plz advice here. Thanks

Last edited by saluja.deepak; 11-19-2010 at 09:09 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies

2. Shell Programming and Scripting

find files from the past 7 days

Hi All, I have a file which contains the listing of another directory: >cat list.dat -rwxr-xr-x 1 test staff 10240 Oct 02 06:53 test.txtdd -rwxrwxrwx 1 test staff 0 Oct 04 07:22 test.txx -rwxrwxrwx 1 test staff 132 Sep 16 2007 test_tt.sh... (6 Replies)
Discussion started by: deepakgang
6 Replies

3. Red Hat

Find files older than 30 days in directories and delete them

Hi, I have dummies questions: My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself. find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies

4. Shell Programming and Scripting

How to find files older than 30 days

Dear Friends, I have two queries. 1) I want to see the list of folders which were created 29 days ago. 2) I want to see the folders in which last created file is older than 29 days. Can it be done? Thank you in advance Anushree (4 Replies)
Discussion started by: anushree.a
4 Replies

5. UNIX Desktop Questions & Answers

Find files older than 10 days

What command arguments I can use in unix to list files older than 10 days in my current directory, but I don't want to list the hidden files. find . -type f -mtime +15 -print will work but, it is listing all the hidden files., which I don't want. (4 Replies)
Discussion started by: Pouchie1
4 Replies

6. UNIX for Dummies Questions & Answers

How to find files created some days before?

HI, I have 2 questions. 1> Is there any code to see files that created some day or some time before in a directory??? 2> how or where i will find the last exit status of a process?? thanks (6 Replies)
Discussion started by: jyotidas
6 Replies

7. UNIX for Dummies Questions & Answers

Find files newer than x days

We had an arrant rsync run and started copying over new files from one system to another. Although this is what we will want to do at some point, for now, we want to maintain the system as it was a few days ago. I am looking for a script that will find files that are newer than x days. ... (5 Replies)
Discussion started by: Leyva62
5 Replies

8. Shell Programming and Scripting

what is the find to command to find the files created last 30 days

what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies

9. UNIX for Advanced & Expert Users

find files older than 30 days old

Hello, I have a script which finds files in a directory that are older than 30 days and remove them. The problem is that these files are too many and when i run this command: find * -mtime +30 | xargs rm I run this command inside the directory and it returns the error: /usr/bin/find:... (8 Replies)
Discussion started by: omonoiatis9
8 Replies

10. Shell Programming and Scripting

Find the sum of files created 5 days before

Hi, I want to find the sum of all the files created 5 days ago and store it in a variable. (os is HP-UX) can this be extracted from ls -l Is there any other way of getting the sum of all the files created (4 Replies)
Discussion started by: bang_dba
4 Replies
FS_NEWCELL(1)						       AFS Command Reference						     FS_NEWCELL(1)

NAME
fs_newcell - Changes the kernel-resident list of a cell's database servers SYNOPSIS
fs newcell -name <cell name> -servers <primary servers>+ [-linkedcell <linked cell name>] [-help] fs n -n <cell name> -s <primary servers>+ [-l <linked cell name>] [-h] DESCRIPTION
The fs newcell command removes the Cache Manager's kernel-resident list of database server machines for the cell specified by the -name argument and replaces it with the database server machines named by the -servers argument. Each time the machine reboots, the Cache Manager constructs the kernel list of cells and database server machines by reading the local /etc/openafs/CellServDB file. This command does not change the CellServDB file, so any changes made with it persist only until the next reboot, unless the issuer also edits the file. The output of the fs listcells command reflects changes made with this command, because that command consults the kernel-resident list rather than the CellServDB file. This command can introduce a completely new cell into the kernel-resident list, but cannot make a cell inaccessible (it is not possible to remove a cell's entry from the kernel-resident list by providing no values for the -server argument). To make a cell inaccessible, remove its entry from the CellServDB file and reboot the machine. If the -name argument names a DCE cell, then the -servers argument names DFS Fileset Location (FL) Server machines. The -linkedcell argument specifies the name of the AFS cell to link to a DCE cell for the purpose of DFS fileset location. CAUTIONS
Some commands, such as the aklog or klog.krb5 commands, work correctly only when the information is accurate for a cell in both the CellServDB file and the kernel-resident list. OPTIONS
-name <cell name> Specifies the fully-qualified cell name of the AFS or DCE cell. -servers <primary servers>+ Specifies the fully-qualified hostnames of all AFS database server machines or DFS Fileset Location (FL) Server machines for the cell named by the -name argument. If FL Server machines are specified, the local machine must be running the AFS/DFS Migration Toolkit Protocol Translator. -linkedcell <linked cell name> Specifies the name of the AFS cell to link to a DCE cell for the purpose of DFS fileset location. -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
The following example changes the machine's kernel-resident list of database server machines for the ABC Corporation cell to include the machines "db1.abc.com" and "db2.abc.com": % fs newcell -name abc.com -servers db1.abc.com db2.abc.com The following example links the DCE cell "dce.abc.com" to the AFS cell "abc.com". The AFS client contacts the Fileset Location (FL) servers "db1.dce.abc.com" and "db2.dce.abc.com" for fileset location information as it interprets a DFS pathname. % fs newcell -name dce.abc.com -servers db1.dce.abc.com db2.dce.abc.com -linkedcell abc.com PRIVILEGE REQUIRED
The issuer must be logged in as the local superuser root. SEE ALSO
CellServDB(5), fs_listcells(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 FS_NEWCELL(1)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy