Questions tagged [redirect]

Redirection is the switching of a standard stream of data so that it comes from a source other than its default source or so that it goes to some destination other than its default destination.

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

apache2 redirect going to default domain

I'm trying to redirect all requests for ardsley73.com (or at least www.ardsley73.com) to www.ardsleyhigh73.com. I tried the following rewrite rule in sites-available/ardsley73.conf, but after enabling ...
0 votes
1 answer
82 views

Redirecting issue in firefox browser

I have been using firefox on ubuntu 22 for more than a month and everything was working fine untill 4 days earlier when i first got error relating to security certificate issue and data hijacking. But ...
  • 1
0 votes
1 answer
29 views

Made a weird typo doing a redirect, and the result baffles me

I'm learning bash, and was doing some simple redirect exercises. Intended to type: echo "hello world" > file1 ; easy-peasy, creates a file called "file1" with the text "...
2 votes
2 answers
1k views

How to redirect output to a text file in bash and have it show in the terminal at the same time? [duplicate]

If I use the text re-directors > and >> they output to a text file which is fine for long term logging but, I also need them to be present on screen in the traditional Standard Input, ...
  • 31
0 votes
0 answers
42 views

My Ubuntu 20.04 spits out "logger: socket /dev/log: No such file or directory"

I'm a newbie to Ubuntu. I am trying to run a script that needs access to /dev/log when the following error occurred "logger: socket /dev/log: No such file or directory". Any ideas on how to ...
0 votes
0 answers
18 views

If I redirect a URL to someone else's domain, how can I get Twitter/FB/etc. to recognize the meta info?

So within my .htaccess I redirect a non-existent directory to a 3rd party server in this manner, without a glitch. Redirect 301 /clouds www.ibm.com/cloud/free However, when I paste my link www....
0 votes
0 answers
26 views

One URL redirecting to another on Ubuntu 21.10 impish

So I recently setup a github pages site. When I visit the site at https://example.github.io(Obviously that's not the real url) on my phone(Or any device other than my computer), it works fine. However,...
  • 11
4 votes
1 answer
737 views

How to hide output of first command when using the || operator and exit?

This hides output from the first command, and prints Oops to stderr if it fails. So far, so good. #!/usr/bin/env bash invalid_command > /dev/null 2>&1 || >&2 echo "Oops" ...
  • 2,353
0 votes
0 answers
87 views

New server, aliases file doesn't work, virtual does

So, my question is: Why doesn't postfix simply use /etc/aliases to redirect incoming mail to external email addresses like I'm used to when I used ubuntu 16.04LTS? Follow up question: Is there a ...
  • 1
0 votes
0 answers
26 views

2 domains 1 Ubuntu 2 Spring servers

I have 2 domains reditected (using A record) to one IP where Ubuntu server lives. All incoming requests go to running Spring Boot on port 80 (which works now). But I would like to run 2 Spring Boot ...
3 votes
2 answers
609 views

How to append date and text to a file as an alias?

I want to create an alias to append a dated note to a file. (The use case I want to reproduce : Sebastian Daschner - How to do effective note taking as developer. So far I was able to append the date, ...
1 vote
1 answer
208 views

Create user home directory on a network share

I have Ubuntu 20.04 machine that I'm preparing for VDI environment. All the VDI VMs will be joined to our domain. By default, each user's Home Directory is created locally. On my NetApp storage I have ...
1 vote
1 answer
439 views

How to redirect the output from desktop-entry

I have a program called prg.exe written in C#. I want to run this program in mono with an argument (arg1) and redirect the output to a log file called log.txt. If I open a terminal and enter the ...
  • 13
-2 votes
2 answers
314 views

Redirect output with '>&!'

I know that >& means redirect stderr to stdout. But I don't know the meaning of >&!, I tried following command but it seems like normal. Example: cat xxx.txt >&! xxx.output My ...
0 votes
0 answers
221 views

Can I provide meta tags within .htaccess on a 301 redirect?

I have a specific directory on my server: www.example.com/myfavrockgroup Within .htaccess of my server I am doing a 301 redirect: Redirect 301 /myfavrockgroup https://en.wikipedia.org/wiki/The_Go-Go%...
0 votes
1 answer
50 views

Mount / Link non-existent volume directory to a directory

Recently I've removed a volume, /volume2 and moved all the folders to /volume1 but many programs are still looking for files under /volume2 I want to redirect all /volume2 requests to /volume1 I've ...
  • 3
0 votes
1 answer
766 views

Redirects to a website do not complete

Ubantu 20.04 LTS I have set up this server to replace a very old Mac OS server that will not serve a current version of TLS. While I was using Apache on the Mac, the version on the Ubantu requires ...
0 votes
1 answer
91 views

Help me understand this redirection and the read built-in?

I have a backup script which I'm asking now to (offer to) call a git pull script before actually running the syncs (when run interactively). The syncs are done thusly: rsync aiSP --delete The ...
  • 143
0 votes
0 answers
650 views

command history

Which is the most correct answer for this question: Write a one-line command that searches the last 50 commands that have been used for the term "find", and saves the result in history.txt ...
  • 1
1 vote
0 answers
198 views

Redirect Not Working On PHP Extensions

I've just added a load of 301 Redirects and they all work apart from those that include a PHP extension. For example, /gallery/ redirects fine and so does /brochure.pdf but /sitemap.php or any other ...
2 votes
1 answer
189 views

Why is the file being emptied during input/output redirection to the same file?

This might look like a very simple question but I haven't been able to come up with a proper explanation so far. Say I use tr to transform some random text(it can be any program) and want to output ...
  • 262
0 votes
1 answer
189 views

top command till a process runs out

I'm running a process and I want to store its CPU usage. So I used top command { test_case.sh > out.log ; } && { sleep 2s ; x=`pidof test_case` ; top -p $x -d 5 -b > cpu.log ; } But the ...
0 votes
1 answer
864 views

Redirect all requests to https://www. using Apache on Ubuntu 18.04

I'm using Ubuntu 18.04 with Apache. I have the following in /etc/apache2/sites-available/000-default.conf: <VirtualHost *:80> RewriteEngine On RewriteCond %{SERVER_NAME} =www.example.com ...
  • 131
0 votes
1 answer
244 views

Command output is not redirected to file

I want to execute the following command, which is related to Rational ClearCase. The output of this command should be redirected to the file testout. Command rgy_check -vobs > testout Output ...
4 votes
1 answer
2k views

How to get both the output of the time command in a file?

I ran the command time echo "Hello world" | tee output.txt expecting to get the full output to both terminal stdout and the output.txt file. However, the file content is not what I expect : ...
1 vote
1 answer
415 views

How can I redirect sox messages to null or a log file

I run the following command to capture the output of audio into a file: $ sox -t pulseaudio alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -t mp3 test.mp3 silence 1 0.1 3% 1 3.0 3% > /dev/null ...
  • 552
3 votes
1 answer
1k views

How to completely suppress output of a command?

I want this command to work silently, echo "any_password" | sudo -S true I tried redirecting the output of stdout and stderr to /dev/null. When I provide the correct password it works as ...
0 votes
1 answer
84 views

How does redirecting a command output to a file deals with opening and closing that file?

If we redirect a command such as sar -r 1> a_file.txt how does this works with opening, writing the output of the command and closing the file? In other words, how does redirecting a command ...
0 votes
1 answer
635 views

/etc/hosts block or redirect domain

I tried blocking domains like this: 127.0.0.1 https://facebook.com 127.0.0.1 https://www.facebook.com But FB open correctly. How can I block or redirect websites on this file?
1 vote
1 answer
301 views

Unable to redirect from http to https

Im sure this question got answered above a hundred times (cause i nearly have read them all), but i cant get my apache2 redirection working. Im a total beginner regarding everything on linux and im ...
0 votes
1 answer
526 views

Command that writes to both stdout and stderr

We're doing workshops for internships where we explain the Bash. One topic is redirection, because it's quite important. So far we explained > and 2> independent from each other. Our examples ...
1 vote
1 answer
544 views

Failing to Redirect Output to File

I want to redirect output from "time" to a file. However, my attempts to redirect stdout, stderr, or both, are not working. For example, when I use: time python process-column.py 2>/tmp/times....
  • 111
1 vote
1 answer
128 views

Declaring stdout as stder

$ cat x cat: x: No such file or directory $ cat y This is y. $ cat x y 1> hold 2>&1 cat: x: No such file or directory This is y. Why stder got redirected to hold as well? stder got declared ...
  • 1,516
0 votes
2 answers
127 views

htaccess redirect problem

So, Say I have my shopping cart at foo.com/a I want to redirect shoppers to foo.com/b At foo.com my .htaccess contains RedirectMatch 302 ^/(index\.html)?$ foo.com/b But people still land on foo....
  • 131
1 vote
1 answer
159 views

here strings versus input redirection

The following example is taken from William Shott's The Linux command line. It is a shell script which gathers user info from the /etc/passwd file. The specific user for which this is done is read ...
30 votes
5 answers
12k views

What is the difference between "cat < filename" and "cat filename"?

The simplest way to display file contents is using the cat command: cat file.txt I can get the same result using input redirection: cat < file.txt Then, what is the difference between them?
  • 1,775
0 votes
0 answers
3k views

Redirect program ouput to screen and file simultaneously

I have a Python script. I want to save its result while it outputs something in the terminal. I tried python program.py 2>&1 | tee output.txt However, it seems only after the program finishes, ...
1 vote
0 answers
25 views

Redirect output to file returns permission denied [duplicate]

I'm trying to add some files from a file to another but at time to redirecting output the terminal returns me a message of "Denied permission" and I don't know where I should put sudo. I tried with ...
18 votes
3 answers
28k views

What does >&2 mean in a shell script?

I am doing my homework and I have a question about one line. I don't understand what this >&2 means: if test -d $2 then echo "$2: Is directory" >&2 ; exit 21 fi
0 votes
0 answers
53 views

Whats the difference between 0> and > redirections?

I cant redirect the output of a particular program using > , but it works if i use 0> , e.g ./foo > ouput.txt ./foo 0> output.txt this program writes to the standard using the C ...
's user avatar
1 vote
1 answer
2k views

How to redirect a command's output to file, when the command is via a wrapper's system call?

I want to redirect both output and stderr to a log file. Easy enough, right? python3 /home/user/Utilities/gpu.py L1.py &> log_L1.py.txt & However, when instead of calling the command ...
  • 113
1 vote
0 answers
118 views

Permanent redirect on Ubuntu for Mosquitto bidirectional MQTT traffic

I need to permanently redirect all traffic in the short term from an old mosquitto server to a new one until the firmware updates have been completed on the edge devices. I tried using iptables as ...
0 votes
1 answer
2k views

Redirection cannot open for reading

I ran the following command and I am not able to understand why I am getting this error : tail /var/log/fontconfig.log 1 >> /home/myuser/b.log tail: cannot open '1' for reading: No such file or ...
  • 167
16 votes
3 answers
5k views

How to pass 2>/dev/null as a variable?

I have this code that works: # Hide irrelevant errors so chrome doesn't email us in cron if [[ $fCron == true ]] ; then google-chrome --headless --disable-gpu --dump-dom \ "$RobWebAddress"...
1 vote
3 answers
98 views

understanding bash redirection using > char

I am learning bash and am not able to understand what is going wrong with the output redirection in the following example: I have a file called myfile.txt with the following content. Practice makes ...
1 vote
1 answer
886 views

How do I select a USB drive folder for an application output?

I'm attempting to install a new app on an Ubuntu 18.04 system. I want to redirect the files outputted to a USB drive, rather than on my SSD. eg: /var/snap/sabnzbd/common/Downloads/incomplete to ...
15 votes
5 answers
3k views

Shorten or merge multiple lines of `&> /dev/null &`

Every time starting the machine, I run the following program: $ cat start.sh #! /bin/bash google-chrome &> /dev/null & lantern &> /dev/null & xdg-open . &> /dev/null &...
  • 2,541
3 votes
3 answers
2k views

How do I suppress GtkDialog warnings in zenity and yad using Bash redirection in a script?

I'm trying to suppress GtkDialog warnings in zenity and yad: $ zenity --error --text hello Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. Error redirection and ...
0 votes
0 answers
419 views

Reset debug/verbose mode logging in bash script

I use a cronjob as root to check via lsof if some remote machines have established an ssh tunnel to the main server (root, otherwise lsof and netstat won't show the username and sshd pid). Then for ...
  • 1
0 votes
0 answers
3k views

How to prevent 'Bad Request' error while opening HTTP address on a Apache server with SSL (with non-default port)?

as you may know if you configure apache2 with SSL (non-default port) and open it with 'HTTP' address you will get this error: https://[ip-address]:20443 --> http://[ip-address]:20443 Bad Request ...
  • 118

1
2 3 4 5