just a quick question. I want to use my inode number in a bash script, but I need help.
I use the ls -i "filename" , which echoes the "inode number" "filename". The problem is that I only need the inode number. Is there a way when I can "cut off" the output?
ls -i "filename"
You can use the stat command with %i to get only inode nuymbers:
stat
%i
stat -c '%i' *
Most utilities / commands use the lstat system call, which is used by the stat command, to use the inode.
lstat
you can also awk over ls
-bash-3.2$ ls -i current.py | awk '{print $1}'