Sponsored Content
Top Forums Shell Programming and Scripting Find and replace the path value in files, pattern is not full known. Post 303018599 by rbalaj16 on Monday 11th of June 2018 03:35:58 PM
Old 06-11-2018
Hi RudiC,

This works. Thanks a ton.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find pattern in FILES and replace it ??

Hi How can I looking for a pattern found in more than one file and replace it with anther pattern this what I was used: find . -name "account.adrs" -depth -follow -exec grep -l "Email = ;" {} \; this print the files name -which is account.adrs- and its path -which is deferent for each... (4 Replies)
Discussion started by: tamer
4 Replies

2. Shell Programming and Scripting

to find the file with full path

Hi, I have written this shell script: fl=`ls -1lrt $mylist | grep '\.xml$' | awk '{print $9}'` echo $fl (1) for i in $fl do for dir in $mylist do if then echo $dir/$i >> tmp (2) fi done done The mylist contains some directory names. The satement (1) gives the sorted list... (5 Replies)
Discussion started by: surjyap
5 Replies

3. Shell Programming and Scripting

Replace a filename with full path using sed

hi, i need to replace a line a file with a new raw device location.. original file.. /opt/sybase/ASE1502/ASE-15_0/bin/dataserver \ -d/data/TST_AKS1/sybdevices/master.dat \ -e/logs/sybase/TST_AKS1/SFO_TST_AKS1.log \ -c/apps/sybase/ASE1502/ASE-15_0/TST_AKS1.cfg \... (2 Replies)
Discussion started by: aksaravanan
2 Replies

4. Shell Programming and Scripting

List files with full path

Hi all, How to save file full name to a file. I tried the following but don't know to include path name. $ ls -l | awk '{print $9}' > outputfile.dat $ cat outputfile.dat fifth.txt first.txt fourth.txt second.txt third.txt My wanted result is ie: ... (3 Replies)
Discussion started by: mr_bold
3 Replies

5. UNIX for Dummies Questions & Answers

Listing files with full path

Hi, I need to store all the files in a directory to a text file with its full path. The example below can explain: ./File1.txt ./File2.txt ./Folder1/File11.txt ./Folder1/File12.txt ./Folder1/Folder11/File111.txt ./Folder2/file21.txt : : The ls -R1 command won't give the result as... (5 Replies)
Discussion started by: r_sethu
5 Replies

6. Shell Programming and Scripting

How to extract strings from full path when full path is not fixed

/Path/snowbird9/nrfCompMgrRave1230100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird6/nrfCompMgrRave1220100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird14/nrfCompMgrRave920100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.... (0 Replies)
Discussion started by: Shirisha
0 Replies

7. Emergency UNIX and Linux Support

Find, replace, file path in multiple files for Solaris 10

Guys I have a big issue that I need to get fixed ASAP however I can not seem to find a way to do it. We started to use zones with Solaris 10 at work and we moved a zone from a SIT box to a DEV box. Problem is the software we have installed is looking at a /lcl/sit/apps/ path and it needs to look... (5 Replies)
Discussion started by: LRoberts
5 Replies

8. Shell Programming and Scripting

Pattern match a path anywhere in the line and replace it with new path

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

9. Shell Programming and Scripting

Comment all lines which are not already commented for each full path pattern matched

Hello. Question 1 : I want to comment out all lines of a cron file which are not already commented out for each full path pattern matched. Example 1 nothing to do because line is already commented out; pattern = '/usr/bin/munin-cron' # */5 * * * * munin test -x... (3 Replies)
Discussion started by: jcdole
3 Replies

10. UNIX for Beginners Questions & Answers

30 days old files with full path

my requirement is 30 days old files along with size and pull path of the file (file should be listed in descending by size). output: 12345 /app/testing/file1 12341 /app/testing/file2 (5 Replies)
Discussion started by: Rajesh123
5 Replies
APT-FILE(1)															       APT-FILE(1)

NAME
apt-file - APT package searching utility -- command-line interface SYNOPSIS
apt-file [ options ] [ action ] [ pattern ] apt-file -f [ options ] search [ file ... ] apt-file -D [ options ] search [ binary-packet.deb ... ] DESCRIPTION
apt-file is a command line tool for searching files in packages for the APT package management system. Some actions are required to run the search: find Alias for search. list List the contents of a package matching the pattern pattern. This action is very close to the dpkg -L command except the package does not need to be installed or fetched. purge remove all Contents-* files from the cache directory. search Search in which package a file is included. A list of all packages containing the pattern pattern is returned. apt-file will only search for filenames, not directory names. This is due to the format of the Contents files it searches. show Alias for list. update Resynchronize the package contents from their sources. The lists of the contents of packages are fetched from the location(s) speci- fied in /etc/apt/sources.list. This command attempts to fetch the Contents-<ARCH>.gz files from remote sources. For downloading these uses either the curl or wget commands as specified in apt-file.conf. OPTIONS
-a, --architecture architecture Sets architecture to architecture. This option is useful if you search a package for a different architecture from the one installed on your system. It determines how the $ARCH variable in sources.list is expanded (but it does not influence the search in any other way). -c, --cache cache-directory Sets the cache directory to cache-directory instead of its default. If executed as non-root user, the default is $HOME/.cache/apt- file with fall-back to /var/cache/apt/apt-file. The latter is also the default if apt-file is called as root. -d, --cdrom-mount cdrom-mount-point Use cdrom-mount-point instead of apt's. -D, --from-deb Use contents of the given .deb archives(s) as patterns. Useful for searching for file conflicts with other packages. Implies -F. -f, --from-file Read patterns from the given file(s), one per line. Use -f - for stdin. This is much faster than invoking apt-file many times. -F, --fixed-string Do not expand search pattern with generic characters at pattern's start and end. -i, --ignore-case Ignore case when searching for pattern. -l, --package-only Only display package name; do not display file names. -N, --non-interactive Skip schemes that are listed in the interactive line in apt-file.conf. This is useful if you want to call 'apt-file update' in cron jobs and skip all schemes that may require user input. -s, --sources-list sources.list Sets the sources.list file to a different value from its default /etc/apt/sources.list. -v, --verbose Run apt-file in verbose mode. -x, --regexp Treat pattern as a (perl) regular expression. See perlreref(1) for details. Without this option, pattern is treated as a literal string to search for. -y, --dummy Run in dummy mode (no action). -h, --help Display a short help screen. CONFIGURATION FILE
The apt-file configuration file can be found in /etc/apt/apt-file.conf. A string expansion is done on several values. See the string expansion section. destination This variable describes how cached files will be named. http | ftp | ssh | rsh | file | cdrom Defines the commands used to fetch files. STRING EXPANSION A sources.list entry is defined as: deb uri dist component1 component2 ... A uri is defined as: proto:/[/][user[:password]@]host[:port][/path] <host> replace with the hostname <port> replace with the port number <uri> replace with full uri <path> replace with full path (relative to / on the host) <dist> replace with distribution name <comp> replace with component name <cache> replace with cache directory <dest> replace with destination expanded value. <cdrom> replace with cdrom-mount-point. BUGS
The cdrom backend has not been tested. Non-release lines in sources.list are not handled by apt-file. There is only one Contents file per distribution that contains all components (i.e. main, contrib, and non-free). Threrefore, apt-file will display search results from all components, even if not all components are included in the sources.list file. When a new line has been added to the sources.list and apt-file update has not been run, apt-file does not print a warning message. Complex regular expressions that match the leading slash may not work correctly. As a workaround, try to pull the leading slash to the beginning of the regular expression. For example, use "/(usr/bin/vim|sbin/lvm)" instead of "/usr/bin/vim|/sbin/lvm". FILES
/etc/apt/sources.list Locations to fetch package contents from. /etc/apt/sources.list.d/ Directory with additional sources.list snippets /etc/apt/apt-file.conf Configuration file for apt-file. SEE ALSO
auto-apt(1), apt-cache(8), apt-cdrom(8), dpkg(8), dselect(8), sources.list(5), apt.conf(5), apt_preferences(5). The APT users guide in /usr/share/doc/apt/ AUTHOR
apt-file was written by Sebastien J. Gross <sjg@debian.org>. May 2003 APT-FILE(1)
All times are GMT -4. The time now is 02:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy