Hot answers tagged

141

This is binfmt_misc in action: it allows the kernel to be told how to run binaries it doesn't know about. Look at the contents of /proc/sys/fs/binfmt_misc; among the files you see there, one should explain how to run Mono binaries: enabled interpreter /usr/lib/binfmt-support/run-detectors flags: offset 0 magic 4d5a (on a Debian system). This tells the ...


16

/dev/vcs[a]<n> will only get you the last screen-full even if you've scrolled up, but the selection ioctl()s as used by gpm will allow you to dump the currently displayed screen even when you've scrolled up. So you can can do: sleep 3; perl -e ' require "sys/ioctl.ph"; # copy: ioctl(STDIN, &TIOCLINUX, $arg = pack("CS5", 2, 1, 1, 80, 25, ...


9

I'm not working for a distribution, but I can think of at least two reasons: Some distributions apply their custom patches to the Kernel which are not merged into mainline yet. This means for every update of the Kernel they need to ensure that their patches don't break anything and still function properly. Even the latest stable Kernel release can contain ...


8

The terminal description is named for Linux, which provides its own console emulator (as do several other kernels). Except for FreeBSD, all of the Linux- and modern BSD-platforms get "termcap" by deriving it from the terminfo database in ncurses. Console entries are specific to the systems in which they are implemented (unlike many terminal emulators, ...


6

The commands that read stdin are almost all of the filter family, i.e. programs that transform a flow of text data to a transformed one. cat , sed, awk, gzip and even sh are good examples of such "filters". The cited commands, cp, mv and rm are definitely not filters but commands that do things with the arguments passed, here files or directories. The cd ...


5

The "marking that memory as unused" is a function of how much work the unlinkat(2) system call has to do, which in turn scales linearly with the size of the file. For a default tmpfs on a RHEL 6 system with ~4G of memory, this can be demonstrated as follows. $ sudo mkdir /tmpfs; sudo mount -t tmpfs -o size=75% tmpfs /tmpfs; cd /tmpfs $ dd if=/dev/zero bs=1M ...


4

The Linux kernel's system call interfaces are very stable. But the kernel has other interfaces that aren't always compatible. /proc is mostly stable, but there have been a few changes in the past (e.g. some interfaces moving to /sys some time after /sys was created). A number of device-related interfaces have been removed in the past. /sys contains some ...


3

ifconfig is deprecated on Linux and furthermore, it's the wrong tool for the job. To set the default gateway on Linux use the ip command as follows: ip route add default via <host> dev <dev> # e.g. ip route add default via 192.168.0.101 dev eth0


3

ifconfig is not the correct command to do that. You can use route like in route add default gw 192.168.0.254 for exemple. And if route is not present, and ip is, you can use it like this : ip route add default via 192.168.0.254 dev eth0 assuming that 192.168.0.254 is the ip of your gateway


3

There's two issues; how cd behaves, which is easy to test via: bash-4.1$ mkdir first second bash-4.1$ cd first second bash-4.1$ pwd /home/jdoe/first bash-4.1$ So cd for this shell is going to the first item found. Second, find itself may or may not be doing any sorting of the results, and for directories (probably) only has a -d or "find first by depth" ...


2

To create the hard-link alice will need write+execute permissions on target-dir on all cases. The permissions needed on target.txt will vary: If fs.protected_hardlinks = 1 then alice needs either ownership of target.txt or at least read+write permissions on it. If fs.protected_hardlinks = 0 then any set of permissions will do; Even 000 is okay. This ...


2

There is also FuseISO, a user space file system driver. I wish I had known about this option a few years ago because I too had been just converting them with mdf2iso. Since I tend to like to keep source files, this made for clutter.


2

Couple of general thoughts I had over this general question : (1) During Windows shutdown, most services will generate atleast one event on terminating. Sometimes each service may have many events. Eg "NTP Service terminating", "Printer Driver got signal to terminate", "Printer Driver is flushing the queue" "Printer Driver Exitting". These Events are ...


2

The package lists apt-get is using are out of date; you need to run apt-get update before installing your packages. The connection errors to ftp.fr.debian.org are strange, that site is accessible for me...


2

There is another option which allows more control about the ARP handling. Have a look at arp_ignore.


2

Process handles are a Windows concept so as far a Unix and Linux are concerned, there is nothing to close in the first place. The parent process must however properly get the process exit status with waitpid or wait. When a process has stopped, i.e. is suspended but has not exited, it can be resumed and you can find a lot of information about it. When it ...


2

People underestimate the lifetime of modern flash as most (decent) flash cards will take hundreds of terabytes of data and still work. As indicated here on Ask Different (though not quite exactly your problem), it's going to be some time before you should start worrying about your SD card's lifespan. To quote an example, my SanDisk 32GB Extreme lasted for ...


2

You have got some wrong record in /etc/ssh/ssh_known_hosts as the log proposes. How did you set up that one? It is system wide alternative to ~/.ssh/known_hosts and should be used only in reasonable situations (distribution, local network, certificates). Check what is in that file, check for some inconsistencies and possibly if there is your server1 or ip ...


2

Here's a sed script that will split your example: #!/bin/sed -Ef # replace all commas with newlines s/,/\ /g # Do we need to re-join any lines? :loop # Unmatched brace containing possibly another (matched) level of # braces: s/(\{([^{}]|\{[^{}]*\})*)\ /\1,/ tloop # remove any leading space s/\n */\ /g # At first line, print result, then exit. 1q ...


2

Try a pure bash #!/bin/bash TEST_STRING="{0,1}, alpha, {(x,y,z)}, {{1,2,3}, {a,b,c}}" TEST_STRING="$TEST_STRING""," count=0 newword='' while [ "${TEST_STRING::1}" ] ; do l="${TEST_STRING::1}" TEST_STRING=${TEST_STRING:1} [ "$l" = '{' ] && ((count++)) [ "$l" = '}' ] && ((count--)) if [ "$l" = ',' ] && ! ((count)) ...


2

Arch Linux is a rolling release distro, once you install it you don't have to 'upgrade' the entire OS. Like Chrome or Firefox your system keeps up-to-date.


2

The proper approach would be to install a couple of SATA drives using drive caddies, then install the OS using mirroring. VMs and camera images tend to be time consuming to re-create so you don't want a dead hard drive killing your entire environment. You might be able to get hardware mirroring working depending on your specific hardware, but if you can't, ...


2

su gives you root permissions but it does not change the PATH variable and current working directory. so you can't execute files in /usr/sbin folder. su- changes the PATH too... and root's home becomes your current working directory. you become proper root and can execute all commands.


2

The usermod command wont work if you're logged in with the user you are trying to make changes on. From the manual page on usermod it says: CAVEATS usermod will not allow you to change the name of a user who is logged in. You must make certain that the named user is not executing any processes when this command is being executed if the user's ...


2

Like file systems, snapshots and clones, zvols are datasets too. Regardless of the terminology, the ARC is used to improve read access to zvols just like most of what can be stored in the pool.


2

Command-line arguments are not at all the same thing as stdin; even commands that use both generally use them for different things. Take cat for example: echo foo bar | cat # outputs "foo bar" cat foo bar # looks for files named "foo" and "bar", and concatenates them (if found) If you look at most other commands that read from stdin, you'll ...


1

Assuming you have sufficient access rights to the device, you should be able to access the hidden partition from the VM by creating a special vmdk file that will map the raw partition to a virtual device. You need to first identify the wanted partition with something like: C:\Program Files\Oracle\VirtualBox> VBoxManage internalcommands listpartitions ...


1

Turns out all I had to do was update to the latest kernel 4.2.x since it supported my wireless card.



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