|
CS469/569 - Linux and Unix Administration and Networking
Spring 2022
|
Displaying ./code/02-22/h6/a.sh
#!/bin/bash
# This script should take a list of file-names on the command line and print
# the names and inode numbers of only those that are regular files. ex:
# >./a.sh /net/*
# 12 /net/aquota.user
for f; do
# if test on $f being regular file. [ -f $f ]
stat -c "%i %n" $f
done
exit
fwiw, file system looks (kind of) like....
disk block 0 has something like
"bin" -> inode 1234 (block number on the disk)
"usr" -> inode 4567
"u1" -> mounted disk
block 1234 ("bin")
"Mail" -> "/usr/bin/mailx"
"[" -> inode 7889
|