Sponsored Content
Top Forums Shell Programming and Scripting Find Files with a input in directories Post 302729463 by aksijain on Friday 9th of November 2012 07:20:03 PM
Old 11-09-2012
What exactly are you looking for? Do you want to find files which are older than a particular file or you want to find it using name?
If you are looking for files older than your reference file (let's say ref_file) you can use this :

Code:
find . ! -newer ref_file print

(! for not newer than or rather older than your reference file)
Moderator's Comments:
Mod Comment Please use code tags

Last edited by jim mcnamara; 11-09-2012 at 08:55 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find files in Directories

Hello, We have in a file a list of the path of files from one server. We want to search if these files exist on another server , but the path on this new server isn't the same. We want to use the command "awk" but there isn't the god way. Example: on server 1 in a file : listServer1.txt... (4 Replies)
Discussion started by: steiner
4 Replies

2. UNIX for Advanced & Expert Users

find -type d returning files as well as directories

Can anyone see why the following command returns all files and not just the directories as specified? find . -type d -exec ls -F {} \; Also tried find . -type d -name "*" -exec ls -F {} \; find . -type d -name "*" -exec ls -F '{}' \; -print Always returns all files :-\ OS is... (2 Replies)
Discussion started by: tuns99
2 Replies

3. Homework & Coursework Questions

Find and delete empty files and directories

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Need to make a script, to remove all empty files and folders from current category. It also should show the name... (2 Replies)
Discussion started by: Itixop
2 Replies

4. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

5. Shell Programming and Scripting

Script to go Into Directories and Find/Delete files

I have a task, I usually do manually, but with growing responsibilities I tend to forget to do this weekly, I want to write a script that automates this, but I cant seem to work it out in my head, I have the shell of it out, but need help, and you guys have helped me with EVERY problem I have... (5 Replies)
Discussion started by: gkelly1117
5 Replies

6. Shell Programming and Scripting

Find only files/directories with different permissions/owners

My git post-update has the following lines in it to make sure the permissions are set right: find /usr/local/apache/htdocs -type d -print0 | xargs -0 chmod 755 find /usr/local/apache/htdocs -type f -print0 | xargs -0 chmod 644 chown -R apache:apache /usr/local/apache/htdocsThe only problem is... (5 Replies)
Discussion started by: dheian
5 Replies

7. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies

8. UNIX for Dummies Questions & Answers

Find Files In A List with known Partial Directories

First I'm new to Linux and have used the find command pretty often but this is where I've hit a snag. I have a file that contains 3500 files that I want to find and then eventually copy to my own directory (these files are all on a shared directory at work atm). Our work computer are huge and... (2 Replies)
Discussion started by: Myrona
2 Replies

9. UNIX for Dummies Questions & Answers

Loop over certain user directories and find files

Hello I have user directories that contain /temp directory. Example folders: /user1/temp/ /user2/temp/ /user3/temp/ How can i loop over all user directories and find all files only in their /temp folder? Thanks a lot for help! (3 Replies)
Discussion started by: flavius42
3 Replies

10. Shell Programming and Scripting

Find common files between two directories

I have two directories Dir 1 /home/sid/release1 Dir 2 /home/sid/release2 I want to find the common files between the two directories Dir 1 files /home/sid/release1>ls -lrt total 16 -rw-r--r-- 1 sid cool 0 Jun 19 12:53 File123 -rw-r--r-- 1 sid cool 0 Jun 19 12:53... (5 Replies)
Discussion started by: sidnow
5 Replies
Info::CiscoConfig(3pm)					User Contributed Perl Documentation				    Info::CiscoConfig(3pm)

NAME
SNMP::Info::CiscoConfig - SNMP Interface to Cisco Configuration Files AUTHOR
Justin Hunter, Eric Miller SYNOPSIS
my $ciscoconfig = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost. "; my $class = $ciscoconfig->class(); print " Using device sub class : $class "; DESCRIPTION
SNMP::Info::CiscoConfig is a subclass of SNMP::Info that provides an interface to CISCO-CONFIG-COPY-MIB, CISCO-FLASH-MIB, and OLD-CISCO- SYS-MIB. These MIBs facilitate the writing of configuration files. Use or create a subclass of SNMP::Info that inherits this one. Do not use directly. Inherited Classes None. Required MIBs CISCO-CONFIG-COPY-MIB CISCO-FLASH-MIB OLD-CISCO-SYS-MIB GLOBALS
These are methods that return scalar value from SNMP $ciscoconfig->old_write_mem() ("writeMem") $ciscoconfig->old_write_net() ("writeNet") TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash. Config Copy Request Table ("ccCopyTable") $ciscoconfig->config_protocol() ("ccCopyProtocol") $ciscoconfig->config_source_type() ("ccCopySourceFileType") $ciscoconfig->config_dest_type() ("ccCopyDestFileType") $ciscoconfig->config_server_addr() ("ccCopyServerAddress") $ciscoconfig->config_filename() ("ccCopyFileName") $ciscoconfig->config_username() ("ccCopyUserName") $ciscoconfig->config_password() ("ccCopyUserPassword") $ciscoconfig->config_notify_complete() ("ccCopyNotificationOnCompletion") $ciscoconfig->config_copy_state() ("ccCopyState") $ciscoconfig->config_copy_start_time() ("ccCopyTimeStarted") $ciscoconfig->config_copy_complete_time() ("ccCopyTimeCompleted") $ciscoconfig->config_fail_cause() ("ccCopyFailCause") $ciscoconfig->config_row_status() ("ccCopyEntryRowStatus") Flash Copy Table ("ciscoFlashCopyTable") Table of Flash copy operation entries. $ciscoconfig->flash_copy_cmd() ("ciscoFlashCopyCommand") $ciscoconfig->flash_copy_protocol() ("ciscoFlashCopyProtocol") $ciscoconfig->flash_copy_address() ("ciscoFlashCopyServerAddress") $ciscoconfig->flash_copy_source() ("ciscoFlashCopySourceName") $ciscoconfig->flash_copy_dest() ("ciscoFlashCopyDestinationName") $ciscoconfig->flash_copy_row_status() ("ciscoFlashCopyEntryStatus") SET METHODS
These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See "SETTING DATA VIA SNMP" in SNMP::Info for general information on set operations. $ciscoconfig->copy_run_tftp (tftpserver, tftpfilename ) Store the running configuration on a TFTP server. Equivalent to the CLI commands "copy running-config tftp" or "write net". This method attempts to use newer "copy running-config tftp" procedure first and then the older "write net" procedure if that fails. The newer procedure is supported Cisco devices with the CISCO-CONFIG-COPY-MIB available, Cisco IOS software release 12.0 or on some devices as early as release 11.2P. The older procedure has been depreciated by Cisco and is utilized only to support devices running older code revisions. Example: $ciscoconfig->copy_run_tftp('1.2.3.4', 'myconfig') or die Couldn't save config. ",$ciscoconfig->error(1); $ciscoconfig->copy_run_start() Copy the running configuration to the start up configuration. Equivalent to the CLI command "copy running-config startup-config" or "write mem". This method attempts to use newer "copy running-config startup-config" procedure first and then the older "write mem" procedure if that fails. The newer procedure is supported Cisco devices with the CISCO-CONFIG-COPY-MIB available, Cisco IOS software release 12.0 or on some devices as early as release 11.2P. The older procedure has been depreciated by Cisco and is utilized only to support devices running older code revisions. Example: $ciscoconfig->copy_run_start() or die "Couldn't save config. ",$ciscoconfig->error(1); perl v5.12.4 2011-09-28 Info::CiscoConfig(3pm)
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy