Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Recursively listing of the file Post 302546284 by Abhi2910 on Wednesday 10th of August 2011 11:42:43 PM
Old 08-11-2011
Thanks for prompt reply ...but its printing twice one time without path and next with path

to explain better to group

bash-3.00$

bash-3.00$ ls -lRt Raj
RAJ:
total 2
drwxrwxrwx 2 Raj Prati 1024 Aug 6 11:00 Prati

Raj/Prati:
total 413746

-rw-r--r-- 1 Raj Prati 35305472 Aug 6 11:00 TRAMS_I_20110728000000.TXT_2011080616002408
-rwxr-xr-x 1 Raj Prati 35770539 Jul 15 14:10 TRAMS_I_20110707094500.TXT_20110715191002686
-rw-r--r-- 1 Raj Prati 35770539 Jul 15 14:04 TRAMS_20110707094500.TXT_20110715185704506
-rwxr-xr-x 1 Raj Prati 34880052 Jun 22 10:57 TRAMS_I_20110609000000.TXT_20110622155721450
-rw-r--r-- 1 Raj Prati 50 Jun 22 10:23 TRAMS_I_20110601000000.TXT_2011062215232147
-rw-r--r-- 1 Raj Prati 34880052 Jun 9 05:45 TRAMS_I_20110609000000.TXT_20110609104535858
-rwxr-xr-x 1 Raj Prati 35016921 Jun 8 15:05 TRAMS_20110601000000.TXT_20110608200529168


bash-3.00$ ls -lRt | grep 20110609

-rwxr-xr-x 1 Raj Prati 34880052 Jun 22 10:57 TRAMS_I_20110609000000.TXT_20110622155721450
-rw-r--r-- 1 Raj Prati 34880052 Jun 9 05:45 TRAMS_I_20110609000000.TXT_20110609104535858
bash-3.00$

So if we look at above the directory structre is missing but I want directory and subdirectory comletely.
Also,
if somehow I can just print the Timestamp column and Filename it will be great
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can 'file' be used recursively?

I'd like find all the files with names containing a certain pattern, in a directory hierarchy - not just a single directory. For example: file *.txt But throughout the entire hierarchy. Can this be done? If so, how? Thank you (4 Replies)
Discussion started by: jsmith_4242
4 Replies

2. Shell Programming and Scripting

Changing file permission recursively

I have a directory named DIR. The contents of the directory is something like: a.sh b.sh cghsk.sh assjsjkd gdshddll DFG/ ... ... Where only DFG/ is a folder. I want to grant execute permission to all(a+x), for all the files directly under the DIR directory except the files that... (4 Replies)
Discussion started by: proactiveaditya
4 Replies

3. Shell Programming and Scripting

Insert file.txt recursively

Anyone knows how I can change this script so that it works recursively as well (meaning: *.c files in sub directories will get changed as well)? for file in *.c do cat file.txt "$file" > tempfile cat tempfile > "$file" done rm tempfile (5 Replies)
Discussion started by: psve
5 Replies

4. Red Hat

Copy certain file types recursively while maintaining file structure on destination?

Hi guys, I have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash. I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also... (1 Reply)
Discussion started by: rockf1bull
1 Replies

5. Shell Programming and Scripting

Listing latest modified or created files recursively

Hi, I want to display latest files (created or modified) recursively in a path. I tried in different ways, but didn't get any desired output: find $path -type f -exec ls -lt {} \; | sort -n -r find $path -type f -printf %p";" | xargs -d ";" ls -t Second one is giving the error:... (21 Replies)
Discussion started by: karumudi7
21 Replies

6. Shell Programming and Scripting

how to find a pattern from an external file in a directory containing multiple file recursively

Hi, Need your help in this. I have an input file that has multiple enrollment_number, somewhat like 1234567 8901234 9856321 6732187 7623465 Now i have to search and delete these enrollment_number recursively from all the files that are within multiple sub-directories of a... (10 Replies)
Discussion started by: mukulverma2408
10 Replies

7. Shell Programming and Scripting

Transpose recursively into delimited file

I would like to write a script that takes something like this: Line 1 Line 2 Line 3 Line 4 Line 6 Line 7 Line 8 Line 9 etc.... And makes it to look like this: Line 1|Line 2|Line 3|Line 4| Line 6|Line 7|Line 8|Line 9| etc. I would think it would be fairly easy to use two loops,... (4 Replies)
Discussion started by: jcs
4 Replies

8. UNIX for Dummies Questions & Answers

[Solved] How to remove listing of current user cmd from ps -ef listing?

Hi All, Could you please help to resolve my following issues: Problem Description: Suppose my user name is "MI90". i.e. $USER = MI90 when i run below command, i get all the processes running on the system containing name MQ. ps -ef | grep MQ But sometimes it lists... (8 Replies)
Discussion started by: KDMishra
8 Replies

9. Shell Programming and Scripting

Change permission on a file recursively

Hi, this is the structure of the directory /local/home/app/cases under cases directory, below are the sub directories and each directory has files. /local/home/app/cases/1 /local/home/app/cases/2 /local/home/app/cases/3 /local/home/app/cases/4 File types are .txt .sh and so... (5 Replies)
Discussion started by: lookinginfo
5 Replies

10. UNIX for Dummies Questions & Answers

Find and rename file recursively

Hi, I have a directory which contains multiple files with .txt extension, i want to rename all these file to .bak extension using find command, this is what i've tried, please help me to correct this : find /home/application/test -name '*.txt' -exec rename 's/txt/bak/' {} \; seems to... (8 Replies)
Discussion started by: mukulverma2408
8 Replies
BITMAP_ONTO(9)						  Basic Kernel Library Functions					    BITMAP_ONTO(9)

NAME
bitmap_onto - translate one bitmap relative to another SYNOPSIS
void bitmap_onto(unsigned long * dst, const unsigned long * orig, const unsigned long * relmap, int bits); ARGUMENTS
dst resulting translated bitmap orig original untranslated bitmap relmap bitmap relative to which translated bits number of bits in each of these bitmaps DESCRIPTION
Set the n-th bit of dst iff there exists some m such that the n-th bit of relmap is set, the m-th bit of orig is set, and the n-th bit of relmap is also the m-th _set_ bit of relmap. (If you understood the previous sentence the first time your read it, you're overqualified for your current job.) In other words, orig is mapped onto (surjectively) dst, using the the map { <n, m> | the n-th bit of relmap is the m-th set bit of relmap }. Any set bits in orig above bit number W, where W is the weight of (number of set bits in) relmap are mapped nowhere. In particular, if for all bits m set in orig, m >= W, then dst will end up empty. In situations where the possibility of such an empty result is not desired, one way to avoid it is to use the bitmap_fold operator, below, to first fold the orig bitmap over itself so that all its set bits x are in the range 0 <= x < W. The bitmap_fold operator does this by setting the bit (m % W) in dst, for each bit (m) set in orig. Example [1] for bitmap_onto: Let's say relmap has bits 30-39 set, and orig has bits 1, 3, 5, 7, 9 and 11 set. Then on return from this routine, dst will have bits 31, 33, 35, 37 and 39 set. When bit 0 is set in orig, it means turn on the bit in dst corresponding to whatever is the first bit (if any) that is turned on in relmap. Since bit 0 was off in the above example, we leave off that bit (bit 30) in dst. When bit 1 is set in orig (as in the above example), it means turn on the bit in dst corresponding to whatever is the second bit that is turned on in relmap. The second bit in relmap that was turned on in the above example was bit 31, so we turned on bit 31 in dst. Similarly, we turned on bits 33, 35, 37 and 39 in dst, because they were the 4th, 6th, 8th and 10th set bits set in relmap, and the 4th, 6th, 8th and 10th bits of orig (i.e. bits 3, 5, 7 and 9) were also set. When bit 11 is set in orig, it means turn on the bit in dst corresponding to whatever is the twelfth bit that is turned on in relmap. In the above example, there were only ten bits turned on in relmap (30..39), so that bit 11 was set in orig had no affect on dst. Example [2] for bitmap_fold + bitmap_onto: Let's say relmap has these ten bits set: 40 41 42 43 45 48 53 61 74 95 (for the curious, that's 40 plus the first ten terms of the Fibonacci sequence.) Further lets say we use the following code, invoking bitmap_fold then bitmap_onto, as suggested above to avoid the possitility of an empty dst result: unsigned long *tmp; // a temporary bitmap's bits bitmap_fold(tmp, orig, bitmap_weight(relmap, bits), bits); bitmap_onto(dst, tmp, relmap, bits); Then this table shows what various values of dst would be, for various orig's. I list the zero-based positions of each set bit. The tmp column shows the intermediate result, as computed by using bitmap_fold to fold the orig bitmap modulo ten (the weight of relmap). orig tmp dst 0 0 40 1 1 41 9 9 95 10 0 40 (*) 1 3 5 7 1 3 5 7 41 43 48 61 0 1 2 3 4 0 1 2 3 4 40 41 42 43 45 0 9 18 27 0 9 8 7 40 61 74 95 0 10 20 30 0 40 0 11 22 33 0 1 2 3 40 41 42 43 0 12 24 36 0 2 4 6 40 42 45 53 78 102 211 1 2 8 41 42 74 (*) (*) For these marked lines, if we hadn't first done bitmap_fold into tmp, then the dst result would have been empty. If either of orig or relmap is empty (no set bits), then dst will be returned empty. If (as explained above) the only set bits in orig are in positions m where m >= W, (where W is the weight of relmap) then dst will once again be returned empty. All bits in dst not set by the above rule are cleared. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 BITMAP_ONTO(9)
All times are GMT -4. The time now is 04:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy