09-20-2018
Quote:
Originally Posted by
infernalhell
Could you please let me know what each of the output fields in ls -ltr for a directory imply.
Example :
drwxrwsr-x 4294967295 infamgr infagrp 2147549184 Sep 2 17:01 job
basically would want to know 4294967295 and 2147549184
Something you can try to do is determine the sizeof a dir entry on your system...it's a simple C program to write and it'd give you how much storage each dir entry takes up...although the "no. of entries X sizeof each dir entry" may still not equal the 2147549184 figure...at least that'd be the rationale behind it yet the kernel has complete control over the inner workings of a dir so one cannot be sure of what it's actually doing.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am getting a variable as x=2006/01/18
now I have to extract each field from it.
Like x1=2006, x2=01 and x3=18.
Any idea how?
Thanks a lot for help.
Thanks
CSaha (6 Replies)
Discussion started by: csaha
6 Replies
2. Shell Programming and Scripting
Hi guys,
I couldn't find solution to this problem. If anyone knows please help me out.
your guidance is highly appretiated.
I have two files -
FILE1 has the following 7 columns ( - has been added to make columns visible enough else columns are separated by single space)
155.34 - leg - 1... (8 Replies)
Discussion started by: smriti_shridhar
8 Replies
3. Shell Programming and Scripting
Hi,
I am writing a code where the file is a pipe delimited and I would need to extract the 2nd part of field2 if it is "ATTN", "C/O" or "%" and check to see if field9 is populated or not. If field9 is already populated then leave it as is but if field9 is not populated then take the 2nd part of... (3 Replies)
Discussion started by: msalam65
3 Replies
4. Shell Programming and Scripting
Hi All,
Looking for a quick AWK script to output some differences between two files.
FILE1
device1 1.1.1.1 PINGS
device1 2.2.2.2 PINGS
FILE2
2862 SITE1 device1-prod 1.1.1.1 icmp - 0 ... (4 Replies)
Discussion started by: stacky69
4 Replies
5. Shell Programming and Scripting
Diff output as follows:
< AAA BBB CCC DDD EEE 123
> PPP QQQ RRR SSS TTT 111
> VVV WWW XXX YYY ZZZ 333
> AAA BBB CCC DDD EEE 124
How can i use awk to compare the last field to determine if the counter has increased, and need to ensure that the first 4 fields must have the same... (15 Replies)
Discussion started by: ux4me
15 Replies
6. Shell Programming and Scripting
Attached is a file called diff.txt
It is the output from this command:
diff -y --suppress-common-lines --width=5000 1.txt 2.txt > diff.txt
I have also attached 1.txt and 2.txt for your convenience.
Both 1.txt and 2.txt contain one very long CSV string.
File 1.txt is a CSV dump of... (0 Replies)
Discussion started by: gvolpini
0 Replies
7. Shell Programming and Scripting
Hi All,
I am using the following command in Linux:
sar -r 30 3
Linux 2.6.18-194.3.1.7.3.el5xen 02/07/2013
02:55:47 PM kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
02:56:17 PM 128646024 22348920 14.80 230232 15575860 75497464 ... (4 Replies)
Discussion started by: a1_win
4 Replies
8. Red Hat
In our environment we used to lot of events for ntp issues. I am unable to find the what needs to consider here. :(
ntpq -p fields.
remote refid st t when poll reach delay offset jitter
---------- Post updated at 05:13 AM ---------- Previous update was at 04:47 AM... (1 Reply)
Discussion started by: Naveen.6025
1 Replies
9. Shell Programming and Scripting
help me (2 Replies)
Discussion started by: sonu pandey
2 Replies
10. Shell Programming and Scripting
I need to print field and the next one if field matches 'patternA' and also print 'patternB' fields.
echo "some output" | awk '{for(i=1;i<=NF;i++){if($i ~ /patternA/){print $i, $(i+1)}elif($i ~ /patternB/){print $i}}}'
This code returnes me 'syntax error'. Pls advise how to do properly. (2 Replies)
Discussion started by: urello
2 Replies
dir(5) File Formats Manual dir(5)
Name
dir - format of directories
Syntax
#include <sys/types.h>
#include <sys/dir.h>
Description
A directory behaves exactly like an ordinary file, except that no user may write into a directory. The fact that a file is a directory is
indicated by a bit in the flag word of its i-node entry. For further information, see The structure of a directory entry is given in the
include file.
A directory consists of some number of blocks of DIRBLKSIZ bytes, where DIRBLKSIZ is chosen such that it can be transferred to disk in a
single atomic operation (for example, 512 bytes on most machines).
Each DIRBLKSIZ byte block contains some number of directory entry structures, which are of variable length. Each directory entry has a
struct direct at the front of it, containing its inode number, the length of the entry, and the length of the name contained in the entry.
These are followed by the name padded to a 4-byte boundary with null bytes. All names are guaranteed null terminated. The maximum length
of a name in a directory is MAXNAMLEN.
The macro DIRSIZ(dp) gives the amount of space required to represent a directory entry. Free space in a directory is represented by
entries which have dp->d_reclen > DIRSIZ(dp). All DIRBLKSIZ bytes in a directory block are claimed by the directory entries. This action
usually results in the last entry in a directory having a large
dp->d_reclen. When entries are deleted from a directory, the space is returned to the previous entry in the same directory block by
increasing its dp->d_reclen. If the first entry of directory block is free, then its dp->d_ino is set to 0. Entries other than the first
in a directory do not normally have dp->d_ino set to 0.
#ifdef KERNEL
#define DIRBLKSIZ DEV_BSIZE
#else
#define DIRBLKSIZ 512
#endif
#define MAXNAMLEN 255
The DIRSIZ macro gives the minimum record length that will hold the directory entry. This requires the amount of space in struct direct
without the d_name field, plus enough space for the name with a terminating null byte (dp->d_namlen+1), rounded up to a 4-byte boundary.
#undef DIRSIZ
#define DIRSIZ(dp)
((sizeof (struct direct) - (MAXNAMLEN+1)) +
(((dp)->d_namlen+1 + 3) &~ 3))
struct direct {
u_long d_ino;
short d_reclen;
short d_namlen;
char d_name[MAXNAMLEN + 1];
/* typically shorter */
};
struct _dirdesc {
int dd_fd;
long dd_loc;
long dd_size;
char dd_buf[DIRBLKSIZ];
};
By convention, the first two entries in each directory are for dot (.) and dot dot (..). The first is an entry for the directory itself.
The second is for the parent directory. The meaning of `..' is modified for the root directory of the master file system ("/"), where dot
dot has the same meaning as dot.
See Also
fs(5)
dir(5)