Article View: comp.bugs.sys5
Article #1116Re: 'ls -n' opens password file for reading
From: Ubben Greg
Date: Tue, 16 May 1989 03:00
Date: Tue, 16 May 1989 03:00
22 lines
1629 bytes
1629 bytes
In article <1622@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: > he didn't say anything about "ls" without the "-n" flag or with other > flags. I presume he has a legitimate reason for wanting to do an "ls > -n" on a system with either "/etc/passwd" or "/etc/group" missing.... Speaking of "ls -n" ... (INFORMATION ARTICLE) For Bourne shell programmers, the following script magnifies the speed difference between using "ls -n" and "ls -l" on System V: mkdir a && cd a # Build playpen # Create a lot of files with different owners to make ls work hard sed 's/:.*//; s/.*/chown & & >&/' /etc/passwd | sh - timex ls -l # Really slow (might want to >/dev/null) timex ls -n # Much faster (though less portable) cd .. && rm -fr a # Clean up (be careful) You can instead just try LS on one of the more popular parents of home directories for the same effect. For this reason, I never use "ls -l" in scripts when I don't need the actual owner or group names. -- Greg Ubben bink@aplcen.apl.jhu.edu
Technical Details
Message-ID:
<1245@aplcen.apl.jhu.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!rutgers!ukma!uflorida!indri!aplcen!binkReferences:
<1326@rivm05.UUCP> <128@softop.UUCP> <1622@auspex.auspex.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!rutgers!ukma!uflorida!indri!aplcen!bink From: bink@aplcen.apl.jhu.edu (Ubben Greg) Newsgroups: comp.bugs.sys5 Subject: Re: 'ls -n' opens password file for reading Summary: Why you shouldn't use "ls -l" when "ls -n" will do. Message-ID: <1245@aplcen.apl.jhu.edu> Date: 16 May 89 03:00:43 GMT References: <1326@rivm05.UUCP> <128@softop.UUCP> <1622@auspex.auspex.com> Reply-To: bink@aplcen.apl.jhu.edu (Greg Ubben) Distribution: na Organization: The Johns Hopkins University, Baltimore MD Lines: 22