Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How do I redirect output from "find", either to a file or another command? Post 303043866 by arghvark on Sunday 9th of February 2020 01:12:41 PM
Old 02-09-2020
This looks more or less like what I need, but I need some help parsing it. When I try to execute the command in the root directory, it says I don't have access, which is fair.

I think of the ">" symbol as "redirect output to a file, I'll tell you what the filename is". I think of "|" as "take this output and feed it into another program", which doesn't require a filename. I can tell that "2" and "1" represent stdout and stderr; is there a way to direct them both to the pipe, instead of the file? AFAIK, I/we don't have to first direct output to a file and then to grep, and in fact I don't know that it will work that way.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

the operato < for redirect output "inverse"....

see this cat < Files return the cointent of Files but cat files return the same result WHI??? this command lp -f """PRINTER" < cat files not print the content of files (1 Reply)
Discussion started by: ZINGARO
1 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

store the output of "find" command in a variable?

I intend to find the path/full location of a file(filename given by user thru "read filenme") using "find" or any other command and then store it's output in a variable for some other processing. But struggling to put all things together (i.e finding the fully qualified location of that file and... (4 Replies)
Discussion started by: punitpa
4 Replies

4. UNIX for Dummies Questions & Answers

Explanation of "total" field in "ls -l" command output

When I do a listing in one particular directory (ls -al) I get: total 43456 drwxrwxrwx 2 root root 4096 drwxrwxrwx 3 root root 4096 -rwxrwxr-x 1 nobody nobody 3701594 -rwxrwxr-x 1 nobody nobody 3108510 -rwxrwxr-x 1 nobody nobody 3070580 -rwxrwxr-x 1 nobody nobody 3099733 -rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

5. 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

6. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

7. Shell Programming and Scripting

Using a single "find" cmd to search for multiple file types and output individual files

Hi All, I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd. What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Discussion started by: swaters
3 Replies

8. Shell Programming and Scripting

What is the right way to redirect script output use ">" or ">>" ?

Which one of the following are more accurate and why? nohup myScript.sh 1>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh 1>>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh >nohup_$(date +%Y%m%d%H%M%S).out 2>&1 & nohup myScript.sh >>nohup_$(date +%Y%m%d%H%M%S).out 2>&1 &... (3 Replies)
Discussion started by: kchinnam
3 Replies

9. 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

10. Programming

Redirecting output to new file for command "perldoc perllocal"

Hi, I have to redirect output of the command "perldoc perllocal" to new file which contains all the perl module installed. Currently using perldoc perllocal >> mod_data This does not contain all perl modules installed locally on machine, and each character is doubled. Please... (3 Replies)
Discussion started by: asak
3 Replies
NIP2(1) 						      General Commands Manual							   NIP2(1)

NAME
nip2 - image processing with the VIPS library SYNOPSIS
nip2 [filename1 ...] nip2 -s filename [arg1 ...] nip2 -e expression [arg1 ...] DESCRIPTION
nip2 (for New Image Processing) is a tool for manipulating images using the VIPS image processing library. There are three principal modes: nip2 [filename1 ...] start in GUI mode, loading the named files nip2 -e expression [arg1 ...] nip2 --expression=EXPRESSION [arg1 ...] start in no-GUI mode; set main = expression, set list argv to ["filename", "arg1", "arg2", ...], set argc to length of list; print the value of symbol "main" to stdout; exit nip2 -s filename [arg1 ...] nip2 --script=FILENAME [arg1 ...] start in no-GUI mode; read in filename as a set of definitions, set list argv to ["filename", "arg1", "arg2", ...], set argc to length of list; print the value of symbol "main" to stdout; exit; useful for running nip2 as an interpreter on unix You can use -o to direct output to a file rather than stdout. -o filename --output=FILENAME the value of main is written to the named file. If main is a list, the filename is incremented between objects. You can use the suffix to specify the format and options to write in Other options provide finer control over startup and shutdown. If you need to do something strange, don't use -e/-s, use these in combina- tion. -b --batch batch (ie. non-GUI) mode -m --no-load-menus don't load menus, for faster startup -a --no-load-args don't load extra command-line arguments -w --stdin-ws load stdin as a workspace -d --stdin-def load stdin as a set of definitions -p --print-main print the value of main on exit. nip2 will check for a top-level symbol called main, and also check each workspace for a main Finally some other options are useful for debugging, timing and for generating strings for internationalisation. -V --verbose produce verbose error messages: handy for debugging in batch mode -i --i18n output strings from .def files for internationalisation -v --version print version information -c --benchmark benchmark: no GUI, just start up and shut down -t --time-save time saves: after every image save a popup tells you the time the save took in seconds -T --test test: start up (including any arg processing), test for any errors, and exit with an error code if any occured. Useful for running automated tests. -x PREFIX --prefix=PREFIX set install prefix: start up as if nip2 had been installed to PREFIX. Useful for running automated tests without installing the thing. EXAMPLES
nip2 fred.jpg Start nip2, loading fred.jpg. nip2 -e "2 + 2" Prints 4 to stdout. nip2 -e "99 + Image_file argv?1" -o result.png fred.jpg Load argv1 (fred.jpg), add 99, output to result.png. nip2 -e "Matrix [[1,2],[4,5]] ** -1" -o poop.mat Invert the 2x2 matrix and write the result to poop.mat. COPYRIGHT
2008 (c) Imperial College, London Oct 4 2004 NIP2(1)
All times are GMT -4. The time now is 08:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy