g | x | w | all
Bytes Lang Time Link
086TSQL250514T165009ZBradC
018Juby240312T170426ZJordan
168SAKO250326T165913ZAcrimori
049AWK250325T203302Zxrs
013APLNARS250323T213621ZRosario
079Tcl181208T235046Zsergiol
040Bash240710T141759ZThemooni
020Raku181209T225602ZJo King
034sed 4.2.2 r240715T173520Zguest430
030min240713T213440Zchunes
320C++240711T181539Zjreneew2
035Zsh240711T173555Zroblogic
062Forth gforth240710T130721Zreffu
054Octave240710T081803ZGlory2Uk
051PowerShell240322T161345ZJames Fl
057Swift 5.9230715T000944ZmacOSist
040TIBasic240312T232435ZYouserna
008Brachylog240312T194651ZDLosc
007Uiua SBCS240312T171946Zchunes
023ForWhile230712T193427Zbsoelch
179Racket230706T182446ZEd The &
003Nekomata230706T015818Zalephalp
032JavaScript Node.js230703T071036Zl4m2
077Rockstar230624T092907ZShaggy
052Lua230630T025722Zbluswimm
041JavaScript Node.js230628T131008ZFhuvi
030Arturo230624T024710Zchunes
003Thunno 2230623T172350ZThe Thon
031Julia 1.0221031T174014ZAshlin H
003Vyxal221101T005608Zaketon
026Ruby nl221031T175218ZJordan
003Stax221029T001554Zrecursiv
nan221028T140559Zbigyihsu
013APL Dyalog Unicode221025T225220ZSeggan
nanFig221020T000311ZnaffetS
003Vyxal221019T235717ZnaffetS
025Factor221019T220341Zchunes
005MATL181209T214937ZSuever
052Pepe181210T114448Zu-ndefin
003Japt181208T223836ZShaggy
018perl 5190108T133916ZNahuel F
038brainfuck190514T122924ZDorian
011cQuents190513T152149ZStephen
079C# .NET Core190114T194034ZDestroig
066MBASIC190111T151403Zwooshiny
063PHP190110T025800Z640KB
038Reticular190108T235127ZWisław
059Runic Enchantments190108T222254ZDraco18s
088Common Lisp190108T171753ZRenzo
036JavaScript181210T005829Zguest271
050C 32bit181209T184757Zuser7740
039Ruby181211T045741Zacornell
026Wolfram Language Mathematica181209T000400ZMisha La
054C clang181210T034649Zuser3604
061Lua181212T031103Zcyclamin
036JavaScript181209T195415ZOliver
033Ruby181211T210227ZG B
007Pyth181211T203428ZSok
032JavaScript ES6181208T232816ZArnauld
005MathGolf181211T151634Zmaxb
082SNOBOL4 CSNOBOL4181210T220149ZGiuseppe
064Clojure181210T205125ZCarcigen
085Java JDK181210T161658ZOlivier
044Powershell181210T090828Zmazzy
008V181208T222102ZDJMcMayh
034C# Visual C# Interactive Compiler181209T232606Zdana
059brainfuck181209T232333ZJo King
004Pushy181209T215749ZFlipTack
032Perl 6181209T193519ZSean
078Tcl181209T183859Zdavid
011Pyth181209T133601ZElPedro
058R181209T174313ZdigEmAll
048Python 2181209T090331ZElPedro
043Red181209T084221ZGalen Iv
007J181209T075234ZGalen Iv
013Attache181209T004002ZConor O&
038Python 2181209T000054Zxnor
010Charcoal181208T235438ZNeil
002Jelly181208T225329ZJonathan
00305AB1E181208T222827ZOkx
027Haskell181208T224108Znimi
006APL Dyalog Unicode181208T222229ZAdá

T-SQL, 86 bytes

SELECT SUBSTRING(s+s,number+2,len(s))FROM t,spt_values WHERE TYPE='P'AND number<len(s)

Input is taken from pre-existing table t with string column s per our IO rules.

This must be run in the master database, which (on MS SQL servers) includes a system table named spt_values containing the digits 0 through 2047.

J-uby, 18 bytes

:*%[:& &:|,:+@|:+]

Attempt This Online!

Explanation

:* % [:& & :|, :+@ | :+]
               :+@ | :+   # Range 1..(input length)
:* % [       ,         ]  # Map with...
      :& & :|             #   Rotate input chars

SAKO, 168 bytes

PODPROGRAM:F(*W)
CALKOWITE:*W,I,J,K
STRUKTURA(9):W
I=0
1)I=I+1
GDYW(I)=58:2,INACZEJ1
**2)C=W(K)
W(K)=W(K-1)
W(K-1)=C
POWTORZ:K=1(1)I
DRUKUJWIERSZ:W
POWTORZ:J=1(1)I
WROC

Repeatedly moves character to the end. The string is expected to end in LF as is usually in SAKO.

Full programme version, 177 bytes

CALKOWITE:*W,I,J,K
BLOK(9):W
W(=I)=0
CZYTAJWIERSZ:W
I=0
1)I=I+1
GDYW(I)=58:2,INACZEJ1
**2)C=W(K)
W(K)=W(K-1)
W(K-1)=C
POWTORZ:K=1(1)I
DRUKUJWIERSZ:W
POWTORZ:J=1(1)I
STOP1
KONIEC

AWK, 49 bytes

{for(;i++<NF;)print$0=substr($0,2)substr($0,1,1)}

Attempt This Online!

{for(;i++<NF;)   # iterate based on num of chars
print$0          # print string
=substr($0,2)    # sub string from 2 position till end
substr($0,1,1)}  # sub string first char concatted.

APL(NARS), 13 chars

{{⍵⌽k}¨⍳≢k←⍵}

test:

  {{⍵⌽k}¨⍳≢k←⍵}'john'
┌4──────────────────────────────┐
│┌4────┐ ┌4────┐ ┌4────┐ ┌4────┐│
││ ohnj│ │ hnjo│ │ njoh│ │ john││
│└─────┘ └─────┘ └─────┘ └─────┘2
└∊──────────────────────────────┘     

Tcl, 79 bytes 80 | 91

proc P s {time {puts [set s [regsub ^. $s ""][string in $s 0]]} [string le $s]}

Try it online!

Bash, 44 40 bytes

-4 bytes by roblogic

for((;i++<${#1};)){ echo ${1:i}${1::i}
}

Attempt This Online!

Use as body of a bash function or as a bash script. takes the string as first arg and outputs to stdout.

explanation:

for ((;i<${#1};i++)){ # ${#1} is the length of $1, so this is a for loop counting character positions
echo ${1:$i}${1::$i}  # ${1:x:y} is the substring of $1 starting at position x ending at position y.
}

Raku, 20 bytes

{.rotate(all 1..$_)}

Try it online!

Anonymous code block that has input/output as a list of characters. The output is a Junction object that contains all the rotated arrays. I'm not sure how legal this is, since extracting values from a Junction is not normal.

Explanation:

{                  }   # Anonymous codeblock
 .rotate(         )    # Rotate the input list
         all 1..$_     # By all of the range 1 to length of the input array
                          # all creates a junction of values
                          # And it runs the function on each value

The all can be replaced by any of any, one, [&], [|], [^].

If the Junction isn't allowed, here's an alternate solution:

Raku, 20 bytes

{{.rotate(++$)xx$_}}

Try it online!

There's probably a better way to reset the anonymous variable ++$ than by wrapping the code in another code block... There is! And it's the same size as the Junction solution somehow.

sed 4.2.2 -r, 34 bytes

h;:
x;s/(.)(.*)/\2\1/p
x;s/.//;//b

Try it online!

honestly surprised there's not a sed answer here yet, this is something sed does well. it holds the string, and then puts the first char at the end and deletes a char from the held string until there's no more held string

min, 30 bytes

(dup(swap rest append dup)map)

Takes a list of characters and outputs a list of lists of characters.

running the code + output

C++, 320 bytes

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char* argv[]){std::string i=std::string(argv[1]);std::vector<std::string>r;std::cout<<i<<" -> ";for(int a=0;a<i.size();a++){std::rotate(i.begin(),i.begin()+1,i.end());r.push_back(i);}for(const auto& b:r){std::cout<<b<<" ";}}

Zsh, 35 bytes

for i ({0..$#1})<<<${1:$i}${1:0:$i}

Try it online!

Forth (gforth), 62 bytes

: f >r i for j 0 do dup i j + k mod + 1 type loop cr next r> ;

Try it online!

Explanation

Input is the form of a standard forth string (addr & length) on the stack. Output is printed, one permutation per line, in "reverse" (moving characters from the end). Saved several bytes by abusing the return stack, to cut out a bunch of normal stack manipulation.

Code Explanation

: f           \ start a new word definition
  >r          \ place string length on the return stack
  i for       \ start a reverse counted loop from len to 0
    j 0 do    \ start a counted loop from 0 to len
      dup     \ duplicate the string starting address
      i j +   \ add current index and offset
      k mod   \ Get the total modulo the string length to get current char index
      +       \ add the current char index to the string starting address
      1 type  \ output the current char
    loop      \ end the inner counted loop
    cr        \ output a newline
  next        \ end the outer reverse counted loo
  r>          \ remove the string length from the return stack
;             \ end word definition

Octave, 54 bytes

@(x)arrayfun(@(j)circshift(x,[0,j]),1:sum(x|1),'un',0)

Try it online!

I see basically two options here: subsetting + concatenation and using a built-in circshift to rotate a string. The built-in approach turned to be the shorter one.

PowerShell, 51 bytes

1..$s.Length|%{$s=$s[1..$s.Length]+$s[0]-join'';$s}

Try it online!

Swift 5.9, 65 59 57 bytes

var s="",r={s=$0
s.map{$0
s+=[s.removeFirst()]
print(s)}}

r(_:) is the closure to call.

TI-Basic, 40 bytes

For(I,1,length(Ans)-1
sub(Ans,2,length(Ans)-1)+sub(Ans,1,1
Disp Ans
End
Ans

Takes input in Ans. Rotates to the left.

Brachylog, 8 bytes

l≥ℕ₁;?↺₍

Generator solution: takes a string as input, outputs one rotation at a time when called repeatedly. Try it online!

Explanation

l≥ℕ₁;?↺₍
l          Length of input string
 ≥         Get a number less than or equal to that
  ℕ₁       which is also an integer greater than or equal to 1
    ;?     Put it in a list with the input string
      ↺₍   Rotate the latter the former number of times

Uiua SBCS, 7 bytes

⇌≡↻⇡⊃⧻¤

Try it!

If it is allowed to start with the input rather than end with it, then remove the reverse for -1 byte.

⇌≡↻⇡⊃⧻¤
    ⊃⧻¤  # fix the input and get its length
   ⇡     # range
 ≡↻      # rotate input by each number in the range
⇌        # reverse

ForWhile 23 bytes

{:0$(.0@,0@(.0@,#:)9#)}

Input: a char array followed by its length (stored on stack)

Output: prints rotations of input separated by tab (newline would need an additional character)

online interpreter

Explanation

{          \ define anonymous procedure
:0$        \ store copy of string length at address 0
(.         \ start for-loop, ignore loop-counter
0@,        \ rotate top (string length) stack elements
0@(.0@,#:) \ print string but keep it on the stack
9#         \ print tab
)          \ end outer for-loop
}          \ end procedure

Calling the procedure:

{:0$(.0@,0@(.0@,#:)9#)} \ procedure
1$                      \ store procedure at address 1
"ForWhile"              \ procedure argument
1@?                     \ call procedure

prints:

orWhileF    rWhileFo    WhileFor    hileForW    ileForWh    leForWhi    eForWhil    ForWhile

Racket - 179 bytes

#!racket
(let([s(read-line)][a string-append])(let g([r s][i(string-length s)])(display(a r(if(= i 0)""" -> ")))(if(= i 0)(void)(g(a(substring r 1)(~a(string-ref r 0)))(- i 1)))))

Try it online!


Explanation

On line one we have the required language expression. Yesterday, I learnt that #![language] is short for #lang [language], but it is discouraged in normal programs.

On line two, we define an immediately invoked function using let. The parent let receives a line of input from the user and passes it to it's child let called g. The child let acts as a recursive loop that uses the length of the parent string as an iterator. The first if check is in charge of pretty printing the rotated string. (While it would save some bytes to remove it, I like the way it looks.) The second check is used to determine whether the string should be rotated again or if the program should end.

To rotate the string, we split the string at index 1 and append the first character to the end of the string.

#lang racket

(let ([str (read-line)] [str-app string-append])
  (let loop ([rotated str] [idx (string-length str)])
    (display (str-app rotated (if (= idx 0) "" " -> ")))
    (if (= idx 0)
      (void)
      (loop (str-app (substring rotated 1)
                     (~a (string-ref rotated 0)))
            (- idx 1)))))

Output (Input: Heya!)

Heya! -> eya!H -> ya!He -> a!Hey -> !Heya -> Heya!

Nekomata, 3 bytes

x→Ř

Attempt This Online!

x       Enumerate; push [0, 1, ..., len(input) - 1]
 →      Increment
  Ř     Rotate right by that amount (automatically vectorized)

Unfortunately x is 0-indexed, so we have to increment it before rotating.

JavaScript (Node.js), 32 bytes

s=>[...s].map(_=>s=s.slice(1)+_)

Try it online!

JavaScript (Node.js), 32 bytes

s=>s.map(_=>s=[...s.slice(1),_])

Try it online!

Found similarity

Rockstar, 79 77 bytes

Listen to S
X's 0
While S at X
Cut S
Rock roll S in S
Join S
Say S
Let X be+1

Try it (Code will need to be pasted in)

Lua, 52 bytes

s=...for i=1,#s do s=s:sub(2)..s:sub(1,1)print(s)end

Try it online!

JavaScript (Node.js), 41 bytes

Another JS answer, which doesn't beat any of the previous JS ones.
Input is an array of characters (as seen in other answers), and output is an array of strings.
Rotates the string the inverted way, as allowed by OP.

s=>[...s].map(_=>[...s]=s.pop()+s.join``)

Try it online!


Different approach that swaps each character with their corresponding one, obtained via calculation of its index (correct rotation direction, 58 bytes) :

s=>s.map((_,i)=>s.map((_,j)=>s[(i+j+1)%s.length]).join``)

Try it online!

Arturo, 30 bytes

$->s[0-1map s=>[rotate s<=1+]]

Try it!

Thunno 2, 3 bytes

ż€Ỵ

Attempt This Online!

Explanation

ż€Ỵ  # Implicit input
ż    # Push the length range
 €   # For each number in this range:
  Ỵ  #  Rotate the input left that many times

Julia 1.0, 31 bytes

!s=(r=keys(s)).|>i->(s*s)[i.+r]

Try it online!

Vyxal, 3 bytes

(Ǔ…

Explanation:

(   # For each char in the input
 Ǔ  # Rotate left
  … # Print without popping

Try it Online!

Ruby -nl, 26 bytes

$_.scan(/./){puts$'+$`+$&}

Attempt This Online!

Stax, 3 bytes

:(m

Run and debug it

Go, 105 bytes

func f(s[]rune)(o[][]rune){for i:=0;i<len(s);i++{o=append([][]rune{append(s[i:],s[:i]...)},o...)}
return}

Attempt This Online!

Without the requirement of the original being at the end, this saves 13 bytes:

92 bytes

func f(s[]rune)(o[][]rune){for i:=0;i<len(s);i++{o=append(o,append(s[i:],s[:i]...))}
return}

Attempt This Online!

APL (Dyalog Unicode), 13 bytes

{(↓,↑)∘⍵¨⍳≢⍵}

Try it online!

Over twice as long as the other APL answer, but uses a different more literal tactic. Test harness stolen from that answer.

{(↓,↑)∘⍵¨⍳≢⍵}
{           } ⍝ Define function
         ⍳≢   ⍝ Indexes of
           ⍵  ⍝ The input
        ¨     ⍝ For each item in ^
 (   )        ⍝ Apply the following function:
  ↓              ⍝ Drop n elements
    ↑            ⍝ Take n elements
   ,             ⍝ Concatenate the 2 above results
      ∘⍵      ⍝ Bind the right input of the above function to the input

Fig, \$13\log_{256}(96)\approx\$ 10.701 bytes

$#GLxWxO'+]xq

Try it online!

This is so long

Vyxal, 3 bytes

żvǓ

Try it Online!

Factor, 25 bytes

[ all-rotations reverse ]

Try it online!

               ! "john"
all-rotations  ! { "john" "ohnj" "hnjo" "njoh" }
reverse        ! { "njoh" "hnjo" "ohnj" "john" }

MATL, 6 5 bytes

tf&+)

1 byte saved thanks to @luis!

Try it at MATL Online!

Explanation:

    # Implicitly grab input string
t   # Duplicate the input
f   # Create an array [1, ..., N] where N is the number of characters in the input
&+  # Add the transpose of this array to itself to create a 2D array of indices
    #
    #   +   1  2  3  4
    #       ----------
    #   1 | 2  3  4  5
    #   2 | 3  4  5  6
    #   3 | 4  5  6  7
    #   4 | 5  6  7  8
    #
)   # Use this 2D array to index into the original string using periodic indexing
    # Implicitly display the resulting character array

Pepe, 64 52 bytes

rEEEEeREEeRREeeeREEReREEEeeReReeeReeERREeeerEEEEERee

Try it online! Uses newlines for separation.

Japt, 5 3 bytes

Takes input as a character array, outputs an array of character arrays

£=é

Try it here

£=é     :Implicit input of character array U
£       :Map
  é     :  Rotate U one element to the right
 =      :  Reassign to U for next iteration

perl 5, 18 (-n) bytes

Thanks to Xcali

s/./say$',$`,$&/ge

TIO

Original answer (23 bytes)

/^.+?(?{say$'.$&})(?!)/

TIO

brainfuck, 38 bytes

,[>>,]<<<+>[[.>>]<<[<<]>-[+>.>-].<<+>]

Try it online!

Based on the idea of JoKing to use null-characters as space symbols. This code marks the current letters to print and loops until it reaches the left end.

,[>>,]<<    input string with empty cells in between
<+>         set first marker
[           main loop
  [.>>]     print remaining characters
  <<[<<]    return to start
  >-[+>.>-] print until marker (remove marker)
  .         print null
  <<+       set new marker
  >         restart loop with next character to the left
]           stop if there's no character to the left

cQuents, 11 bytes

=A#|LA)&_lZ

Try it online!

Explanation

=A#|LA)&_lZ

=A              first term in sequence is the input
  #|LA)         add second input n: length of input
       &        output first n terms in sequence
                each term equals:
        _l                        unary rotate left of 
          Z                                            previous term

Replace _l with _r to rotate right instead of left.

C# (.NET Core), 103, 79 bytes

Without LINQ.

EDIT: ASCII-only golfing -24 bytes with a better use of a for loop and substring return!

p=>{var s="";for(int j=0;j++<p.Length;s+=p+" ")p=p.Substring(1)+p[0];return s;}

Try it online!

MBASIC, 69 66 bytes

-3 bytes, thanks to Ørjan Johansen

1 INPUT S$:L=LEN(S$):FOR I=1 TO L:S$=MID$(S$+S$,2,L):PRINT S$:NEXT

PHP, 63 bytes

for($s=$argv[1];$x++<strlen($s);)echo$s=substr($s,1).$s[0]," ";

Try it online!

Output

$php strrot.php john
ohnj hnjo njoh john

$php strrot.php heehee
eeheeh eheehe heehee eeheeh eheehe heehee

Reticular, 56 38 bytes

iSL:%=@qB[:%`@d]:%`*[[o]:%`1-*p$]:%`*;

Try it online!

Explanation with input "Hee"

iS                # Read input string and put its chars into an array
L:%=              # Get length of string and save it as `%`
@qB               # Reverse array and push its items to the stack
                   Stack: [H, e, e]
[:%`@d]:%`*       # Duplicates the top length(str) items in the stack
                   a total of length(str) number of times
                   Stack before: [H, e, e]
                   Stack after: [H, e, e, H, e, e, H, e, e, H, e, e]
[[o]:%`1-*p$]:%`* # Output the top length(str) items from the stack
                    with a trailing newline, and then
                    pop the next item in the stack.
                    Iterate this `%` number of times
                    Stack before: [H, e, e, H, e, e, H, e, e, H, e, e]

                    Stack after 1st iteration: [e, e, H, e, e, H, e, e]
                    Output: Hee
                    Stack after 2nd iteration: [e, H, e, e]
                    Output: Hee
                            eeH
                    Stack after 3rd iteration: []
                    Output: Hee
                            eeH
                            eHe

;                 # Exit

Runic Enchantments, 59 bytes

>iu0l:1-}[{ R{:0=1\
/:$ak$0l1-[{U$:/?-/
\}?*2=0:-1{]{~ /;$~

Try it online!

Can handle inputs up to 8 characters (spaces need to be escaped, however).

Essentially just a bunch of stack manipulation, with integer 0 denoting the end of the stack and the original length used as a counter held at the end.

Without using the stack-of-stacks commands [ and ] the solution is slightly larger (63 bytes) but can handle strings up to 16 characters:

>iu0l1-}l1-sRl1-s:0 \
/s:$ak$0l1-sU$:/?-1=/
\-1l}?*5=0:-1{~/;${

Try it online!

Common Lisp, 88 bytes

(lambda(x)(loop for s from 1 to(length x)do(format t"~a~a "(subseq x s)(subseq x 0 s))))

Try it online!

JavaScript, 48 43 36 bytes

-5 bytes courtesy of @Bubbler *-7 bytes courtesy of @Shaggy

Input is a character array and output is an array of character arrays.

s=>s.map(_=>([a,...b]=s,s=[...b,a]))

Try it online!

C (32-bit), 58 51 50 bytes

-1 byte for a nice round number thanks to ceilingcat

i;f(s){for(i=0;i++<printf("%s%.*s\n",s+i,i,s)-2;);}

Try it online!

Degolf

i;           // "Global" i.
f(s){   // s is pointer to string, which conveniently fits in a 32 bit integer.
    for(i=0; // Initialize i.
        // Increment i and take its complement, and add it to the
        // return value of printf(); which just happens to be strlen(s)+1.
        // ~i + strlen(s) + 1 == strlen(s) + 1 - i - 1, so the last printed
        // string is the original string.
        ~++i + printf("%s%.*s\n",s+i,i,s);
        // The printf prints two strings: first until the terminating \0,
        // the second until a \0 or until i chars have been printed. It also
        // prints a linefeed.
}

Ruby, 39 bytes

->s{a=s.chars.to_a;a.map{a.rotate!*''}}

Try it online!

Wolfram Language (Mathematica), 35 26 bytes

Partition[#,Tr[1^#],1,-1]&

Try it online!

Takes a list of characters as input.

Partition (but not its variant StringPartitionused below) has an optional fourth argument for treating its input as cyclic (and for specifying how exactly to do so), which makes this solution simpler than the string one - in addition to not having any 15-character built-in functions.

Wolfram Language (Mathematica), 44 bytes

Rest@StringPartition[#<>#,StringLength@#,1]&

Try it online!

The same, but takes a string as input.

Turns "john" into "johnjohn", then takes all the length-StringLength["john"] substrings of this string with offset 1, producing {"john","ohnj","hnjo","njoh","john"}, then drops the first of these with Rest.

C (clang), 57 54 bytes

i;f(int*a){for(i=0;a[i++];printf("%S%.*S ",a+i,i,a));}

Try it online!

Takes input as a wide string.

Lua, 61 bytes

function(s)for i=1,#s do print(s:sub(i+1)..s:sub(1,i))end end

Try it online!

Split string at successive indices from one to the length of the string (one-based indexing), concatenate the pieces in the reverse order, print.

JavaScript, 36 bytes

Saved 3 bytes thanks to @Shaggy by using shift() instead of splice().

a=>a.map(x=>a.push(a.shift())&&a+"")

Try it online!

Ruby, 33 bytes

->s{s.chars.map{s=s[1..-1]+s[0]}}

Try it online!

Pyth, 7 bytes

_.e.>Qk

Accepts input as a string or as a list of characters, output is a list of the same. Try it online here.

JavaScript (ES6), 37 32 bytes

Returns an array of strings.

s=>[...s].map(c=>s=s.slice(1)+c)

Try it online!

MathGolf, 5 bytes

hÅ╫o;

Try it online!

Explanation

h       length of array/string without popping
 Å      start block of length 2
  ╫     left-rotate bits in int, list/str
   o    print TOS without popping
    ;   discard TOS

SNOBOL4 (CSNOBOL4), 82 bytes

	S =INPUT
T	X =X + 1
	S LEN(1) . L REM . R
	OUTPUT =S =R L LE(X,SIZE(S))	:S(T)
END

Try it online!

Clojure, 64 bytes

(fn[w](take(count w)(rest(iterate #(str(subs % 1)(first %))w))))

Try it online!

See the pre-golfed code below for an explanation. Returns a (lazy) list of strings.

(defn cycle-word [word]
  (->> ; Take the word
       word

       ; Create an infinite list of iterations of strings where
       ;   the first character is moved to the end of the subs(tring)
       (iterate #(str (subs % 1) (first %)))

       ; Drop the first result since we don't want it to start with the original word
       (rest)

       ; Then take as many iterations from the infinite list as the word has characters
       (take (count word))))

(cycle-word "john")
=> ("ohnj" "hnjo" "njoh" "john")

Java (JDK), 85 bytes

s->{for(int i=s.length();i-->0;)System.out.println(s.substring(i)+s.substring(0,i));}

Try it online!

Powershell, 44 bytes

($s=$args|% t*y)|%{$h,$t=$s;-join($s=$t+$h)}

Test script:

$f = {

($s=$args|% t*y)|%{$h,$t=$s;-join($s=$t+$h)}

}

@(
    ,('john', 'ohnj', 'hnjo', 'njoh', 'john')
    ,('heehee', 'eeheeh', 'eheehe', 'heehee', 'eeheeh', 'eheehe', 'heehee')
) | % {
    $s,$expected = $_
    $result = &$f $s
    "$result"-eq"$expected"
    $result
}

output:

True
ohnj
hnjo
njoh
john
True
eeheeh
eheehe
heehee
eeheeh
eheehe
heehee

V, 8 bytes

ýñx$pÙñd

Try it online!

Hexdump:

00000000: fdf1 7824 70d9 f164                      ..x$p..d

C# (Visual C# Interactive Compiler), 34 bytes

x=>x.Select(c=>x=x.Substring(1)+c)

Try it online!

brainfuck, 59 bytes

,[>,]<[>>[>]+[<]<[<]>-[[>]>[>]<+[<]<[<]>-]>[.>]>[.>]<[<].<]

Try it online!

Outputs each string separated by null bytes.

Explanation:

,[>,]    # Get input
<[       # Start loop over input
  >>[>]       # Go to end of the string
  +           # Set it to one to mark it
  [<]<[<]>    # Move to the beginning of input
  -[[>]>[>]<+[<]<[<]>-]   # Transfer the first character to the end
  >[.>]>[.>]  # Print the rotated string
  <[<].       # Print a nul byte
<]       # Repeat loop while input

Pushy, 4 bytes

L:{"

Try it online!

L:    \ Length of the string times do:
  {   \    Cyclically shift left once
   "  \    Print

Perl 6, 32 bytes

{m:ex/^(.*)(.+)$/».&{[R~] @$_}}

Try it online!

m:ex/^(.*)(.+)$/ exhaustively matches the given regex, splitting the input string at every possible place, except that the second substring must have at least one character--that prevents the input string from showing up twice in the output. Then each of the resulting Match objects' capture groups are reduced ([]) to a single string with R~, the reversed string concatenation operator.

Tcl, 78 bytes

proc R t {time {puts [set t [regsub -all (.?)(.*) $t {\2\1}]]} [string le $t]}

Try it online!

Pyth, 11 bytes

VSlQ+>QN<QN

Try it online!

Pretty much just a port of my Python answer

Explanation

==================================================
assign('Q',eval_input())
for N in num_to_range(Psorted(Plen(Q))):
 imp_print(plus(gt(Q,N),lt(Q,N)))
==================================================

V                    # for N in 
 S                   # 1-indexed range
  lQ                 # length of evaluated input
    +                # concatanate
     >QN             # all characters after index N in Q (Q[N:])
        <QN          # and all characters before index N in Q (Q[:N])

R, 58 bytes

function(s,`[`=substring)paste0(s[n<-nchar(s):1],s[1,n-1])

Try it online!

Python 2, 54 48 bytes

lambda i:[i[x:]+i[:x]for x in range(1,len(i)+1)]

Try it online!

Well beaten by xnor but posted as an alternative approach anyway.

Red, 49 43 bytes

func[s][forall s[print move head s tail s]]

Try it online!

J, 7 bytes

#\|."{]

Try it online!

Explanation:

  |."{    - rotate ( "{ is short for "0 1 - rank 0 1 ) 
      ]   - the input
#\        - lenght of the successive prefixes of the input 

Attache, 13 bytes

Rotate#{1:#_}

Try it online!

Explanation

Rotate#{1:#_}
      #          fork(f, g) = ${ f[x, g[x]] }; this forks:
Rotate               rotate's the input by
       {1:#_}        each number from 1 to the length of the input

Alternatives

15 bytes: {_&Rotate!1:#_}

16 bytes: {Rotate[_,1:#_]}

16 bytes: Rotate@Rotations

16 bytes: Rotate#(1&`:@`#)

17 bytes: Rotate#{1+Iota@_}

18 bytes: Rotate#(1&`+@Iota)

19 bytes: Rotate#(Succ=>Iota)

Python 2, 38 bytes

s=input()
for c in s:s=s[1:]+c;print s

Try it online!

Charcoal, 10 bytes

⮌Eθ⭆θ§θ⁻μκ

Try it online! Link is to verbose version of code. Explanation:

  θ         Input string
 E         Map over characters
    θ       Input string
   ⭆        Map over characters and join
      θ     Input string
     §      Circularly indexed by
       ⁻    Difference between
        μ   Inner index
         κ  Outer index
⮌           Reversed
            Implicitly print each string on its own line

To rotate in the opposite direction, replace Minus with Plus.

Jelly, 2 bytes

ṙJ

A monadic Link accepting a list of characters which yields a list of lists of characters

Try it online! (footer pretty prints by calling the link and joining with newline characters)

05AB1E, 3 bytes

ā._

Try it online!

Haskell, 27 bytes

scanl(\(a:b)_->b++[a])=<<id

Try it online!

APL (Dyalog Unicode), 6 bytesSBCS

⍳∘≢⌽¨⊂

Try it online!

 the indices

 of

 the tally

⌽¨ each rotate (to the left)

 the entire string