Tag Info

Hot answers tagged

6

Device files on Unix systems in general are just one way for user programs to access device drivers; there isn't a one-to-one mapping from devices files to physical hardware, and not all hardware has a device file (or even a device driver). The kernel itself doesn't use device files to interact with hardware. As pointed out by lcd047, network cards don't ...


6

Whatever you're saying about ~$, home$, and /home$ doesn't make much sense.  I guess you're talking about your command line prompt; if so, it would have been useful to show what you typed and what happened (and then explained what you expected). But I can read minds, so I believe that I understand the issue: ~ and ~user239887 (assuming user239887 is your ...


5

Linux kernel maintainers are listed in the MAINTAINERS file in the kernel source code. There's a specific section for memory management: MEMORY MANAGEMENT L: linux-mm@kvack.org W: http://www.linux-mm.org S: Maintained F: include/linux/mm.h F: include/linux/gfp.h F: include/linux/mmzone.h F: include/linux/memory_hotplug.h ...


5

smem is the standard tool for this. It's clean and simple. On a Debian based system, install it via package manager: sudo apt-get install smem A sample (clipped) output from my system: $ smem -s swap -t -k -n PID User Command Swap USS PSS RSS 831 1000 /bin/bash 0 3.8M ...


5

What sets the size of the tmpfs? (On my machine it resides in /dev/shm) I can see its entry in /etc/fstab, but no notation of its size. The kernel documentation covers this underneath the mount options: size: The limit of allocated bytes for this tmpfs instance. The default is half of your physical RAM without swap. If you oversize your tmpfs ...


5

Halt terminates all processes and shuts down the cpu. poweroff is exactly like halt, but it also turns off the unit itself (lights and everything on a PC). It sends an ACPI command to the board, then to the PSU, to cut the power. shutdown is like poweroff, but it also runs the shutdown scripts. Sources: ...


4

In the linux kernel source code in sysrq.c at line 415, there is a struct defined, what should happen when a certain key is pressed. So you see, no command in a terminal is excuted, instead of this, hard coded functions in the kernel are called. So, as long as the kernel is not crashed, you can press those keys, doesn't matter which application is running in ...


4

Brendan Gregg's iosnoop (part of his perf-tools) will give you detailed information about an application's I/O; for example: # ./iosnoop Tracing block I/O... Ctrl-C to end. COMM PID TYPE DEV BLOCK BYTES LATms supervise 1809 W 202,1 17039968 4096 1.32 supervise 1809 W 202,1 17039976 ...


3

You can use X forwarding on Windows as well; all you need is an X server (such as Xming) and an SSH client (such as PuTTY). Xming includes documentation explaining how to go about things; basically, you enable X forwarding in PuTTY, start the X server on your Windows machine, SSH to the Linux machine and run your Java application. You might find that rather ...


3

Generally, stopping and starting the system cron daemon is a bad idea. Commenting out the line isn't always convenient so here are a couple of related alternatives Use a semaphore One solution to this requirement is to use a semaphore - or flag - to indicate whether or not the script is permitted to run. In this instance the semaphore can be represented by ...


3

You could use the kernel isolcpus option in conjunction with the taskset command. On the Raspberry Pi reserve the core(s) you want to use by appending the following to the line in /boot/cmdline.txt. E.g. to reserve cores 2 and 3. isolcpus=2,3 Then use taskset to assign programs to the core(s). E.g. to launch the Python interpreter. taskset -c 3 python ...


3

If timeout times out, it exits with status 124; you can check this to determine whether the script timed out or not.


3

You may try inotify (often packaged inotify tools since kernel 2.6). It will monitor a part of your filesystem and inform you on events like creating/deleting files or directories. A simple use would be: inotifywait -m -r /tmp/ Then, when filesystem activity occurs, you'll see: #=> I'm creating /tmp/b /tmp/ CREATE,ISDIR b /tmp/ OPEN,ISDIR b /tmp/ ...


3

On my Fedora system, though they do different things, all these commands are handled by systemctl. $ for cmd in halt poweroff shutdown; do file `which $cmd`; done /usr/sbin/halt: symbolic link to `../bin/systemctl' /usr/sbin/poweroff: symbolic link to `../bin/systemctl' /usr/sbin/shutdown: symbolic link to `../bin/systemctl' Their differences can be read ...


2

You can avoid to use eval source /tmp/config.txt counter=1 line0="machine$counter[0]" echo ${!line} And much better to call echo via loop for counter in 1 2 3 do line="machine$counter[@]" for element in "${!line}" do echo $element done done


2

Use the eval command. eval "echo \${machine${counter[0]}}" Notice that the first $ is escaped so that it isn't evaluated until eval processes the string. The way this works is that eval executes a command the same as if you had typed it at the command prompt. The difference is that the command that is executed can be constructed programmatically. So in ...


2

I have also noticed this with CentOS 7.1 (upgraded from 7.0) running on Hyper-V (Windows 8.1). You can get the cursor back even at the logon prompt by pressing the Windows Key and right arrow. Does this open up another console? You can go back to the original console by pressing the Windows Key and left arrow. I would like to solve this problem to but I ...


2

The route or the ip utility get their information from a pseudo filesystem called procfs. It is normally mounted under /proc. There is a file called /proc/net/route, where you can see the kernel's IP routing table. You can print the routing table with cat instead, but the route utility formats the output human readable, because the IP adresses are stored in ...


2

I did a quick search on my Debian stable machine, and with the exception of xroach and oneke, they are all available with the names you gave. However, the correct name for oneke is oneko, and it is available in Debian with that name. What is your distribution? Doing a little searching produces the Debian bug report Debian Bug report 158188: xroach: not ...


2

As stated by jpkotta, network-manager is likely the culprit. You can see its status by running ps -aux | grep network-manager | grep <username>. If you get a result, it is running, otherwise it isn't. It will keep overwriting any changes you make with ifconfig as long as it is running. Kill network-manager by running sudo service network-manager ...


2

You might try writing your own gettimeofday() routine, loading it into a compiled library, and using LD_PRELOAD to have your application get a faked time. This should not affect any other applications.


2

kill-ports() { for port in "$@"; do fuser -n tcp "$port" -k -TERM; done } (You absolutely do not need the quotes in this case, but it's always good to use them, or else you'll get complains/edits from people.)


2

There is a solution, thanks to @StéphaneChazelas comment: "Just do: lsof -ti "tcp:$1" | xargs -r kill, that's what -t is for (and -r tells xargs not to run the command if there's no argument. That's for GNU xargs. Some other implementations like FreeBSD do that automatically)" In the end it looks like this and also works (Some cleanup by me too): ...


2

The entries in /dev/mapper are LVM logical volumes. You can think of these as Linux's native partition type. Linux can also use other partition types, such as PC (MBR or GPT) partitions. Your disk is divided in MBR partitions, one of which (/dev/sda2) is an LVM physical volume. The LVM physical volume is the single constituent of the volume group ...


2

To allow XDM remote logins you can do following: Edit file: /etc/X11/xdm/Xaccess change(uncomment) line: # * #any host can get a login window to: * #any host can get a login window and change(uncomment): # * CHOOSER BROADCAST #any indirect host can get a chooser to: * CHOOSER BROADCAST #any ...


2

This could be due to some resource limit, either on the server itself (or) specific to your user account. Limits in your shell could be checked via ulimit -a. Esp check for 'ulimit -u' max user processes, if you have reached max processes, fork is unable to create any new and failing with that error. This could also be due to swap/memory resource issue


2

as linked in the wikipedia article in external links ... you can see that documentation here: Linux Magic System Request Key Hacks edit: this is also found in Linux kernel source under the Documentation subdirectory


2

awk awk 'FNR==NR { a[$2, $3]=$4 next } ($2, $3) in a{ print $0, a[$2, $3] } ' file2.txt file1.txt > out.txt join join -j 2 \ <(sort -k2,3 file2.txt | sed 's/ /+/2') \ <(sort -k2,3 file1.txt | sed 's/ /+/2') \ -o ...


2

Simply you can compare the performance of these operators with time command: time [ 1 -eq 0 ] real 0m0.000s user 0m0.000s sys 0m0.000s time [ 1 = 0 ] real 0m0.000s user 0m0.000s sys 0m0.000s Which is real means Wall Clock time and user means User Space time and sys means System or kernel time. Now, if you compare these operators with ...


2

You can achieve this in any terminal emulator by the simple expedient of arranging for the program not to exit without user confirmation. Tell the terminal to run terminal_shell_wrapper which is a script containing something like #!/bin/sh if [ $# -eq 0 ]; then "${SHELL:-sh}"; else "$@"; fi echo "The command exited with status $?. Press Enter to close the ...



Only top voted, non community-wiki answers of a minimum length are eligible