LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-18-2013, 01:14 PM   #1
theboyk
LQ Newbie
 
Registered: Jun 2013
Posts: 4

Rep: Reputation: Disabled
Nano: How to copy entire non-wrapping line?


Hello.

I'm working on some documentation and I need to copy some tasks from my crontab and paste them into another file. The problem, when I view the crontab with Nano, it's not wrapping the lines and is truncating it with a trailing $ when the line length is longer than the width of the terminal window (like it's supposed to).

So, I'm wondering if anyone knows how I can copy the complete (truncated) line from the crontab using Nano so I can then paste it into another document?

Thanks,
Kristin.
 
Old 06-18-2013, 01:24 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,816

Rep: Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346
The $ lets you know that the line is continuing. Go to the line and scroll right.

If you were asking how to make it line wrap -- just press CTRL-J (Justify)

Last edited by szboardstretcher; 06-18-2013 at 01:26 PM.
 
1 members found this post helpful.
Old 06-18-2013, 01:34 PM   #3
theboyk
LQ Newbie
 
Registered: Jun 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yea, I knew if I scrolled to the right of the $, it would continue displaying the line, but still wasn't able to copy the entire line that way. But, justifying the line worked perfectly!

That said—what exactly is Justify doing in terms of how the file is built? I know line-wrapping within the crontab isn't typically used (because the line wrap = new line and errors out when saving the crontab), but would the same thing happening if using Justify?

I typically end up going into vi to edit the contab tasks, but I'm slightly more comfortable in nano, so if the Justify option on a long line doesn't have any negative implications, I might consider doing that going forward...

Thanks!
 
Old 06-18-2013, 01:44 PM   #4
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,011

Rep: Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621
If you just want to duplicate a line under itself in the same file, for example, then just hit Ctrl+k then Ctrl+u twice.
Not sure whether that helps.
 
Old 06-18-2013, 01:45 PM   #5
theboyk
LQ Newbie
 
Registered: Jun 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
If you just want to duplicate a line under itself in the same file, for example, then just hit Ctrl+k then Ctrl+u twice.
Not sure whether that helps.
No, I'm looking to copy the line to the Clipboard (OS X) so I can then paste it into a text file. Thanks though.
 
Old 06-18-2013, 01:50 PM   #6
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,011

Rep: Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621
Quote:
Originally Posted by theboyk View Post
No, I'm looking to copy the line to the Clipboard (OS X) so I can then paste it into a text file. Thanks though.
Though that might be the case, sorry. I'd be interested in a solution too.
 
Old 06-18-2013, 01:52 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,816

Rep: Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346Reputation: 1346
Offhand i do not know. But testing should be straight forward. Create a temp file with those lines, justify it, then cat the file and see if everything is ok. And testing the copy and paste functionality is just as easy to test. Justify it, then copy and paste it.
 
1 members found this post helpful.
Old 06-18-2013, 01:58 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,011

Rep: Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621
I just tried justify on my .conkyrc (file with long lines I have handy) and it did nothing. I'm a little stumped now.
 
Old 06-18-2013, 02:21 PM   #9
theboyk
LQ Newbie
 
Registered: Jun 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yea, the Justify hard-returns line-breaks, but all good. Just won't save the file after justifying it. 8)
 
Old 06-18-2013, 04:45 PM   #10
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,433

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
With nano, you could read the file containing the long lines into your document (Ctrl-R) and then delete what you do not need.
 
2 members found this post helpful.
Old 06-18-2013, 04:55 PM   #11
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,011

Rep: Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621
Quote:
Originally Posted by allend View Post
With nano, you could read the file containing the long lines into your document (Ctrl-R) and then delete what you do not need.
Good call! TI could be excessive in some circumstances but it's a working solution, thanks. I didn't know this was something I wanted to do before I read this thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy/paste a line in nano editor smp0219 Linux - Newbie 7 01-03-2016 07:40 PM
Line wrapping broken on Bash 3.0 ninjabob7 Linux - Software 4 09-21-2009 01:50 PM
line wrapping email RON Howe Linux - Newbie 9 04-14-2009 08:10 AM
line wrapping in terminal emetib Linux - General 4 10-29-2003 10:18 PM
bash line wrapping gone awol acid_kewpie Linux - Software 10 05-14-2003 06:04 AM


All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration