General :: Add Number For Each Day From Log?

Jul 5, 2011

i have a log like:

Jul 4 23:19:02 Node-1 node-KPI: [INFO] KPI [proc.count = 11 files]
Jul 4 23:22:46 Node-1 node-KPI: [INFO] KPI [proc.count = 27 files]
Jul 4 23:37:49 Node-1 node-KPI: [INFO] KPI [proc.count = 27 files]
Jul 4 23:49:01 Node-1 node-KPI: [INFO] KPI [proc.count = 12 files]

[code]...

I would like to add up the numbers in the last column for each day and get that as the output. It could look like:

Jul 5 : 54
Jul 6 : 38

how can this be done with a bash script?

View 5 Replies


ADVERTISEMENT

General :: Unix Ps -l Priority Whoes One Number In Column "PRI" But In Same Time Ps -o Pri Shows Another Number?

May 21, 2011

Why does unix ps -l whows one number in column "PRI" but in same time ps -o pri shows another number? cpu and nice are zero for those processes

View 1 Replies View Related

Ubuntu :: Get The Card Number And Device Number On System For Attched USb Audio Device?

Oct 1, 2010

how to get the card number and device number on system for attched USb audio device?

View 3 Replies View Related

General :: Max Number From The Name Of A File?

Mar 24, 2010

I need to get the max number from the name of a file

Formant of the file name:
[a-zA-Z]*_[0-9][0-9]_[A-Z][A-Z].log
Delimiter as underscore '_'

[code]....

known part in the above file name will be GA.log A give directory may or may not contain files in the above format or may contain file other then the above format if so then ignore it.

Eg:-

1) Directory=/tmp/log having below listed files

ant_01_EG.log ant_02_GA.log ant_04_EG.log cvs_01_EG.log cvs_02_GA.log cvs_04_EG.log master_01_GA.log master_03_EG.log master_04_GA.log

[code]....

output=> 06

2) Directory=/tmp/log no files

cmd=> ls *[0-9][0-9]_GA.log 2> /dev/null | awk -F_ '{ print $2}' | sort -nr | head -n1 | awk 'BEGIN { if ($1 >0 ) x=0; else x=1 } END {printf "%02.0f
", $1+1}'

output=> 01

if there are no files the output should be 01 and if file(s) found the output should be next highest number+1, In the above example it is 06 My cmd is bit lenghty. reduce my cmd and it should be in one line.

View 6 Replies View Related

General :: 567 Is A 3 Character Number Why The O/p Is 4

Jan 11, 2011

look into the following command...

Code:
asit@ubuntu:~/script$ echo 567 | wc -c
4

though 567 is a 3 character number, why the o/p is 4 ??

View 1 Replies View Related

General :: What Number Of Bytes Should Set The Bs To In The Dd Command

Apr 3, 2011

I have just created a usb boot disk so that I can install Fedora 14.I used the following which was successfully. However, I am left wondering what does the bs parameter actually does. I know it mean bytes and copies these at a time. But how do I know what to set it to?dd if=F14-Live-i686.iso of=/dev/sdb bs=8MIn the above example it is set to 8MB. However could I set this to any value that I want?

View 1 Replies View Related

General :: Osx - Get Folder With Largest Number At The End Of The Name In OS X?

Apr 22, 2011

I asked this question yesterday with Linux, but I realized I need to get it working in both Linux and OS X. Link to earlier question: Get folder with largest number at the end of the name in Linux. I have some folders r1, r2, r3, etc. and I want to get the name of the folder with the largest number at the end. How do I get the name? The ls -v solution looks promising, but I want to exclude all folders that don't follow the pattern r[0-9]*

View 3 Replies View Related

General :: Maximum Number Of Partitions With EFI?

Jul 5, 2011

I was wondering what is the maximum number of partition on an GPT-partitionned drive under Linux. The GPT partition table can contain up to 128 partitions, but the device nodes for /dev/sda? (as described here, block device of major number 8) only allow /dev/sda1 up to /dev/sda15. Does that means that there cannot be more that 15 partitions on a drive, even on a GPT-partitionned drive?

View 2 Replies View Related

General :: Searching For Number Within A File?

Nov 9, 2010

I'm currently trying to design a small, simple enough shell program for area codes. I have a list of area codes in a database, and I am trying to write a program that will have a user input an area code, and then have the program print out information that immediately follows that area code in my database. I assume I need to use a find or locate command, but I'm not sure if I should be searching for a string or the number itself. The number could possibly occur at some other point in the file, though the way I have the file set up it only occurs once at the newline.

what function I should use and how I should go about it? As is I only have the absolute bare-bones beginning of having an echo for the prompt to input an area-code, and the read once it's input. Without the find I'm not sure how much farther I can get. Also, would it make it easier if I added some character such as a ! to the end of the number at the newline to make it easier to search for? With a macro that would be easy enough to do.

View 1 Replies View Related

General :: Changing The SSH Port Number?

Jan 12, 2011

im using CentOS 5.2 and cant change my default ssh port number. I have edited /etc/ssh/sshd_config to this

Code:

#$OpenBSD: ssh_config,v 1.21 2005/12/06 22:38:27 reyk Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files

[code]....

I have then restarted ssh by typing (as root) "sbin/service sshd restart" and it restarts fine but still is on 22 and not 222.

View 9 Replies View Related

General :: Force A Folder To Have GID Number?

Jun 20, 2010

I created a group, and after adding the users into this group, they have a /home/worksharing that is shared

Code:

addgroup teamnight --gid 2578

So that everyone of the teamnight can read/write data of the /home/worksharing , how can this folder be forced, so that all from it e.g. subdirectories, directories, files,... will take the GID group number 2578 of teamnight?

View 10 Replies View Related

General :: Use RANDOM Number In Procmailrc?

May 2, 2011

I want to generate random name for email file name to prevent overwriting but $RANDOM ENV VARs does not work in it what can I do? this is my procmailrc:

Quote:

SHELL=/bin/bash
SUBJECT=`formail -xSubject:`
FROM=`formail -xFrom:`
SUBJECT=`echo $SUBJECT | sed -e 's/ /-/g'`
FROM=`echo $FROM | sed -e 's/.*<//g' | sed -e 's/>//g' | sed -e 's/@/AT/g'`
STOREFILE=20`date +%y-%m-%d_%H-%M-%S`_${FROM}_${SUBJECT}_${RANDOM}${RAMDOM}

it works fine except ${RANDOM}${RAMDOM} and I do not want to use mktemp command .

View 8 Replies View Related

General :: Generate Random Number Either 1 Or 0?

Jan 21, 2010

Not only that but I need tons and tons of them generated, and I need it to be totally random each time.

Code:
matthew@mvm:/h/misc> cat a
#!/bin/bash
for i in {1..5}; do
echo $RANDOM

[Code]....

There you can see that it is the same number. It does that every time!! Grrr. The strange thing is each time I manually type [or copy & paste] it into the terminal, it gives random [not static, like I am getting from my script] results.

The reason I want this is because I am making a script where this line will randomly go up or down [depending on if the random number is 1 or 0].

View 4 Replies View Related

General :: Relationship Between Vector And Irq Number?

Dec 9, 2010

I just found in kernel-2.6.35.3, in file arch/x86/kernel/irq.c:

unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
/* high bit used in ret_from_ code */
unsigned vector = ~regs->orig_ax;

[Code]...

Does any body know the relationship between the vector number and irq number?

View 1 Replies View Related

General :: Extract Last Number From Filename

May 27, 2010

I have to extract last number from filename.

ex- my file name is a10b8c1000

so i want to extract 1000 from it.

i tried using sed
sed 's/[a-z][0-9]*[a-z][0-9]*[a-z]//g' a10b8c1000

but sed looks for content inside file.

View 8 Replies View Related

General :: Number Of Repositories For Which Yum Can Be Configured?

Jul 27, 2009

What is the number of repositories for which i can configure YUM?

And are there any chances of instability when using number of repositories with yum?

I am using RHEL5.

And i suspect that i have configure my yum for DAG WIEERS.

How to know that?

View 8 Replies View Related

General :: How To Get Number Of Occurrences Of String From Grep

Apr 29, 2010

How do I find a string in files in a directory. And these file names begin with letter a. I also want to get the number of occurrences of this string from the grep I run.
I tried this:
cat * | grep -c string but it searches all files. I just want to search files that begin with letter a

View 5 Replies View Related

General :: GRUB: How Find Partition Number - Hd0,x ?

Aug 29, 2010

I am playing with grub and i change the root using:

How can i know what's x for /dev/sda7 ?

The problem is that in Gparted view, the order is not like sda5, sda6, sda7, ...but the order is like:

So what's x for /dev/sda7 ?

View 2 Replies View Related

General :: Restrict Number Of SSH Connections By User Name Or IP?

Sep 14, 2010

Can I restrict the number of ssh connections to my Linux box - by username or by ip or both?

View 1 Replies View Related

General :: Command To Return Number Of Bits (32 Or 64)?

Nov 7, 2010

What is a Linux command that I can run to programmatically return either 32 or 64 to indicate whether the processor is a 32 bit or 64 bit processor?

View 4 Replies View Related

General :: Maximum Number Of IPs That Can Be Assigned To A Given Computer?

Jan 11, 2011

I really need to know this for a linux server, but since it also applies to client OSes, I figured the question should be posed here instead of server fault.

View 3 Replies View Related

General :: What Do The Number Suffixes In Dynamic Libraries Mean

Jun 18, 2011

Here's an example:

What do the numbers after so, such as in the last line, 1.1.0 mean?

My first guess was that they are version numbers, but:

So the 1.1.0 does not seem to have any connection to the version of the library, reported to be 2.4.46.

View 1 Replies View Related

General :: Restrict The Number Of Ssh Connections To Box - By Username Or By Ip Or Both?

Jan 27, 2010

Can I restrict the number of ssh connections to my Linux box - by username or by ip or both?

View 3 Replies View Related

General :: Bash Scripting - Grab First And Last Number?

Jan 13, 2011

I'm trying to get an output of a file in numeric order. Basically I need the starting number and the ending number in sed this into anther file. The test2.lis file I'm just awk'ing for the first row and if its out of order put it in order so I can grab the first and last numbers. I'm sure I can do this all in an array. The first sed command gets rid of blank lines and outputs it to a file. Then I head and tail for the first and last number then I want to sed those numbers into a file that exsist.

[code]...

The error I get is:

sed: -e expression #1, char 24: unterminated `s' command.

View 13 Replies View Related

General :: Detecting WWID Number Of HBA On SLES11

Jul 2, 2010

I have SLES11 installed on server. I have attached 2 SAS cables which are connected to External storage device. I have connected 3 machines to external storage device. It shows total 6 ID�s. I want to know which 2 are from which machine. I would like to find out the WWID number of HBA�s on SLES 11 machine.

View 11 Replies View Related

General :: Find Inode Of A Particular File Using Its Number?

Nov 16, 2010

Can we find the inode of a particular file using its inode number?

The reason is i want to know how many blocks are occupied by specific file.

if we consider block size of 1K.
if the file size is of 100 bytes. In such a case, when the file is
stored on disk, the file will occupy 100 bytes or 1K (since we have
choosen block size to be 1K) ?

View 6 Replies View Related

General :: How To Check For Number Of Folders - Then Delete IF

Apr 9, 2010

I have a daily backup script executing on my server. I would like to be able to delete the "last" backup. for ex the folder that's 30 days old.

How to find a command that will check for the oldest folder ? Then do an action with that folder. In this case, delete.

View 4 Replies View Related

General :: How To Determine Number Of RAM Slots Using Dmidecode

Apr 5, 2011

I m using SUN Server .
How would i determine the number of RAM slots using dmidecode.

I m running following command to get RAM information. code....

View 7 Replies View Related

General :: Only Allowing A Limited Number Of Directories?

May 14, 2011

I have a drive NTFS formatted drive mounted in Debian and a script set to make directories via a linux script and cron job. This was running flawlessly till recently, when I started getting 'mkdir: cannot create directory 'dirname': Operation not supported'.I have been unable to find any help with this issue online. I assume it is a NTFS mount issue. I know it isn't about file size, as the drive it 1TB.Here is my fstab for reference:Code:/dev/sdb1 /mnt/backupLocation ntfs-3g rw 0 0Do you know what the issue is here? Like I said, up until recently I have been able to create seeming unlimited directories here, but it now stops after about 7 - 10 directories have been created?

View 9 Replies View Related

General :: Maximum Number Of Files Per Folder?

Apr 28, 2011

I would like to ask you if there is any maximum allowed number of files per folder in linux (without risking it to lose everything). I am using openuse 11.4 with latest kde (4.6?).

I am trying something fast and dirty and it might be that one folder will contain like 10^6 files.

Is there is anything I should be warned about that?

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved