Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have directory where different type of files and folders exist. I want to list these files and folders inodes numbers with a single command in a single screen. How can achive that? Thanks.

What I have tried:

I have directory where different type of files and folders exist. I want to list these files and folders inodes numbers with a single command in a single screen. How can achive that? Thanks.
Posted
Updated 14-Jun-19 5:34am

 
Share this answer
 
The -i option to ls gives inode numbers. You might want to use -F option, which appends a '/' for directories, and '@' for symbolic links, and '*' for executables (plus a couple of others indicators we can probably ignore for now).
e.g.
$ ls -iF
   872499 bar@    13150 foo/   1142157 x*  19583190 x.c

Whether that will fit on a single screen or not depends on how big your screen is and how many files and directories you have. There's also a -m option that outputs all directory entries in a single line, separated by ', '. That might be useful in situations where you have a huge number of entries that you want to process in script.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900