text

How can I search based on file contents? (GUI, not terminal)

How can I search based on file contents? (GUI, not terminal) Every question and answer I’ve seen so far is ancient or just about grep in the terminal. I want an easy way to search my ~/code folder for certain strings. And I want the interface to allow filtering by file extension, etc. I thought …

Total answers: 1

mate-terminal showing unwanted text when it starts

mate-terminal showing unwanted text when it starts i’am on parrot OS, after a forced restart my mate-terminal begun showing text from bashrc every time it started, after a "clear" it goes away and the prompt is properly colored and everything is functional. i checked bashrc and there is nothing wrong with it. i don’t know …

Total answers: 1

How to do replace with the dte editor

How to do replace with the dte editor The dte editor a small and easy to use console text editor. In readme or its online doc, both says: Regex search and replace (are the key features). However, I haven’t found how to do the replace anywhere yet. Even man dte doesn’t mention anything about the …

Total answers: 1

bash script to compare fields of two files and replace columns

bash script to compare fields of two files and replace columns I have two files. File A: newname,1,string newname,2,string newname,3,string … name,65500,string File B; oldname,1,string oldname,2,string oldname,3,string … oldname,65500,string I need a bash script to change "oldname" in file B with "newname" in file A where their second column number match. Asked By: masoud hanifehzadeh …

Total answers: 2

find a number after a special character and multiply it by awk

find a number after a special character and multiply it by awk I have a file: "UDP", "x", 12880, "any", "any", x, 0.0.0.0/0, 0.0.0.0/0, {85000, drop, -1, fast+dsample:1000}, {1m, alert, -1, none} How can I change 85000 number which is after "{" and multiply it by a value to reduce it by awk. like: 85000*0.75= …

Total answers: 1

Compare two files and remove every line that doesn't match with file B

Compare two files and remove every line that doesn't match with file B I have two files. file A: Modern Tales: Age Of Invention Playstation 4, 1935, 3478-3480 Modern Tales: Age Of Invention Xbox One, 3074 Moero Chronicle Switch, 6667, 12400, 28910, 29900, 29901, 29920 MOHAA Counter Intelligence, MOHAA MatchWatch, 950, 5500-5699, 13000-14000 MOHAA Missionary, …

Total answers: 1

script to compare two files and remove match line in file A

script to compare two files and remove match line in file A I have two files. file A: Modern Tales: Age Of Invention Playstation 4, 1935, 3478-3480 Modern Tales: Age Of Invention Xbox One, 3074 Moero Chronicle Switch, 6667, 12400, 28910, 29900, 29901, 29920 MOHAA Counter Intelligence, MOHAA MatchWatch, 950, 5500-5699, 13000-14000 MOHAA Missionary, Mokoko …

Total answers: 2

Concatenating txt files and keeping directory name

Concatenating txt files and keeping directory name I am concatenating thousands of .txt files together but I want to keep the path written above the text of each .txt file so I can refer back to the directory to review files if needed. Example: file1.txt has the following content: id: 1234 info: 1234 id: abcd …

Total answers: 4

Write directories, subdirectories and file names to .txt file

Write directories, subdirectories and file names to .txt file I am looking for a command that will write the names of all directories, subdirectories and file names to a text file. Example format: directory1 |_subdirectory1 | |_filename1.mp4 |_subdirectory2 | |_filename2.txt | |_filename3.jpg | directory2 | … So the text file will only just show what …

Total answers: 2

What's inside a character device file?

What's inside a character device file? A character device file is a special linux file where you can read from and write to an infinite number of chars and other file operations that you can define inside a kernel device driver. But does this file actually exist? If we look at it as normal text …

Total answers: 1

Output text file contents (/proc/interrupts) as they change

Output text file contents (/proc/interrupts) as they change Is there some command I can use to monitor changes in /proc/interrupt? For example, using head -4 I can see that the file is changing, but only if I run head again and again: > head -4 /proc/interrupts CPU0 CPU1 0: 451325 0 IO-APIC 2-edge timer 1: …

Total answers: 1

How to separate with a comma in a logfile

How to separate with a comma in a logfile I have a log file as below, 011122111128 :16267281288 :40586200370017022 :947700000622 :919400146760221 :SSD :4065376D : :9477000006 :9170120275030 :210 :18 :002919544716189 :unknown :unknown :unknown I need to print each line(always I need to get last 50 records) with a comma-separated line then I can import it as …

Total answers: 1

insert block of lines only before first matched pattern

insert block of lines only before first matched pattern i need to insert the below lines (after variable substitution) before the first matched string which is server { in /etc/nginx/nginx.conf Variable: website=www.hello.com Block of lines: server { # Permanent redirect to www server_name ${website:4}; rewrite ^/(.*)$ http://$website/$1 permanent; } After variable substitution the block of …

Total answers: 2

Convert all small words (2-3 characters) to upper case with awk or sed

Convert all small words (2-3 characters) to upper case with awk or sed I need all 2-3 character words completely capitalized. 1 character and 4+ character words need to be remain untouched. Input: cat Example Dog I Fish su Su adm Amd Cat ignore Expected output: CAT Example DOG a Fish SU SU ADM ADM …

Total answers: 4

Indent lines of text following given rule

Indent lines of text following given rule I was wondering how indenting recursively more and more lines of poetry following a custom rule. For instance Let say we have: OF Mans First Disobedience, and the Fruit Of that Forbidden Tree, whose mortal tast Brought Death into the World, and all our woe, With loss of …

Total answers: 2