Print from command line
Two questions for ya first how do you print from vi? I tried to search here for it but you can't search for vi as it is under 3 letters, then along the same lines how do you print from command line say cat test.txt > ????? I already have my printer installed and working great but as most of my work seems to be at command line this is quite the handicap. Thanks for any info.
|
I haven't done this from linux, only Solaris, but check out the man pages for "lpr", and maybe "lpq" for a start
Not sure exactly how to make this happen from vi or vim, but I would think you can always save the file first, and then do a lpr "file" from the command prompt. |
Thanks for the reply that works great, does anyone know the command for printing while you are in vi, there is alot of times where I will be working on code and want to have a quick printout of if to check some syntex things.
|
OK, just fired up vi under Redhat 7.2 which tells me it is "vim" (vi improved?). Don't know if this will work but its worth a try.
to run a shell command, say like 'lpr myfile' from within vi(m) do <esc> to get to command mode, then :!<cmd> where <cmd> is the <cmd> you want like 'lpr myfile' if that worked for you like you said. so save the 'file' first ("<esc>:w" , then do <esc>:!lpr 'file' let me know if that works or doesn't, I haven't tried |
Yep works great thank you very much. I had to keep going into gui just to print off my html and php files, seems like a bit of a waste to me, I like spending my time in the command line, I guess it is just a sickness or something.
|
All times are GMT -5. The time now is 06:22 AM. |