Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux get url after redirections

curl -Ls -o /dev/null -w %{url_effective} http://google.com
# http://www.google.com/

# We pass in http://google.com, but the URL redirects to http://www.google.com/. Let’s break down the command.
# The -L option tells the curl command to follow the URL redirections. The -s option is for silent mode, which means the command should not output anything to the terminal, while the -o option provides the path that it should send the output to instead of sending it to stdout. In the case above, we’re sending the output to /dev/null.
# The -w option writes out information after the transfer is complete. Moreover, this option has a lot of variables that are set with values and information from the data transfer. The %{url_effective} variable displays the URL that was fetched last. Since we’ve provided the –L option to follow redirections, it’ll give us the final URL.
Comment

PREVIOUS NEXT
Code Example
Shell :: change default directory of the server 
Shell :: -bash: jupyter: command not found linux 
Shell :: Live Share not doing anything on linux ubuntu 20.04 
Shell :: docker no space left on device 
Shell :: install angular cdk 
Shell :: move hidden files linux 
Shell :: open cmd with size 
Shell :: git rename remote 
Shell :: node_modules not being ignored git 
Shell :: create r anaconda environment 
Shell :: .env in gitignore 
Shell :: wget typo3 9 
Shell :: how to open running docker container 
Shell :: cmd kill process on port 
Shell :: list of unmerged branches 
Shell :: git remove current pull 
Shell :: alpine linux free port 
Shell :: windows port permission denied 
Shell :: ubuntu installing gimp 
Shell :: how to recover from git stash 
Shell :: how to install haxeflixel 
Shell :: add public key to server 
Shell :: alpine install psql 
Shell :: cassandra get table size 
Shell :: rmazenamento de chaves JKS usa um formato proprietário. É recomendada a migração para PKCS12, que é um formato de padrão industrial 
Shell :: how to install data purifer 
Shell :: how to check prime number in shell script 
Shell :: check directory size linux 
Shell :: how to install firefox in kali linux 
Shell :: eslint npm install 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =