I suggest that you read the documentation on the GRASS Wiki page. There are several steps needed to set up the GRASS environment. My answer will mostly be some copy/paste of this page in order to avoid a "link only" answer.
# Example in bash shell syntax:
# path to GRASS binaries and libraries:
export GISBASE=/usr/lib64/grass78
export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib
# set PYTHONPATH to include the GRASS Python lib
if [ ! "$PYTHONPATH" ] ; then
PYTHONPATH="$GISBASE/etc/python"
else
PYTHONPATH="$GISBASE/etc/python:$PYTHONPATH"
fi
export PYTHONPATH
# use process ID (PID) as lock file number:
export GIS_LOCK=$$
# settings for graphical output to PNG file (optional)
export GRASS_PNGFILE=/tmp/grass6output.png
export GRASS_TRUECOLOR=TRUE
export GRASS_WIDTH=900
export GRASS_HEIGHT=1200
export GRASS_PNG_COMPRESSION=1
export GRASS_MESSAGE_FORMAT=plain
In addition, you must also define a grass session.
# path to GRASS settings file
export GISRC=$HOME/.grassrc7
Then you can start with some command lines (e.g. adding new column to mydata)
v.db.addcol mydata="new_col DOUBLE PRECISION"