What is "getty", and why does it have such a 'descriptive' name?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Rep:
What is "getty", and why does it have such a 'descriptive' name?
In my further efforts to learn a bit more about Linux, I have to ask what may seem to be another stupid question. So here goes:-
What is Getty, why does it have a name that means nothing that could be called descriptive. In fact, why do lots of Linux programs have odd names that bear no resemblance to what they do, and therefore give no clue as to their possible purpose. Now bear with me here, I am not looking for a flame war, it's just that I am getting a little older, and therefore slower absorbing information than I used to do. There was a time when you could throw questions about Novell networking, and the Win series of software at me, (up to 98se anyway), and |I would be pretty confident at being able to answer them. I can also answer plenty of stuff about Linux, but some things just elude me,(an age thing).
Anyway, rambling on. Info on mingetty also pls as I don't seem to have either man or info pages for neither of these 2 things.
gettys are something like "login screens"; when you boot your linux machine into text-mode, you'll get something like
localhost login:
where localhost is the hostname of the machine. that's getty. it's the prog that waits there until somebody gets lost in it's way and wants to get in so it is basically a login manager or part of it, I'd say...I have a manpage for agetty, an alternate linux getty program.
all I could think of it's name that resembles it's doings is the "get" part of it's name; it gets your attention when you want to log in heh..quite a bad memory rule but that's at least one. and yes, some linux apps do have somehow weird names, but that's just something we all have to deal with..I mean, "getty" is better than "daf04s.2" I think
EDIT: oh yes, and isn't mingetty something like "minimal getty" ? so it's basically the same program as getty, but more...minimal
a cut from agetty's manpage:
"DESCRIPTION
agetty opens a tty port, prompts for a login name and invokes the
/bin/login command. It is normally invoked by init(8)."
hopefully this cleared things at least a bit...or, at least, did not mess them up any more.
Unix philosophy is a bit different from windows: windows makes big programs with lot's of purposes. Unix makes lots of programs for small purposes. Without starting a flame war about which philosophy is better , I can conclude unix-like os's have lot's of programs which must all have a name. And many linux-programs are written by geeks too, so... . Getty really is a small program: it just asks for a username (I have forgotten the exact details). After you have given a username another program starts: login. Login checks your password. I agree getty isn't really descriptive, but I wouldn't know anything better...
Another nice example: the program "more" lets you scroll through a textfile: when you hit enter you will scroll down, get 'more'. The program less is about the same, but you can scroll back too. So 'less' is more than 'more' . Confusing naming indeed. Btw, do you know the program 'finger'? It's called finger cause it creates a list of users, and people use their fingers to read through the list .
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
OK, that's about as clear as mud. I agree with the Unix philosophy thing, but am still confused. I thought that the text based login screen that is being talked about here is BASH, or whatever shell one happens to prefer, still, I defer to your knowledge in this. In the same vien,(think that's spelt right), can you give me a reason behind the 'touch' command. Just why would you wish, or need to change the timestamp on a file manually. I can understand the need to know the last access time etc, but isn't this an automatic feature anyway?. The reason I ask is that looking through some of the shell scripts in my efforts to learn, I very often see the touch command referenced, without much, if any explanation why. Maybe I'm getting to old for this. LOL the old grey matter is just struggling a bit.
It's called "getty" because it's European-immigrated-to-Canada mother couldn't pronounce "Gary". Anybody who gets that joke gets five bonus-points.
The shell doesn't exist until after you login, then it gets spawned. If you look through the process list "ps -ax", you'll see a number of "...getty tty#"s, but only as many "-bash"s as you have users logged in.
Touch can be used for a number of things...
You can create a file with "touch filename". Can be useful in a script if you're not sure if a file exists or not... Touch it, and it creates it if it didn't already exist.
You can change the timestamp on files you are backing up... Search for all files older then a date, and back them up, changing the date as you go.
Yes, it's perfectly intuitive once you know what a tty is. But this begs the question, how the heck do you get "tty" out of text console? Short for teletype or teletypewriter? Now there's a bit of jargon the young'uns will never have heard of...
one more thing about the naming of unix programs: as quite many of unix-users know, windows is based on "click-and-open" -way of working, and unix, on the other hand, is more like "write-and-open" -thing. that is, windows is windows, it's command prompt is mainly for some old apps and sivilized users ought to use the graphical environment (which is almost the whole thing) instead. in unix, x window system is just a part of the system, and a small one indeed - the real work is done in console, and I have noticed myself (altough I disagreed this when I moved to linux) that console is way faster and effective than any graphics based windows-like environment..anyway, let's get to the point:
when you're in windows, you have graphical desktop, and it's nice that when you see an application's binary file, you can read it's name like "MS Outlook Express". just click and it opens, easy as that. but when it comes to unix-like systems, especially if you use console (like I often do myself), you can't click. you must type it. and partly because of unix's style of making difference between upper- and lowercase, writing "MS Outlook Express" is hard to write and takes time, it makes things a lot faster to use short, quikcly writeable names. but still the names should tell something (rather than being a series of randomly chosen numbers or letters), the information is shortened to minimum: so if one wants to have a program that "gets a tty", nobody doesn't have to write anything like "get\ a\ tty" (notice \ marks before spaces), but write "getty" instead; there is a meaning behind the name, but the name is just made short so that you don't have to type it too long.
a long explanation, that's what this was..but I think it explains something. shortly: in graphical environment it's easy to use long program names because you don't have to write them but click (when it doesn't matter how long the name is), but if you _do_ have to write them, it's best to make the names short.
also, when one wonders what a program does, man-pages (and info-pages) come to help you. whenever you are in trouble of remembering how, why or what a program does, (assuming you have installed man/info-pages), just type
man appname
in console and if there is a manpage for the application "appname" (as there often, but not always is), it's shown to you and you can read everything you need from there.
here's some examples of names that have a meaning behind them, a "shortened meaning":
mkisofs - MaKeISOFileSystem, in cd-writing process
mv - MoVe (easy? I think it is)
cp - CoPy
cd - ChangeDirectory
nano - well, nano has a physical meaning of something really small, and the editor behind this name truly isn't anything big
I understand it's difficult to say from a program name what it does, before you've once seen the "whole name" that it refers to. and I can't say that there aren't any names that don't have meaning, because there as well might be...but most of them have somekind of sense and when one uses them from time to time, they gradually start digging into one's memory...not that it would be possible to know or remember them all, but it usually does to remember the ones that one uses and needs; that isn't impossible.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.