Skip to main content

Questions tagged [filter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
277 views

nftables priority filter: what does this mean?

The nftables wiki explains the priorities here. Clearly, the priority is a numeric value like -10, 0 or 10. The Red Hat nftables documentation does the same. Priorities remain numeric in the examples ...
CeSinge's user avatar
  • 53
5 votes
6 answers
249 views

subset columns from the 1st file using column names in 2nd file

I have two text files: 1st file is a Tab delimited file which looks like this: chrom pos ref alt a1 a2 a3 a4 10 12345 C T aa bb cc dd 10 12345 C T aa bb cc dd 10 12345 C ...
user3138373's user avatar
  • 2,559
0 votes
0 answers
127 views

How to Identify column names in terminal commands

Sometimes its useful to select/de-select specific columns from a command output data, but the columns are not always listed by name in the manpages. How can we find the names? For example Running two ...
raquel's user avatar
  • 11
-3 votes
1 answer
79 views

How to use awk to get a special field from a file?

This is the output of ifconfig, I want to get only the number 78 (4th octet of the ip address) using awk ns33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.78 ...
Mahmoud Youssef's user avatar
1 vote
1 answer
103 views

How can I convert terminal output? [duplicate]

I want to convert all output to the terminal that a certain command generates, using some filter program. How can I achieve this? The immediate answer might be, “Use a pipeline”. However, too many ...
Wolfgang Jeltsch's user avatar
0 votes
1 answer
138 views

Why does grep not find MAC addresses and host names in Linux?

I have a file mac-hosts containing MAC addresses and their associated host names: e4:5f:01:21:79:01 PF3 e4:5f:01:21:79:03 PF3-BR0 e4:5f:01:21:79:be PF2 e4:5f:01:21:79:c0 PF2-BR0 I want to get a count ...
FKEinternet's user avatar
0 votes
1 answer
42 views

Can I "clear up" the audio I'm hearing from a video clip in my browser?

I'm listening to some recording of a talk, which was made with a microphone far from the speaker; there's some noise and perhaps a bit of echo and it's not super clear. Now, if this were just an audio ...
einpoklum's user avatar
  • 9,653
2 votes
0 answers
226 views

In sieve, how can I copy a message to another user's mailbox on the same server without re-sending it externally?

I am using sieve to filter email in our IMAP server (Cyrus imapd). I have basic knowledge of how this works and have made a few simple sieve scripts that behave as expected so far. To attach those ...
Binarus's user avatar
  • 3,420
0 votes
1 answer
86 views

Changing packet payload with tc

How can tc be used to match a particular payload of an ingress packet, e.g., if the first 32 bits of payload of an IP/UDP packet are equal to some constant $c, the value $c should be changed to $d? ...
qemvirt's user avatar
  • 13
1 vote
3 answers
321 views

How to filter a table using awk

I was wondering how to filter a table with several columns based on a specific value in each of the columns of interest. I have this example here: Chr1 16644 0 0 1 1 ...
Assa Yeroslaviz's user avatar
1 vote
0 answers
244 views

How to set bandwidth limit using linux tc

In my linux router: interface eth1 total bandwidth is 1gbit I want to divide 1140kbit to GroupA, divide 150kbit to GroupB Set users 10.10.10.158, 10.10.21.5, 10.10.21.6 to GroupB Each user has no ...
ackema's user avatar
  • 11
0 votes
3 answers
30 views

Filter duplicated based on values of another column

I have the following example of a dataframe.Where you see that elements of 3nd column could be duplicated.I want to keep the entry which has the highest value in column 5 Meaning that for AGCCCGGGG I ...
Anna Antonatou -Pappaioannou's user avatar
0 votes
1 answer
19 views

Find entries that match 2 criteria, one based on a column one based on order

I have a tab-delimited file look like this. First column is read name and third is a column specifying if the read is Bacteria or Eukaryota. Each read could have many entries/hits. I want to extract ...
Anna Antonatou -Pappaioannou's user avatar
0 votes
1 answer
350 views

Rsync with date filter over ssh

I use the following command successfully rsync -e 'ssh' -avr [email protected]:/home/mikrotik /bck/mikrotik/ How can I add date filter to this command? I would like to sync only files that are newer ...
mikia's user avatar
  • 103
2 votes
1 answer
89 views

How can I re{duce,move} the Angry Fruit Salad effect [duplicate]

Above, you can see the output of the kscreen-doctor -o command on Suse Tumbleweed. I tried kscreen-doctor -o | cat to no avail. Short of using a black background as a damage limiting device (still ...
gboffi's user avatar
  • 1,454
2 votes
1 answer
209 views

checksum a pipeline

I want to construct a huge blob of data (a backup of a sort) and send it over the network (ssh or rsync) to another host. There is enough space on the remote for the data, but not on the local host, ...
q.undertow's user avatar
0 votes
0 answers
375 views

How can I use rsync filters properly?

I'm having trouble in getting rsync to respect my .rsync-filter files; which, I guess, it is due to me not properly understanding how they work. Basically, I have made a filter inside my $HOME folder ...
telometto's user avatar
  • 2,055
1 vote
1 answer
233 views

How to use variables (that change in loop) in awk statement to cut a file

I have a large file that needs to be filtered by the first field (which is never repeated). Example as below: NC_056429.1_398 2 3 0.333333 0.333333 0.333333 0.941178 NC_056429.1_1199 2 ...
natasha15's user avatar
1 vote
1 answer
68 views

Filtering lines of two files based on a third list file

I have 3 files: list_file, file1, and file2. I want to extract entire lines from file1 and file2 based on a list_file pairwise and concatenate the results on output. Namely, I need to extract only ...
rseg's user avatar
  • 35
0 votes
1 answer
68 views

grep unique results but show full line containing the match

I'd like to filter an input like this foo 2022-11-11 foo 2022-12-11 something else bar 2022-12-07 to obtain foo 2022-11-11 bar 2022-12-07 I'm starting with grep -oP "^[A-z]{3}" | sort -u ...
Xaser's user avatar
  • 115
0 votes
0 answers
42 views

How can Postfix smtp server scan or calculate the md5sum of an attachment while it enters to my server?

How can a Postfix SMTP server scan or calculate the md5sum of an attachment which arrived to my server? The issue comes from a recurring attachment that is sent with different body and different email ...
superlinux's user avatar
0 votes
1 answer
253 views

Passing value with xargs to generate dynamic output filename

I have some files in a folder. By running the following command I can create a list with the filtered filenames ( test1, test2,test3) and pass it using xargs to a grep filtering command filter file in ...
peti27's user avatar
  • 51
1 vote
0 answers
158 views

postfix: conditionally ignoring certain "User unknown in virtual mailbox table" errors when using a milter

NOTE: I have voted to close this question here, and I'm moving it to ServerFault, where there seem to be more questions and answers involving postfix. I'm running postfix version 2.93 under Debian 8, ...
HippoMan's user avatar
  • 657
0 votes
1 answer
63 views

Remove/move files in a directory with filename timestamp pattern

So I have files that need to remove/move/filter. All files have this pattern like this in a directory, let's say directory frames contain this pattern filename timestamp_in_nanosecond.jpg. And this is ...
Muhammad Ikhwan Perwira's user avatar
3 votes
1 answer
959 views

How does tmux list-panes -f (filter) work?

I read the man page but I could not find how to use -f when using tmux list-panes. It seems to be a filter, I assume this works like grep in some way? Does anyone know how -f works?
Dave's user avatar
  • 621
0 votes
1 answer
1k views

How to filter rows by one column?

Sorry if this is a basic question, I don't use linux often but I have a 13GB file that I want to filter down. I have 123 columns and I want to remove rows that have only a . in the 75th column. I've ...
dn95's user avatar
  • 3
4 votes
1 answer
684 views

Find directories with name, but filter them if they contain a specific top-level file in them

I want to find all directories that are named Contents and then from the list of found results, I want to filter them and only include those that have a file named Database.json directly inside them. ...
Saeed Neamati's user avatar
1 vote
0 answers
100 views

How to import Kmail filters into Evolution?

Is there a way to import filters defined in Kmail into Evolution? I know how to export them (Tools → Import/export → Kmail/config), and extract the filters (extract config/filters which describes them ...
Jessica's user avatar
  • 369
0 votes
2 answers
2k views

How to combine find and cp in linux to copy specific files

I am having the following problem in linux: I need to find specific files from a directory and copy those files (if they exist) into another directory this is the command (i need to find specific text ...
Josh.h's user avatar
  • 3
2 votes
2 answers
606 views

Filtering file list to show only files alphabetically after certain file

I have a huge number of images from which I'd like to feed some to ffmpeg time to time. But I only want to feed ones that are alphabetically after certain image (last frame of previous run, name ...
Huwglw2's user avatar
  • 23
-1 votes
3 answers
66 views

How to strip characters by argument?

I want to filter any comma and any double quote mark from output by some command with. For some entries. Pseudocode: removechar --any -, -" Current output could look like any of these lorem, ...
Lahor's user avatar
  • 123
1 vote
1 answer
1k views

Filtering a file based on values from another file

I have two files file1: U 20 100 1_A 1_A U 14 200 1_B 1_B U 14 300 1_C 1_C file2: D 12 90 1_A 1_A D 15 97 1_A 1_A D ...
Lia's user avatar
  • 59
0 votes
1 answer
342 views

How Do I Get `tree` to Selectively Exclude Contents of Directories?

I'm using tree on a directory which has -- among other things -- some Audacity projects in it. Each Audacity project is some file X.aup, along side a directory X_data, which contains a few sub-...
MCLooyverse's user avatar
0 votes
1 answer
662 views

Stream filtering changing log file in realtime

I have file.log with this sample: 11-Feb-2022 18:34:42 lorem uneeded5 11-Feb-2022 18:34:43 water uneeded6 11-Feb-2022 18:34:44 ipsum uneeded7 11-Feb-2022 18.34.45 waterfall uneeded8 I expect output ...
Muhammad Ikhwan Perwira's user avatar
-1 votes
3 answers
144 views

Trim pathname in CSV file

I am struggling over a filter where I am trying to trim data in a specific column of a CSV after the 3rd or nth occurrence of the character \. My data looks something like this: data,data,c:\path1\...
Todd Telle's user avatar
0 votes
1 answer
487 views

date string column to timestamp column in a log file

I have log.txt with sample output like these: ... 10-Feb-2022 15:15:14.099 lorem 10-Feb-2022 15:15:15.133 ipsum 10-Feb-2022 15:15:16.233 dolor ... I expect the output of filtered log.txt will be ... ...
Muhammad Ikhwan Perwira's user avatar
0 votes
1 answer
481 views

Filter changing file periodically and redirect filtered output to new file

Suppose I have log.txt The sample of log.txt are like these format: Code Data Timestamp ... C:57 hello 1644498429 C:56 world 1644498430 C:57 water 1644498433 ... If I want filter string line that ...
Muhammad Ikhwan Perwira's user avatar
0 votes
0 answers
3k views

Copying files from remote to local using lftp in unix

I originally posted this in server fault, but it didn't get much traction. I'm hoping someone here can help. I'm trying to write a script to copy some files from a remote ftp server to a local ...
pbuchheit's user avatar
1 vote
3 answers
108 views

How to get the list all files that are x.y but are not z/x.y?

I have a lot of Settings.json files on this machine. I get the list of all of them using: find / -name "Settings.json" 2>&- But some of them are in directories that end to Api. For ...
Saeed Neamati's user avatar
0 votes
1 answer
5k views

nftables refuses to add rules "Error: Could not process rule: No such file or directory"

Problem: When trying to add nft rules, I keep getting "Error: Could not process rule: No such file or directory" Example command: nft add rule netdev filter input ip daddr 10.10.10.10 ...
Dave's user avatar
  • 621
1 vote
1 answer
861 views

Linux not responding to public ip ssh request

I'm trying to connect via ssh to my home server from outside of my home network, but I don't get any respond. When I try to locally ssh that server, everything is just fine. But when I do it from ...
Daniel Šebík's user avatar
1 vote
1 answer
334 views

grep -v does not return complement of grep

I want to filter a file for lines starting with a space. I use the following command: grep -v "^ " < input > input_no_starting_space To double check my results, I run the following: ...
Stijn's user avatar
  • 113
1 vote
1 answer
94 views

Filter phots into directories by date range

I have set up our family mobile phones to automatically backup all photos taken to a NAS (Qnap TS-231P), one folder per mobile. For one phone, for some reason a lot of photos were copied multiple ...
Stacknaut's user avatar
0 votes
0 answers
832 views

Illegal "match" error when applying Linux tc, u32 filters mask

I want apply the following rules for TOS based traffic shaping. All rules works but the final rule which mask the IP header shows illegal "match" error sudo tc qdisc del dev tun0 root handle ...
Javad Rahimi's user avatar
1 vote
1 answer
2k views

Defining functions and using map in jq

Can you explain to me how the following two differ? jq ´def addvalue(f): . + [f]; map(addvalue(.[0]))´ [[1,2],[10,20]] => [[1,2,1], [10,20,10]] jq ´def addvalue(f): f as $x | map(. + $x); ...
Logan Lee's user avatar
  • 249
0 votes
0 answers
377 views

IPTABLES Limit connection per ip

I have ubuntu 20 server with nginx, php, etc How i can block ips (http port 80, 443) where connections > 20, but don't block proxy ip 1.2.3.4.5
mahif11550's user avatar
0 votes
0 answers
462 views

tc traffic shaping with HTB and CQB causes packet transmission gap inconsistencies

I am sorry if this is duplicate of https://serverfault.com/q/1076769/822163. I created that first and then realized the Linux and Unix stack exchange is the right place. Problem: When the tc HTB or ...
Chinmaey Shende's user avatar
8 votes
1 answer
3k views

How to select based on an allowlist/blocklist using jq

Using jq, how can we select json elements from an array based on inclusion/exclusion of each element's key in some allowlist/blocklist? I want to do a case-insensitive contains (so allowlist/blocklist ...
Zeta.Investigator's user avatar
2 votes
1 answer
159 views

How to get a list of latest files recursively with a specific extension and copy them into a folder

How to get a list of the latest files with the extension .jmx recursively and use the file names in another process? I have a list of JMX files organized into different folders and want to pick the ...
Janesh Kodikara's user avatar
0 votes
1 answer
638 views

What does this bcf error mean?

I ran this code to filter out biallelic variants from my vcf file: bcftools view --max-alleles 2 --exclude-types indels merged.ecDNA.vcf.gz>merged.ecDNA2.vcf.gz However, I got an error message: [E:...
Michelle Yang's user avatar

1
2 3 4 5