Top "Io-redirection" questions

I/O redirection is used in shell scripting.

Redirect all output to file

I know that in Linux, to redirect output from the screen to a file, I can either use the > …

linux bash io-redirection
How to redirect and append both stdout and stderr to a file with Bash?

To redirect stdout to a truncated file in Bash, I know to use: cmd > file.txt To redirect stdout …

bash append stdout io-redirection stderr
How to pass password to scp?

I know it is not recommended, but is it at all possible to pass the user's password to scp? I'd …

linux scp io-redirection
Redirect stderr and stdout in Bash

I want to redirect both stdout and stderr of a process to a single file. How do I do that …

bash shell stdout io-redirection stderr
Find and replace in file and overwrite file doesn't work, it empties the file

I would like to run a find and replace on an HTML file through the command line. My command looks …

shell unix sed io-redirection
Redirecting Output from within Batch file

I am creating a batch file with some simple commands to gather information from a system. The batch file contains …

windows batch-file cmd io-redirection
What is /dev/null 2>&1?

I found this piece of code in /etc/cron.daily/apf #!/bin/bash /etc/apf/apf -f >> /dev/…

shell syntax posix io-redirection
How do I use sudo to redirect output to a location I don't have permission to write to?

I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite …

linux permissions sudo io-redirection permission-denied
How to redirect both stdout and stderr to a file

I am running a bash script that creates a log file for the execution of the command I use the …

bash stdout io-redirection stderr
Send string to stdin

Is there a way to effectively do this in bash: /my/bash/script < echo 'This string will be sent …

bash redirect stdin io-redirection