Search Results

Search: Posts Made By: jayan_jay
2,181
Posted By jayan_jay
Expecting this .. for i in hostlist.txt do...
Expecting this ..

for i in hostlist.txt
do
ssh $i "hostname ; df -Ph ; hostname : \$\(df -Ph | wc -l\)" >> /tmp/vvv
done
echo "$(wc -l < /tmp/vvv)" ; cat /tmp/vvv
14,824
Posted By jayan_jay
$ find . -name "*" -type f -mtime -1 -exec du -sk...
$ find . -name "*" -type f -mtime -1 -exec du -sk {} \; | nawk '{sum+=$1} END {print sum/1024" MB"}'
1,234
Posted By jayan_jay
one more in awk. $ awk '!($0 in a)...
one more in awk.

$ awk '!($0 in a) {a[$0];print}' infile
3,048
Posted By jayan_jay
$ sed 's, /// ,/,g' infile
$ sed 's, /// ,/,g' infile
21,513
Posted By jayan_jay
Performance not tested .. To avoid arithmetic...
Performance not tested .. To avoid arithmetic calculations, try with egrep

$ egrep "83 (1...$|2000)" infile
83 1453
$
1,124
Posted By jayan_jay
$ sed "s,..:..-,$(date +%Y)-,g" infile hostname...
$ sed "s,..:..-,$(date +%Y)-,g" infile
hostname 2007-Feb-9 /u100/DEVCO/Patching a.log
hostname 2010-Jun-25 /u100/DEVCO/DumpCleaner a.log
hostname 2011-Jun-25 /u100/DEVCO/DumpCleaner/sample a.log...
2,387
Posted By jayan_jay
if [ -f "$file_name" ]; then echo File...
if [ -f "$file_name" ]; then
echo File $file_name Found
else
echo File $file_name Not Found
fi


Alternate one ..

$ [ -f "$file_name" ] && echo "Filename $file_name Found"...
1,997
Posted By jayan_jay
$ paste - - - < infile USER_ID 12/31/69...
$ paste - - - < infile
USER_ID 12/31/69 19:00:00 12/31/69 19:00:00
USER_ID 12/31/69 19:00:00 12/31/69 19:00:00
USER_ID 12/31/69 19:00:00 12/31/69 19:00:00
USER_ID 12/31/69...
1,643
Posted By jayan_jay
Simple way .. $ awk '{print FILENAME" "$0}'...
Simple way ..

$ awk '{print FILENAME" "$0}' *.avg
2,303
Posted By jayan_jay
One way.. (Include the highlighted part for high...
One way.. (Include the highlighted part for high to low)

$ find /dir/location -type f | nawk -F\/ '{$NF=""; print}' OFS=\/ | sort | uniq -c | sort -nr
2,303
Posted By jayan_jay
$ find dir_path -type f -exec ls -ltr {} \; |...
$ find dir_path -type f -exec ls -ltr {} \; | nawk -F\/ '{$NF=""; print}' OFS=\/ |
nawk '{a[$NF]++ ; b[$NF]=b[$NF]+$5}END{for(i in a) print(i, a[i], b[i])}'
24,789
Posted By jayan_jay
$ find dir_name -mtime 0
$ find dir_name -mtime 0
24,789
Posted By jayan_jay
-mtime 0 will pick latest 24 hrs modified files...
-mtime 0 will pick latest 24 hrs modified files .. Thats y it picks yours yesterday dates files too ..

Then try with the below ..

$ find dir_path -mtime 0 -type f -exec ls -ltr {} \; | grep...
1,574
Posted By jayan_jay
Based on the input file given.. $ nawk...
Based on the input file given..

$ nawk '/InsuredName/ {f=NR; getline; print} NR==f+8' infile
Address1
ClaimNo1
Address1
ClaimNo2
1,385
Posted By jayan_jay
$ awk '/9/{print NR}' infile
$ awk '/9/{print NR}' infile
5,474
Posted By jayan_jay
Based on the input given .. $ fgrep -vf...
Based on the input given ..

$ fgrep -vf file2 file1
2,293
Posted By jayan_jay
Based on the input given .. Try with this .. ...
Based on the input given .. Try with this ..

$ nawk '/CREATED|COMPLETED/{split($1,a,">"); print a[2]}' infile
2010-03-25-09.51.52.484529
2010-03-25-09.51.53.171452
2010-03-25-09.51.52.484529...
5,275
Posted By jayan_jay
If your HOSTNAME variable value is set in all...
If your HOSTNAME variable value is set in all servers, then you will retrieve it via ssh

$ env | grep -w HOSTNAME
HOSTNAME=xxxxxxxxx

Instead of it, go with the hostname command

ssh...
2,082
Posted By jayan_jay
Or pipe output to | grep '.'
Or pipe output to | grep '.'
14,607
Posted By jayan_jay
Try with this .. $ for i in $(cat infile) ;...
Try with this ..

$ for i in $(cat infile) ; do echo "ibase=16; $i" | bc ; done | xargs
1,098
Posted By jayan_jay
$ fgrep -vf file2 file1
$ fgrep -vf file2 file1
8,743
Posted By jayan_jay
To overcome .. :) month=$((10#${dat:2:2}))
To overcome .. :)

month=$((10#${dat:2:2}))
19,694
Posted By jayan_jay
I have assigned first column as the variable name...
I have assigned first column as the variable name ..

$ awk '/(Home|Shell|Primary|Second)/ {print $1"="$NF}' infile > infile1

$ chmod 755 infile1

$ . ./infile1

$ echo $Home $Shell...
2,989
Posted By jayan_jay
sort < infile | uniq -c
sort < infile | uniq -c
4,675
Posted By jayan_jay
Use backslashes .. $ ssh user@servername...
Use backslashes ..

$ ssh user@servername "a=\$(hostname); echo \$a"
servername
$
Showing results 1 to 25 of 171

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