2022-10-21 17:16:00 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home ](./index.md ) > [bitburner ](./bitburner.md ) > [NS ](./bitburner.ns.md ) > [tail ](./bitburner.ns.tail.md )
## NS.tail() method
Open the tail window of a script.
2023-02-11 19:18:50 +01:00
**Signature:**
2022-10-21 17:16:00 +02:00
```typescript
2024-04-24 02:21:05 +02:00
tail(fn?: FilenameOrPID, host?: string, ...args: ScriptArg[]): void;
2022-10-21 17:16:00 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2023-02-11 19:18:50 +01:00
| fn | [FilenameOrPID ](./bitburner.filenameorpid.md ) | _(Optional)_ Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed. |
| host | string | _(Optional)_ Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional. |
2024-04-24 02:21:05 +02:00
| args | [ScriptArg ](./bitburner.scriptarg.md )<!-- --> \[\] | Arguments for the script being tailed. |
2022-10-21 17:16:00 +02:00
2023-02-11 19:18:50 +01:00
**Returns:**
2022-10-21 17:16:00 +02:00
void
## Remarks
RAM cost: 0 GB
Opens a script’ s logs. This is functionally the same as the tail Terminal command.
If the function is called with no arguments, it will open the current script’ s logs.
2023-08-28 20:49:37 +02:00
Otherwise, the PID or filename, hostname/ip, and args… arguments can be used to get the logs from another script. Remember that scripts are uniquely identified by both their names and arguments.
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
## Example
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
```js
//Open logs from foo.js on the current server that was run with no args
ns.tail("foo.js");
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
//Get logs from foo.js on the foodnstuff server that was run with no args
ns.tail("foo.js", "foodnstuff");
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
//Get logs from foo.js on the foodnstuff server that was run with the arguments [1, "test"]
ns.tail("foo.js", "foodnstuff", 1, "test");
2022-10-21 17:16:00 +02:00
```