mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
18 lines
510 B
ReStructuredText
18 lines
510 B
ReStructuredText
ls() Netscript Function
|
|
=======================
|
|
|
|
.. js:function:: ls(hostname[, grep])
|
|
|
|
:RAM cost: 0.2 GB
|
|
:param string hostname: Hostname of the target server.
|
|
:param string grep: a substring to search for in the filename.
|
|
:returns: String array of all files in alphabetical order.
|
|
|
|
Example:
|
|
|
|
.. code-block:: javascript
|
|
|
|
ns.ls("home"); // returns: ["demo.js", "msg1.txt"]
|
|
ns.ls("home", ".txt"); // returns: ["msg1.txt"]
|
|
ns.ls("home", ".script"); // returns: []
|