The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [line]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
61 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
2answers
321 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, ...
2
votes
6answers
99 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
0answers
25 views

How do I change my command line colors for Centos 7?

I just want to change the text of everything after the [user@localhost ~]$ to white. Right now all the text is blue. I want the previous part to remain as it is, blue, while the rest is white. I ...
0
votes
1answer
34 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
2answers
35 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
2answers
85 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: ...
3
votes
2answers
14k 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
1answer
120 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
1answer
53 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
5answers
68 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
1answer
102 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
1answer
170 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 ...