Questions tagged [filter]
The filter tag has no usage guidance.
181
questions
0
votes
0
answers
5
views
Seeking CUPS filter to convert gray to black
I get a lot of documents containing color for no good reason. I want them printed in solid black with no gray. I see some questions about this here along with some printer-specific suggestions, but ...
1
vote
0
answers
11
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 ...
0
votes
1
answer
36
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 ...
2
votes
2
answers
74
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 ...
-1
votes
3
answers
36
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, ...
0
votes
1
answer
119
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 ...
0
votes
1
answer
23
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-...
0
votes
0
answers
40
views
using mutt and filter emails to be downloaded
i am new with mutt and i really like it. I am new in linux world and my technical english is not the best either, therefore as a last result i turn to this forum. I tried to find in google how the ...
0
votes
1
answer
79
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 ...
-1
votes
3
answers
57
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\...
0
votes
1
answer
49
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
...
...
0
votes
1
answer
38
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 ...
0
votes
0
answers
428
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 ...
1
vote
3
answers
48
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 ...
0
votes
1
answer
356
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 ...
1
vote
1
answer
173
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 ...
1
vote
1
answer
115
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:
...
1
vote
1
answer
35
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 ...
0
votes
0
answers
187
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 ...
1
vote
1
answer
320
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); ...
0
votes
0
answers
35
views
FFMPEG Multiple Filters (Scale Video + Scale / Apply Watermark)
Can someone please tell me the proper syntax for combining the following filters into a single command? I can't seem to figure it out.
The following command is being used to scale the video.
ffmpeg -i ...
0
votes
0
answers
27
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
0
votes
0
answers
77
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 ...
5
votes
1
answer
340
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 ...
2
votes
1
answer
51
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 ...
0
votes
1
answer
60
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:...
0
votes
0
answers
34
views
iptables rules to restrict IP with/without Tunnel Example
I have question about iptable:
Lets consider the following example from my book:
We have host IP 192.168.1.58 which is accessible through public network and we know the public IP of each user. Is it ...
4
votes
4
answers
1k
views
Extract values from a string that follow a specific word using sed
I'd like to extract only a specific value from command output.
The string that the command returns is something like this:
Result: " 5 Secs (11.2345%) 60 Secs (22.3456%) 300 Secs (33.4567%)"
...
-1
votes
1
answer
45
views
How to compile lines with a certain word in the last column into a separate file?
I have a csv file and I need to filter it out into two files based on whether the last column contains the word "ecDNA". I already have two more copies of the file to edit without changing ...
2
votes
3
answers
100
views
BASH Script - Reading output and cutting by value
I am trying to create a BASH script that will run a command, filter the output of that command and then read the results of that output to then print only sections that meet the given requirement.
For ...
0
votes
0
answers
35
views
Filter csv file with AWK passing a variable in the regex [duplicate]
I need to filter a very large csv file in the most efficient way. I already tried csvgrep but is not efficient timewise, so I'm now trying to use AWK for this task.
The csv file has a ; separator, and ...
0
votes
4
answers
58
views
reading and discarding lines
I have a question about a problem that I have to solve, I have my lines in this way:
Input
GTEX-1117F-0003-SM-58Q7G
GTEX-1117F-0003-SM-5DWSB
GTEX-111CU-0826-SM-5EGIJ
GTEX-111CU-0926-SM-5EGIK
GTEX-ZZPU-...
1
vote
1
answer
624
views
Only show entries of the last hour of log file
I have a huge logfile access.log with entries like:
192.11.111.111 - - [05/Mar/2021:00:00:02 +0100] "GET ..."
192.250.14.80 - - [05/Mar/2021:00:00:09 +0100] "GET ..."
12.249.66.42 -...
0
votes
0
answers
982
views
Linux tc filter add - errors RTNETLINK answers: Operation not supported
I'm working on the network simulation to create some traffic on specific ports , and trying to inject the network delay. I'm using the linux tc utility to do this operations. So i'm new to the tc ...
0
votes
1
answer
52
views
Filter directory tree and create bash menu from results
I have a Google Drive folder in the cloud that I sync with my server to backup and restore a WordPress web directory and MySQL database dump and I accomplish this with rclone. I am able to see the ...
0
votes
1
answer
122
views
BlueTooth device(output) and PulseAudio's module-echo-cancel help needed
I'm trying to run PulseAudio's 'module-echo cancel' filter on my bluetooth speaker(output only).
I've edited /etc/pulse/default.pa like that:
.ifexists module-echo-cancel.so
load-module module-echo-...
0
votes
2
answers
130
views
Limit SSH to a range of IP
I work with OpenBSD and I want to limit the port 22 for all user who have an IP between 192.168.42.40 - 192.168.42.60. But I don't know how to do this.
I need to modify the packet filter ?
(SSH is on ...
0
votes
1
answer
116
views
Mail processing with custom script on Postfix and Plesk (plesk_virtual)
I'd like to parse incoming mail with custom script. Something which would be easily done with
man aliases(5) for real users or with procmail for vitual users.
But on my system is is plesk and setup is:...
1
vote
1
answer
38
views
Match contents of first file with second to generate third file
Sample data of my first file first.txt is below:
10.0.0.1,Web Server,comments1,jboss is older version,myappcode1
10.0.0.3,Web Server,comments4,httpd is latest version,myappcode15
10.0.0.7,Web Server,...
0
votes
1
answer
151
views
Qemu network traffic filtering with iptables
I need to filter both outcoming and incoming traffic of the guest system on Qemu (Linux). The host system is Linux too. I think iptables is a good tool, but I don't know how to use it here. What ...
-1
votes
1
answer
117
views
rsync only particular file types in subdirectories with a fixed maximum depth
I want to sync all *.sh files in exactly one sub directory. I tried this cmd but all files in a directory are synced instead of only particular file types.
rsync -vr -n --include="*.sh" --...
0
votes
2
answers
30
views
how can i pull data based on certain flags for rows of data and create a new file with them
I'm working with Upper Air Balloon data with a format of ....
**254 12 1 JAN 2002
1 94703 72501 40.87N 72.87W 20 1116**
2 100 100 250 40 32767 3
**3 ...
0
votes
1
answer
3k
views
filter by incoming ip v4 packets with tcpdump
I want to filter with TCPDUMP only incoming and ip v4 packets.
tcpdump -i eth0 inbound and ip -w res.pcap give me incoming packets with ipv4 and ipv6
How can I filter by ipv4 only?
-1
votes
1
answer
415
views
postfix modify subject based on sender
There is a map:
email1@example.com ONE
email2@example.com TWO
email3@example.com THREE
How to change subject in mails sent to test@example.net this way:
(from email1@example.com, original subject ...
0
votes
1
answer
543
views
Filter rows of a file by list of a second file
file1.tabular contains information of 'elements' over 3 columns.
element1 235 oval red \
element2 334 oval red \
element3 356 rectangular blue
file2.txt contains a single column
element1\
element3
I ...
0
votes
3
answers
2k
views
How to limit grep to scan only the first 10 lines?
I got a command foo that output a list of files separated by \n line.
I am using the below command to filter the results by regex content of the files.
foo | xargs grep -l regex
The problem is that ...
1
vote
2
answers
860
views
Filter a list of files by content
I got a command foo that outputs a list of files separated by a new line.
How can I filter those files by their content using regex, and output the filtered files list?
1
vote
1
answer
124
views
Picking selected items from stdin via choices typed into console
Can anyone point me at a 'pick' filter script that works somewhat as described below?
I've spent about an hour hunting for a simple bash script/filter that will allow me to pipe in a list of values ...
0
votes
1
answer
74
views
searching logs for failures using grep with wordlist?
I am building a wordlist which will contain words like error,fail,kill,warn,out of,over,too.....etc.
so that I can filter tons of logs for issues within seconds using grep.
Especially, it's for ...
0
votes
1
answer
21
views
Save "unseen" output of command to file
I have a program that returns some content every time I run it. Some of that content may have already shown during the last run.
foo
bar
baz
and on next execution it might show two "old lines" and ...