github.com/adityamillind98/nomad@v0.11.8/website/pages/docs/commands/alloc/fs.mdx (about) 1 --- 2 layout: docs 3 page_title: 'Commands: alloc fs' 4 sidebar_title: fs 5 description: | 6 Introspect an allocation directory on a Nomad client 7 --- 8 9 # Command: alloc fs 10 11 **Alias: `nomad fs`** 12 13 The `alloc fs` command allows a user to navigate an allocation directory on a Nomad 14 client. The following functionalities are available - `cat`, `tail`, `ls` and 15 `stat`. 16 17 - `cat`: If the target path is a file, Nomad will `cat` the file. 18 19 - `tail`: If the target path is a file and `-tail` flag is specified, Nomad will 20 `tail` the file. 21 22 - `ls`: If the target path is a directory, Nomad displays the name of a file and 23 directories and their associated information. 24 25 - `stat`: If the `-stat` flag is used, Nomad will display information about a 26 file. 27 28 ## Usage 29 30 ```plaintext 31 nomad alloc fs [options] <allocation> <path> 32 ``` 33 34 This command accepts a single allocation ID (unless the `-job` flag is 35 specified, in which case an allocation is chosen from the given job) and a path. 36 The path is relative to the root of the allocation directory. The path is 37 optional and it defaults to `/` of the allocation directory. 38 39 ## General Options 40 41 @include 'general_options.mdx' 42 43 ## Fs Options 44 45 - `-H`: Machine friendly output. 46 47 - `-verbose`: Display verbose output. 48 49 - `-job`: Use a random allocation from the specified job, preferring a running 50 allocation. 51 52 - `-stat`: Show stat information instead of displaying the file, or listing the 53 directory. 54 55 - `-f`: Causes the output to not stop when the end of the file is reached, but 56 rather to wait for additional output. 57 58 - `-tail`: Show the files contents with offsets relative to the end of the file. 59 If no offset is given, -n is defaulted to 10. 60 61 - `-n`: Sets the tail location in best-efforted number of lines relative to the 62 end of the file. 63 64 - `-c`: Sets the tail location in number of bytes relative to the end of the file. 65 66 ## Examples 67 68 ```shell-session 69 $ nomad alloc fs eb17e557 70 Mode Size Modified Time Name 71 drwxrwxr-x 4096 28 Jan 16 05:39 UTC alloc/ 72 drwxrwxr-x 4096 28 Jan 16 05:39 UTC redis/ 73 -rw-rw-r-- 0 28 Jan 16 05:39 UTC redis_exit_status 74 75 76 $ nomad alloc fs eb17e557 redis/local 77 Mode Size Modified Time Name 78 -rw-rw-rw- 0 28 Jan 16 05:39 UTC redis.stderr 79 -rw-rw-rw- 17 28 Jan 16 05:39 UTC redis.stdout 80 81 82 $ nomad alloc fs -stat eb17e557 redis/local/redis.stdout 83 Mode Size Modified Time Name 84 -rw-rw-rw- 17 28 Jan 16 05:39 UTC redis.stdout 85 86 87 $ nomad alloc fs eb17e557 redis/local/redis.stdout 88 foobar 89 baz 90 91 $ nomad alloc fs -tail -f -n 3 eb17e557 redis/local/redis.stdout 92 foobar 93 baz 94 bam 95 <blocking> 96 ``` 97 98 ## Using Job ID instead of Allocation ID 99 100 Setting the `-job` flag causes a random allocation of the specified job to be 101 selected. Nomad will prefer to select a running allocation ID for the job, but 102 if no running allocations for the job are found, Nomad will use a dead 103 allocation. 104 105 ```plaintext 106 nomad alloc fs -job <job-id> <path> 107 ``` 108 109 This can be useful for debugging a job that has multiple allocations, and it is 110 not required to observe a specific allocation.