Sponsored Content
Full Discussion: Find cmd and sym links
Top Forums UNIX for Advanced & Expert Users Find cmd and sym links Post 302997102 by Don Cragun on Monday 8th of May 2017 04:18:02 AM
Old 05-08-2017
Quote:
Originally Posted by jim mcnamara
If you create another (second) inode - not a symlink (a hard link) - then it will work.

Use the ln command -this has one limitation for the new hard link : the file has to be in the same file system as the original. That usually means the same mount point with no intervening mount points. From my man page:


Be careful doing this - lots of hard links use up the inode quota for the file system. Bad things happen at that point.
Hi Jim,
No. No matter how many hard links there are to a file, that file only consumes one i-node.

If you have a bunch of symbolic links pointing to a regular file, the regular file and each symlink will consume separate i-nodes; but even if there are a 1000 hard links (i.e., 1000 different directory entries naming a single file) to a file, that file only consumes one i-node.

Note that if you use the command:
Code:
ln sym link

where sym is the name of an existing file of type symbolic link, the standards do not specify whether the file named link will be created as a hard link to the symbolic link sym or as a hard link to the file to which sym resolves. (The latest revision of the POSIX standard added -L and -P options to the ln utility to let the user choose the behavior they want, but most implementations haven't released updates that conform to this version of the standard yet.)

Hi general_franco,
By definition, you can't hard link files that are on different filesystems.

When asking questions like this, it always helps to know what operating system you're using.

Have you tried:
Code:
find /u04/ -name example.file -type f

? Adding the trailing / to the pathname operand you pass to find will fail if that pathname argument doesn't resolve to a directory, but it should cause any symbolic links contained in that pathname to be resolved with or without the -L option.
These 3 Users Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find and sym links

Would I be correct in assuming that find doesn't bother recursivley searching down sim links. (It doesn't seem to so I guess it doesn't!!!) Is there anyway to make it do so? (3 Replies)
Discussion started by: peter.herlihy
3 Replies

2. Shell Programming and Scripting

Find cmd not working as expected

Hi, i wan to search the file starting with Admin into the directory Output. I am running below command: find /appl/Output -name "Admin*" -prune but this command is going into the sub directories present under output. I do not want to search under sub directories. Any help will be highly... (6 Replies)
Discussion started by: Vishal123
6 Replies

3. Shell Programming and Scripting

using find cmd to find certain files

i have a list of files below: rwxrwxrwx 1 pipe pipe 180 Mar 4 22:47 del_0n_Date -rwxrwxrwx 1 pipe pipe 472 Mar 4 22:58 mail_Check -rw-r--r-- 1 pipe pipe 92 Mar 4 22:58 minfo.txt -rwxrwxrwx 1 pipe pipe 609 Mar 5 05:12... (6 Replies)
Discussion started by: ali560045
6 Replies

4. Shell Programming and Scripting

Find cmd not working correctly in script

I am trying to copy 2 types of files so I can archive them. I tested with a set of commands: touch -t $(date -d "-60 day" +%Y%m%d) WORKDIR/REF find TARGETDIR/ -type f -maxdepth 1 -iname \*.out\* -or -iname \*.log\* ! -newer WORKDIR/REF -exec ls -l {} \; This correctly lists any files in the... (2 Replies)
Discussion started by: prismtx
2 Replies

5. Shell Programming and Scripting

date with find cmd

Hi for today i have 10 files, in that i need search some values how can i write a find cmd with perticular date thanks SAIC (4 Replies)
Discussion started by: saic
4 Replies

6. Shell Programming and Scripting

How to link lsof and find cmd?

Hi All, My target is to find the biggest files opened by any process and from that i have to find process id and the corresponding file also to avoid file system being hung-up. Finding the process id: is to kill the process Finding the biggest file: is to remove the file To get the process... (0 Replies)
Discussion started by: Arunprasad
0 Replies

7. Shell Programming and Scripting

Nested find cmd

Hi gurus, greetings. Objective: find in a path directories that are named Logs. In each found Logs dir search for files with .log extension and remove -atime +6. (Note for test/example, rm and -atime is not used). Issue: If I execute the script without redirecting output to a file, on... (8 Replies)
Discussion started by: rsheikh
8 Replies

8. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

9. UNIX for Dummies Questions & Answers

Help with the find cmd

Hello, I'm having a trouble with the find cmd. I would like to find all the java versions on my systems. I have solaris 9 & 10 RHEL and SUSIE. java -version doesn't give all the versions on the server. So I am trying to use the find command to find them all find / -name java I would... (7 Replies)
Discussion started by: bitlord
7 Replies

10. UNIX for Dummies Questions & Answers

Create Sym Links for a series of files

Hello, I would like to create symbolic links for a series of files in my cwd (after confirming that the links don't already exist). The above files all have a similar prefix, but different extensions. I created a shell script like shown below and I get an error message "No such file or... (4 Replies)
Discussion started by: Gussifinknottle
4 Replies
All times are GMT -4. The time now is 04:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy