bitburner-src/markdown/bitburner.ns.ls.md

32 lines
748 B
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [ls](./bitburner.ns.ls.md)
## NS.ls() method
Returns an array with the filenames of all files on the specified server (as strings). The returned array is sorted in alphabetic order.
<b>Signature:</b>
```typescript
2021-10-30 21:46:34 +02:00
ls(host: string, grep?: string): string[];
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-10-30 21:46:34 +02:00
| host | string | Host or IP of the target server. |
2021-10-30 18:34:14 +02:00
| grep | string | A substring to search for in the filename. |
<b>Returns:</b>
string\[\]
Array with the filenames of all files on the specified server.
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 0.2 GB
2021-10-30 18:34:14 +02:00