Sponsored Content
Top Forums Shell Programming and Scripting Find zero byte file but don't need path Post 302518291 by ahamed101 on Friday 29th of April 2011 07:42:32 AM
Old 04-29-2011
Try this

Code:
find . -size 123c | xargs basename

c=>bytes

regards,
Ahamed
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to find if a file is zero byte or not?

hi, How to check if a file or files are of zero bytes and if yes, then to print their names? Ashu (1 Reply)
Discussion started by: er_ashu
1 Replies

2. Shell Programming and Scripting

Find a file in sub-directories.. o/p just the path

Hello All, I am somehow stumped with this ting. 'Find' will sure show me.. but I want only thepath of all the occurences of the file in any of the sub-dirs.. Any help will be sincerely appreciated. thanx! (3 Replies)
Discussion started by: pranavagarwal
3 Replies

3. UNIX for Dummies Questions & Answers

command to find the path of a file

What is the command to find the path of a file if we know the file name and the root directory where the file resides.. For eg. if a file abc.dat resides in /home/mydir/myfiles/. I am looking for a command which will be fired from / directory, takes abc.dat as input and display the path of... (3 Replies)
Discussion started by: abhilashnair
3 Replies

4. Shell Programming and Scripting

how to find the path of a file?

Hi all, Is there any way to find the the path of a file? I mean executable files and just anyother file we can think of? i know of one cmd called which $which mount /usr/bin/mount this is fine, but "mount" is a cmd not a file that can be searched eg: say i have created a text file... (3 Replies)
Discussion started by: wrapster
3 Replies

5. UNIX for Dummies Questions & Answers

find locked files, print file path, unlock file

using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked how can I do this? I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like. Thanks! (0 Replies)
Discussion started by: alternapop
0 Replies

6. Shell Programming and Scripting

How to a find a file in which path it is there?

Hi Firends, Good Morning to all, I want a find command to search a paticular file present in my system(ie search through under all users and all directories.) I am looking forward from you.:) Advance Thanks, Siva Ranganath CH (3 Replies)
Discussion started by: sivaranga001
3 Replies

7. UNIX for Advanced & Expert Users

Don't find file from foxbase 2.1.2d

Hi there, finally i'm installed Sco Foxbase 2.1.2d over my Sco Open Server 5.0.7v server. Well at this point almost is working fine, but, when i Run mi application i receive the next error: "sh: the_name_of_file": does not exist". I checked it over the Hard Disk and the file exist, the... (1 Reply)
Discussion started by: danilosevilla
1 Replies

8. UNIX for Dummies Questions & Answers

PATH settings don't seem to persist across sessions

I recently installed LaTeX on my linux machine and I attempted to add a directory to the PATH as the instructions say to do. They tell me to give the following command: PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH; export PATH After I do this I can use commands such as "pdflatex" anywhere,... (5 Replies)
Discussion started by: TR5
5 Replies

9. Shell Programming and Scripting

Find command don't output anything, but file is there

Please if You can help me debug why nothing is found by this command? # echo "Zeus Robot" >> /home/vps/190/test # cat /home/vps/190/test Zeus Robot # find /home/vps -type f -mtime 2 -size -1000k -exec grep -l "Zeus Robot" {} \; >> out # cat out # cat /home/vps/190/test Zeus Robot Why... (6 Replies)
Discussion started by: postcd
6 Replies

10. UNIX for Beginners Questions & Answers

Don't have tree, need advise to differentiate dir from file from this alternative that uses find

Hi, I don't have tree on the Solaris server and our SA don't want to install it. I found this example from One Line Linux Command to Print Out Directory Tree Listing | systemBash that more or less does what I am mainly looking for. Example run is as below: $: find ./ | sed -e... (2 Replies)
Discussion started by: newbie_01
2 Replies
Find::Lib(3pm)						User Contributed Perl Documentation					    Find::Lib(3pm)

NAME
Find::Lib - Helper to smartly find libs to use in the filesystem tree VERSION
Version 1.01 SYNOPSIS
#!/usr/bin/perl -w; use strict; ## simple usage use Find::Lib '../mylib'; ## more libraries use Find::Lib '../mylib', 'local-lib'; ## More verbose and backward compatible with Find::Lib < 1.0 use Find::Lib libs => [ 'lib', '../lib', 'devlib' ]; ## resolve some path with minimum typing $dir = Find::Lib->catdir("..", "data"); $path = Find::Lib->catfile("..", "data", "test.yaml"); $base = Find::Lib->base; # or $base = Find::Lib::Base; DESCRIPTION
The purpose of this module is to replace use FindBin; use lib "$FindBin::Bin/../bootstrap/lib"; with something shorter. This is specially useful if your project has a lot of scripts (For instance tests scripts). use Find::Lib '../bootstrap/lib'; The important differences between FindBin and Find::Lib are: o symlinks and '..' If you have symlinks in your path it respects them, so basically you can forget you have symlinks, because Find::Lib will do the natural thing (NOT ignore them), and resolve '..' correctly. FindBin breaks if you do: use lib "$Bin/../lib"; and you currently are in a symlinked directory, because $Bin resolved to the filesystem path (without the symlink) and not the shell path. o convenience it's faster too type, and more intuitive (Exporting $Bin always felt weird to me). DISCUSSION
Installation and availability of this module The usefulness of this module is seriously reduced if Find::Lib is not already in your @INC / $ENV{PERL5LIB} -- Chicken and egg problem. This is the big disavantage of FindBin over Find::Lib: FindBin is distributed with Perl. To mitigate that, you need to be sure of global availability of the module in the system (You could install it via your favorite package managment system for instance). modification of $0 and chdir (BEGIN blocks, other 'use') As soon as Find::Lib is compiled it saves the location of the script and the initial cwd (current working directory), which are the two pieces of information the module relies on to interpret the relative path given by the calling program. If one of cwd, $ENV{PWD} or $0 is changed before Find::Lib has a chance to do its job, then Find::Lib will most probably die, saying "The script cannot be found". I don't know a workaround that. So be sure to load Find::Lib as soon as possible in your script to minimize problems (you are in control!). (some programs alter $0 to customize the display line of the process in the system process-list ("ps" on unix). (Note, see perlvar for explanation of $0) USAGE
import All the work is done in import. So you need to 'use Find::Lib' and pass a list of paths to add to @INC. See "BACKWARD COMPATIBILITY" section for more retails on this topic. The paths given are (should) be relative to the location of the current script. The paths won't be added unless the path actually exists on disk base Returns the detected base (the directory where the script lives in). It's a string, and is the same as $Find::Lib::Base. catfile A shorcut to File::Spec::catfile using Find::Lib's base. catdir A shorcut to File::Spec::catdir using Find::Lib's base. BACKWARD COMPATIBILITY
in versions <1.0 of Find::Lib, the import arguments allowed you to specify a Bootstrap package. This option is now removed breaking backward compatibility. I'm sorry about that, but that was a dumb idea of mine to save more typing. But it saves, like, 3 characters at the expense of readability. So, I'm sure I didn't break anybody, because probabaly no one was relying on a stupid behaviour. However, the multiple libs argument passing is kept intact: you can still use: use Find::Lib libs => [ 'a', 'b', 'c' ]; where "libs" is a reference to a list of path to add to @INC. The short forms implies that the first argument passed to import is not "libs" or "pkgs". An example of usage is given in the SYNOPSIS section. SEE ALSO
FindBin, FindBin::libs, lib, rlib, local::lib http://blog.cyberion.net/2009/10/ive-done-something-bad-i-broke-backward-compatibility.html <http://blog.cyberion.net/2009/10/ive-done-something-bad-i-broke-backward-compatibility.html> AUTHOR
Yann Kerherve, "<yann.kerherve at gmail.com>" BUGS
Please report any bugs or feature requests to "bug-find-lib at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Find-Lib <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Find-Lib>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. ACKNOWLEDGEMENT
Six Apart hackers nourrished the discussion that led to this module creation. Jonathan Steinert (hachi) for doing all the conception of 0.03 shell expansion mode with me. SUPPORT &; CRITICS I welcome feedback about this module, don't hesitate to contact me regarding this module, usage or code. You can find documentation for this module with the perldoc command. perldoc Find::Lib You can also look for information at: o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Find-Lib <http://annocpan.org/dist/Find-Lib> o CPAN Ratings http://cpanratings.perl.org/d/Find-Lib <http://cpanratings.perl.org/d/Find-Lib> o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Find-Lib <http://rt.cpan.org/NoAuth/Bugs.html?Find-Lib> o Search CPAN http://search.cpan.org/dist/Find-Lib <http://search.cpan.org/dist/Find-Lib> COPYRIGHT &; LICENSE Copyright 2007, 2009 Yann Kerherve, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-09-17 Find::Lib(3pm)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy