Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

awk

How to merge two files based on the matching of two columns?

August 10, 2022 by Magenaut

I have file1 likes:

Categories Q&A, Unix & Linux Tags awk, bioinformatics, join, text-processing Leave a comment

Find files that contain multiple keywords anywhere in the file

August 10, 2022 by Magenaut

I’m looking for a way to list all files in a directory that contain the full set of keywords I’m seeking, anywhere in the file.

Categories Q&A, Unix & Linux Tags awk, find, grep, shell, text-processing Leave a comment

Add prefix and suffix to every line in a .txt file

August 10, 2022 by Magenaut

I am trying to append and prepend text to every line in a .txt file.

Categories Q&A, Unix & Linux Tags awk, sed, text-processing Leave a comment

Extract file name from path in awk program

August 10, 2022 by Magenaut

I have an awk script and I have passed a CSV file to it.

Categories Q&A, Unix & Linux Tags awk, filenames Leave a comment

Count records matching pattern with Awk

August 10, 2022 by Magenaut

So I was told to do last > lastloggedin which creates a file that shows the classes last login since the last system reboot, and now I am asked to write an Awk script which is named myawk that counts/determines how many lines of lastloggedin contain the string CFS264.

Categories Q&A, Unix & Linux Tags awk, scripting, text-processing Leave a comment

Why does awk stop and wait if the filename contains = and how to work around that?

August 10, 2022 by Magenaut

Either of the following two types of argument can be intermixed:

Categories Q&A, Unix & Linux Tags awk, filenames Leave a comment

Split file by number of lines including header in each one

August 10, 2022 by Magenaut

I need to split a .txt file into smaller ones containing 100 lines each, including the header. I don’t know if this is relevant, but the original file is delimited like this:

Categories Q&A, Unix & Linux Tags awk, files, split Leave a comment

How can you combine all lines that end with a backslash character?

August 10, 2022 by Magenaut

Using a common command line tool like sed or awk, is it possible to join all lines that end with a given character, like a backslash?

Categories Q&A, Unix & Linux Tags awk, perl, sed, text-processing Leave a comment

Remove entire row in a file if first column is repeated

August 10, 2022 by Magenaut

I have a file containing two columns and 10 million rows. The first column contains many repeated values, but there is a distinct value in column 2. I want to remove the repeated rows and want to keep only one using awk. Note: the file is sorted with values in column 1. For example:

Categories Q&A, Unix & Linux Tags awk Leave a comment

Replacing pattern after nth match is found on each line?

August 10, 2022 by Magenaut

The s command can be followed by zero or more of the following flags:

Categories Q&A, Unix & Linux Tags awk, sed, shell, shell-script Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 Page4 … Page9 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress