Sponsored Content
Top Forums UNIX for Dummies Questions & Answers ls command for listing the number of files Post 302112004 by cfajohnson on Saturday 24th of March 2007 12:34:14 AM
Old 03-24-2007
Quote:
Originally Posted by jimmyc
I've searched the man page for an option for the ls command to print the number of files in a directory. I'm moving files and folders around and thought a count of files would be a quick way to determine if I was missed one somewhere. Some "unix's" shells do this I think... maybe linux...

Anybody know how to do this real quick

System is: SunOS 5.10 Generic sun4u sparc SUNW,Ultra-5_10 KSH

I did this but is comes back with byte count rather than a file count.
ls -l |wc

You can add the -l option to wc, or you can do it in the shell itself, which will be much faster:
Code:
set -- *
echo $#

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies

2. Solaris

TAR command , listing backed up files

I've backed up several files to tape using tar, and wish to list those that have backed up. % tar cvf /dev/rmt/2un /s_1/oradata/pgpub/config.ora a /s_1/oradata/pgpub/config.ora 2 tape blocks But when I go to list the files: % tar tvf /dev/rmt/2un tar: tape read error What am I... (3 Replies)
Discussion started by: FredSmith
3 Replies

3. UNIX for Dummies Questions & Answers

unix command to cound the number of files in a folder

Hi All Can some one help me out. Please tell the unix command to cound the number of files in a folder. Ungent please# Thanks manas (6 Replies)
Discussion started by: manas6
6 Replies

4. UNIX for Dummies Questions & Answers

find command -- listing files twice

I noticed the other day that after i used the find command to search for some files, the computer listed them twice -- first with just the names of the files (meaning ./(then the individual file names), then with the directory name, followed by the file names (./directory name/file name). I was... (2 Replies)
Discussion started by: Straitsfan
2 Replies

5. UNIX for Dummies Questions & Answers

Long listing of files using find command on remote server via SSH

Hi , I am trying to find some files on a remote machine using the find command. >ssh -q atukuri@remotehostname find /home/atukuri/ -name abc.txt /home/atukuri/abc.txt The above command works fine and lists the file, but if I want to do a long listing of files (ls -l) its not working . ... (2 Replies)
Discussion started by: atukuri
2 Replies

6. AIX

command to verify number of files

Guy's I have file system called /appspft has millions of files and I want to know exactly how many file under it Pls advice with that command to verify number of files .. (3 Replies)
Discussion started by: Mr.AIX
3 Replies

7. Solaris

SFTP Command Help - listing files

Ok I am just going to explain what I am running step by step sftp user@hostname sftp > ls < when I run the command "ls" I get a long listing the old version, on the new version I get a short listing how can I change my new version to give me long listing by default (1 Reply)
Discussion started by: slufoot80
1 Replies

8. UNIX for Dummies Questions & Answers

Unix Command for listing files containing one text but not other.

Hi, I want to list all files present in directory those contains one specific word but exclude other. If possible suggest unix commands instead of script to do so. e.g. List all files name from directory which are having "PROMOTION" word but not "LEN_PROMOTION". Thanks (4 Replies)
Discussion started by: gauravgautam135
4 Replies

9. UNIX for Dummies Questions & Answers

Listing only the files under a directory from the result of find command

Hi, I have a main folder 'home'. Lets say there is a folder 'bin' under 'home'. I want to check the list of files under subdirectories present under the /bin directory created in the last 24 hours. I am using the following find command under home/bin directory: find . -mtime -1 -print ... (3 Replies)
Discussion started by: DJose
3 Replies

10. AIX

Getting files through find command and listing file modification time upto seconds

I have to list the files of particular directory using file filter like find -name abc* something and if multiple file exist I also want time of each file up to seconds. Currently we are getting time up to minutes in AIX is there any way I can get file last modification time up to seconds. (4 Replies)
Discussion started by: Nitesh sahu
4 Replies
platform(4)							   File Formats 						       platform(4)

NAME
platform - directory of files specifying supported platforms SYNOPSIS
.platform DESCRIPTION
The Solaris operating environment release includes the .platform directory, a new directory on the Solaris CD image. This directory con- tains files (created by Sun and Solaris OEMs) that define platform support. These files are generically referred to as platform definition files. They provide a means to map different platform types into a platform group. Platform definition files in the .platform directory are used by the installation software to ensure that software appropriate for the architecture of the system will be installed. Sun provides a platform definition file named .platform/Solaris . This file is the only one that can define platform groups to which other platform definition files can refer. For example, an OEM platform definition file can refer to any platform group specified in the Solaris platform definition file. Other platform definition files are delivered by OEMs. To avoid name conflicts, OEMs will name their platform definition file with an OEM- unique string. OEMs should use whatever string they use to make their package names unique. This unique string is often the OEM's stock symbol. Comments are allowed in a platform definition file. A "#" begins a comment and can be placed anywhere on a line. Platform definition files are composed of keyword-value pairs, and there are two kinds of stanzas in the file: platform group definitions and platform identifications. o Platform group definitions: The keywords in a platform group definition stanza are: PLATFORM_GROUP The PLATFORM_GROUP keyword must be the first keyword in the platform group definition stanza. The value assigned to this keyword is the name of the platform group, for example: PLATFORM_GROUP=sun4c The PLATFORM_GROUP name is an arbitrary name assigned to a group of platforms. However, PLATFORM_GROUP typically equals the output of the uname -m command. PLATFORM_GROUP value cannot have white space and is limited to 256 ASCII characters. INST_ARCH The instruction set architecture of all platforms in the platform group, for example: INST_ARCH=sparc The INST_ARCH keyword value must be the value returned by the uname -p command on all platforms in the platform group. o Platform identifications: The keywords in a platform identification stanza are: PLATFORM_NAME The PLATFORM_NAME keyword must be the first keyword in the platform identification stanza. The PLATFORM_NAME is the name assigned to the platform, for example: PLATFORM_NAME=SUNW,SPARCstation-5 Typically, this name is the same as the value returned by the uname -icommand on the machine, but it need not be the same. The PLATFORM_NAME value cannot have white space and is limited to 256 ASCII characters. If it contains paren- theses, it must contain only balanced parentheses. For example. the string "foo(bar)foo" is a valid value for this keyword, but "foo(bar" is not. The other keywords in the platform identification stanza can be in any order, as long as the PLATFORM_NAME keyword is first. PLATFORM_ID The value returned by the uname -i command on the machine, for example: PLATFORM_ID=SUNW,SPARCstation-5 MACHINE_TYPE The value returned by the uname -m command on the machine, for example: MACHINE_TYPE=sun4c IN_PLATFORM_GROUP The platform group of which the platform is a member, for example: IN_PLATFORM_GROUP=sun4c The platform group name must be specified in the same file as the platform identification stanza or in the platform definition file with the name .platform/Solaris . The IN_PLATFORM_GROUP keyword is optional. A platform doesn't have to belong to a platform group. If a plat- form is not explicitly assigned to a platform group, it essentially forms its own platform group, where the platform group name is the PLATFORM_NAME value. The IN_PLATFORM_GROUP value typically equals the output of the uname -m command. IN_PLATFORM_GROUP value cannot have white space and is limited to 256 ASCII characters. INST_ARCH The instruction set architecture of the platform, for example: INST_ARCH=sparc This field is only required if the platform does not belong to a platform group. The INST_ARCH keyword value must be the value returned by the uname -i command on all platforms in the platform group. COMPATIBILITY
The installation program will remain compatible with the old Solaris CD format. If a Solaris CD image does not contain any platform defini- tion files, the installation and upgrade programs will select the packages to be installed based on machine type, that is, the value returned by the uname -p command. EXAMPLES
Example 1: Platform Group Definitions The following example shows platform group definitions from the .platform/Solaris platform definition file. # PLATFORM_GROUP=sun4u INST_ARCH=sparc Example 2: Platform Identification Stanzas The following example shows platform identification stanzas, which define systems that belong in a platform group, from the .plat- form/Solaris platform definition file. # PLATFORM_NAME=SUNW,SunFire PLATFORM_ID=SUNW,SunFire IN_PLATFORM_GROUP=sun4u PLATFORM_NAME=SUNW,Ultra-80 PLATFORM_ID=SUNW,Ultra-80 IN_PLATFORM_GROUP=sun4u # PLATFORM_NAME=SUNW,SunFire PLATFORM_ID=SUNW,SunFire IN_PLATFORM_GROUP=sun4u # PLATFORM_NAME=SUNW,Ultra-80 PLATFORM_ID=SUNW,Ultra-80 IN_PLATFORM_GROUP=sun4u FILES
The .platform directory must reside as /cd_image/Solaris_vers/.platform, where cd_image Is the path to the mounted Solaris CD (/cdrom/cdrom0/s0 by default) or the path to a copy of the Solaris CD on a disk. Solaris_vers Is the version of Solaris, for example, Solaris_2.9. NOTES
Typically, a platform identification stanza contains either a PLATFORM_ID or a MACHINE_TYPE stanza, but not both. If both are specified, both must match for a platform to be identified as this platform type. Each platform identification stanza must con- tain either a PLATFORM_ID value or a MACHINE_TYPE value. If a platform matches two different platform identification stanzas--one which matched on the value of PLATFORM_ID and one which matched on the value of MACHINE_TYPE , the one that matched on PLATFORM_ID will take precedence. The .platform directory is part of the Solaris CD image, whether that be the Solaris CD or a copy of the Solaris CD on a system's hard disk. SunOS 5.10 19 Nov 2002 platform(4)
All times are GMT -4. The time now is 02:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy