Ist es möglich, einen einfachen Inline-SSH-Befehl auszuführen, zum Beispiel:
ssh foo@bar.com { cd foo/bar && rm *.foobar }
Ist es möglich, einen einfachen Inline-SSH-Befehl auszuführen, zum Beispiel:
ssh foo@bar.com { cd foo/bar && rm *.foobar }
Antworten:
Wenn Sie cd foo/bar && rm *.foobarauf dem entfernten Computer ausführen möchten , tun Sie dies einfach
ssh foo@bar.com 'cd foo/bar && rm *.foobar'
und sehen man ssh...
ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D
[bind_address:]port] [-e escape_char] [-F configfile]
[-i identity_file] [-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R
[bind_address:]port:host:hostport] [-S ctl_path] [-w tunnel:tunnel
[user@]hostname [command]
Die Teile, die Sie wollen:
ssh [user@]hostname [command]