I am trying to manage user accounts. They are basically just numbers, but I would rather see user last names on the screen. Is it possible to automatically replace displayed text with something else?For example when I go to /home/users and type ls-al, can I somehow see:SmithJohnsonAdamsAndrewsinstead of001 002 003 004or can I somehow see both?001 Smith002 Johnson003 Adams004 Andrews
Can you replace displayed text with something else in command window?
shell;sed;string;replace;text
If I understand correctly, you named all your users by number, and you want to see their last names. Where are their last names stored? in other words, you need to make some kind of correlation between the names and numbers; where is the source of that information?Assuming you have some master list that correlates NUMBER to LAST-NAME, then you could set up an ls frontend for your self. For example:If you have a file usernames.list:001 Smith002 Johnson003 Adams004 AndrewsThen you can write a loop that re-implements ls but with correlation between your list and the keys it finds in /home:for DIR in * ; do fgrep ${DIR} /path/to/usernames.list ; doneWhich would print:001 Smith002 Johnson003 Adams004 AndrewsIf you userlist is more complex than those key/value pairs, you can use cut to parse the info as you desire.For the record, this is not the standard way of managing users. Users on a POSIX system already have unique identifiers (the User ID, see the id command) so naming all your users incrementally from 001 is definitely not ideal.