Q:

how to ssh to the remote path?

I have a folder in ~/apps/ and another one in the root /apps/
I want to ssh to them
ssh user@abc.com:~/apps/

and
ssh user@abc.com:/apps/ 

I got the following error:

Could not resolve hostname

What did I do wrong?

A:

ssh user@server -t "cd /some/directory; bash --login"

-t keeps up the connection if there is user interaction)
the "command" is in quotes
bash --login is required to keep up the connection after the cd (see -t)

A:

I think you are mixing scp and ssh
For ssh you do not need to specify the destination path. You just log in as user@host.com and you land into the user's home folder.

A:

SSH expects the following syntax:
ssh [other_options] [user@]hostname [command]

so when you typed:
ssh user@abc.com:~/apps/

SSH understood that you want to connect to a host named "abc.com:~/apps/" with a user "user". Since that host does not exist, you receive the error you quoted. 
You will have to break your command into two like this:
ssh user@abc.com
(type the password, and wait for ssh to log you in)
cd ~/apps/

