Sponsored Content
Top Forums Shell Programming and Scripting find files in sub dir with tag & add "." at the beginning [tag -f "Note" . | xargs -0 {} mv {} .{}] Post 303043314 by Nexeu on Friday 24th of January 2020 01:40:24 AM
Old 01-24-2020
Hi Scrutinizer,

Thanks for the quick response.

for tag command :
Code:
tag -0 -f "Note" . | xargs -0 -I {} echo {}

It only echo out a list of files including directories. Something like this /dir/dir/dir/file.ext.

So when I try to do:

Code:
tag -0 -f "Note" . | xargs -0 -I {} rename -n 's/^/\./' {}

the out put came out like :
Code:
'/dir/dir/dir/file.ext' would be renamed to './dir/dir/dir/file.ext'

but I want the result to be :
Code:
'/dir/dir/dir/file.ext' would be renamed to '/dir/dir/dir/.file.ext'

For mdfind, I modified the code to be like this to echo out the list:
Code:
mdfind -0 "kMDItemUserTags == 'Note'" | xargs -0 -I {} echo {}

But still no luck of adding '.' to the file only at the beginning.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

3. Shell Programming and Scripting

print all the rows from "BUY" Tag with "SELL" with Buy/sell tag at end

hi I have the following input and i want to print all the rows from "BUY" Tag till "SELL" alongwith Buy/sell tag at end of each row ------ INPUT ===== 30/06/2009,NORMAL,ALL,ALL BUY 1,CBLO/020709,T+0,30/06/2009,100.00,3.00,999835643.46,200906300000422,-, 15:04:42,BUY... (5 Replies)
Discussion started by: r_t_1601
5 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

6. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
update-fonts-dir(8)					      System Manager's Manual					       update-fonts-dir(8)

NAME
update-fonts-dir - compile fonts.dir files SYNOPSIS
update-fonts-dir [OPTION] directory ... DESCRIPTION
update-fonts-dir creates a fonts.dir file in an X font directory by invoking mkfontdir(1x) with the appropriate arguments. It is typically invoked only from the post-installation and post-removal scripts of a package containing fonts for the X Window System, but may be invoked at any time to reconstruct fonts.dir files. For each directory, which is simply the last component of its path (such as '75dpi' or 'misc'), update-fonts-dir will generate either /usr/lib/X11/fonts/directory/fonts.dir or /usr/share/fonts/X11/directory/fonts.dir from the fonts.scale and font files found within it. This enables multiple packages to provide names for fonts in the same directory. No font package actually provides the fonts.dir file in the X font directory itself, so there is no danger of overwriting one package's font names with those of another. For instance, the two packages 'xfonts-base' (real) and 'xfonts-nifty' (hypothetical) may both install fonts into the directory /usr/lib/X11/fonts/misc, and update-fonts-dir will ensure that the fonts.dir file in that directory contains information about the font files provided by both packages. The format of fonts.dir files is described in the mkfontdir(1x) manual page. An example of how to use update-fonts-dir in package maintainer scripts is provided in the Debian Policy Manual. OPTIONS
-h, --help displays a brief usage message and exits. -7, --x11r7-layout switches the font layout to the one introduced in X11R7: fonts in /usr/share/fonts/X11/directory (default is: fonts in /usr/lib/X11/fonts/directory) OPERANDS
update-fonts-dir takes one or more X font directory names to operate on as operands. Only the final path component of the directory name should be specified; e.g., update-fonts-dir 75dpi is correct, while 'update-fonts-dir /usr/X11R6/lib/X11/fonts/75dpi' and 'update-fonts-dir /usr/lib/X11/fonts/75dpi' are not. ENVIRONMENT
COLUMNS indicates the width of the terminal device in character cells. This value is used for formatting diagnostic messages. If not set, the terminal is queried using stty(1) to determine its width. If that fails, a value of '80' is assumed. DIAGNOSTICS
Errors usage error: one or more font directories must be provided update-fonts-dir was invoked without operands. Supply one or more X font directory names to operate on. usage error: unrecognized option update-fonts-dir was invoked with an unrecognized option argument. Use only the options documented in "OPTIONS", above. fatal error: path to X font directory must be used A directory name was supplied that was not an X font directory name. Supply X font directory names only. Warnings warning: absolute path directory was provided Usage of absolute paths is deprecated. Use only the final component of the X font directory name for directory. warning: directory does not exist or is not a directory The supplied directory was invalid. update-fonts-dir skipped it. EXIT STATUS
0 update-fonts-dir ran successfully. 1 update-fonts-dir experienced a fatal error; see the section on diagnostic messages above. 2 update-fonts-dir was invoked with invalid arguments. BUGS
See the Debian Bug Tracking System <http://bugs.debian.org/xfonts-utils>. If you wish to report a bug in update-fonts-dir, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. AUTHOR
update-fonts-dir was written by Branden Robinson. SEE ALSO
mkfontdir(1x) Debian Project 2004-11-11 update-fonts-dir(8)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy