Sponsored Content
Top Forums UNIX for Dummies Questions & Answers List all File Content its subdirectory Post 302949089 by alvinoo on Tuesday 7th of July 2015 05:42:27 AM
Old 07-07-2015
List all File Content its subdirectory

Is there anyway to display the file content in a subdirectory that starts or ends with a certain filename, say .txt? or start with NTS

Code:
$ ls *
dos2unix.bat  dos2unix.exe  test.txt

FilePermissions:
filepermission.html      NTSLA32_SystemDrive.txt  NTSLA36_regedit.txt
filepermission.sh        NTSLA33_regedit.txt      NTSLA36_SystemDrive.txt
NTSLA30_regedit.txt      NTSLA33_SystemDrive.txt  NTSLA37_regedit.txt
NTSLA30_SystemDrive.txt  NTSLA34_regedit.txt      NTSLA37_SystemDrive.txt
NTSLA31_regedit.txt      NTSLA34_SystemDrive.txt  NTSLA38_regedit.txt
NTSLA31_SystemDrive.txt  NTSLA35_regedit.txt      NTSLA38_SystemDrive.txt
NTSLA32_regedit.txt      NTSLA35_SystemDrive.txt

NTSLA30:
File Permissions_                        NTSLA30-Registry Permissions.docx
NTSLA30 (4-23-2015 2-15 PM).mbsa         NTSLA30-ServerVersion.png
NTSLA30_Services.txt                     Thumbs.db
NTSLA30-File and Registry Auditing.docx  Uesr Right Assign.txt
NTSLA30-GPO.txt

NTSLA31:
File Permissions                         NTSLA31-GPO.txt
NTSLA31 (4-23-2015 2-17 PM).mbsa         NTSLA31-Registry Permissions.docx
NTSLA31_Services.txt                     NTSLA31-ServerVersion.png
NTSLA31-File and Registry Auditing.docx  Thumbs.db

NTSLA32:
File Permissions                         NTSLA32-Registry Permissions.docx
NTSLA32 (5-20-2015 11-15 AM).mbsa        NTSLA32-ServerVersion.png
NTSLA32_services.txt                     Security Opt.txt
NTSLA32-File and Registry Auditing.docx  Thumbs.db
NTSLA32-GPO.txt                          User Rights Assign.txt

NTSLA33:
File Permissions                         NTSLA33-Registry Permissions.docx
NTSLA33 (4-23-2015 2-14 PM).mbsa         NTSLA33-ServerVersion.png
NTSLA33_Services.txt                     Security Opt.txt
NTSLA33-File and Registry Auditing.docx  Thumbs.db
NTSLA33-GPO.txt                          User Rights Assignment.txt

NTSLA34:
File Permissions                         NTSLA34-Registry Permissions.docx
NTSLA34 (4-23-2015 2-14 PM).mbsa         NTSLA34-ServerVersion.png
NTSLA34_Services.txt                     Security Opt.txt
NTSLA34-File and Registry Auditing.docx  Thumbs.db
NTSLA34-GPO.txt                          User Rights Assign.txt

NTSLA35:
File Permissions                         NTSLA35-Registry Permissions.docx
NTSLA35 (4-23-2015 2-15 PM).mbsa         NTSLA35-ServerVersion.png
NTSLA35_Services.txt                     Security Opt.txt
NTSLA35-File and Registry Auditing.docx  Thumbs.db
NTSLA35-GPO.txt                          User Rights Assign.txt

NTSLA36:
File Permissions                         NTSLA36-Registry Permissions.docx
NTSLA36 (5-20-2015 3-43 PM).mbsa         NTSLA36-ServerVersion.PNG
NTSLA36_Services.txt                     Security Opt.txt
NTSLA36-File and Registry Auditing.docx  Thumbs.db
NTSLA36-GPO.txt                          User Rights Assign.txt

NTSLA37:
File Permissions                         NTSLA37-Registry Permissions.docx
NTSLA37 (4-23-2015 2-14 PM).mbsa         NTSLA37-ServerVersion.png
NTSLA37_Services.txt                     Security Opt.txt
NTSLA37-File and Registry Auditing.docx  Thumbs.db
NTSLA37-GPO.txt                          User Right Assign.txt

NTSLA38:
File Permissions                         NTSLA38-Registry Permissions.docx
NTSLA38 (4-27-2015 4-25 PM).mbsa         NTSLA38-ServerVersion.png
NTSLA38_Services.txt                     Security Opt.txt
NTSLA38-File and Registry Auditing.docx  Thumbs.db
NTSLA38-GPO.txt                          User Rights Assign.txt

Policies:
accountlockout  auditpol  eventlog  passwordpol  secopt  test.txt  userrights

services:
NTSLA30  NTSLA32  NTSLA34  NTSLA36  NTSLA38        services.sh
NTSLA31  NTSLA33  NTSLA35  NTSLA37  services.html

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find and replace in subdirectory (filename & content - both)

Hi, I have to rename all occurance of CUST_MST to RESELLER_MST both in filename and file content under a directory (say D0) which contains multiple (2-3 levels) sub directory. Example: D0 -> D1 -> D2 has a file CUST_MST_TEMP.txt this contains : > cat /D0/D1/D2/CUST_MST_TEMP.txt... (3 Replies)
Discussion started by: sabyasm
3 Replies

2. AIX

find for specific content in file in the directory and list only file names

Hi, I am trying to find the content of file using grep and find command and list only the file names but i am getting entire file list of files in the directory find . -exec grep "test" {} \; -ls Can anyone of you correct this (2 Replies)
Discussion started by: madhu_Jagarapu
2 Replies

3. Shell Programming and Scripting

Need help with awk - how to read a content of a file from every file from file list

Hi Experts. I need to list the file and the filename comes from the file ListOfFile.txt. Basicly I have a filename "ListOfFile.txt" and it contain Example of ListOfFile.txt /home/Dave/Program/Tran1.P /home/Dave/Program/Tran2.P /home/Dave/Program/Tran3.P /home/Dave/Program/Tran4.P... (7 Replies)
Discussion started by: tanit
7 Replies

4. Shell Programming and Scripting

list file content as individual variables

Hello, I've created a couple of files within a list using the command "ls -ltr | tail -2 > list" These files are the newest files placed within a directory. From the "list" file, I need to place the filenames as a variable. In which the newest file will be called "new_ctrl" the older file... (4 Replies)
Discussion started by: petersf
4 Replies

5. Shell Programming and Scripting

How to list directory and subdirectory?

Hi, I want to list all the directory and subdirectories under any directory. For eg. i am in a directory called A and want to check all directories under A. Output should be as below. /A /A/a1 /A/a1/a2 /A/b1 /A/c1/c2 A,a1,a2,b1,c1 and c2 all are directories.Just for Eg. Please... (7 Replies)
Discussion started by: anshu ranjan
7 Replies

6. UNIX for Dummies Questions & Answers

How to list content with file name ?

I want to search the string including the symbol like 'search' for example, file a.txt in \\dir contains, a for 'appable' b for 'banana' c for 'cat' s for 'search' Here I need to display(serach outpur) like \\dir\a.txt s for 'search' ... ... How to list content with file name... (5 Replies)
Discussion started by: gkskumar
5 Replies

7. Shell Programming and Scripting

Pick one file from each subdirectory

Hi, I have a problem I am trying to solve with bash. I need to search in a file system (data base) with hundreds of directories and thousands of subdirectories and millions of files. The files have a specific format with a header that gives the properties. Directories are organized so... (1 Reply)
Discussion started by: majest
1 Replies

8. Shell Programming and Scripting

list file content

I need help. I have this file, it has 2 fields with at least 300 lines: 1 4 2 3 3 6 4 2 . . 300 5 My output should be for every line in input file the output should be like this, for example line 1: wget http://somewebsite/page=1&line=1 wget http://somewebsite/page=1&line=2 wget... (4 Replies)
Discussion started by: zorrox
4 Replies

9. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

10. Shell Programming and Scripting

List the files after sorting based on file content

Hi, I have two pipe separated files as below: head -3 file1.txt "HD"|"Nov 11 2016 4:08AM"|"0000000018" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" head -3 file2.txt "HD"|"Nov 15 2016 2:18AM"|"0000000019" "DT"|"240350264"|"56432" "DT"|"240350264"|"56432" I want to list the... (6 Replies)
Discussion started by: Prasannag87
6 Replies
XML::Easy::Content(3pm) 				User Contributed Perl Documentation				   XML::Easy::Content(3pm)

NAME
XML::Easy::Content - abstract form of XML content SYNOPSIS
use XML::Easy::Content; $content = XML::Easy::Content->new([ "foo", $subelement, "bar", ]); $twine = $content->twine; DESCRIPTION
An object of this class represents a chunk of XML content, the kind of matter that can be contained within an XML element. This is in an abstract form, intended for general manipulation. It is completely isolated from the textual representation of XML, and holds only the meaningful content of the chunk. The data in a content object cannot be modified: different data requires the creation of a new object. An XML content chunk consists of a sequence of zero or more characters and XML elements, interspersed in any fashion. Character content can use almost all Unicode characters, with only a few characters (such as most of the ASCII control characters) prohibited by the specification from being directly represented in XML. Each XML element in a content chunk itself recursively contains a chunk of content, in addition to having attached metadata. This class is not meant to be subclassed. XML content is unextendable, dumb data. Content objects are better processed using the functions in XML::Easy::NodeBasics than using the methods of this class. CONSTRUCTOR
XML::Easy::Content->new(TWINE) Constructs and returns a new content chunk object with the specified content. TWINE must be a reference to an array listing the chunk's content in twine form (see "Twine" in XML::Easy::NodeBasics). The content is checked for validity, against the XML 1.0 specification, and the function "die"s if it is invalid. METHODS
$content->twine Returns a reference to an array listing the chunk's content in twine form (see "Twine" in XML::Easy::NodeBasics). The returned array must not be subsequently modified. If possible, it will be marked as read-only in order to prevent modification. $content->content Deprecated alias for the "twine" method. SEE ALSO
XML::Easy::Element, XML::Easy::NodeBasics AUTHOR
Andrew Main (Zefram) <zefram@fysh.org> COPYRIGHT
Copyright (C) 2008, 2009 PhotoBox Ltd Copyright (C) 2009, 2010, 2011 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-11-16 XML::Easy::Content(3pm)
All times are GMT -4. The time now is 06:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy