The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
30 views

Awk and discarding non-matching tokens in a string?

I'm having trouble getting a string tool to provide what I need (due to my ignorance). I have a string based on CPU features. The string will change as different processors offer different features: #...
1
vote
3answers
144 views

filter text xml file

I have a big (with couple of hundred thousands records) XML file from which I'd like to filter only specific fields. example of the file construction: <A> <id>123</id> <B> &...
1
vote
1answer
38 views

What does '-t' do in mv command? Example below

ls -lrt |grep 'Jun 30th' | awk '{print $9}' | xargs mv -t /destinationFolder I'm trying to move files from certain date or pattern or createuser. It doesn't work properly without the -t option. ...
-1
votes
0answers
22 views

Filter two file extension in if statement in perl script

How do I filter file extensions .csv and .CSV in an if statement? Below testing failed. 67 opendir ( DIR, $source ) || die "Error in opening dir $source\n"; 68 69 foreach my $fileName (readdir(...
-2
votes
2answers
61 views

To filter out input in lowercase characters [closed]

I need to filter out input in lowercase characters. I tried giving a file to the command: cat ws2.txt | sed "s/[a-zA-Z0-9]/[A-Z]/g"
1
vote
0answers
33 views

find-like tool to search (recursively) in MailDir folders by size, sender, recipient, attachment name regex, etc

I am not looking for a tool like locate, that works by creating an index in the MailDir, or generating other runtime files there; I am searching for real-time, direct search on live MailDirs. The ...
9
votes
5answers
39k views

ls list files not matching given string in filename

I have a directory in which lots of files (around 200) with the name temp_log.$$ are created with several other important files which I need to check. How can I easily list out all the files and ...
1
vote
1answer
6k views

Mail filtering with procmail in a postfix/dovecot system with virtual users

I had a postfix/dovecot system with mail users working. After unsuccessfully following a few tutorials online to enable procmail, now I have an unusable system. What I want is to enable procmail ...
0
votes
1answer
42 views

Filtering standard error output from remote BorgBackup repository

I want to filter standard error for a command that prints status information to standard error. In this case, Borg Backup. Specifically, the default output of borg check includes lines like: Checking ...
3
votes
1answer
2k views

Savings emails as individual files using Procmail

I installed Getmail to retrieve emails from another email server and Procmail to filter the incoming emails. (I am running Debian/Squeeze.) The recipe I created has this code: :0: * ^...
0
votes
1answer
1k views

Unable to launch Gnome System Log Viewer after setting filters

I am unable to launch Gnome System Log Viewer after setting some filters. This is so, even after rebooting and reinstalling this GUI program. I found the following relevant line in /var/log/messages: ...
2
votes
1answer
282 views

regex usage in exim filtering

I'm trying to create an exim filter to block spam messages containing " 85% OFF" in the subject line. That's a blank space, then any two digits, then the percent sign, a blank space and the ...
5
votes
2answers
22k views

My Postfix installation is sending out spam; how to stop it?

Since a few days, my web/mailserver (centos 6.4) is sending out spammails by the bunch, and only stopping the postfix service is putting an end to it. SMPT is set up to only accept connections over ...
7
votes
1answer
110 views

Linux setup for intellectually impaired

This is not a request for which distro (I intend to use arch + openbox as that's the setup I'm familiar with), but rather which tools can help me accomplish the following: I want to set up my sister'...
2
votes
2answers
50 views

How to view all ancestor processes?

How can I view all the ancestors for all instances of a given process name?
0
votes
1answer
67 views

Is there a way to move files marked as spam to another folder in Evolution?

The "Junk" folder in evolution is not an actual folder, as all of the messages marked as junk are still in the Inbox on imap. There is a filter option in Evolution based on whether or not a message ...
6
votes
7answers
787 views

Keep only the lines containing exact number of delimiters

I have a huge csv file with 10 fields separated by commas. Unfortunately, some lines are malformed and do not contain exactly 10 commas (what causes some problems when I want to read the file into R). ...
5
votes
5answers
677 views

Remove lines from file up to a pattern, unless the pattern doesn't exist

I am attempting to write a filter using something like sed or awk to do the following: If a given pattern does not exist in the input, copy the entire input to the output If the pattern exists in ...
22
votes
6answers
9k views

Can ps display only non kernel processes on Linux?

How can I ask ps to display only user processes and not kernel threads? See this question to see what I mean...
1
vote
1answer
152 views

Text extraction from HTML page

I am using xidel command to extract text from html page. Here is my code xidel http://www.ip-adress.com/ip_tracer/8.8.8.8 --extract "<table> <tbody> <tr> <td> <...
0
votes
0answers
149 views

extracting text from HTML

I have this page http://www.ip-tracker.org/locator/ip-lookup.php?ip=8.8.8.8. I wanna extract text from html page particularly table heading (th) and table data (td). For Example --> Country: United ...
3
votes
1answer
151 views

Some ICMP-Reply messages don't arrive in User Space in recent Kernels

I'm moving an application from 2.6.23 (yes, it's ancient; that's why we are moving) to 3.18LTS. The application monitors multiple network links to the same target with ping packets. The different ...
2
votes
1answer
136 views

how to show only processes *not* matching a filter?

I'm using htop to interactively monitor my processes. However, sometimes a few processes get "in the way" and I would like to filter them out. Unfortunately, it seems that htop's built in filter (e....
1
vote
0answers
46 views

Using rsync with the verbose option and filtering the information displayed

I am using rsync with the -a -r and -v options to copy files and directories from one server to another. This all works fine. But when I make a change, for example, to a single file on the source ...
6
votes
3answers
13k views

Filter a .CSV file based on the 5th column values of a file and print those records into a new file

I have a .CSV file with the below format: "column 1","column 2","column 3","column 4","column 5","column 6","column 7","column 8","column 9","column 10 "12310","42324564756","a simple string with a , ...
0
votes
2answers
308 views

Linux Distrib with build in Web filter solution

Is there any distribution with a built in solution for web content filtering for my network?
39
votes
5answers
13k views

Program that passes STDIN to STDOUT with color codes stripped?

I have a command that produces output in color, and I would like to pipe it into a file with the color codes stripped out. Is there a command that works like cat except that it strips color codes? I ...
1
vote
1answer
61 views

Obtaining unique lines with matching strings [duplicate]

I have a JSON like text file of records with duplicate ids that look like: {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"93" , "ST":[42,77,51,29,63]} {"...
16
votes
9answers
1k views

Filter file by line number

Given a file L with one non-negative integer per line and text file F, what would be a fast way to keep only those lines in F, whose line number appears in file L? Example: $ cat L.txt 1 3 $ cat F....
1
vote
0answers
116 views

What exactly is the “Filter” option in CUPS' printers.conf?

I just stumbled over the Filter option that one can add to a <printer></printer> in CUPS' printers.conf. It is described in the docs https://www.cups.org/documentation.php/doc-1.7/ref-...
2
votes
0answers
72 views

Using interface file with LP and txt2pdf utility to transform print file to PDF

Our legacy application uses LP commands on Solaris 5.10 to print report files to printers throughout our org. However, now we have a remote location that won't have access to a printer (at least not ...
0
votes
2answers
730 views

Get or filter duplicated lines by column

I have a file with three columns and I would like to get duplicated lines by third column, for example: AAA = 342 BLABLABLA = 2 BBBx2 = 23 1+1 = 2 KOKOKO= 5 2x1 = 2 The output sould ...
1
vote
3answers
507 views

Filtering multi-lines from a log

Should this question be moved to stackoverflow instead? I often need to read log files generated by java applications using log4j. Usually, a logged message (let's call it a log entry) spans over ...
1
vote
1answer
758 views

DNS whitelist domains

I'm trying to set a couple of DNS servers to resolve only specified domains. My first attempt was to run DNSmasq and create a manual list of domains/IPs, like so: no-resolv address=/whatsapp.com/192....
10
votes
5answers
7k views

How to remove multiple blank lines from a file?

I have some text-files I use to take notes in - just plain text, usually just using cat >> file. Occasionally I use a blank line or two (just return - the new-line character) to specify a new subject/...
2
votes
1answer
515 views

macos - local port redirection using pfctl and syntax errors

I am running MacOS(really BSD), and I want to redirect certain traffic over an ssh tunnel using a a local forward. Seems easy enough, but I am repeatedly blocked by the ambiguous "/etc/pf.conf:29: ...
0
votes
2answers
284 views

Filter hyperlinks from web page and download all that match a certain pattern

I wanted to download all graphic files from our organisation's graphics repository web page. They are Illustrator (.ai) format and Corel Draw (.cdr) format. They are directly hyperlinked (i.e. <a ...
7
votes
6answers
25k views

iptables to block https websites

I wish to block a few websites that also run upon https, like facebook, twitter, and gmail, in my organization. Squid is not supposed to be used here as per the orders from higher management. We can ...
2
votes
1answer
53 views

Unix Filename ignore list [closed]

We are trying to set up Unix based server and we are trying to figure out if there is any way to forbid creating certain files on the server. I mean files like: .DS_Store, .BridgeCache, .BridgeCachet,...
2
votes
0answers
285 views

Filter UDP packet in tc filter

Hello I'm trying to limiting the bandwidth on my iperf udp test (iperf -u). I use tc qdisc and class to make some assured rate and ceiling rate for it. However, I don't know what filter I should use ...
3
votes
2answers
125 views

How do I efficiently select specific line numbers from a list of records?

I want to take a list of numbers representing line numbers of a source file I want to filter and filter those lines from the source file. How I can build a unix pipeline to extract these lines from ...
2
votes
1answer
81 views

I _WANT_ procmail to delay one users e-mail 10 seconds then continue processing

Thank You all for Stack Exchange. It is a wonderful resource and I have obtained answers many times in the past here. Thank You. I use procmail. I wrote my own spam filter in procmail (long with ...
19
votes
8answers
17k views

How to print the longest line in a file?

I'm looking for the simplest method to print the longest line in a file. I did some googling and surprisingly couldn't seem to find an answer. I frequently print the length of the longest line in a ...
3
votes
3answers
817 views

grep filter all lines plus one before each hit

I want to parse some output so I exclude all lines that contain either foo or bar, as well as all lines immediately preceding those lines. For example: echo " 1 some line 2 line to exclude because ...
3
votes
1answer
763 views

Hide lines based on multiple patterns

I'm using less to view log files quite a lot and every so often I'd like to filter the output by hiding lines which contains some keywords. In less it's possible to filter-out lines with &!<...
2
votes
1answer
781 views

remove tc filter (Traffic Shaping)

How can I remove a single filter? tc filter show dev peth1 shows filter parent 1: protocol ip pref 16 u32 filter parent 1: protocol ip pref 16 u32 fh 800: ht divisor 1 filter parent 1: protocol ip ...
1
vote
3answers
109 views

How to run executable program with filter

I want to run a shell script. This script have a long name. So I want to use filter for file. ex: ls | grep myfile | ./ Is it possible to execute a file with filter.
10
votes
2answers
1k views

Filter output of command by color

I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that ...
2
votes
0answers
328 views

Extract particular words from Rsyslog %msg% facility

After lot of search on Google and reading all manuals available on man page and internet, I finally ask here. In my scenario, I have one rsyslog server working with mysql and a custom template ...
1
vote
1answer
432 views

Create a Filter for Postfix on Virtual Mails

This is what I am trying to do: I have a server using Postfix on a Ubuntu precise 64bits and I have a table list of emails in /etc/postfix/virtual, like this: artz@mydomain.com artz@gmail.com artz2@...