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.
Can someone tell me how it is possible to get a textfile printed on the screen and if a new entry will be added the output will be automaticly be updated with the last line.
i.e.
File test1.txt:
Line1 -> Hello
Line2 -> bla, bla, bla...
--> Print file (Line1/2) on screen...
A Program added Line 3
As soon as the program added the Line the command should also print the added line to the konsole.
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
more explanation just for fun.
the -f option means follow, and keeps tail open, and keeps doing tail when the file changes. the >> option means to append to a file instead of overwriting it.a single > would overwrite the file each time instead. the & at the end of the line means give me back the prompt and do this in the background. you can bring it back to the foreground with fg and then kill or suspend the process with control-c or control-z. if you control-z, you can run fg and the process will resume in the foreground, or you can run bg and it will resume in the background.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.