The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
5 views

command line, how to search a pattern in the first line and delete them

I want to delete something not useful in the first line like following: 1-TagDir (cs) 2-TagDir (a) 3-TagDir (cd) 4-TagDir (abc) Output: 1 2 3 4 How should I ...
25
votes
8answers
3k views

Is there a convenient way to classify files as “binary” or “text”?

Standard Unix utilities like grep and diff use some heuristic to classify files as "text" or "binary". (E.g. grep's output may include lines like Binary file frobozz matches.) Is there a convenient ...
1
vote
1answer
33 views

file command output for a non-ASCII text file in AIX and Linux [closed]

I am getting different output while using file command in AIX vs Linux. File contents : D|P_APAC_PH_PHINGTF00240_20150731031225|APAC|PH|NN (L) SPEK DYWIDENDOWYCH RYNKÓW ...
0
votes
1answer
38 views

Unix, create file based on command [duplicate]

I have a command, but I want to get the results into a .txt file I can open. How do I alter my command to allow the results to be put into a text file. I plan to transfer this .txt file to my local ...
15
votes
3answers
10k views

Finding all “Non-Binary” files

Is it possible to use the find command to find all the "non-binary" files in a directory? Here's the problem I'm trying to solve. I've received an archive of files from a windows user. This archive ...
0
votes
1answer
90 views

Text as block on Kali Linux Rolling after apt-get upgrade

I just installed Kali Linux Rolling and I run apt-get upgrade. When it finished on the tweak tool on the appearance tab in the cursor option, I get this text "Adwaita [][][][][][][][][]" instant of ...
8
votes
3answers
865 views

Copy a long single-line text from a terminal with undesired change-line

locate ... | less outputs a long path, which is shown as several lines in the terminal, although it is actually a single line. I copy the path from the terminal by selecting the text with mouse and ...
0
votes
1answer
161 views

How to number paragraphs

I know I have already asked this question, but I didn't get an answer that worked. So please could someone answer my question? I have a text file, containing paragraphs of text, each separated by a ...
26
votes
4answers
2k views

Does vi silently add a newline (LF) at the end of file?

I have trouble understanding a weird behavior: vi seems to add a newline (ASCII: LF, as it is a Unix (AIX) system) at the end of the file, when I did NOT specifically type it. I edit the file as such ...
1
vote
2answers
93 views

Debian - How to change Terminal background colors

I am a Git Bash user who is now switching to Debian. Here was my Git Bash's look: Here is my look on Debian: My .bashrc file is completely EMPTY. I have nothing in there currently. I've been ...
0
votes
0answers
18 views

Script acting as textfile, possible? [duplicate]

A program I'm running has a -logFile option. The file I set as a logfile is filling up quite rapidly, and I only need about half of what's actually in it. Is it at all possible to: have a script ...
4
votes
2answers
320 views

Right-align comments in vim

I'm writing C code using vim and are searching for a possibility to right-align my comments so that they all end at col 80. To give a short example: int a = 80; /* initialize a */ int b = 7; /* ...
0
votes
3answers
79 views

Make curl/cat not scroll down when given long text?

I have made a program where I read the text from a url using curl. The problem is that when given texts that are larger than the terminal window, it automatically scrolls down to the bottom, I want to ...
1
vote
0answers
33 views

Read and write line from .txt, in CSH script [closed]

well I have to do a basic script,is mandatory in csh, and I decided to do a simple "task manager". Based on a .txt file, the user can add task, show tasks, delete X task. The problem I don't manage to ...
0
votes
0answers
26 views

Tips for parsing proprietary file formats?

So I got a quarkxpress file. The problem is, it confidential, so I can't upload here. In general, given some proprietary file format, what steps can you take to recover data from it in linux? I have ...
2
votes
0answers
41 views

Command like `column -t` but encoding-type agnostic? [closed]

Essentially, I am looking for an encoding-type agnostic version of the column -t command in linux. I need to convert delimited files to flat and then write to an outfile. The specific delimiter ...
6
votes
1answer
55 views

How can I make `file` output line break type and encoding for all file types?

I often find myself in the need to check the encoding and the line break type of a file. The file utility seems to be a perfect fit. Unfortunately it doesn't output the desired information for all ...
0
votes
0answers
37 views

How to extract text out of QuarkXPress file in linux?

Is there a way to extract the text from QuarkXPress? (Preferably, I would not want to use QuarkXPress itself, but free software compatible with it.)
2
votes
4answers
260 views

Transforming text to tabular form

I have a text file with the following structure: aaa bbb ccc ddd eee fff 1 2 3 4 5 6 1.1 1.2 1.3 1.4 1.5 1.6 ggg hhh iii jjj kkk lll 7 8 9 10 11 12 2.1 2.2 2.3 2.4 2.5 2.6 and I want the ...
0
votes
2answers
67 views

Check whether a file uses CRLF or LF to end lines [duplicate]

How to check whether lines in a text file end with CRLF or LF?
1
vote
3answers
56 views

How to extract “foo” from “foo-bar-baz” in bash? [duplicate]

I'm trying to extract foo from the string "foo-bar-baz" in bash. Any ideas how to do it using string substitution or something similar (without external tools). I tried this but it didn't work: $ ...
3
votes
4answers
125 views
3
votes
1answer
200 views

Extract specific columns from text file

There is a text file, with aboot 10000+ lines, in the format: field1 field2 field3 field4 field5 ... fieldX It needs to be converted to look like: field1,field2,field4,field3,field5 to fieldX The ...
1
vote
1answer
101 views

save output of a python script to a text file

how can i save output of this python script to a text file? this is a KMS server which clients connect to it and activates their windows or office. i wanted to save the log in a text file. I should ...
2
votes
1answer
45 views

Exclude similar values from awk

Kindly consider below files: File 1: boo,194,2322 foo,999,7559 File 2: boo,2322 boo,4526 foo,4222 foo,4223 I need to link Field1 in File 1 with Field1 in File 2 and get the related Field2 ...
0
votes
3answers
50 views

Search for number in text [closed]

I have a text file and I want so scan this text file for a specific number. Lets say the text file is: asdg32dasdgdsa dsagdssa11 adad 12345 dsaga Now I want to search for a number with the length ...
1
vote
0answers
95 views

How can I recieve SMS texts with the mail command? [closed]

I have figured out how to send sms messages with mail; the same way I would with regular email, by sending my message to phonenumber@SMSgate. This works great. I've also entered "linux" in ...
11
votes
4answers
13k views

creating a sequence of numbers, one per line in a file

Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line? something like magic_command start 100 lines 5 > b.txt and then, b.txt ...
0
votes
0answers
39 views

CentOS 7 VM small text issue at High Resolution

I recently created a CentOS 7 VM in order to prepare for the RHCSA 7 exam (since they are both based on Fedora and are quite similar, I decided to opt for CentOS 7 as it is free, and RHEL isn't). In ...
0
votes
1answer
48 views

Default text file permissions?

How do I find out the default permissions for a newly created text file? I've tried ls -l filename.txt but it keeps saying it cannot access the txt file, so im pretty sure I'm doing it wrong ...
1
vote
2answers
136 views

What's the best way display tabs/spaces in my plain text files

I have a file that unfortunately contains both tabs and spaces. How do I display them so I know if a particular space is actually tab or space?
16
votes
4answers
7k views

Is there some sort of PDF to text -converter?

I need PDF files to text so I can search over them in bulk from commandline. Is there some converter for Ubuntu, OBSD or similar distro? Perhaps related post, OCR with ubuntu here.
0
votes
0answers
24 views

In sed, what's the best way to apply blocks of commands to multiple addresses?

If I have a block of sed commands I want to apply to multiple addresses that aren't an address range, what is the best way to do this without repeating the block separately for each address? The only ...
0
votes
1answer
41 views

Can you replace displayed text with something else in command window?

I am trying to manage user accounts. They are basically just numbers, but I would rather see user last names on the screen. Is it possible to automatically replace displayed text with something else? ...
3
votes
0answers
10 views

With EN/HE layout, why do the arrow keys switch from logical to visual with Ctrl down?

I type in both Hebrew and English. When I use the Windows Manager's dialogs, or a GUI text editor such as leafpad, and type Hebrew text, I find the horizontal arrow keys (LeftArrow and RightArrow) ...
2
votes
3answers
145 views

uniq showing duplicate lines

$ grep home american.txt | sort | uniq A home and a country should leave us no more! ...
2
votes
3answers
6k views

Converting a UTF-8 file to ASCII (best-effort)

I have a file in UTF-8 that contains texts in multiple languages. A lot of it are people's names. I need to convert it to ASCII and I need the result to look as decent as possible. There are many ...
1
vote
0answers
35 views

Print pdf like paps, but with actual fonts?

So I convert a piece of text to PDF like so: INPUT="this text goes to a pdf file" paps $INPUT 2>/dev/null | ps2pdf -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true - out.pdf Which works ...
3
votes
2answers
267 views

Preventing mid-word line breaks in a2ps

So I understand that a2ps is mostly for converting ASCII code to postscript for printing, but occasionally I like to print a .txt or .md file for school. Often, an entire sentence (or even a ...
0
votes
0answers
34 views

What's wrong with this conky config? It's dog slow and doesn't display most of the text

It looks fine other than that it runs very slowly and I don't get any text beyond the 9th line or so. Window is the right size. I've got this feeling like Conky is the wrong tool for this. For the ...
0
votes
0answers
15 views

sorting files using header information [duplicate]

I have multiple image files inside a directory having the same extension (.mrc). In the terminal, if I do, header , it gives following output: RO image file on unit 1 : ...
0
votes
0answers
31 views

Polish–Vietnamese mojibake in a .txt file, using LibreOffice, mousepad, and vim

I have a trouble with some .txt file. When I try open it with mousepad, vim or LibreOffice Writer in every case some Polish letters are changing to another, incorrectly (i.e. correct char ś and ć are ...
0
votes
1answer
1k views

How to add new line in text file in output from remote shell script using plink

From windows i am executing a remote shell script using putty plink cmd>plink.exe -ssh username@hostipd -pw gbG8qs4 /user/alice/listoffiles.sh > C:\log1.txt Shell script in remote server #! ...
0
votes
1answer
119 views

What does this “matching lines means”?

The grep manual says "By default, grep prints the matching lines.". What does this matching lines says. When I tried its prints the whole paragraph containing the pattern.
2
votes
2answers
911 views

view file containing DOS text (box-drawing characters, CRLF line terminators) and escape sequences

I have stumbled upon a strange text file in an archive of an old dos game downloaded from some abandonware site. The text file is named WHY_NOT.TXT. I assume the file is some sort of .NFO file from ...
1
vote
1answer
275 views

textutil convert PDF to txt producing garbled output

I am trying to convert PDF files to text files using textutil. I don't if there are special types of PDFs that can and cannot be converted. The files I am trying to convert are in a searchable ...
0
votes
1answer
265 views

How can I find and replace only in a range of columns?

I have a text file with 9267 lines. I want to find "A" with 5 spaces after it and replace it with "A" with 5 spaces before and after it on all lines, but only between columns 67 and 88. Text outside ...
2
votes
1answer
259 views

Continously writing terminal output to text file

I am running a small cli python app in terminal. It loops infinitely and outputs text to the terminal. I want to output the text to a file, and I can do that with the following command python [my cli ...
2
votes
5answers
324 views

Duplicate lines and make them unique?

I have the following structure of text lines: 3923 001 L05 LV,L05 RM 3923 002 L12 RA,L12 LA 3923 003 I06 ALL 3923 004 G04 RV,Z09 ALL but i would need this: 3923 001 L05 LV 3923 001 ...
3
votes
2answers
30k views

How to select, copy and paste some columns from different files and create one file from them?

I want to create and organize data in a file from a number of files by selecting parts of the columns of the given files. I have more than 10 file to copy the second, third and forth columns of each ...