Sponsored Content
Top Forums Shell Programming and Scripting Print path files in different directories Post 302751733 by joeyg on Friday 4th of January 2013 11:11:12 AM
Old 01-04-2013
Not really sure what you are trying to do, but...

Have you looked at the
Code:
ls -R

command?
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Recursive call to find files and directories in Shell script from current path.

################################################################ Copy this script to your path from where you want to search for all the files and directories in subdirectories recursively. ################################################################# code starts here... (2 Replies)
Discussion started by: Ramit_Gupta
2 Replies

3. UNIX for Dummies Questions & Answers

Want to create 3 different new directories under the same path

Hi, Iam new to UNIX...My requirement is to create 3 dir as an hierarchy under /var/opt/temip.The output should be /var/opt/temip/GP_Int/GPTTS/AUTO. I have tried the following script...But only GP_int folder is getting created and not other folders...Can someone help??? #!/usr/bin/ksh #script... (1 Reply)
Discussion started by: Llb
1 Replies

4. Shell Programming and Scripting

find in given path do not want to traverse to its sub-directories

Hi All, My UNIX Version is: OS Name Release Version AIX appma538 3 5 I want to find certain files with some criterias under the given path. At the same time i want to find the files which resides under the given directory, but normal find traverse to its sub-directories... (4 Replies)
Discussion started by: Arunprasad
4 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

Howto Print File Path or Print the Filename

I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction? for FILE in `cat list`; do if ; then ... (1 Reply)
Discussion started by: overkill
1 Replies

7. UNIX for Dummies Questions & Answers

Script to search for a particular word in files and print the word and path name

Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name". Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies

8. 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

9. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

10. HP-UX

Adding Directories to PATH in HP-UX with csh

HI Guys, I am truing to add some directories to the productive HP-UX (like /usr/sbin) the problem is that i tried some methods like (export) and setenv but i failed. I add some logs output of the commands to provide you with more info . the user which I am trying to add this path is different... (5 Replies)
Discussion started by: barry1946
5 Replies
File::Spec::OS2(3pm)					 Perl Programmers Reference Guide				      File::Spec::OS2(3pm)

       canonpath
	      No physical check on the filesystem, but a logical cleanup of a path. On UNIX eliminated successive slashes and successive "/.".

       splitpath
		  ($volume,$directories,$file) = File::Spec->splitpath( $path );
		  ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );

       Splits a path in to volume, directory, and filename portions. Assumes that the last file is a path unless the path ends in '/', '/.', '/..'
       or $no_file is true.  On Win32 this means that $no_file true makes this return ( $volume, $path, undef ).

       Separators accepted are  and /.

       Volumes can be drive letters or UNC sharenames (\servershare).

       The results can be passed to "catpath" to get back a path equivalent to (usually identical to) the original path.

       splitdir
	      The opposite of catdir().

	   @dirs = File::Spec->splitdir( $directories );

       $directories must be only the directory portion of the path on systems that have the concept of a volume or that have path syntax that dif-
       ferentiates files from directories.

       Unlike just splitting the directories on the separator, leading empty and trailing directory entries can be returned, because these are
       significant on some OSs. So,

	   File::Spec->splitdir( "/a/b//c/" );

       Yields:

	   ( '', 'a', 'b', '', 'c', '' )

       catpath
	      Takes volume, directory and file portions and returns an entire path. Under Unix, $volume is ignored, and this is just like cat-
	      file(). On other OSs, the $volume become significant.

NAME
File::Spec::OS2 - methods for OS/2 file specs SYNOPSIS
require File::Spec::OS2; # Done internally by File::Spec if needed DESCRIPTION
See File::Spec::Unix for a documentation of the methods provided there. This package overrides the implementation of these methods, not the semantics. perl v5.8.0 2002-06-01 File::Spec::OS2(3pm)
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy