lhunath 1173060640 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-adviced, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. All of these can possibly be a part of a filename! Use a loop and stat or another tool to evaluate your file stats one by one. lhunath 1174891335 forget lhunath 1174891337 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-adviced, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. All of these can possibly be a part of a filename! As such, you might be splitting some filenames in half by trying to delimit it by either of these. xmb 1180372971 forget xmb 1180372974 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-adviced, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. All of these can possibly be a part of a filename! As such, you might be splitting some filenames in half by trying to delimit it by either of these. -- fo xmb 1180373008 forget xmb 1180373017 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-adviced, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. All of these can possibly be a part of a filename! As such, you might be splitting some filenames in half by trying to delimit it by either of these. -- fo xmb 1180373114 forget xmb 1180373121 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-adviced, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. All of these can possibly be a part of a filename! As such, you might be splitting some filenames in half by trying to delimit it by either of these. igli 1180530523 forget igli 1180530583 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-advised, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. *All* of these can possibly be a part of a filename! As such, you might be splitting some filenames in half by trying to delimit it by either of these. for i in * is igli 1180530589 forget igli 1180530594 learn ls is a tool used to print out stats about files in the currect directory. Any attempt to parse the output of ls is VERY ill-advised, since there is simply no way of making sure you get what you expect out of it. This is because ls uses spaces, tabs, or newlines to delimit its output. *All* of these can possibly be a part of a filename! As such, you might be splitting some filenames in half by trying to delimit it by either of these. greycat 1180640934 forget greycat 1180640951 learn NEVER do this: for file in `ls`... See http://wooledge.org/mywiki/BashPitfalls to learn why. kojiro 1182980202 forget kojiro 1182980205 learn Please never parse, pipe, grep, capture, read, or loop over the output of ls. It's dangerous and there's always a better way. See http://wooledge.org/mywiki/BashPitfalls savetheWorld 1186066282 forget savetheWorld 1186066307 learn Its better to use stat for scripting than ls. Please never parse, pipe, grep, capture, read, or loop over the output of ls. It's dangerous and there's always a better way. See http://wooledge.org/mywiki/BashPitfalls savetheWorld 1186066391 forget savetheWorld 1186066411 learn Its better to use a glog or stat for scripting than ls. Please never parse, pipe, grep, capture, read, or loop over the output of ls. It's dangerous and there's always a better way. See http://wooledge.org/mywiki/BashPitfalls savetheWorld 1186066426 forget savetheWorld 1186066452 learn Its better to use a glob, (echo * ), or stat for scripting than ls. Please never parse, pipe, grep, capture, read, or loop over the output of ls. It's dangerous and there's always a better way. See http://wooledge.org/mywiki/BashPitfalls savetheWorld 1186066547 forget savetheWorld 1186066572 learn Its better to use a glob --> (echo * ), or the command stat for scripting than ls. Please never parse, pipe, grep, capture, read, or loop over the output of ls. It's dangerous and there's always a better way. See http://wooledge.org/mywiki/BashPitfalls lhunath 1187217083 forget lhunath 1187217166 learn Please never parse, pipe, grep, capture, read, or loop over the output of ls. unlike popular belief, ls is NOT designed to enumerate files. Using ls for this is dangerous and there's always a better way (for example, GLOBS!). See http://wooledge.org/mywiki/BashPitfalls lhunath 1187686944 forget lhunath 1187687031 learn Please never parse, pipe, grep, capture, read, or loop over the output of 'ls'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse statistics on them. Using 'ls' for this is dangerous (word splitting!) and there's always a better way (for example, globs or find). See http://wooledge.org/mywiki/BashPitfalls kojiro 1187716340 forget kojiro 1187716418 learn Please never parse, pipe, grep, capture, read, or loop over the output of 'ls' or 'find'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse statistics on them. Using 'ls' for this is dangerous (word splitting) and there's always a better way (for example, globs or find). See http://wooledge.org/mywiki/BashPitfalls savetheWorld 1189863361 forget savetheWorld 1189863388 learn Please never parse, pipe, grep, capture, read, or loop over the output of 'ls' or 'find'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse statistics on them. Using 'ls' for this is dangerous (word splitting) and there's always a better way (for example, globs or find and especially stat). See http://wooledge.org/mywiki/BashPitfall savetheWorld 1190028628 forget savetheWorld 1190028641 learn Please never parse, pipe, grep, capture, read, or loop over the output of 'ls' or 'find'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse statistics on them. Using 'ls' for this is dangerous (word splitting) and there's always a better way (for example, globs or find and especially stat). See http://wooledge.org/mywiki/BashPitfalls koala_man 1190029147 forget koala_man 1190029151 learn Please never parse, pipe, grep, capture, read, or loop over the output of 'ls' or 'find'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse statistics on them. Using 'ls' for this is dangerous (word splitting) and there's always a better way (for example, globs or find). See http://wooledge.org/mywiki/BashPitfalls lhunath 1192522211 forget lhunath 1192522329 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of `ls`. Unlike popular belief, `ls` is NOT designed to enumerate files or parse their statistics. Using `ls` for this is dangerous (word splitting) and there's always a better way (eg. globs). savetheWorld 1194201374 forget savetheWorld 1194201389 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of `ls`. Unlike popular belief, `ls` is NOT designed to enumerate files or parse their statistics. Using `ls` for this is dangerous (word splitting) and there's always a better way (eg. globs, or stat). karolisl 1194201602 forget karolisl 1194201629 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of `ls`. Unlike popular belief, `ls` is NOT designed to enumerate files or parse their statistics. Using `ls` for this is dangerous (word splitting) and there's always a better way (eg. globs, find or stat). redduck666 1194201779 forget redduck666 1194201795 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of `ls`. See http://wooledge.org/mywiki/BashPitfalls karolisl 1194201806 forget karolisl 1194201861 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of `ls`. Unlike popular belief, `ls` is NOT designed to enumerate files or parse their statistics. Using `ls` for this is dangerous (word splitting - refer to http://wooledge.org/mywiki/BashPitfalls for examples) and there's always a better way (eg. globs, find or stat). go|dfish 1194222850 forget lhunath 1194254810 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of 'ls'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse their statistics. Using 'ls' for this is dangerous (word splitting) and there's always a better way (eg. globs). lhunath 1210624169 forget lhunath 1210624243 learn Please NEVER parse, pipe, grep, capture, read, or loop over the output of 'ls'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse their statistics. Using 'ls' for this is dangerous (word splitting) and there's always a better way; eg. globs: files=(*). kojiro 1237153430 forget kojiro 1237153511 learn Please never parse, pipe, grep, capture, read, or loop over the output of 'ls' or 'find'. Despite popular belief, 'ls' is not designed to enumerate files or parse their statistics. Using 'ls' this way is dangerous (word splitting) and there's always a better way; eg. globs, find -exec, etc. greycat 1237403841 forget greycat 1237403862 learn Don't try to parse ls output in a script. http://mywiki.wooledge.org/ParsingLs lhunath 1240181908 forget lhunath 1240181921 learn Don't try to parse ls output. http://mywiki.wooledge.org/ParsingLs lhunath 1291286451 forget lhunath 1291286630 learn ls shows you a representation of files. They are NOT file names (for simple names, they mostly happen to be equivalent). Do NOT try to parse it. http://mywiki.wooledge.org/ParsingLs lhunath 1330942451 forget lhunath 1330942743 learn ls is a tool for interactively looking at file information. Its output is formatted for humans and will cause bugs in scripts. Use globs or find instead. Understand why: http://mywiki.wooledge.org/ParsingLs lhunath 1383594428 forget lhunath 1383594590 learn DO NOT USE ls' output for anything. ls is a tool for interactively looking at directory metadata. Any attempts at parsing ls' output with code are broken. Globs are much more simple AND correct: ''for file in *.txt''. Read http://mywiki.wooledge.org/ParsingLs Nintendo 1678173088 forget Nintendo 1678173141 learn DO NOT USE ls' output for anything. ls is a tool for interactively looking at directory metadata. Any attempts at parsing ls' output with code are broken. Globs are simpler AND correct: ''for file in *.txt''. Read http://mywiki.wooledge.org/ParsingLs emanuele6 1678174738 forget emanuele6 1678175173 learn DO NOT USE the output of ls in scripts. Its output format is neither portable nor reliable. Use globs instead. See https://mywiki.wooledge.org/ParsingLs