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)
I'm trying to create a simple file inventory for a series of huge directories containing e-records. What I'm after is a list of all directories and sub-directories with just the number of each type of file in that directory/sub-directory. For example output would look like:
... (6 Replies)
Hi all,
I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder?
please send me the query asap. (3 Replies)
Hi,
I am trying to get the total file size for certain files per directory.
I am using
find /DirectoryPath -name '*.dta' -exec ls -l {} \; | awk '{ print $NF ": " $5 }' > /users/cergun/My\ Documents/dtafiles.txt
but this lists all the files in the directories.
I need the total... (9 Replies)
wow, back again :)
I am trying to write a program that has many functions, however one of the functions will count the total number of users in the database.
I want to just use wc -l passwd (i've made a copy of passwd to play with, no worries lol)
but I am worried that if any of the... (4 Replies)
I am trying to get the total size of the folder using the below command
but its not working. any ideas?
du -bc <foldername>/|grep total|tr -s " "|cut -d" " -f1
the output i am getting is
78996 total
but i just want it to be as
78996
please help (3 Replies)
Hi All,
I have written a script on this but it does not do the requisite job. My requirement is this:
1. I have two kinds of files each with different extensions. One set of files are *.dat (6000 unique DAT files all in one directory) and another set *.dic files (6000 unique DIC files in... (1 Reply)
I'm trying to make this code below to work but I can't find the way to do the following: I want to make the script to touch only 10% of the total amount of files counted inside the given directory instead of all like it is now.
I would greatly appreciate it if someone can give me a direction on... (9 Replies)
Hi All,
When i give the ls -lrt to list out all files with total number of files , i get the output as
ls -lrt
total 72
-rw-r--r-- 1 hari staff 796 Jul 11 09:17 va.txt
-rw-r--r-- 1 hari staff 169 Jul 13 00:20 a.log
-rwxr-xr-x 1 hari staff 659 Aug... (9 Replies)
So I'm trying to search for the top 10 or 15 items under a directory by file type. I want to run a command on a directory and get something like the following:
Example of expected output.. .PDF: 100, .txt: 95, .word: 80..
What would be the best way of going about this? I've searched around... (2 Replies)
Discussion started by: shackle101
2 Replies
LEARN ABOUT PHP
imageftbbox
IMAGEFTBBOX(3) 1 IMAGEFTBBOX(3)imageftbbox - Give the bounding box of a text using fonts via freetype2SYNOPSIS
array imageftbbox (float $size, float $angle, string $fontfile, string $text, [array $extrainfo])
DESCRIPTION
This function calculates and returns the bounding box in pixels for a FreeType text.
PARAMETERS
o $size
-The font size. Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2).
o $angle
- Angle in degrees in which $text will be measured.
o $fontfile
- The name of the TrueType font file (can be a URL). Depending on which version of the GD library that PHP is using, it may
attempt to search for files that do not begin with a leading '/' by appending '.ttf' to the filename and searching along a
library-defined font path.
o $text
- The string to be measured.
o $extrainfo
-
Possible array indexes for $extrainfo
+------------+-----------------------------+
| Key | |
| | |
| | Type |
| | |
| | Meaning |
| | |
+------------+-----------------------------+
| | |
|linespacing | |
| | |
| | |
| | float |
| | |
| | Defines drawing linespacing |
| | |
+------------+-----------------------------+
RETURN VALUES imageftbbox(3) returns an array with 8 elements representing four points making the bounding box of the text:
+--+--------------------------------+
|0 | |
| | |
| | lower left corner, X position |
| | |
|1 | |
| | |
| | lower left corner, Y position |
| | |
|2 | |
| | |
| | lower right corner, X position |
| | |
|3 | |
| | |
| | lower right corner, Y position |
| | |
|4 | |
| | |
| | upper right corner, X position |
| | |
|5 | |
| | |
| | upper right corner, Y position |
| | |
|6 | |
| | |
| | upper left corner, X position |
| | |
|7 | |
| | |
| | upper left corner, Y position |
| | |
+--+--------------------------------+
The points are relative to the text regardless of the $angle, so "upper left" means in the top left-hand corner seeing the text horizon-
tally.
EXAMPLES
Example #1
imageftbbox(3) example
<?php
// Create a 300x150 image
$im = imagecreatetruecolor(300, 150);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
// Set the background to be white
imagefilledrectangle($im, 0, 0, 299, 299, $white);
// Path to our font file
$font = './arial.ttf';
// First we create our bounding box
$bbox = imageftbbox(10, 0, $font, 'The PHP Documentation Group');
// This is our cordinates for X and Y
$x = $bbox[0] + (imagesx($im) / 2) - ($bbox[4] / 2) - 5;
$y = $bbox[1] + (imagesy($im) / 2) - ($bbox[5] / 2) - 5;
imagefttext($im, 10, 0, $x, $y, $black, $font, 'The PHP Documentation Group');
// Output to browser
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
NOTES
Note
This function requires GD 2.0.1 or later (2.0.28 or later is recommended).
Note
This function is only available if PHP is compiled with freetype support ( --with-freetype-dir=DIR)
PHP Documentation Group IMAGEFTBBOX(3)