Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
It displays as the command has determined. Some commands output nothing, others write and remove files and send a great deal to standard out. The devil's in the details of the command executed.
Augmenting previous reply.....When working in a terminal, it is designated as the "standard output" (STDOUT). This can be redirected---to a file, to another terminal, etc.
The source code uses a "file descriptor" which is a sort of key to access a file. By convention, the first three file descriptors are reserved:
0 - standard input
1 - standard output
2 - standard error
So a C code can send a message (for example using printf or fprintf) to file descriptor 1 (or 2) and it will be printed out in the console/terminal.
In Fortran you have "unit numbers". Here, by convention:
0 - standard error
5 - standard input
6 - standard output
You can redirect commandline output:
$ echo "my text" > newfile.txt
will send output to the named file, and it works the other way around as well
$ mysql mydatabase -umyusername -pmypassword < mydata.sql
will send the contents of the sql file to the database
You can redirect commandline output:
$ echo "my text" > newfile.txt
will send output to the named file, and it works the other way around as well
$ mysql mydatabase -umyusername -pmypassword < mydata.sql
will send the contents of the sql file to the database
thanx for the answer, but my question is how does a ouput display on SCREEN......
Google those items I mentioned. Is this a generic homework qn or do you have a specific qn?
There are several levels involved in this qn and its not at all clear which one you want...
Google those items I mentioned. Is this a generic homework qn or do you have a specific qn?
There are several levels involved in this qn and its not at all clear which one you want...
i simply want to know that when i typed
$ echo hello
hello was the output on the screen, plz tell me how does a ouput display on screen.......... i mean what is the internal working takes place?
If you type 'echo hello', it defaults to stdout (chan 1)
As I said, there's more (many) levels underneath.
If you tell us why you want to know, we can give you better answers.
WELL,i m doing a research for my office on echo command and i wanna know each and everything abt echo.......
plz help me out..
1. echo uses which libraries
2. how does echo work internally
3. what is the significance of escape sequences and who recognize that sequences in system....
As this is Linux, you can read the source code; much faster than asking lots of qns.
Why do you care/need to know the internals? What are you trying to achieve?
As this is Linux, you can read the source code; much faster than asking lots of qns.
Why do you care/need to know the internals? What are you trying to achieve?
i hv to learn the internals..... how can i get the sorce code of a command.. can u plz gv me some useful links...
1. echo uses which libraries
2. how does echo work internally
3. what is the significance of escape sequences and who recognize that sequences in system...
1. Use the ldd command to find out which libraries are used by echo:
Code:
ldd `which echo`
2. read the source. The echo command is provided by the package coreutils. Look for it on the GNU website.
3. same as point 2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.