Monday, June 7, 2021

Sunday, May 2, 2021

How to find the executable path of a php,mysql program? - Try which and whereis

You may want to find out where the executable is installed or is being executed from

which php

/usr/php


which mysql

/usr/local/mysql/bin/mysql

 

Alternative command for the same results as above.

whereis php

whereis mysql

echo "">access_log How to clear a log file without deleting it?

 Do you want to debug a file and realize it has too much of content in it.

Let's say the file name is access_log.

just say echo "">access_log.

This will replace the content with the blank file.

Now your file is ready to starting logging data from now :-).

Note: Please use this at your own discretion. This is just a workaround.

How to define a temporary variable in mac Terminal

How to define a temporary variable in mac Terminal?
 

Example1: Lets say I want to store company Name into a temporary variable in a terminal and display it.

export companyName="GGHL"
echo $companyName
GGHL

 

Example2: Display machine name path

export myhomedir=/Userss/${USER}
echo $myhomedir
/Users/username