2
votes
1answer
71 views

Windows cmd output redirection to standard input ( >&0 )

From a question on Stackoverflow, i've being testing with redirection from/to stdin stream. And this tests, trying to send data to the stdin stream, just to see what happens, end with an apparently ...
0
votes
3answers
34 views

Redirect stdin to stdout

I've got a script, ex myscript.sh, and it has to redirect to stdout what it gets from stdin (like a cat). For example: myscript.sh < myfile.txt > myfile2.txt How to do this? Also, how can i ...
1
vote
1answer
38 views

redirect one bash line to stdout/terminal vs log

I have a bash script where I'm redirecting output into a file for logging. if test -t 1; then # stdout is a terminal exec > $OUTPUT_FILE 2>&1 else # stdout is not a terminal, no ...
0
votes
1answer
37 views

how to use standard output from multiple commands as file arguments

I want to compare the output of 2 commands. For example: $ command1 arguments1 > tempfile1 $ command2 arguments2 > tempfile2 $ diff tempfile1 tempfile2 > savefile $ rm tempfile1 tempfile2 ...
0
votes
2answers
88 views

Redirect two stdout to one stdin in Linux bash

I've got a C program that reads from stdin and does some operations. I am asked to enter information periodically (every 20 sec), and leave the user interaction the same while doing some tests. Is ...
1
vote
1answer
82 views

How to redirect ALL output from a command in Linux

I'm running Gentoo Linux. A program (equery) outputs a massive list of all the currently installed packages (equery list "*"). I want to find out which of them are unstable. Equery marks the unstable ...
2
votes
2answers
308 views

cat “input file is output file” while trying to combine multiple files into one

The plan was to collect all source lines of Java into one file, recursively: $ find . -name '*.java' | xargs cat >> all.java But there was an error: cat: ./all.java: input file is output ...
0
votes
1answer
83 views

what are the commands to redirect a subfolder of C:\ProgramData to D:\ProgramData

I am using Garmin Express, a program to update my Garmin NĂ¼vi 2595LTM GPS device. I noticed that Garmin Express is taking up over 6.3GB in the C:\ProgramData folder. I only have a small SSD as the C: ...
0
votes
1answer
439 views

Batch to prompt for folder name and command, redirect to TXT file

What I'm trying to accomplish, is to have the batch file prompt the user to input their specific folder on our team's directory, and then prompt for a specific command to be used, and redirected to a ...
1
vote
1answer
66 views

Linux - Output to Folder that Yet Exists (in one command)

Is it possible to achieve this in one command without requiring a script: echo "test" > /folder/that/does/not/exist/newFile.txt
0
votes
1answer
107 views

Bash conditional redirection when testing/debugging

What is the best way to conditionally do a redirection in Bash for testing and debugging purposes? In my scripts I add a debug option to show what would have happened effectively doing a test run ...
2
votes
6answers
625 views

How to execute the output of `ls` from the command line?

Sometimes I forget my relative paths and by the time I track down where the file, is I have typed : Cris-Mac-Book-2:weird cris$ ls ../../../ Icon? Research Support Cris-Mac-Book-2:weird ...
0
votes
2answers
4k views

Redirect the output of netstat to a file?

I'm trying to redirect the output of netstat to a file and it doesn't work. Initially I tried: runas /noprofile /user:xxxxx\administrator "netstat -a -b > C:\temp\file.txt" Then I read ...
6
votes
1answer
149 views

What is a good way to get back to the command prompt discarding STDOUT and STDERR

I often launch applications from the cli via e.g. command & to immediately get back to the prompt back. The downside of this is, that I still get STDOUT and STDERR. So I use command &> ...
3
votes
2answers
11k views

In windows, can I redirect stdout to a (named) pipe in command line?

Is there a way to redirect the standard output of a process in Win32 console to a named pipe? Named pipes are built in to Windows and while they would be an useful concept, I've never seen them used ...
2
votes
1answer
2k views

Redirecting input from file to command-line program

I have a command-line program that normally gets its parameters from the keyboard after the program is run. Something like this: Enter parameter 1? 3 Enter parameter 2? 2.6 Calculate something y/n? y ...
8
votes
2answers
6k views

Windows CMD Batch, START and output redirection

I would like to run two programs simultaneously from a batch file, and redirect the first program's output into a text file like: start python 1st.py arg1 arg2 > out.txt start 2nd.exe %1 arg2 arg3 ...
21
votes
3answers
20k views

How to wget a file with correct name when redirected?

So after some time of searching on google and superuser (and scanning man pages) I was unable to find an answer to something that (I think) should be simple: If you go here: ...
0
votes
1answer
218 views

egrep redirection not working when following tail of file

I want to redirect the filtered output of a tail -f, as follows: tail -f myfile | egrep '(searchterm_a)|(searchterm_b)' >> outputfile.txt But for some reason the redirection is not working as ...
2
votes
2answers
415 views

How do I capture all the output from a CLI program?

I need to capture all the messages from cmd.exe. I tried abc.exe &> res.dat, but it doesn't seem to work with stderr or others. What should I do?
0
votes
3answers
312 views

Command output redirection to vim not working on OS X

I'm trying to redirect the output of a command to vim using the - argument, but it doesn't seem to work on OS X. For example, if I type $ ls | vim - on the command line on one of my Linux ...
23
votes
1answer
17k views

Is there an equivalent to /dev/null in Windows?

If I want to ignore stdout of a command, I do this on *nix: myprog > /dev/null How do I achieve the same on Windows (in cmd or a batch file)?
4
votes
3answers
4k views

How to ignore error messages in bash on Ubuntu?

I'm trying to show the number of lines, words and characters of all configuration files in /etc/*conf (with command wc). How can I modify the command (or commandline) to not view the error messages?
0
votes
1answer
1k views

getting error while doing cat command “Ambiguous output redirect.”

while executing cat test.txt | java myfile > test1.txt 2> test2.txt I am getting error "Ambiguous output redirect." my java file contains System.out and System.err . I am in Unix csh ...
7
votes
4answers
446 views

Documenting Unix commands on the command line

I would like to append both the last command and the output of the last command to a text file for the purpose of a tutorial. For example: After I do an ls in my home directory I see this on the ...
8
votes
2answers
14k views

How to redirect output to a text file and the console (cmd) window at the same time?

How can I redirect output to a text file and the console (cmd) window at the same time?
38
votes
3answers
43k views

What does “2>&1” do in command line?

I know that the > sign is used for output redirection in the command line, but I'm having trouble finding something that explains the use of 2>&1 in the command line. For example: curl ...
1
vote
2answers
679 views

Question on the <> Linux Redirection Operator

I'm studying for my LPIC-1 and I'm confused by the <> redirection operator. I know the official definition for this is that it "causes the specified file to be used for both standard input and ...
1
vote
1answer
3k views

Displaying and storing Windows Batch file output

I've got a batch file written that runs a program we've developped, passing in a number of parameters. Whilst running the program in debug mode, a large number of debug messages are output, which it ...
1
vote
2answers
127 views

Linux redirection question

What does the following do on Linux? cat <> FIFO | Where FIFO is a FIFO created in the current directory.