Questions tagged [line]
The line tag has no usage guidance.
27
questions
0
votes
1
answer
33
views
How to search an argument/flag/option in man with a line break?
In man argument/flag/option chapters generally include a line break, as with:
-s
silent
How could I find only the -s which includes a line break after it, just as in the above example?
The ...
0
votes
0
answers
38
views
FOLD not working on very long lines
I have a fold command as below to split a file with very long line into multiple lines. It works if the file is small. But if the length of the file is too long, it stops adding new line character ...
1
vote
1
answer
218
views
Showing line numbers by default in ed
In the ex editor, one can show line numbers by default by adding this line to a .exrc file:
set number
Is there a way to have ed start with line numbers showing by default, when lines are invoked?
2
votes
2
answers
318
views
In a file to find and replace/change multiple strings in a line with shell script
I am new to shell scripting
What I have is a log file, each line begins like the below entry,
[2021.04.27.17:03:43.813]: ERROR -
[2021.04.27.17:04:36.790]: SUCCESS -
The desired output to a new file ...
0
votes
1
answer
180
views
PureOS Command Line Window
I'm new to PureOS and I've been looking for a way to open a command line window without any luck. How do I open a console/command line window in PureOS?
0
votes
0
answers
21
views
Gnuplot connect points when no value
I have below example,
1|5
2|8
3|1
6|8
7|5
8|10
With below code the chart connects between 3 and 6 x data is there a way to plot zero values between 3 and 6 x data,
gnuplot << EOT
set ...
1
vote
1
answer
35
views
merge x and x + n lines
I am writing a script which returns 15 lines of titles and 15 lines of URLs.
title 1
title 2
title 3
*snip*
title 14
title 15
http://example.com/query?1
http://example.com/query?2
http://example.com/...
-1
votes
2
answers
568
views
Is a text file bigger on Windows than on Linux because of carriage return?
Let's say I have the same ASCII text file on Linux and Windows:
one
two
three
The two files will have \n and \r\n respectively as EOL character on the two OSes.
Does this mean that the file on Linux ...
0
votes
3
answers
284
views
How do I print line numbers but reset line counter at empty line?
I have a file.txt containing:
this is the first
second line
not last line
fourth but first
second in list
seventh in file
seventh with nl
Normally I would just cat and pipe | it into nl like so:
$&...
0
votes
2
answers
71
views
using $ arguments on the command line and providing values for them at the end
rather than write scripts for every single process I need to do, I like to just save commands in a text file and copy and paste them on the command line. Of course, some of the specifics of the ...
2
votes
4
answers
3k
views
Read file line by line with awk to replace characters in certain line numbers
I have got this script here. It is supposed to run the loop by reading the file LineNumbers.file line by line (each contains a line number) and then accordingly replacing 0/0 with ./. in the ...
0
votes
2
answers
129
views
How to delete particular lines in vim editor
Suppose I have 50 lines in my vim editor and I have to delete particular lines (5,9,16,28) in a single command.
23
votes
10
answers
14k
views
How to remove empty lines from beginning and end of file?
I would like to remove empty lines from the beginning and the end of file, but not remove empty lines between non-empty lines in the middle. I think sed or awk would be the solution.
Source:
1:
2:
3:...
0
votes
1
answer
128
views
Dovecot add existent folder from command line
I've insert a .INBOX.test folder in my mailbox folder /home/user/Maildir but I dont see it from Thunderbird.
What i have to do for see it?!
Thanks
13
votes
2
answers
3k
views
How to make a continuous vertical line in vim?
I want to make a table in vim.
Making a horizontal line is easy
______________________________
For the vertical I use this
yes "|" | head -10
But the result is bad
|
|
|
|
|
|
|
|
|
I want ...
1
vote
3
answers
2k
views
How to make text wrap with diff -y?
When I use diff -y to compare two text files with long lines of text, the result cuts off each column and I cannot read an entire line. I would like instead the text to wrap (or fold as it is also ...
4
votes
2
answers
443
views
Is there a way to count the number of lines of text in a file including non-delimited ones?
The POSIX wc command counts how many POSIX lines in a file. The POSIX standard defines a line as a text string with the suffix \n. Without \n, a pure text string can't be called a line.
But to me, ...
3
votes
6
answers
4k
views
sed: delete all lines before matching one, including this one
TARGET
How to delete all lines in a text file before a matching one, including this one?
Input file example:
apple
pear
banana
HI_THERE
lemon
coconut
orange
Desired output:
lemon
coconut
orange
...
0
votes
1
answer
243
views
Running command on each line of output immediately [duplicate]
I found out that when I run a command which executes a software that has continuous output lines e.g. traffic monitor like tcpdump or tshark the command keeps counting numbers on screen like 4, 8, 12 ....
0
votes
2
answers
45
views
How can I delete a particular file through the command line?
I'm using Ubuntu and would like to know if there is an easy way to delete a single file through the command line. In the same way you might use 'rmdir -r' to delete a whole file.
0
votes
2
answers
347
views
grep stringset as a single line
Let say in a text file if I do
grep FINAL *.msg
it returns
FINAL COMPUTATIONS: Elapsed Time: 000:30:55.65; CPU Time: 000:30:26.53
FINAL COMPUTATIONS: Elapsed Time: 000:28:11.77; CPU Time: ...
20
votes
2
answers
78k
views
check command line arguments
I would like to check if the first command line argument ($1) has an minimum amount of 10 characters and if it is empty.
The script is called as:
./myscript.sh 2018-08-14
I tried this but it doesn'...
1
vote
1
answer
254
views
Bash script Issue parsing text in line with whitespace characters
I have a list of commands to parse through for an audit, similar to this:
1. -a *policy name=PolicyName -a *policy workflow name=PolicyWorkflow -a *policy action name=PolicyAction -s Server -b ...
0
votes
1
answer
59
views
Special content and line by line [duplicate]
commrads!
I have a file:
# cat file
'\\.\Aktiv Co. Rutoken S 00 00\USER1@R69-20180109'
'\\.\Aktiv Co. Rutoken S 00 01\USER2@R69-20180109'
and i need execute line by line:
for LINE in `cat file`
do
...
0
votes
5
answers
2k
views
How can I split a line that contains an underline with awk?
I have this line, but I want each part of it separated and I want this separation to be done with awk.
The original line is the following:
3302491505_8139829707_13970101.csv
and what I want as an ...
1
vote
1
answer
164
views
sed command to replace a word from one file with entire line of another file [closed]
I want to use the sed command (or something that works) to replace a word in a template file with a word in a line of another file.
As an example I have a file with a list of words, each word is in ...
0
votes
1
answer
385
views
fix slapcat 79 character line wrap in output
I use slapcat to do a full-text search in our very large ldap directory.
As it is easier to match what I am looking for when I don't know where to look.
The problem is that it wraps long lines
...