[SOLVED] long command line is wrapped at the beginning of the same line
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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
long command line is wrapped at the beginning of the same line
I tried to change COLUMNS and added "export COLUMNS=250"
in my .bash_profile.
but after re-login, suppose it will pick up the updated COLUMNS variable, but it didn't. I did source the .bash_profile again, then the variable is updated. But when I use "set" command, it is still the old value. I don't know where 65 is set. and when I resize the terminal window, this value keeps changing. Can somebody explain this to me?
[ipbx@lab33 ~]$ printenv COLUMNS
[ipbx@lab33 ~]$ echo $COUMNS
I believe there's some miscommunication at work here. I, and probably most of the others, don't understand what the "wrapping" trouble actually is, and why you think you have to mess with the COLUMNS variable to fix it.
Could you please explain exactly what your problem is, in detail?
And please use ***[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
edit: After reading the title again a couple of times, I think druuna may be right, and you have a mis-configured prompt. If there are unprotected non-printing characters involved, you often get behavior like lines wrapping back upon themselves.
So if you've changed something in your PS1 variable, please post it (in code tags, naturally).
Last edited by David the H.; 12-19-2012 at 11:36 AM.
Reason: as stated
I tried "shopt -s checkwinsize", the wrapping didn't work immediately. After I re-size the window to smaller size, the long command was wrapped to the next line afterwards.
I looked at another shell, checkwinsize was on by default. So I am not sure if "shopt -s checkwinsize" helped.
I am going to add this shopt to my .bashrc anyway to see if I will run into the same problem again.
Thanks for help.