12-10-2005
ls -R command but need complete path name on each line
Can anyone help me with the following:
I need to traverse subdirectories to create a list of files with the pathname. For example, here's what I get with a simple ls -alR command:
/MAIN/data/30007390 dte2>>ls -alR
.:
total 2
drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 .
drwxrwx--- 37 ecfadmin staff 1024 Oct 24 18:35 ..
drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 GroupB
drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 GroupA
./GroupB:
total 8
drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 .
drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 ..
-rwxrwx--- 1 ecfadmin staff 1968 Oct 24 18:35 02050506.GZ
-rwxrwx--- 1 ecfadmin staff 1976 Oct 24 18:35 02050720.GZ
./GroupA:
total 20
drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 .
drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 ..
-rwxrwx--- 1 ecfadmin staff 9453 Oct 24 18:35 05050602.GZ
What I would like to get back is something with the full path name and file name:
/MAIN/data/30007390/GroupB/02050720.GZ
/MAIN/data/30007390/GroupB/02050506.GZ
/MAIN/data/30007390/GroupA/05050602.GZ
*Permissions, primary and secondary group names, dates times and sizes are not needed but don't have to be excluded.
I'm looking for something pretty straight forward, I could write a little shell to handle it but was hoping for something a little more elegant. (I was hoping there was a version (or option) of “ls” out there that might do it).
Any help would be appreciated.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Does anyone know how to ammend the .cshrc file in $HOME for your session to display the path as part of the command line? So that I dont need to keep on typing pwd to see where I am?
thanks
Ocelot (2 Replies)
Discussion started by: ocelot
2 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
Does anyone know how to ammend the .cshrc file in $HOME for your session to display the path as part of the command line? So that I dont need to keep on typing pwd to see where I am?
thanks
Ocelot (3 Replies)
Discussion started by: ocelot
3 Replies
3. UNIX for Dummies Questions & Answers
Dear Techs,
In the past on a different box (HP) I use to be able to complete something I was typing by entering a portion of the filename in the pwd and I would hit the Esc key and it would match the rest of the filename. I did this without understanding how it was setup.
Now I am on a new... (1 Reply)
Discussion started by: jxh461
1 Replies
4. UNIX for Advanced & Expert Users
hi experts(novice people can stay away as it is no child's game),
i am developing a script which works like recycle bin of windows.
the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture... (1 Reply)
Discussion started by: yahoo!
1 Replies
5. UNIX for Dummies Questions & Answers
hi experts(novice people can stay away as it is no child's game),
i am developing a script which works like recycle bin of windows.
the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture... (5 Replies)
Discussion started by: yahoo!
5 Replies
6. Shell Programming and Scripting
Hi,
I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest.
when i say
#cat $inputFile | while read eachLine
and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters.
Can you... (1 Reply)
Discussion started by: vijaykrc
1 Replies
7. UNIX for Dummies Questions & Answers
Hi
Is there any way GREP command can return word and not complete line.
My file has following data:
Hello Everyone I am NitinrajSrivastava
Hi Friends Welcome VrajSrivastava
I am using grep 'raj' which is returning me complete line.However I want only the word having keyword 'raj'.
Required... (11 Replies)
Discussion started by: dashing201
11 Replies
8. UNIX for Dummies Questions & Answers
Hello Experts,
Can you please help me by providing a code which can give me the complete path except last word in a variable, the variable i can use anywhere else for my operation
eg:
if this below one is my path:
... (3 Replies)
Discussion started by: aks_1902
3 Replies
9. Solaris
Hi,
When I query using ps -ef, the complete command is not displayed and is truncated.
Can you please tell me a method to resolve this ?
I have tried the below.
ps -ef | cat
ps -ef | grep imp >/tmp/t1.txt
/usr/ucb/ps -auxw
pargs <pid>
/usr/ucb/ps -aefyl | grep imp
Thanks (11 Replies)
Discussion started by: mk1216
11 Replies
10. Shell Programming and Scripting
I want to pattern match only path part from below and replace them with new path string.
LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so
JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties
JkLogFile... (4 Replies)
Discussion started by: kchinnam
4 Replies
LEARN ABOUT PLAN9
pts_removeuser
PTS_REMOVEUSER(1) AFS Command Reference PTS_REMOVEUSER(1)
NAME
pts_removeuser - Removes a user from a Protection Database group
SYNOPSIS
pts removeuser -user <user name>+ -group <group name>+
[-cell <cell name>] [-noauth] [-localauth] [-force]
[-help]
pts rem -u <user name>+ -g <group name>+
[-c <cell name>] [-n] [-l] [-f] [-h]
DESCRIPTION
The pts removeuser command removes each user or machine named by the -user argument from each group named by the -group argument.
To add users to a group, use the pts adduser command. To list group membership, use the pts membership command. To remove users from a
group and delete the group's entry completely in a single step, use the pts delete command.
CAUTIONS
AFS compiles each user's group membership as he or she authenticates. Any users who have valid tokens when they are removed from a group
retain the privileges extended to that group's members until they discard their tokens or reauthenticate.
OPTIONS
-name <user name>+
Specifies the name of each user entry or the IP address (complete or wildcard-style) of each machine entry to remove.
-group <group name>+
Names each group from which to remove members.
-cell <cell name>
Names the cell in which to run the command. For more details, see pts(1).
-force
Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the
first error.
-help
Prints the online help for this command. All other valid options are ignored.
-localauth
Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or
-noauth options. For more details, see pts(1).
-noauth
Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1).
EXAMPLES
The following example removes user smith from the groups "staff" and "staff:finance". Note that no switch names are necessary because only
a single instance is provided for the first argument (the username).
% pts removeuser smith staff staff:finance
The following example removes three machine entries, which represent all machines in the ABC Corporation network, from the group
"bin-prot":
% pts removeuser -user 138.255.0.0 192.12.105.0 192.12.106.0 -group bin-prot
PRIVILEGE REQUIRED
The required privilege depends on the setting of the fifth privacy flag in the Protection Database for the group named by the -group
argument (use the pts examine command to display the flags):
o If it is the hyphen, only the group's owner and members of the system:administrators group can remove members.
o If it is lowercase "r", members of the group can also remove other members.
(It is not possible to set the fifth flag to uppercase "R".)
SEE ALSO
pts(1), pts_adduser(1), pts_examine(1), pts_membership(1), pts_setfields(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 2014-04-08 PTS_REMOVEUSER(1)