04-03-2012
You need to strip off the units and convert to a common unit before you try and add it to a total (you could have 3.6M, 4.0K, etc).
This User Gave Thanks to CarloM For This Post:
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies
2. UNIX for Dummies Questions & Answers
Hi All
Can anyone help me with the following du querry. I am trying to achieve a total size for all the zipped files in a directory. Using du -k *.gz gets me a file by file list but no handy total at the bottom.
Thanks
Ed (9 Replies)
Discussion started by: C3000
9 Replies
3. Shell Programming and Scripting
hi group,
How can I count total number of 5's which are continuous in the end. i.e. in the below string, the o/p should be 4
I just know to calculate total number of 5's
$ echo "95952325555" | awk -F "5" '{print NF-1}'
6 (3 Replies)
Discussion started by: uwork72
3 Replies
4. Shell Programming and Scripting
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies
5. Shell Programming and Scripting
How would I get a total of a wildcard of files from the 'du' command?
du -s *.pdf
Result:
736 11mens_bracket.pdf
64 2011_NIT_Bracket_3_13_11.pdf
80 Doing more with Less part1.pdf
1064 Doing more with Less part2.pdf
28 Parkview_1309_Garage.pdf
3964 statsheet-bracket-2011.pdf
Expected... (7 Replies)
Discussion started by: AlphaLexman
7 Replies
6. Shell Programming and Scripting
Input file
SFSQW 5192.56
HNRNPK 611.486
QEQW 1202.15
ASDR 568.627
QWET 6382.11
SFSQW 4386.3
HNRNPK 100
SFSQW 500
Desired output file
SFSQW 10078.86 3
QWET 6382.11 1
QEQW 1202.15 1
HNRNPK 711.49 2
ASDR 568.63 1
The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies
7. Shell Programming and Scripting
Have a input file like this .....
attachments 100G
shared 1T
archive 300M
documents 300G
remotedocs 150M
I need the total in GB's ... where as M=MB,G=GB,T=TB
Basically need awk to calculate the total based on end... (5 Replies)
Discussion started by: greycells
5 Replies
8. Solaris
i want to list Total HDD count in any soalris machine..can someone suggest some commands or combinations of commands (6 Replies)
Discussion started by: omkar.jadhav
6 Replies
9. Shell Programming and Scripting
Input
435,BL_lmapm03,rrr,RDF1+TDEV,0cef,45,mask1
435,BL_lmapm03,rrr,TDEV,080a,50,mask2
435,BL_lmapm02,fff,RDF1+TDEV,0ceg,45,mask4
435,BL_lmapm02,fff,TDEV,080b,60,mask6
435,BL_lmapm06,hhh,TDEV,080f,60,mask9
Output
435,BL_lmapm03,rrr,RDF1+TDEV,0cef,45,mask1... (4 Replies)
Discussion started by: greycells
4 Replies
LEARN ABOUT X11R4
systemd.target
SYSTEMD.TARGET(5) systemd.target SYSTEMD.TARGET(5)
NAME
systemd.target - Target unit configuration
SYNOPSIS
target.target
DESCRIPTION
A unit configuration file whose name ends in ".target" encodes information about a target unit of systemd, which is used for grouping units
and as well-known synchronization points during start-up.
This unit type has no specific options. See systemd.unit(5) for the common options of all unit configuration files. The common
configuration items are configured in the generic [Unit] and [Install] sections. A separate [Target] section does not exist, since no
target-specific options may be configured.
Target units do not offer any additional functionality on top of the generic functionality provided by units. They exist merely to group
units via dependencies (useful as boot targets), and to establish standardized names for synchronization points used in dependencies
between units. Among other things, target units are a more flexible replacement for SysV runlevels in the classic SysV init system. (And
for compatibility reasons special target units such as runlevel3.target exist which are used by the SysV runlevel compatibility code in
systemd. See systemd.special(7) for details).
IMPLICIT DEPENDENCIES
There are no implicit dependencies for target units.
DEFAULT DEPENDENCIES
The following dependencies are added unless DefaultDependencies=no is set:
o Target units will automatically complement all configured dependencies of type Wants= or Requires= with dependencies of type After=
unless DefaultDependencies=no is set in the specified units. Note that Wants= or Requires= must be defined in the target unit itself --
if you for example define Wants=some.target in some.service, the automatic ordering will not be added.
o Target units automatically gain Conflicts= dependency against shutdown.target.
EXAMPLE
Example 1. Simple standalone target
# emergency-net.target
[Unit]
Description=Emergency Mode with Networking
Requires=emergency.target systemd-networkd.service
After=emergency.target systemd-networkd.service
AllowIsolate=yes
When adding dependencies to other units, it's important to check if they set DefaultDependencies=. Service units, unless they set
DefaultDependencies=no, automatically get a dependency on sysinit.target. In this case, both emergency.target and systemd-networkd.service
have DefaultDependencies=no, so they are suitable for use in this target, and do not pull in sysinit.target.
You can now switch into this emergency mode by running systemctl isolate emergency-net.target or by passing the option
systemd.unit=emergency-net.target on the kernel command line.
Other units can have WantedBy=emergency-net.target in the [Install] section. After they are enabled using systemctl enable, they will be
started before emergency-net.target is started. It is also possible to add arbitrary units as dependencies of emergency.target without
modifying them by using systemctl add-wants.
SEE ALSO
systemd(1), systemctl(1), systemd.unit(5), systemd.special(7), systemd.directives(7)
systemd 237 SYSTEMD.TARGET(5)