- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Files Count
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 11:20 PM
09-14-2004 11:20 PM
I will be performing a filesystem copy to another filesystem using the cp -Rhp option.
I need to verify that the resultant filesystem does not miss out any files.
I run the command ls -al |grep ^d |wc -l for directory count
I run the command ls -al |grep ^- |wc -l for file count
I will run the command ls to grep for
b Block special file
c Character special file
d Directory
l Symbolic link
n Network special file
p Fifo (also called a "named pipe") special file
s Socket
- Ordinary file
Just wondering is there any other better way to perform the file count from the top directory level rather then cd to each directory and perform the ls command mentioned above?
thanks n regards/cliff
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 11:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 11:28 PM
09-14-2004 11:28 PM
Re: Files Count
cp command warns you for each file it misses! Do it like this:
cp -Rhp ... |more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 11:30 PM
09-14-2004 11:30 PM
Re: Files Count
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 11:44 PM
09-14-2004 11:44 PM
Re: Files Count
find
"*" -- will give all files,
So try as,
OLDFSDIR> cd
NEWFSDIR> cd
Check the difference with diff command as,
diff /tmp/oldfs.log /tmp/newfs.log
It will it easily.
More you can use -type
find . -type f -name "*"
f is regular file,
see more on find command for -type option. as
f regular file
b Block special file
c Character special file
d Directory
l Symbolic link
n Network special file
p Fifo (also called a "named pipe") special file
s Socket
HTH.
- Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2004 11:49 PM
09-14-2004 11:49 PM
Re: Files Count
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 12:25 AM
09-15-2004 12:25 AM
Re: Files Count
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 01:27 AM
09-15-2004 01:27 AM
Re: Files Count
if someone could help you, please don't forget to assign points
Regards
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 01:37 AM
09-15-2004 01:37 AM
Re: Files Count
This would ensure that everything is copied to the destination and perms will be same as that of the source. Also you have option of using a larger block size and copy it fast.
dd if=/dev/vgxx/lvolx of=/dev/vgyy/lvoly bs=1024k
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 02:04 AM
09-15-2004 02:04 AM
Re: Files Count
Pls try checking the cp's command return code, i.e:
cp -Rp ...
STATUS=$?
if [ "$STATUS" = "0" ]
then
echo "Command concluded successfully"
else
echo "Command concluded with errors"
fi
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2004 02:47 PM
09-15-2004 02:47 PM
Re: Files Count
I think ls -lR |wc -l works well.
cheers/cliff