Sponsored Content
Top Forums Shell Programming and Scripting Little bit weired : Find files in UNIX w/o using find or where command Post 302119008 by jatin.jain on Saturday 26th of May 2007 04:58:18 AM
Old 05-26-2007
Hi Ghost,
i tried using ls but how to do it recursively ls -r ?. It dint work for me
i will show u a snippet of my script

#!/bin/sh
echo $1 #display the input entered
c=$1
ls -l $c | awk `(if(NR>0) pwd)` # usinf ls command and awk i m trying to get those records and print its path,pwd is not working there
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find a file in UNIX without find command?

given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies

2. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies

3. UNIX for Dummies Questions & Answers

Command to find 32/64 bit in Linux

Hi, Can somebody tell me which command will help me find whether the OS is 32 bit or 64 bit. Regards, Giridhara Babu Tadikonda. (3 Replies)
Discussion started by: giribt
3 Replies

4. Shell Programming and Scripting

unix command/s to find files older than 2 hours in a directory

I need to write a script to find files older than 2 hours in set of direcotries and list them ina mail. I know find command ti list files greater/lesser than days but i need to do it for hours. Any input. (6 Replies)
Discussion started by: Presanna
6 Replies

5. Shell Programming and Scripting

How to find sticky bit dir/files

I need to find all sticky bit dir/files on my system and clean them up if necessary. How to I write a script to do this? Thanks. (2 Replies)
Discussion started by: pdtak
2 Replies

6. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

7. UNIX for Dummies Questions & Answers

find files with SUID bit turned on

I'm writing a script that will search for files with the SUID bit turned on, and put the list in a file called id.txt i read that files with the SUID bit turned on are chmod'd to 4000, so i tried: find / -perm 4000 > id.txt also various others such as -perm 4777 etc etc but it found nothing... (1 Reply)
Discussion started by: SoVi3t
1 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. Shell Programming and Scripting

Command to find 32/64 bit in Linux

Hi, Can somebody tell me which command will help me find whether the OS is 32 bit or 64 bit. OS is LInux Thanks (3 Replies)
Discussion started by: aish11
3 Replies

10. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies
File::Find::Rule::Procedural(3pm)			User Contributed Perl Documentation			 File::Find::Rule::Procedural(3pm)

NAME
File::Find::Rule::Procedural - File::Find::Rule's procedural interface SYNOPSIS
use File::Find::Rule; # find all .pm files, procedurally my @files = find(file => name => '*.pm', in => @INC); DESCRIPTION
In addition to the regular object-oriented interface, File::Find::Rule provides two subroutines for you to use. "find( @clauses )" "rule( @clauses )" "find" and "rule" can be used to invoke any methods available to the OO version. "rule" is a synonym for "find" Passing more than one value to a clause is done with an anonymous array: my $finder = find( name => [ '*.mp3', '*.ogg' ] ); "find" and "rule" both return a File::Find::Rule instance, unless one of the arguments is "in", in which case it returns a list of things that match the rule. my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} ); Please note that "in" will be the last clause evaluated, and so this code will search for mp3s regardless of size. my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' ); ^ | Clause processing stopped here ------/ It is also possible to invert a single rule by prefixing it with "!" like so: # large files that aren't videos my @files = find( file => '!name' => [ '*.avi', '*.mov' ], size => '>20M', in => $ENV{HOME} ); AUTHOR
Richard Clamp <richardc@unixbeard.net> COPYRIGHT
Copyright (C) 2003 Richard Clamp. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
File::Find::Rule perl v5.12.4 2011-09-19 File::Find::Rule::Procedural(3pm)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy