Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
just wondering how those great command line programs are made such as links, vim , top etc.i mean how to they wrote those interface.
i know we can write GUI programs using gtk or qt. but when is comes to making command line programs how is the interface made ( for example mc, how is those split screens, using keyboard to select things etc are impliment), is there any equivalent gtk or qt for making command line interface?
can someone give me some direction on how to write command interface programs?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
I think what you need is ncurses. Vi etc. might have been written with their own screen handling routines, not sure about that. But programs like fcdisk, mc and lynx use ncurses for sure.
There is plenty of documentation and demos included with the package, and various websites offer an on-line function reference. I just do not have the links at hand, but it is easy to find when you google.
To get started, from the command line enter "man bash".
This will tell you about the bash shell, which is where most of it starts.
If you want to learn shell scripting, you also need to learn about sed, awk, grep, cut, cat, and an assortment of other commands that let you manipulate strings.
I think what you need is ncurses. Vi etc. might have been written with their own screen handling routines, not sure about that. But programs like fcdisk, mc and lynx use ncurses for sure.
There is plenty of documentation and demos included with the package, and various websites offer an on-line function reference. I just do not have the links at hand, but it is easy to find when you google.
I agree. FYI, ncurses is a console-based, "pseudo" GUI library. More on ncurses here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.