linux

Working of fork() in linux gcc

"fork() creates a new process and the child process starts to execute from the current state of the parent process". This is the thing I know about fork() in LINUX. So, accordingly the following code : int main() { printf("Hi"); fork(); return 0; } needs to print "Hi" only once as per the above. But on executing the above in l...

Linux: get list of files a program currently has open

In Linux, how can I get a list of files currently open in program X? (Specifically, I'm on Fedora, and the program is Zend Studio, but I assume there's a general answer.) ...

Creating bash script of a complex linux command

I have few long commands that I will be using on a day to day basis. So I though it would be better to have a bash script where I could pass arguments, thus saving typing. I guess this is the norm in Linux but I am kind of new to it. Could someone show me how to do it. A example is the following command cut -f <column_number> <filename>...

I am running apt-get install rdiff-backup, or really any program I want, and I get stuck on the "Setting up libuuid1 (1.41.3-1) ..."

So I run the apt-get install and then any program. The first part runs fine, but then reaches the "Setting up libuuid1 (1.41.3-1) ..." and locks up. Any ideas what could be causing this stop, i have checked the log files and there is nothing there. ...

Best approach to detecting a move or rename to a file in Linux?

Some solution could probably be applicable to Windows, however I am not familiar with the Windows OS, so this will be Linux focused. As far as I understand, Unix file system all have the concept of inodes, which is where the file system metadata and the "file" is stored. Thus I am wondering if it is possible to use the inode number wit...

Linux: How to make a deamon/service usable with xinetd ?

Anybody knows what changes are necessary for a server to work with xinetd ? The server being a .NET mailserver that runs on Linux. See the bottom of this post for reference: Lumisoft Mailserver Forum Post Note: xinetd, not mono-service. [x]inetd is an internet superserver. A superserver starts a server service on demand. (As opposed t...

Python print statements being buffered with > output redirection

I'm doing print statements in python. I'm executing my script like so: python script.py > out.log nohup & The print statements are not all showing up in out.log but the program is finishing ok. That line of code is in an .sh file I execute by doing ./script.sh Update: The log does get all the data but not until a certain # of lines ...

pass option containing comma to configure script (Linux)

Hi, I have a configure script where I need to pass an option that contains a comma. Now if it weren't for the comma I could put some "s around to make configure recognize the string as a whole: ./configure --with-arpack="-Wl,-rpath,/my/path -L/my/path -larpack" But the commas are interpreted as option delimiters, so the script only ...

I want to benchmark solaris and linux with java

Can anyone point me out to a project out there that I can download and run it and it would load / stress test itself and then provide me with reports? I want the project to be as big as it can and to involve as many components in java as it can, also i need it free... or to some very good already made results over the web that I can alre...

does anyone have more info on standard in and standard out?

I don't have much of an interest in designing guis (too much work), and I wanna know how it is that programs like vim, and greed work, how is it that vim can modify it's standard out without printing it all out again?, and I often see the output from terminal programs in bright colors, is there some sort of markup language that tells the...

Configuring GTK accelerators.

I run GTK2 applications under linux, on my apple computer. I would like to know how to modify the global accelerator settings. In particular, I would like to copy paste using Command-c Command-v instead of Ctrl-c Ctrl-v. Has anybody done this? Is there a config file somehwere that contains the accelerator assignments? ...

Global function inside in Bash?

I want to define a constant inside a function that could be used outside the function's scope. function section { variable = "Hello" } echo variable Is this possible? ...

is it possbile to dowload one part of a file from web ?

lets say there is one very big file on some server and i just want to download first 1MB. How can I do it on Linux ? ...

inotify program compile error

hi i want write a program in c by inotify to a system with kernel 2.6.9 but 2.6.9 dosnt support inotify, since i update kernel to version 2.6.18, when i want to compile my program error say:undefined reference toinotify_init'` what can i solve that? glibc version 2.3.4 gcc version 3.4.4 ...

Makefile with multiple targets

Hopefully this is a very simple question. I have a makefile pattern rule that looks like this: %.so : %.f %.pyf f2py -c -L${LAPACK_DIR} ${GRASPLIBS} -m $* $^ ${SOURCES} --opt='-02' --f77flags='-fcray-pointer' >> silent.txt I want the makefile to build a number of .so files, so I tried to get it to build two files (radgrd_py.so and...

What is the best way to use linux utilities under windows?

Linux utilities like sed, awk and other shell scripting features are awesome and life becomes a lot harder when I am developing on windows and cant use any of these. People suggest to use cygwin for those who want the linux like tools under windows. But I feel cygwin will be an overkill for someone who only wants to use the handful comm...

Remote backup solution for openSuSE

I'm looking for some backup solution. My request is pretty simple: Source - FTP credentials (ftp://user:[email protected]/dir1/dir2) Destination on local HDD (/var/backup/server-tld) Possibility of packing to archive (tar.gz/zip) Plan this "script" as a cron job with defined period (e.g. once a day) I know, that all this can be done us...

sendmail time option

is there any option to sendmail linux command on particular time . I want make or sending email on particular time . ...

Linux: Hard disk direct access (without any FS) from C program

Hello all, this is my first post here. I want to access the whole hard disk directly from a C program. There's no FS on it and never's gonna be one. I just want to open /dev/sda (for example) and do I/O at the block/sector level of the disk. I'm planning to write some programs for learning C programming in the Linux environment (...

Linux Assembly reference

I am reading the book "Professional Assembly Language", with sample code written for Intel IA-32 processors. Assembler used is GNU Assembler. Where can I find this Assembly reference? For example, writing Assembly for Windows, I can find the reference in Intel WEB site. What about Linux and GNU Assembler? ...