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
3
votes
2answers
162 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, ...
2
votes
1answer
39 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 ...
0
votes
1answer
65 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 ...
-2
votes
2answers
59 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
0answers
24 views

Why am I redirected /admin/install/install.php?

Even though I am the admin and I have installed this PHP script on Ubuntu 20.04.2. It redirects me to the above-mentioned URL. The website's interface does not open. I need help!
0
votes
0answers
96 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
0answers
28 views

redirecting to admin/install/install.php on vps not on wordpress

I needed some help after getting full access of site Maintenance Settings Control panel it is still redirecting to admin/install/install.php why is that
0
votes
1answer
38 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 ...
0
votes
1answer
401 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
1answer
63 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 ...
0
votes
0answers
24 views

ufw / iptables need help

Can anybody help me with configuring ufw / iptables ... I have two interfaces on ubuntu server. LAN IP: 192.168.1.2 tun0 (OpenVPN) IP: 10.5.0.1 and openVPN client IP: 10.5.0.2 I would like to ...
0
votes
0answers
228 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 ...
0
votes
0answers
14 views

Cancelling redirection of microphone to speakers

I have used the following command in the System Terminal: pactl load-module module-loopback latency_msec=1 It has redirected the microphone into the speakers. I want to restore back to original state ...
1
vote
0answers
160 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 ...
0
votes
0answers
95 views

Extension to Redirect URL's to Open a custom URI in Chromium

I have set up a custom handler that opens applications. For example, using app://gnome-terminal would open my terminal. But, what I mainly would use this for is opening WebApps that I made with ...
1
vote
1answer
65 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 ...
0
votes
1answer
126 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
1answer
614 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 ...
0
votes
1answer
62 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 ...
1
vote
1answer
403 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
1answer
213 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 ...
3
votes
1answer
386 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
1answer
47 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
1answer
228 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
1answer
86 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
1answer
279 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
1answer
311 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....
1
vote
1answer
112 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 ...
0
votes
2answers
119 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....
1
vote
1answer
83 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 ...
29
votes
5answers
10k 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?
0
votes
0answers
2k 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 try python program.py 2>&1 | tee output.txt It seems only after the program finish, it will ...
1
vote
0answers
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 ...
9
votes
3answers
13k 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
0answers
48 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 ...
1
vote
1answer
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 ...
1
vote
0answers
100 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
1answer
1k 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 ...
16
votes
3answers
4k 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
3answers
89 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
1answer
830 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
5answers
2k 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 &...
3
votes
3answers
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
0answers
273 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 ...
0
votes
0answers
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 ...
0
votes
0answers
658 views

Redirecting input from a file with youtube-dl

I am trying to redirect input from a file in which some youtube links are stored, I am using given below command to download those videos.. youtube-dl < link_file.txt but above command gives an ...
1
vote
1answer
1k views

Bash: sudo -S <<< "mypassword" - interactive shell issue

I'm trying to use sudo with -S to issue the password via command line. $ sudo -S <<< "mypassword" command This works, but it doesn't allow for interactive commands. Like nano for example: $...
2
votes
1answer
822 views

how input redirection works?

On my understanding, any command that reads from standard input (i.e keyboard), that it gets its input from a file. $echo < text_content.txt $ But echo command does not read and display the ...
0
votes
0answers
23 views

Why do I get different output from the same commands? (redirect and piping) [duplicate]

So I'm learning to use the CLI and I'm playing around with redirecting and piping and then I get different output from executing the same commands. Basically I'm listing all executables from /bin/ ...
1
vote
1answer
2k views

How to redirect in local domain web site www.mydomain.com/website to www.mydomain.com

I have install simple web service (MediaWiki) in my local server. In my DSN server I have set IP address to this webserver, so now when I call in browser (this works only in my domain IP range) www....

1
2 3 4 5