How to find the last field using ‘cut’

You could try something like this: echo ‘maps.google.com’ | rev | cut -d’.’ -f 1 | rev Explanation rev reverses “maps.google.com” to be moc.elgoog.spam cut uses dot (ie ‘.’) as the delimiter, and chooses the first field, which is moc lastly, we reverse it again to get com

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)