Use full Linux commands

Here are some of Linux usefull general commands

View all Environment variables

env command can be used to view all enviroment variable and its value for current logged user via terminal.

ubuntu@ip-xx-xx-xx-xx:~/maven/JavaProj$ env
SSH_CLIENT= 54904 22

Set Environment Variables on Linux

You can modify each environmental or system variable using the export command. Set the PATH environment variable to include the directory where you installed the bin directory with perl and shell scripts:

export ANT_HOME=/path/to/ant/dir
export PATH=${PATH}:${ANT_HOME}/bin:${JAVA_HOME}/bin

Above command will set value for variable ANT_HOME and append it to PATH

Unset a environment variable

Enviroment variable can be removed from current user environment dynamically without any reboot and affecting other user or same user any other environment using unset command as follows

unset ANT_HOME

Above command remove the ANT_HOME variable and it's value from current user enviroment without affecting same user other enviroment.

View verbose output for git command

Normal git command will not show the output of communication performed with GIT server while executing clone/pull/push command. To view the output of full culr response header value, we need to set the verbose output as true while executing every git command as follows.

GIT_CURL_VERBOSE=1 git clone

command will output the request and response for curl command performand by git command.

ubuntu@ip-xxx-xx-xx-xxx:~/maven/JavaProj$ GIT_CURL_VERBOSE=1 git pull
* Couldn't find host in the .netrc file; using defaults
*   Trying
* Connected to ( port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 596 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_CBC_SHA1
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject:
*        start date: Thu, 14 Dec 2017 00:00:00 GMT
*        expire date: Fri, 14 Dec 2018 12:00:00 GMT
*        issuer: C=US,O=Amazon,OU=Server CA 1B,CN=Amazon
*        compression: NULL
* ALPN, server did not agree to a protocol
> GET /v1/repos/PHPWordPress/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/2.7.4
Accept: */*
Accept-Encoding: gzip
Accept-Language: en-US, *;q=0.9
Pragma: no-cache
< HTTP/1.1 401 Unauthorized



Tags: GIT, CURL, Env, Export