You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, both commands provide different output for the same data based on OS and terminal platforms. This is recognized for -s with a note below the output that memory blocks are different between systems.
But -S also sorts differently because on Mac folder size for sorting includes the files contained in the folder (this matches ls -l but not ls -s), whereas on Windows, folders are still treated as size 0.
If possible, it might be better to use a different example of case difference or just leave it out other than a note. While we could certainly add explanations with more detail on both, using examples that have dramatically different output for what seems like it should be the same is more confusing than helpful for a summary section for novice learners.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion. Learners should probably be alerted that there may be differences in some of the commands since they may use a shell on a remote computer and find a few differences. Examining the output of ls --help or man ls does show that the commands are case sensitive. Maybe comparing ls -f / and ls -F / maybe better?
@bkmgit yes, -f/-F makes more sense to me than what's there as far as cognitive load. They won't always get identical output but if they followed the lesson exactly, the output should be the same across platforms - so you wouldn't need either the existing note on -s or another note on -S.
The General Syntax of a Shell Command section uses
ls -s
andls -S
as examples of case differences in options.Unfortunately, both commands provide different output for the same data based on OS and terminal platforms. This is recognized for
-s
with a note below the output that memory blocks are different between systems.But
-S
also sorts differently because on Mac folder size for sorting includes the files contained in the folder (this matchesls -l
but notls -s
), whereas on Windows, folders are still treated as size 0.If possible, it might be better to use a different example of case difference or just leave it out other than a note. While we could certainly add explanations with more detail on both, using examples that have dramatically different output for what seems like it should be the same is more confusing than helpful for a summary section for novice learners.
The text was updated successfully, but these errors were encountered: