linux - What does an asterisk at the end of a mv command do -


so going along , moving bunch of files

mv /source /dest & mv /source/* /dest/dest/ & ... ... 

then careless and

mv /source/filena* /dest/dest/ * 

omg! ^c^c^c^c [no response terminal command] going on here?

what happens when put * (asterisk) @ end of command instead of & (ampersand)?

the shell expands wildcard *. mv command never sees wildcard, result of expansion.

the wildcard * expands list of files in current directory in lexicographic order. if last file directory, preceding files (/source.filenafoo, /source/filenabar, /dest/dest, hello) moved subdirectory. if last file not directory, mv complains “target a.png not directory” (or words effect).

see what mv ./* without specifying destination do? more detailed examples.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -