[Question]
  [
Inspired by [this question](https://askubuntu.com/questions/600018/how-to-display-the-paths-in-path-separately) on AskUbuntu.
Your job is extremely simple. Take the PATH environment variable (`echo $PATH`) and export it such that each entry (separated by the `:` character) is on its own line.
For example, if the PATH is `/bin:/usr/bin:/usr/local/bin`, your program should output:
```
/bin
/usr/bin
/usr/local/bin
```
Your program may not return a leading newline, but it may return a single trailing newline. You do not need to check if the PATH is right, or that the directory exists. Your program should take no input, meaning that your program is responsible for getting the PATH itself. You may safely assume that objects in the PATH do not contain `:` or newlines. However, spaces are fair game.
Reference implementations are present in the answers to the question above.
### Rules
* This is (obviously) code-golf, so the shortest answer will win the prized green checkmark.
* The accepted answer will be tested to make sure it's actually legit.
* Both Windows and \*nix entries are accepted.
	+ However, if you don't explicitly specify Windows, I will try running it in Linux and fail. (If it's obvious (hi, Batch!), you don't need to specify explicitly.)
* Only have one solution per answer. If you have both a Windows and \*nix version, I will count the shorter one.
* If two answers have the same length, I will give priority to the one with the higher vote total. If they have the same vote total, I will count the older one. If the time posted is the same, I will choose the one that executes faster. If they execute in the same amount of time, I don't know.
### Leaderboard
```
var QUESTION_ID=96334,OVERRIDE_USER=15422;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
# Z shell (zsh), 13 bytes
```
<<<${(F)path}
```
Uses the [`$path` parameter](http://zsh.sourceforge.net/Doc/Release/Parameters.html#Parameters-Used-By-The-Shell), which is a special array parameter used by the shell that is [tied](http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html#index-typeset) to the `$PATH` parameter, and a [parameter expansion flag](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags) to join an array with newlines.
[Answer]
## Bash/Coreutils, ~~17~~ 16 bytes
```
tr : '
'<<<$PATH
```
[Answer]
## Batch, 41 bytes
```
@for %%a in ("%PATH:;=";"%")do @echo %%~a
```
`PATH` is semicolon-delimited on Windows of course. Conveniently, `for` splits on semicolons by default, but inconveniently, also on spaces, so I have to use string replace trickery to quote each path element before splitting. It then remains to remove the quotes afterwards.
[Answer]
# Z shell (zsh), 15 bytes
```
<<<${PATH//:/
}
```
You can test the code on [Anarchy Golf](http://golf.shinh.org/check.rb): click *use form*, select *zsh*, paste the code and submit.
## Bash (pure), 19 bytes
```
echo "${PATH//:/
}"
```
Same idea, but with Bash's less golfy syntax. Test it on [Ideone](http://ideone.com/ri1lrX).
[Answer]
# Powershell, 20 bytes
```
$env:PATH-split':'
```
Edit:
* ***-2** bytes off. Thanks to @TimmyD*
Old:
```
$env:PATH.split(":")
```
[Answer]
# Ruby, 25 bytes
```
puts ENV["PATH"].split":"
```
[Answer]
## Perl, 22 bytes
```
say$ENV{PATH}=~y/:/
/r
```
Needs `-E` or `-M5.010` to run :
```
perl -E 'say$ENV{PATH}=~y/:/
/r'
```
[Answer]
### Bash+Python, 43 bytes
Let's use shell's variable expansion. It eliminates calling `os.environ` , thus less code and less imports. That gives us 46 bytes, and with `xnor`'s trick and removing space before `-c` we've got 43 bytes.
```
python -c"print('$PATH'.replace(*':\n'))"
```
[Answer]
## Java, 58 bytes
```
System.out.print(System.getenv("Path").replace(';','\n'));
```
Full program: 106 bytes
```
class E {
    public static void main (String[] args) {
        System.out.print(System.getenv("Path").replace(';', '\n'));
    }
}
```
[Answer]
## GNU `sed` + `bash`, 25 bytes:
```
sed 's/:/\n/g' <<<"$PATH"
```
If the `PATH` contains no directory name with whitespace, no quoting needed, 23 bytes:
```
sed 's/:/\n/g' <<<$PATH
```
Even shorter, transliterating `:` to newline, thanks to [@Dennis](https://codegolf.stackexchange.com/users/12012/dennis):
```
sed y/:/\\n/<<<"$PATH"
```
[Answer]
# Vim, 19 bytes
`"=$PATH<CR>p:s/:/\r/g<CR>`
Grab `$PATH` from the expression register and paste it. Turn the `:`s into newlines. Nothing tricky.
[Answer]
# C (x86), 60 bytes
```
f(){char*p=getenv("PATH");for(;*p;p++)putchar(*p-58?*p:10);}
```
This won't work on 64-bit platforms without including *stdlib.h*, since *getenv* returns an *int* (32 bits) while *char* pointers are 64 bits wide.
I have yet to find an online 32-bit C compiler.
# C (x86-64), 70 bytes
```
f(){char*getenv(),*p=getenv("PATH");for(;*p;p++)putchar(*p-58?*p:10);}
```
Instead of including *stdlib.h*, we declare *getenv* ourselves as a function returning a *char* pointer.
I've tested this with gcc and clang on Linux; other setups may cry blood. Try it on [Ideone](http://ideone.com/SNfiiv).
[Answer]
## PHP, ~~36~~ ~~35~~ ~~33~~ 32 bytes
*Saved 1 byte, thanks to Blackhole*  
*Saved 2 bytes, thanks to user59178*  
*saved 1 byte, thanks to Martijn* 
### \*nix version
```
<?=strtr(getenv(PATH),":","
")?>
```
### Windows version
```
<?=strtr(getenv(PATH),";","
")?>
```
[Answer]
# Python 2, 49 bytes
Saving 2 bytes thanks to @xnor and 1 byte by replacing `environ` with `getenv` thanks to @Serg and @Oliver
```
import os
print os.getenv('PATH').replace(*':\n')
```
For Python 3, just add `(` and `)` around the `print` argument and add 1 to the byte count.
[Answer]
# jq, 18 characters
(16 characters code + 2 characters command line option)
```
env.PATH/":"|.[]
```
Sample run:
```
bash-4.3$ PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
bash-4.3$ jq -nr 'env.PATH/":"|.[]'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
```
[Answer]
# C, ~~85~~ 84 bytes
-1 byte for using `#import`
```
#import<stdlib.h>
main(){char*a=getenv("PATH");while(*a)putchar(*a++==58?10:a[-1]);}
```
[Answer]
## Racket 39 bytes
Using sed command of @heemayl :
```
(system "sed 's/:/\\n/g' <<<\"$PATH\"")
```
Ungolfed: 
```
(define (f)
  (system "sed 's/:/\\n/g' <<<\"$PATH\"")
)
```
Testing:  
 (f)
Output: 
```
/usr/local/bin
/usr/bin
/bin
/usr/games
/usr/lib/java/bin
/usr/lib/java/jre/bin
#t
```
[Answer]
# Scala, 31 bytes
```
sys env "PATH"replace(':','\n')
```
In scala, `a b c` is syntactic sugar for `a.b(c)`, so this compiles to `sys.env("PATH").replace(':','\n')`
[Answer]
# [Perl 6](https://perl6.org), ~~28 25~~ 24 bytes
```
%*ENV<PATH>.split(':')».put
```
```
put %*ENV<PATH>~~tr/:/\n/
```
```
put %*ENV<PATH>~~tr/:/
/
```
[Answer]
# C#, 64 bytes
```
x=>Environment.GetEnvironmentVariable("PATH").Replace(";","\n");
```
Anonymous function which returns the path variable, each directory on a separate line. Note that `x` is just a dummy object to save 1 byte instead of using `()`.
Full program:
```
using System;
namespace ExportPathVariable
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<object,string>f= x=>Environment.GetEnvironmentVariable("PATH").Replace(";","\n");
            Console.WriteLine(f(0));
        }
    }
}
```
Also works on UNIX systems if you replace `;` with `:`, presuming Mono libraries are available. **Try it online on [ideone](http://ideone.com/SW2O31), .NET Fiddle returns a security exception.**
Alternatively, a full C# program, which is rather verbose:
---
# C#, 118 bytes
```
using System;class P{static void Main(){Console.Write(Environment.GetEnvironmentVariable("PATH").Replace(";","\n"));}}
```
[Answer]
## Haskell, 72 bytes
```
import System.Environment
m ':'='\n'
m x=x 
map m<$>getEnv"PATH">>=putStr
```
An expensive import and no `replace` within the standard library make it quite long.
[Answer]
# [Factor](https://factorcode.org), 28 bytes
for unix-likes. I dunno how to do it on Windows since I'm not at a Windows box.
```
"PATH"getenv ":" "\n"replace
```
[Answer]
# Awk, ~~51~~ 44 characters
```
BEGIN{$0=ENVIRON["PATH"];gsub(":",RS);print}
```
Thanks to:
* [ninjalj](https://codegolf.stackexchange.com/users/267/ninjalj) for suggesting to use `gsub()` instead of manipulating built-in variables (-7 characters)
The typical `awk` way would be to set up the built-in variables which influences how `awk` manipulates the data automatically:
```
BEGIN{FS=":";OFS=RS;$0=ENVIRON["PATH"];$1=$1;print}
```
Sample run:
```
bash-4.3$ PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
bash-4.3$ awk 'BEGIN{FS=":";OFS=RS;$0=ENVIRON["PATH"];$1=$1;print}'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
```
[Answer]
# Node.js, 36 bytes
```
_=>process.env.PATH.split`:`.join`
`
```
Pretty straight forward.
[Answer]
# MATLAB, 34 bytes
```
disp(strrep(getenv('PATH'),58,10))
```
Here is an [online demo](https://ideone.com/zjgtYx) in Octave with a slight modification since `strrep` in octave requires the second and third inputs to be `char` variables rather than numeric values.
[Answer]
# R, 38 bytes
```
cat(gsub(":","\n",Sys.getenv('PATH')))
```
Grab the $PATH, replace `:` with newlines and prints to stdout. [You can try it online here.](http://www.r-fiddle.org/#/fiddle?id=VapdHjKl)
[Answer]
# Groovy, 43 Bytes
```
System.env['PATH'].replaceAll(":","\n")​​​​
```
[Answer]
# Gema, 36 characters
```
\A=@subst{\\:=\\n;@getenv{PATH}}@end
```
Sample run:
```
bash-4.3$ PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
bash-4.3$ gema '\A=@subst{\\:=\\n;@getenv{PATH}}@end'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
```
[Answer]
# Befunge-98 + EVAR fingerprint, 34 bytes
```
"RAVE"4("HTAP"Gv
:!k@:':-!'0*-, >
```
Loads the EVAR fingerprint (`"RAVE"4(`) to easily access environment variables, gets the PATH envvar (`"HTAP"G`), and for each character, exits the program if the character is "\0" (`:!k@`), substracts ASCII 48 "0" if the char is ASCII 58 ":" (`:':-!'0*-`), and outputs the character (`,`).
[Answer]
# ELF/x86, 78 bytes
```
00000000  7f 45 4c 46 01 00 00 00  43 0f 00 00 43 5f eb 10  |.ELF....C...C_..|
00000010  02 00 03 00 0c 50 eb 10  0c 50 eb 10 04 00 00 00  |.....P...P......|
00000020  5f 5f b1 05 be 49 50 eb  10 3d 20 00 01 00 5f f3  |__...IP..= ..._.|
00000030  a6 75 ef 89 f9 80 3f 3a  75 03 80 2f 30 42 ae 75  |.u....?:u../0B.u|
00000040  f4 4a 04 04 cd 80 93 cd  80 50 41 54 48 3d        |.J.......PATH=|
0000004e
```
NASM source:
```
BITS 32                                         ;
ORG 0x10eb5000                                  ;
                                                ;   ELF HEADER    --   PROGRAM HEADER
; ELF HEADER                                    ; +-------------+
DB 0x7f,'E','L','F'                             ; | magic       |    +--------------------+
                                                ; |             |    |                    |
; PROGRAM HEADERS                               ; |             |    |                    |
DD 1                                            ; |*class   32b | -- | type: PT_LOAD      |
                                                ; |*data   none |    |                    |
                                                ; |*version   0 |    |                    |
                                                ; |*ABI    SysV |    |                    |
DD 0xf43        ; offset = vaddr & (PAGE_SIZE-1); |*ABI vers    | -- | offset             |
                                                ; |             |    |                    |
entry:  inc     ebx     ; STDOUT_FILENO         ; |*PADx7       | -- | vaddr = 0x10eb5f43 |
        pop     edi     ; discard argc          ; |             |    |                    |
        jmp     short skip                      ; |             |    |                    |
DW 2                                            ; | ET_EXEC     | -- |*paddr LO           |
DW 3                                            ; | EM_386      | -- |*paddr HI           |
DD 0x10eb500c                                   ; |*version     | -- | filesz             |
DD 0x10eb500c                                   ; | entry point | -- | memsz              |
DD 4                                            ; | ph offset   | -- | flags: RX          |
                                                ; |             |    |                    |
skip:   pop     edi     ; discard argv[0]       ; |*sh offset   | -- |*align              |
        pop     edi     ; discard argv[1]=NULL  ; |             |    |                    |
env:    mov     cl,5    ; \ strlen("PATH=")     ; |             |    |                    |
        mov     esi,PATH; > "PATH="             ; |*flags    /--|    |                    |
DB 0x3d         ; cmp eax,0x10020               ; |*ehsize      |    +--------------------+
DW 32                                           ; | phentsize   |
DW 1                                            ; | phnum       |
                                                ; |             |
        pop     edi     ; > envp                ; |*shentsize   |
        repe    cmpsb   ; > strcmp(envp,"PATH="); |*shnum       |
        jne     env     ; /                     ; |*shstrndx    |
        mov     ecx,edi                         ; +-------------+
nlcolon:cmp     byte[edi],58  ; \ if (char == ':')
        jne     nosub         ; >
        sub     byte[edi],48  ; >   char -= '0'
nosub:  inc     edx           ; > wlen++
        scasb                 ; >
        jne     nlcolon       ; / while(char != 0)
        dec     edx           ; wlen--
        add     al,4
        int     0x80          ; write(1, ecx, wlen)
        xchg    eax,ebx
        int     0x80          ; exit(...)
PATH: db "PATH="
```
]