Sponsored Content
Operating Systems Linux Concept of link count in linux Post 302266862 by vaibhav.kanchan on Thursday 11th of December 2008 07:36:00 AM
Old 12-11-2008
Concept of link count in linux

Hi All,

Please explain me the concept of link counts when you try to view the contents of any file or directory using ls command.

-sh-3.00$ ls -lrt
total 194
drwxr-xr-x 2 root root 4096 Aug 12 2004 srv
drwxr-xr-x 2 root root 4096 Aug 12 2004 mnt
drwxr-xr-x 2 root root 4096 Aug 12 2004 initrd
drwxr-xr-x 2 root root 4096 Aug 12 2004 home
drwxr-xr-x 2 root root 4096 Aug 24 2005 misc
drwx------ 2 root root 16384 Jun 26 2006 lost+found
drwxr-xr-x 2 root root 4096 Jun 26 2006 selinux
drwxr-xr-x 2 root root 4096 Jun 26 2006 post
drwxr-xr-x 4 root root 1024 Jun 26 2006 boot
drwxr-xr-x 28 root root 4096 Nov 2 2006 var
drwxr-xr-x 18 root root 4096 Feb 15 2008 usr
drwxr-xr-x 12 mqm mqm 4096 Sep 26 12:58 mqm
drwxr-xr-x 35 root root 4096 Nov 20 19:42 opt
dr-xr-xr-x 8570 root root 0 Nov 23 13:53 proc
drwxr-xr-x 9 root root 0 Nov 23 13:53 sys
drwxr-xr-x 9 root root 6100 Nov 23 13:57 dev
drwxr-xr-x 4 root root 4096 Nov 23 13:57 media
drwxr-xr-x 2 root root 4096 Dec 7 04:23 bin
drwxr-xr-x 10 root root 4096 Dec 7 04:23 lib
drwxr-xr-x 2 root root 12288 Dec 7 04:23 sbin
drwxr-x--- 3 root root 4096 Dec 10 04:15 root
drwxr-xr-x 61 root root 12288 Dec 11 04:02 etc
drwxrwxrwt 7 root root 4096 Dec 11 12:24 tmp
 

9 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Linux Man Page Online Link

Linux Man Page Online Link LINK: Linux Man Page Man Page for ( Section ) - The UNIX and Linux Forums (0 Replies)
Discussion started by: killerserv
0 Replies

2. Solaris

Impact of zero link count files in proc

Greetings I want to confirm about HUGE and old files with linkcount 0 in proc file system. what is their impact on size of root File system? (3 Replies)
Discussion started by: mr_os
3 Replies

3. UNIX for Dummies Questions & Answers

hard link concept

I created a file named as file and a its hard link named as hlink. Problem is that when I delete the file , it gets deleted without notifying that hardlink exists. But as far as I think we cannot delete the file unless we delete all the hard links pointing to it. Is there anything worng... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

4. UNIX for Dummies Questions & Answers

Is there a way to completely remove an inode when the Link count is 2 ?

Currently my data is organised in a volume which has a cache directory (where all the files are first created or transferred). After that there are suitable directories on the volume which in their subdirs, contain files hardlinked to files in the cache. This is done so that the same inode... (1 Reply)
Discussion started by: abcdino
1 Replies

5. Linux

Linux Library symbolic link damaged

Hi, firstly I am not so familiar with linux and i think i have done some damage to the red hat server. It seems that now in command line I am unable to use any basic command whatsoever (ls, move, cp, bash, etc). I was trying to deploy an application and have changed the symbolic link (soft... (1 Reply)
Discussion started by: zaxx
1 Replies

6. UNIX for Dummies Questions & Answers

Linux Symbolic Link Append Name

Can someone help create a symbolic link where I append my own string to the name of the link? Here's the code that I have so far: find /home/folder1/*.txt -type f -exec ln -s {} \; find /home/folder2/*.txt -type f -exec ln -s {} \;So that command works to create my symbolic link but I would... (1 Reply)
Discussion started by: MikeTheKID
1 Replies

7. Linux

Getting warning that hard link count is wrong

I run a find command to search from root directory. find / -inum 344334 The output gives the below warning: find: WARNING: Hard link count is wrong for /proc/1. This may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to... (2 Replies)
Discussion started by: ravisingh
2 Replies

8. Red Hat

Concept of free –m command in Linux

I wanted to know the concept of free -m command as there are different rows of Mem, -/+ buffers/cache & Swap in the output. As an example, it is showing 195 as free Mem in my server but 13850 in the free section of the -/+ buffers/cache row. The output needs in depth knowledge of the different... (7 Replies)
Discussion started by: RHCE
7 Replies

9. Solaris

Zero link count files in proc

Hi Experts, I had encountered an issue where the zero link process was holding too much amount of data on a Solaris server. I was able to terminate the process after which the space of the file system was released. 40G /proc/8567/fd/2 Can you please let me know if there are any... (11 Replies)
Discussion started by: dhanu1985
11 Replies
load_dat_font(3alleg4)						  Allegro manual					    load_dat_font(3alleg4)

NAME
load_dat_font - Loads a FONT from an Allegro datafile. SYNOPSIS
#include <allegro.h> FONT *load_dat_font(const char *filename, RGB *pal, void *param) DESCRIPTION
Loads a FONT from an Allegro datafile. You can set param parameter to point to an array that holds two strings that identify the font and the palette in the datafile by name. The first string in this list is the name of the font. You can pass NULL here to just load the first font found in the datafile. The second string can be used to specify the name of the palette associated with the font. This is only returned if the pal parameter is not NULL. If you pass NULL for the name of the palette, the last palette found before the font was found is returned. You can also pass NULL for param, which is treated as if you had passed NULL for both strings separately. In this case, the function will simply load the first font it finds from the datafile and the palette that precedes it. For example, suppose you have a datafile named `fonts.dat' with the following contents: FONT FONT_1_DATA FONT FONT_2_DATA FONT FONT_3_DATA PAL FONT_1_PALETTE PAL FONT_2_PALETTE Then the following code will load FONT_1_DATA as a FONT and return FONT_1_PALETTE as the palette: FONT *f; PALETTE pal; char *names[] = { "FONT_1_DATA", "FONT_1_PALETTE" } f = load_dat_font("fonts.dat", pal, names); If instead you want to load the second font, FONT_2, from the datafile, you would use: FONT *f; PALETTE pal; char *names[] = { "FONT_2_DATA", "FONT_2_PALETTE" } f = load_dat_font("fonts.dat", pal, names); If you want to load the third font, but not bother with a palette, use: FONT *f; char *names[] = { "FONT_3_DATA", NULL } f = load_dat_font("fonts.dat", NULL, names); RETURN VALUE
Returns a pointer to the font or NULL on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks. SEE ALSO
register_font_file_type(3alleg4), load_font(3alleg4) Allegro version 4.4.2 load_dat_font(3alleg4)
All times are GMT -4. The time now is 08:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy