Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address "ls -s" and "ls -S" confusion/differences #1351

Open
ndporter opened this issue Jan 9, 2023 · 2 comments
Open

Address "ls -s" and "ls -S" confusion/differences #1351

ndporter opened this issue Jan 9, 2023 · 2 comments

Comments

@ndporter
Copy link
Contributor

ndporter commented Jan 9, 2023

The General Syntax of a Shell Command section uses ls -s and ls -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 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.

@bkmgit
Copy link
Contributor

bkmgit commented Jan 10, 2023

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?

@ndporter
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants