02-05-2008
man du (the arguments depend of OS... but what works on all is du -sk <filename> and result is in KB...)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am taking an intro to unix class and I can not figure out how to do part of the question. I am writing script to be exictued by a program in the tutoral.
Question:
Write every line containing the word ``delete'' produced by ``man mail'' into a file called ``delete''. Hint: What does using... (1 Reply)
Discussion started by: weathergirl
1 Replies
2. UNIX for Dummies Questions & Answers
Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies
3. Shell Programming and Scripting
Is it possible to establish an IF statement inside a case statement in a shell file ?
thx (2 Replies)
Discussion started by: TARFU
2 Replies
4. UNIX for Dummies Questions & Answers
i'm trying to make a script that prints the name of the script for any command line parameter, here is what i have, and get `]]' unexpected:
what am i doing wrong? (3 Replies)
Discussion started by: tefflox
3 Replies
5. Programming
Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
Discussion started by: Xeed
6 Replies
6. Shell Programming and Scripting
Hello ,
I have the folloiwing command :
sed -n "$var,$final w $destfile" $sourcefile
where :
$var - $final represent the range of line numbers to be written in $destfile
However I require this command to work in a loop for which i need the sed command to keep appending the output to the... (2 Replies)
Discussion started by: shweta_d
2 Replies
7. Shell Programming and Scripting
Hi,
Please don't berate me over the simplicity of these questions. I have recently gotten into bash shell scripting and enjoy it quite a bit. One thing I have not found the answer to though is when naming a shell script, what extension is normally used (ie myscript.?)? Also where is the standard... (5 Replies)
Discussion started by: msb65
5 Replies
8. UNIX for Dummies Questions & Answers
Hello, I have a quick question that is not related to homework in any way shape or form (in case anyone wanted to know). My question is thus:
I have a file "temp" that has the two values say "5" and "3" (separated by a white space). Now, I want to simply write an if-else statement that reads... (10 Replies)
Discussion started by: astropi
10 Replies
9. Red Hat
Cheers!
In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not?
To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies
10. Shell Programming and Scripting
Sorry for stupid question, but why this script gives that output?
$ awk 'BEGIN { well=56789; print 1234$well }'
1234
I expected 123456789 (9 Replies)
Discussion started by: silyin
9 Replies
getcwd(3) Library Functions Manual getcwd(3)
NAME
getcwd - Gets the pathname of the current directory
LIBRARY
Standard C Library (libc) System V Library (libsysv)
SYNOPSIS
Standard C Library:
#include <unistd.h>
char *getcwd( char *buffer, size_t size);
System V Library:
char *getcwd( char *buffer, int size);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
getcwd() - libc version: XSH5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to a string space to hold the pathname. Specifies the length of the string space in bytes. The value of the size parameter must be
at least the length of the pathname to be returned plus one byte for the terminating null.
DESCRIPTION
The getcwd() function returns a pointer to a string containing the absolute pathname of the current directory. The getwd() function is
called to obtain the pathname.
[Tru64 UNIX] If the buffer parameter is a null pointer, the getcwd() function, using the malloc() function, obtains the number of bytes of
free space as specified by the size parameter. In this case, the pointer returned by the getcwd() function can be used as the parameter in
a subsequent call to the free() function.
NOTES
[Tru64 UNIX] The getcwd() function is supported for multithreaded applications.
RETURN VALUES
Upon successful completion, getcwd() returns the buffer parameter. Otherwise, a null value is returned and errno is set to indicate the
error.
ERRORS
The getcwd() function sets errno to the specified values for the following conditions: Read or search permission was denied for a component
of the pathname. The size parameter is zero.
[Tru64 UNIX] The size parameter is less than or equal to zero (for the libsys5 version of getcwd() only). The size parameter is
greater than zero, but is smaller than the length of the pathname + 1. The requested amount of memory could not be allocated.
RELATED INFORMATION
Functions: malloc(3), getwd(3)
Standards: standards(5) delim off
getcwd(3)