ls() Netscript Function

ls(hostname[, grep])
RAM cost:

0.2 GB

Arguments:
  • hostname (string) – Hostname of the target server.
  • grep (string) – a substring to search for in the filename.
Returns:

String array of all files in alphabetical order.

Example:

ls("home"); // returns: ["demo.script", "msg1.txt"]