I have a remote host accessing via tramp there is a list of directori names I'd like to find on that host.

What I do now - connect to remote server and

while read -r name; do find / -type d -name "$name"; done < dir_names | tee dir_paths

  • Here is an example where the port is 2222 and the shell/eshell function can be (shell) or (eshell); e.g., replace <call your shell/eshell functions> with one of the previous functions: (let ((default-directory "/ssh:username@ip-address#2222:")) <call your shell/eshell functions>). That will open up a shell of your choice within Emacs and you can run command-line stuff from there. – lawlist Aug 29 '18 at 17:00
  • Building on @lawlist ‘s answer, you can set the ‘default-directory’ as he indicates, then ‘(shell-command (format (“while read ... -name %s; done” (list-of-names)))’ Now you just need to implement ‘(list-of-names)’ that reads a file dir_names and produces a list of names in the format the shell expects. – InHarmsWay Aug 30 '18 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.