Linux, command line program's config file on homedirless setup
location: linuxexchange.com - date: January 23, 2015
Several programs for Linux invoked from terminal/shell use config file where options normally put to program's invocation command line string are put. For instance Vim, for instance curl and their config files ~/.vimrc, ~/.curlrc.
If to take curl and Vim they look for such file in the home directory (it works this way at least according to their man pages).
However I know Linux setups without home directories. For example a NAS.
The known NAS houses several shared volumes / directories to be accessed from client devices via several protocols and by registered users. By default however the NAS does not create home directory for each user newly registered. The administrator hesitate to enable the option "create home directory for this user" if such is needed only for the above purpose.
Is then the usage of program's config file on such setup not possible at all?
Is there a way to kill a program while in Linux command line?
location: linuxexchange.com - date: February 20, 2012
I'm currently testing a C++ program on the command line of a linux machine and unfortunately it sometimes gets into infinite loops. Is there a way that, from the command line, I can kill this program?
C program code to run a Linux command line
location: linuxquestions.com - date: June 5, 2003
I would like a C program code to run a Linux command line such as ifconfig, testparm and others.
Below is a simple C program code, what command would I use so that this little program will execute the command ifconfig. If there is any syntax error below, please fix it also.
========================================
#include <stdio.h>
int main()
{
char *linux-command []
linux-command = "ifconfig"
# What function would I call so that linux-command would be
# execute as if the user in on a command line console.
}
kill program command line
location: linuxquestions.com - date: February 9, 2004
how to kill program or running process from command line?
for example i want to kill "gdm"
how to run linux command from java program?
location: linuxquestions.com - date: November 10, 2004
hi friendz,
i wrote a java program in which is creating a file using the "File" class.... but after creating it i want to change the permissions of tht file.......i.e. i want to run "chmod" command from java.... does any pone know how to do it? or is there any other way to do it using File class or some other class?.....
bye....
Cannot kill program with command lines
location: ubuntuforums.com - date: March 11, 2014
Sometimes a program stops responding but I can't kill it on the the terminal with either killall foo or kill pid. But open the system monitor and click "kill process" always works. I am wondering what is the command used by system monitor.
Execute a linux command using a java program
location: linuxquestions.com - date: October 5, 2005
I have an assignment where I need to write a program in java that will execute the following linux commands:
(1) read file “/proc/uptime” to obtain Totaltime and Idletime
(2) read file “/proc/sys/kernel/hostname” to obtain the hostname
(3) read file “/proc/version” to obtain the kernel version
(4) read file “/proc/meminfo” to obtain the amount of used memory and free memory
(5) read file “/proc/driver/rtc” to obtain time and date
I tried it using the Runtime.getRuntime(); but it doesn't give the info needed. It compiles without errors but that is about it.
A classmate said he used the BufferedRead class to access the different files and broke them down by lines. Then he used the StringTokenizer class to split the lines into word groups and was able to select the data that he wanted.
Does anyone have a sample program that will execute these commands
Thanks
Command line program to create website screenshots (on Linux) [closed]
location: linuxexchange.com - date: November 25, 2013
What is a good command line tool to create screenshots of websites on Linux? I need to automatically generate screenshots of websites without human interaction. The only tool that I found was khtml2png, but I wonder if there are others that aren't based on khtml (i.e. have good JavaScript support, ...).
Alternate program for 'less' linux command/Making 'less' Secure
location: linuxexchange.com - date: April 2, 2014
I want to write an interactive program like 'less' command for Linux. Reason I can't use less in my setup because you can execute shell commands within less prompt '!cmd' which can be a major security risk for any production box.
My preferred language is C, however, if anyone can suggest any other similar program that will be great too, owing to the time I have in my hand.
I know one option will be to browse through the less source code, but it looks like that is not very straight forward either in short time.
Get realtime values from top command in linux into my program
location: linuxexchange.com - date: September 16, 2013
I have a daemon in ruby and I am trying to execute a bash command and get its output into the program. I am able to use the backtick feature in ruby to execute a bash command like ls -a. But since top command is real time, I am not able to get the output of the command into my program. Help me.
Why I need real time data is because I am trying to monitor all processes and kill it if it's memory limit is reached or something. I don't want to do top -bn 1
require 'rubygems'
require 'daemons'
options = {
:backtrace => true,
:app_name => 'limits_logger',
:log_dir => '/home/charizard/',
:log_output => true
}
Daemons.daemonize(options)
puts "#{Time.now} - started #{self}."
puts %x{ top -b }
please wait...
Page: 1 2 3 4 5 6 7 8 9 10