Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: jayan_jay
1,829
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
16,295
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
$
940
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,055
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,604
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,841
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])}'
21,844
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...
21,844
Posted By jayan_jay
$ find dir_name -mtime 0
$ find dir_name -mtime 0
1,114
Posted By jayan_jay
Simple way .. $ awk '{print FILENAME" "$0}'...
Simple way ..

$ awk '{print FILENAME" "$0}' *.avg
2,791
Posted By jayan_jay
$ sed 's, /// ,/,g' infile
$ sed 's, /// ,/,g' infile
1,289
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,182
Posted By jayan_jay
$ awk '/9/{print NR}' infile
$ awk '/9/{print NR}' infile
5,021
Posted By jayan_jay
Based on the input given .. $ fgrep -vf...
Based on the input given ..

$ fgrep -vf file2 file1
1,841
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
4,273
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,096
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...
1,722
Posted By jayan_jay
Or pipe output to | grep '.'
Or pipe output to | grep '.'
12,137
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,017
Posted By jayan_jay
one more in awk. $ awk '!($0 in a)...
one more in awk.

$ awk '!($0 in a) {a[$0];print}' infile
950
Posted By jayan_jay
$ fgrep -vf file2 file1
$ fgrep -vf file2 file1
7,382
Posted By jayan_jay
To overcome .. :) month=$((10#${dat:2:2}))
To overcome .. :)

month=$((10#${dat:2:2}))
18,732
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,650
Posted By jayan_jay
sort < infile | uniq -c
sort < infile | uniq -c
3,975
Posted By jayan_jay
Use backslashes .. $ ssh user@servername...
Use backslashes ..

$ ssh user@servername "a=\$(hostname); echo \$a"
servername
$
10,588
Posted By jayan_jay
Expecting this ..?? if [ condition1 ]; then ...
Expecting this ..??

if [ condition1 ]; then
export 1
elif [ conidtion2 ]; then
export 2
elif [ condition3 ]; then
export 3
else
export 4
fi
Showing results 1 to 25 of 171

 

Featured Tech Videos

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