Search Results

Search: Posts Made By: lewk
3,643
Posted By lewk
Extended ASCII Characters keep on getting reintroduced to text files
I am working with a log file that I am trying to clean up by removing non-English ASCII characters. I am using Bash via Cygwin on Windows.

Before I start I set:

export LC_ALL=C


I clean...
2,174
Posted By lewk
brilliant, thank you for the detailed explanation...
brilliant, thank you for the detailed explanation too!

---------- Post updated at 10:46 PM ---------- Previous update was at 05:25 PM ----------

How would I modify it if for example I do not...
2,174
Posted By lewk
Thanks for spotting that error, I corrected it. I...
Thanks for spotting that error, I corrected it. I intended to have as per your example. I am looking for an exact match on the first three components on the second field.

I am using Ubuntu but...
2,174
Posted By lewk
Input file needs to match a column and print the entire line
I have a file with class c IP addresses that I need to match to a column and print the matching lines of another file.

I started playing with grep -if file01.out file02.out but I am stuck as to...
18,178
Posted By lewk
Noted, thank you for this this.
Noted, thank you for this this.
18,178
Posted By lewk
Thanks, I like your method :b:
Thanks, I like your method :b:
18,178
Posted By lewk
Recursively cat files in a directory with filename printed first.
I want to recursively cat the content of files in a directory e.g.

find /etc -type f -exec cat {} \;

But I want it to print the file name first and then the content. For example let's say...
1,236
Posted By lewk
This is great thanks and it is getting me close...
This is great thanks and it is getting me close to what I am looking for. However how can i limit it to striclty /22 as per the following example;

cat file.txt |grep -e "/22\>"

---------- Post...
1,236
Posted By lewk
Extracting relevant information from syslogs.
I need to analyse some syslogs and I want to print out all the lines containing SSH connections to the inside interface of the firewall and ignore lines where the originating port is 22. So basically...
2,507
Posted By lewk
Read from "list1" and list matches in "list2"
I want to print any matching IP addresse in List1 with List 2;

List 1

List of IP addresses;

161.85.58.210
250.57.15.129
217.23.162.249
74.76.129.101
30.221.177.237
3.147.200.59...
3,029
Posted By lewk
Thanks, I suppose I could just do this; echo...
Thanks, I suppose I could just do this;
echo "zcat *.gz |grep “User5501” > users.out" > users.out | zcat *.gz |grep “User5501” >> users.out
3,029
Posted By lewk
Insert shell command into first line of output file
How can I insert the command executed on the shell into the first line of my output file?

For example if I execute;


zcat *.gz |grep “User5501” > users.out




How can I make my...
3,696
Posted By lewk
Thanks, will double check. ---------- Post...
Thanks, will double check.

---------- Post updated at 12:14 PM ---------- Previous update was at 12:12 PM ----------




Seems to be working fine, thanks for that! :b:
3,696
Posted By lewk
Correct, the file containing the list of IP's is...
Correct, the file containing the list of IP's is called random_ip.txt, not sure why your script is not picking it up? I executed your script from within the directory where the random_ip.txt file...
3,696
Posted By lewk
Thanks for your reply, I get the following error;...
Thanks for your reply, I get the following error;

: No such file or directoryne 3: random_ip.txt
3,696
Posted By lewk
Formatting list of IP addresses into a grep command
Hi

I have an input file with a list of random IP addresses, each on a new line. Below is just an example as I omitted the real IP addresses for obvious reasons.

Input: random_ip.txt

...
11,188
Posted By lewk
Thanks guys, the awk statements are working well...
Thanks guys, the awk statements are working well now!
11,188
Posted By lewk
Ahh man, my apologies those were meant to be line...
Ahh man, my apologies those were meant to be line numbers, they were not necessary. My text editor notes the line numbers and I added them to my original post without realising Ahamed's suggestion...
11,188
Posted By lewk
There is no structure to the data really, each...
There is no structure to the data really, each line is unique. I need a formula to cat file 1, cat file 2 and print the matching lines.

I am on Linux, grep -f printing blank.
11,188
Posted By lewk
Hi guys, Thanks for the help so far, however...
Hi guys,

Thanks for the help so far, however both statements print blank lines and I think it is because I need to tweak my example.

To elaborate further, it only contains numbers but the...
11,188
Posted By lewk
Compare two text files and print matches
Hi,

I am looking for a way to compare two text files and print the matches. For example;

File1.txt
89473036
78474384
48948408
95754748
47849030


File2.txt
47849030
46730356...
25,633
Posted By lewk
awesome thanks, that is exactly what i was...
awesome thanks, that is exactly what i was looking for. was struggling with the syntax
25,633
Posted By lewk
Basically I want to know whether it is possible...
Basically I want to know whether it is possible to automate the following steps in one command without outputting anything to file first?



1. ls -al -R /bigdir > outputfile.txt
2. tar -cvf...
25,633
Posted By lewk
Redirect output to tar.gzip
I would like to make a listing of files in a large directory and output it to tar.gz. Is it possible to do this in one command?

For example;

I would like the text output from this command to be...
6,965
Posted By lewk
Welcome pkabali! There are some very...
Welcome pkabali! There are some very knowledgeable people on here.

I think what you are suggesting is good but I am not sure how well find reads .PDF metadata ? I am searching but there is...
Showing results 1 to 25 of 46

 
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy