Search Results

Search: Posts Made By: un1xl0ver_rwx
2,411
Posted By un1xl0ver_rwx
awk '/<word>/ {i++};END{if(i){print...
awk '/<word>/ {i++};END{if(i){print "Found"}else{print "Not Found"}}' filename
2,813
Posted By un1xl0ver_rwx
the previous solution is simpler. Just another...
the previous solution is simpler.
Just another option.
awk '($3~/^01$/)' filename
13,996
Posted By un1xl0ver_rwx
All these should work. awk '{$3="01"};1'...
All these should work.

awk '{$3="01"};1' filename
awk '$3="01"' filename
awk '{$3="01"}1' filename
1,972
Posted By un1xl0ver_rwx
awk -F [,] '{a=$1;x=$1-a;for...
awk -F [,] '{a=$1;x=$1-a;for (i=2;i<=NF;i++){x=x","$i-a}print x}'
5,071
Posted By un1xl0ver_rwx
Try this awk '{for (i=1;i<=NF;i++){a[$i]++}}...
Try this

awk '{for (i=1;i<=NF;i++){a[$i]++}} END{for (j in a){print j,a[j]}}' <inputFile>
32,201
Posted By un1xl0ver_rwx
Both works great. I wanted to include...
Both works great.
I wanted to include directories and hidden files as well.
So find works best for me.

find .|grep "^./"|wc -l
ls -lR . | grep ^[-d]|wc -l
32,201
Posted By un1xl0ver_rwx
find Commands|wc -l is what I needed. ...
find Commands|wc -l
is what I needed.

Thanks!
6,764
Posted By un1xl0ver_rwx
You can move files around as you wish. mv...
You can move files around as you wish.

mv file1 file1-suffix; mv file1-e file1;
(Can be done in bulk using awk)
OR
you can use sed to edit files one by one.
You can write a wrapper around it...
32,201
Posted By un1xl0ver_rwx
Get the file count in a folder
What is the best way to get the file count (Including the subdirectories) under a folder?
6,764
Posted By un1xl0ver_rwx
You can use sed -i -e option. For example. ...
You can use sed -i -e option.

For example.
If you have files file1 and file2.

file1
abc
cfg abc dfd

file2
cfg abc dfd
fjsl
abc
You can replace abc with xyz in both files.
sed -i -e...
14,057
Posted By un1xl0ver_rwx
tail -f for multiple files
Is there a way to view the log progress from multiple files.

For eg: I have 10 log files from 10 different instances. Instead of opening 10 terminal and doing tail -f on each, is it possible to...
2,657
Posted By un1xl0ver_rwx
Use sed -i -e 's/<img heigth="1" width="1"...
Use

sed -i -e 's/<img heigth="1" width="1" border="0" src="http:\/\/myteenmovies.net\/t.php\?id=5540372">//g' file*
1,692
Posted By un1xl0ver_rwx
An awk solution $ cat input|awk...
An awk solution

$ cat input|awk '/[0-9][0-9][0-9]$/ {print $0 " - VLan"}; /[^0-9][0-9]$/ {print $0 " - Standard"}'
e1000g0 - Standard
nge1 - Standard
dmfe3 - Standard
e1000g123001 - VLan...
2,811
Posted By un1xl0ver_rwx
I guess you want to show duplicate files listed...
I guess you want to show duplicate files listed in the same line.
$ awk -F [/] '{++a[$NF];c[$NF]=c[$NF] " " $0} END{for(i in c){ if (a[i]>1){print c[i],a[i]}}}' input
./aaaa/sample.dat...
Showing results 1 to 14 of 14

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