11-30-2007
How to get dir name tacked onto filename with ls command
hello i'm trying to figure out how to tack the directory name onto the file name when i do the ls -ltrR command please?
---------------------------------------------------------------------------------
I do the following command ls -ltrR > ls.out
and get the following output:
-----------------------------------------ls.out----------------------------------
./PERL:
total 180
-rw-r--r-- 1 kennellr datawhse 24595 May 21 2004 bob.pl
-rw-r--r-- 1 kennellr datawhse 23965 May 21 2004 rdmtools_DBUtil.pm
-rw-r--r-- 1 kennellr datawhse 38094 May 21 2004 rdmtools_functions.pm
-rw-r--r-- 1 kennellr datawhse 27 May 21 2004 date.ksh
-rw-r--r-- 1 kennellr datawhse 1189 May 24 2004 date.pl
./CONFIG:
total 0
./RUNCNTL:
total 8
drwxr-xr-x 2 kennellr datawhse 512 May 26 2004 RUN3
drwxr-xr-x 2 kennellr datawhse 512 May 26 2004 RUN1
drwxr-xr-x 2 kennellr datawhse 512 May 26 2004 CONFIG
drwxr-xr-x 3 kennellr datawhse 512 May 26 2004 RUN2
./RUNCNTL/RUN3:
total 0
-----------------------------------------------------------------------------------
i then run a script that has the following read command in it:
while read m1 m2 m3 m4 m5 m6 m7 m8 m9
do
echo $m5 $m9
done < ls.out
and it produces the following output:
-----------------------------------------------------------------------------------
24595 bob.pl
23965 rdmtools_DBUtil.pm
38094 rdmtools_functions.pm
27 date.ksh
1189 date.pl
512 RUN3
512 RUN1
512 CONFIG
512 RUN2
-----------------------------------------------------------------------------------
But in order to build commands from this list i need the directory name so does any one know if i can modify the
ls -ltr command so it creates a list of files with the directory name tacked onto the file name like so?
-rw-r--r-- 1 kennellr datawhse 24595 May 21 2004 /PERL/bob.pl
versus
-rw-r--r-- 1 kennellr datawhse 24595 May 21 2004 bob.pl
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
On a Sun OS system we have, when executing a ps command it displays a third parties applications password. The ps command used is from the ucb dir, but if you use the ps command which resides in the bin dir it doesn't display the password.
Other users need to use the ps command from the ucb... (2 Replies)
Discussion started by: dbrundrett
2 Replies
2. UNIX for Advanced & Expert Users
Dear expert,
what is this command touch -c filename using for?
I find if execute and filename is existed, it update the date to now.
If the filename is not exeisted, it don't create the file..
so what is this command using for?
Thank a lot! (1 Reply)
Discussion started by: zp523444
1 Replies
3. Shell Programming and Scripting
Greetings,
I am trying to write script, (preferably in sh) that will use a proprietary program to print the resolution and name of files in the current working directory in a vertical format.
I think this script will require 3 commands with variables and a pipe to the prop program, but am not... (6 Replies)
Discussion started by: rocinante
6 Replies
4. UNIX for Dummies Questions & Answers
I want to move the files in a dir to different dirs based on their file names.
Ex: i have 4 different files with name -
CTS_NONE_10476031_MRL_PFT20081215a.txt
CTS_NONE_10633009_MRL_PFT20091020a.txt
CTS_NONE_10345673_MRL_PFT20081215a.txt
CTS_NONE_10872456_MRL_PFT20091020a.txt
and the 1st... (2 Replies)
Discussion started by: Sriranga
2 Replies
5. Shell Programming and Scripting
I want to move the files in a dir to different dirs based on their file names.
Ex: i have 4 different files with name -
CTS_NONE_10476031_MRL_PFT20081215a.txt
CTS_NONE_10633009_MRL_PFT20091020a.txt
CTS_NONE_10345673_MRL_PFT20081215a.txt
CTS_NONE_10872456_MRL_PFT20091020a.txt
and the 1st... (4 Replies)
Discussion started by: Sriranga
4 Replies
6. Shell Programming and Scripting
Hi,
Can the below command will be working in FTP
dir */*/*/*.zip
I want to dynamically know the folder names where the zipfiles are present.
Thnx in advance. (1 Reply)
Discussion started by: weknowd
1 Replies
7. Shell Programming and Scripting
HI
i have below command and i want to run it on each logs of each and every Dir.
/home/Laco/Al
I have sub dir in this folder
/home/Laco/Al/04092012/LP/X/*.logs
/home/Laco/Al/04092012/LP/Y/*.logs
/home/Laco/Al/04092012/LP/Z/*.logs
/home/Laco/Al/04092012/LP/P/*.logs
I want to run... (5 Replies)
Discussion started by: asavaliya
5 Replies
8. Windows & DOS: Issues & Discussions
Well since Windows always laments over some of my files having a too long "path+filename" and it gets in the way of copying complete directory structures I would love to have a DOS Script that helps me with finding those.
I already tried DCSoft Long Filename Finder but that is neither DOS based... (3 Replies)
Discussion started by: pasc
3 Replies
9. Shell Programming and Scripting
Running below command , but unable to print the filename , is there way to print filename/dirname using -print option
find . -type f -exec aclput -i fileacl.template {} \; (5 Replies)
Discussion started by: lalitpct
5 Replies
10. Shell Programming and Scripting
buddies,
my requirement would be as follows,
I have a file called test.txt and content of it would be
yahoo
gmail
hotmail
and i want to search a file name called "yahoo.html" (first line of test.txt) and then "gmail.html" and then "hotmail.html" in a /home/test dir.
Any idea... (8 Replies)
Discussion started by: natraj005
8 Replies
VPO(4) BSD Kernel Interfaces Manual VPO(4)
NAME
vpo -- parallel to SCSI interface driver
SYNOPSIS
device vpo
For one or more SCSI busses:
device scbus
DESCRIPTION
The vpo driver provide access to parallel port Iomega Zip and Jaz drives.
HARDWARE
The vpo driver supports the following parallel to SCSI interfaces:
o Adaptec AIC-7110 Parallel to SCSI interface (built-in to Iomega ZIP drives)
o Iomega Jaz Traveller interface
o Iomega MatchMaker SCSI interface (built-in to Iomega ZIP+ drives)
USAGE
The driver should let you use a printer connected to the drive while transferring data.
DOS and FreeBSD file systems are supported. When mounting a DOS file system or formating a FreeBSD file system, check the slice of the disk
with the fdisk(8) utility.
In order to unixify a ZIP disk, put the following in /etc/disktab:
zip|zip 100:
:ty=removable:se#512:nc#96:nt#64:ns#32:
:pa#196608:oa#0:ba#4096:fa#512:
:pb#196608:ob#0:bb#4096:fb#512:
:pc#196608:oc#0:bc#4096:fc#512:
and use bsdlabel(8).
If you have trouble with your driver, your parallel chipset may not run properly at the detected mode (NIBBLE, PS2 or EPP). Tune the ppc(4)
bootflags to force other modes.
SEE ALSO
da(4), lpt(4), ppbus(4), ppc(4), scsi(4)
HISTORY
The vpo manual page first appeared in FreeBSD 3.0.
AUTHORS
This manual page was written by Nicolas Souchu.
BUGS
During boot, the driver first tries to detect a classic ZIP, then a ZIP+. The ZIP+ detection is intrusive and may send erroneous characters
to your printer if the drive is not connected to your parallel port.
BSD
December 14, 2004 BSD