Sponsored Content
Top Forums Shell Programming and Scripting File count for symlink using find command Post 302614629 by dixits on Wednesday 28th of March 2012 04:23:43 PM
Old 03-28-2012
File count for symlink using find command

Hi Guys,
The script which I am using works really good for finding the file count for files that are not symlink. I know I can use find command like:
Code:
find . -type l | wc -l

This way I can get filecount of the symlink but is there a one liner to use -type l and -type f option ? That is what if the directory as both symlink and real files, than I would need a total count for both.
Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command to find the count of files ina directory

hi Gurus, can anyone provide a awk command to get teh count of number of file sin a specific directory. appreciate any kind of information.. thanks (11 Replies)
Discussion started by: sish78
11 Replies

2. Linux

To find multiple strings count in a file

I need to find the line count of multiple strings in a particular file. The strings are as follows: bmgcc bmgccftp bsmsftp bulkftp cctuneftp crbtftp crmpos cso gujhr I am doing manual grep for each of the string to find the line count. The command i am using right now is: grep mark... (3 Replies)
Discussion started by: salaathi
3 Replies

3. Shell Programming and Scripting

How to find a count of a word within a file

Hello, I'm looking for a wait to count the number of occurrences of a certain string of characters within a file. The file that I trying to parce has segments within the file that have a header and footer to each segment and I'm trying to do a count of the header string and compare it to a count... (9 Replies)
Discussion started by: bd_joy
9 Replies

4. Shell Programming and Scripting

print as well as count the files found by find command

I want the output of the find command to be printed and also the total files found by it. Can someone help in this. Obviously $ find . -type f | wc -l will not output the files found but only the count. I want both. There can be millions and trillions of files so dont want the output of find... (3 Replies)
Discussion started by: amicon007
3 Replies

5. Solaris

symlink on link file

Hi all, I want to create a symlink on a link file, i mean, there is a file which is actually a symlink of some version. Now i want to create one more symlink on that link file. EX: there is a file: uat -> version prod -> version Now i want to create one more link on these 'uat' and... (1 Reply)
Discussion started by: raghu.iv85
1 Replies

6. Shell Programming and Scripting

ln -s creates symlink in symlink, if [ -f ... ] says file that exists doesn't exist

Hi Forums, I got a little problem, I made a few modifications to the code of the launch script of a testing server(minecraft) and now updating is broken aswell as the automatic directory creation. These Lines somehow create an endless symlink that refers to itself and I don't know how to fix... (0 Replies)
Discussion started by: Xaymar
0 Replies

7. Shell Programming and Scripting

Recursive find / grep within a file / count of a string

Hi All, This is the first time I have posted to this forum so please bear with me. Thanks also advance for any help or guidance. For a project I need to do the following. 1. There are multiple files in multiple locations so I need to find them and the location. So I had planned to use... (9 Replies)
Discussion started by: Charlie6742
9 Replies

8. UNIX for Beginners Questions & Answers

Match file and find count

Hi All, I have transaction in one file.I want to match that to another file and find the number of time the transaction is available on the other file.I need to take each record from TRANSFILE and match that with SPEND FILE and find the number of counts of the transaction TRANSFILE: ... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

9. Shell Programming and Scripting

How to create symlink for latest file only?

Hello, On Solaris 10, here are entries for logs in httpd.conf ErrorLog "|/export/apache/apache-2.2.17/bin/rotatelogs -l -f /var/log/apache/error_log.%Y%m%d 86400" It keeps creating daily logs with below names - -rw-r--r-- 1 root root 1016747232 Apr 5 23:59... (16 Replies)
Discussion started by: solaris_1977
16 Replies

10. UNIX for Beginners Questions & Answers

How to find the count of IP addresses that belong to different subnets and display the count?

Hi, I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output Here is how my file looks like 1.1.1.1 1.1.1.2 1.1.1.3 1.1.2.1 1.1.2.2 1.1.3.1 1.1.3.2 1.1.3.3 1.1.3.4 So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
explain_symlink_or_die(3)				     Library Functions Manual					 explain_symlink_or_die(3)

NAME
explain_symlink_or_die - make a new name for a file and report errors SYNOPSIS
#include <libexplain/symlink.h> void explain_symlink_or_die(const char *oldpath, const char *newpath); DESCRIPTION
The explain_symlink_or_die function is used to call the symlink(2) system call. On failure an explanation will be printed to stderr, obtained from explain_symlink(3), and then the process terminates by calling exit(EXIT_FAILURE). This function is intended to be used in a fashion similar to the following example: explain_symlink_or_die(oldpath, newpath); oldpath The oldpath, exactly as to be passed to the symlink(2) system call. newpath The newpath, exactly as to be passed to the symlink(2) system call. Returns: This function only returns on success. On failure, prints an explanation and exits. SEE ALSO
symlink(2) make a new name for a file explain_symlink(3) explain symlink(2) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2008 Peter Miller explain_symlink_or_die(3)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy