To run a free command or date command with ssh:
$ ssh vyga@ucartz.com date
Sample outputs:
Tue Dec 26 09:02:50 UTC 2017
Understanding bash shall and command types
The bash shell understands the following types of commands:
- Aliases such as ll
- Keywords such as if
- Functions (user-defined functions such as genpasswd)
- Built in such as pwd
- Files such as /bin/date
Bash aliases not running or working over ssh client on Unix based system
To solve this problem run ssh command as follows:
$ ssh -t user@remote /bin/bash -ic 'your-alias-here'
$ ssh -t user@remote /bin/bash -ic 'file_repl'
In short run the following command to run bash alias called ll:
$ ssh -t vyga@ucartz.com -ic 'll'