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
23 views

Pipe to grep to directional operator (to file)

What works: any of these three: ping 8.8.8.8 | grep 3 // this will steadily output any ping with the number 3 somewhere in the line to the terminal ping 8.8.8.8 > fileping //this will silently add ...
loonquawl's user avatar
  • 101
0 votes
1 answer
49 views

Configure Apace for HTTP and HTTPS with redirect secured by lets encrypt

While I have used Linux in the past I am not very knowledgeable with it. I have installed Apace on Ubuntu Server. I created a virtual host with Apace. All of this went ok. I am able to pull up the ...
amd.64's user avatar
  • 28
0 votes
1 answer
40 views

Why can I write to /dev/ttys010 using `>` but not `|` [duplicate]

I am trying to play around and understanding ttys. In one terminal emulator window, the output of tty gives me $ tty /dev/ttys010 So I figured if I write to this device, the terminal window will show ...
michael_fortunato's user avatar
0 votes
0 answers
27 views

weird apache2/domain redirect

I got a few domains pointing to my ubuntu 20.04.6 server via a record. I am using apache2 with virtual hosts for all the domains, it always worked great. But since today i got some weird redirects ...
DerRene's user avatar
2 votes
1 answer
237 views

How do I stop a job in the background from outputing to the terminal? [duplicate]

I ran make in the terminal for Kismet on my Pi and it's been outputting to the terminal every 10 to 15 seconds, regardless of it is being run in the background or not. I tried using CTRL+Z and running ...
themaddmaverick's user avatar
0 votes
1 answer
1k views

nginx: [warn] server name has suspicious symbols with long domain redirect

What is the best way in Nginx to redirect two Long domains URLS, I would like to configure a redirect between two domains like this: I'm sure this has been asked before, but I can't find a solution ...
Santosh Baruah's user avatar
0 votes
1 answer
2k views

Rewrite Rule not working in .htaccess file Ubuntu 22.04

I've created a .htaccess file for my site running on my own server, Apache Ubuntu 22.04, where everything works fine except for Rewrite Rule. I definitely have mod_rewrite turned on as when I created ...
Joe Brown's user avatar
0 votes
1 answer
691 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 ...
Mark Olbert's user avatar
-1 votes
1 answer
312 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 ...
Trapti's user avatar
  • 1
0 votes
1 answer
32 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 "...
mintubuntu's user avatar
2 votes
2 answers
12k 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, ...
Michael's user avatar
  • 51
0 votes
0 answers
211 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 ...
Charles's user avatar
0 votes
0 answers
20 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....
Bartender1382's user avatar
0 votes
0 answers
39 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,...
Nick's user avatar
  • 11
5 votes
1 answer
2k 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" ...
cocomac's user avatar
  • 3,063
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 ...
Andreisk's user avatar
3 votes
2 answers
1k 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, ...
Marc Bouvier's user avatar
1 vote
1 answer
488 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 ...
Maor Zohar's user avatar
1 vote
1 answer
837 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 ...
Viorel's user avatar
  • 13
-2 votes
2 answers
2k 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 ...
code_worker's user avatar
0 votes
0 answers
283 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%...
Daniel Kaplan's user avatar
0 votes
1 answer
112 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 ...
klau's user avatar
  • 3
0 votes
1 answer
1k 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 ...
intrrnet's user avatar
0 votes
1 answer
128 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 ...
JamesIsIn's user avatar
  • 152
0 votes
0 answers
1k 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 ...
Riad B's user avatar
  • 1
1 vote
0 answers
244 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 ...
Kirk Johnston's user avatar
2 votes
1 answer
337 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 ...
Alex.Kh's user avatar
  • 262
0 votes
1 answer
226 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 ...
Avinash Baldi's user avatar
0 votes
1 answer
1k 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 ...
David's user avatar
  • 153
0 votes
1 answer
592 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 ...
andy meissner's user avatar
6 votes
1 answer
3k 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 : ...
Ahmed Hussein's user avatar
1 vote
1 answer
620 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 ...
Ahmad's user avatar
  • 612
3 votes
1 answer
2k 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 ...
Akash Karnatak's user avatar
0 votes
1 answer
206 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 ...
KansaiRobot's user avatar
0 votes
1 answer
980 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?
Konfus2234's user avatar
1 vote
1 answer
614 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 ...
devdittmer's user avatar
0 votes
1 answer
711 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 ...
Thomas Weller's user avatar
1 vote
1 answer
780 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....
John's user avatar
  • 111
1 vote
1 answer
142 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 ...
Josef Klimuk's user avatar
  • 1,566
0 votes
2 answers
135 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....
Monkeybus's user avatar
  • 131
1 vote
1 answer
245 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 ...
An Ignorant Wanderer's user avatar
30 votes
5 answers
14k 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?
BlueSkies's user avatar
  • 2,045
0 votes
1 answer
4k 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, ...
Qinsheng Zhang's user avatar
1 vote
0 answers
26 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 ...
Noelia Sancho Mendez's user avatar
27 votes
3 answers
44k 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
Daschok770's user avatar
0 votes
0 answers
55 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 ...
user avatar
1 vote
1 answer
3k 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 ...
Lafayette's user avatar
  • 113
1 vote
0 answers
140 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 ...
johnrscott's user avatar
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 ...
Number945's user avatar
  • 167
16 votes
3 answers
6k 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"...
WinEunuuchs2Unix's user avatar

1
2 3 4 5