Tag Info

Hot answers tagged

94

The forward slash / is the delimiting character which separates directories in paths in Unix-like operating systems. This character seems to have been chosen sometime in the 1970's, and according to anecdotal sources, the reasons might be related to that the predecessor to Unix, the Multics operating system, used the > character as path separator, but the ...


58

It appears that you are confusing two very different parts of the OS. It's understandable, because they are often referred to interchangably, but it's technically incorrect, so your question is based on a faulty premise. In order to fully explore and hopefully answer the question that you likely want to ask, a short history lesson is needed. First, there ...


50

I came across this diagram which shows exactly this.     In the above you can see where tools such as strace, netstat, etc. interact with the Linux kernel's subsystems. I like this diagram because it succinctly shows where each tool latches on to the Linux kernel, which can be extremely helpful when you're first learning about all the tools ...


44

The first hierarchical file system as we know it today was designed for Multics. The design is described in “A General-Purpose File System For Secondary Storage” by R.C. Daley and P.G. Neumann. A salient characteristic of this filesystem is that a directory is a file which can be contained in a directory like any other file. The file structure forms a tree, ...


36

A couple of things come to mind: Recover from a kernel panic A kernel panic, by definition, cannot be recovered from without restarting the kernel. Recover from hangs which leave you without terminal access If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. ...


33

The reason is Unix does not lock an executable file while it is executed or even if it does like Linux, this lock applies to the inode, not the file name. That means a process keeping it open is accessing the same (old) data even after the file has been deleted (unlinked actually) and replaced by a new one with the same name which is essentially what a ...


31

Take a look on Linux From Scratch, LFS they have a tutorial which teaches you how to build your own Linux System, once you understood that you can select a package manager and a set of packages hence creating your own distro. A thing to make the answer a bit more complete, ArchLinux is a Linux Distribuition which uses almost 100% vanilla packages. This ...


31

You can do this directly from the shutdown command, see man shutdown: SYNOPSIS /sbin/shutdown [-akrhPHfFnc] [-t sec] time [warning message] [...] time When to shutdown. So, for example: shutdown -g 21:45 That will run shutdown -h at 21:45. For commands that don't offer this functionality, you can try one of: A. Using at The at daemon ...


29

These /dev nodes appear because the standard PC serial port driver is compiled into the kernel you're using, and it is finding UARTs. That causes /sys/devices/platform/serial8250 (or something compatible) to appear, so udev creates the corresponding /dev nodes. This is happening on your machine because the UARTs are present in the silicon of the motherboard ...


28

Building a custom kernel can be time consuming -- mostly in the configuration, since modern computers can do the build in a matter of minutes -- but it is not particularly dangerous if you keep your current, working kernel, and make sure to leave that as an option via your bootloader (see step #6 below). This way, if your new one does not work, you can just ...


26

It should always be OK to do kill -9, just like it should always be OK to shutdown by pulling the power cable. It may be anti-social, and leave some recovery to do, but it ought to work, and is a power tool for the impatient. I say this as someone who will try plain kill (15) first, because it does give a program a chance to do some cleanup -- perhaps ...


26

The information that you read from the proc filesystem is not stored on any media (not even in RAM), so there is nothing to update. The purpose of the proc file system is to allow userspace programs to obtain or set kernel data using the simple and familiar file system semantics (open, close, read, write, lseek), even though the data that is read or written ...


24

dmidecode -s system-product-name I have tested on Vmware Workstation, VirtualBox, QEMU with KVM, standalone QEMU with Ubuntu as the guest OS. Others have added additional platforms that they're familiar with as well. Virtualization technolgies VMware Workstation root@router:~# dmidecode -s system-product-name VMware Virtual Platform VirtualBox ...


23

What might be happening if a process is "killed due to low RAM"? It's sometimes said that linux by default never denies requests for more memory from application code -- e.g. malloc().1 This is not in fact true; the default uses a heuristic whereby Obvious overcommits of address space are refused. Used for a typical system. It ...


22

I think you might be able to accomplish what you want using network block devices (NBD). Looking at the wikipedia page on the subject there is mention of a tool called nbd. It's comprised of a client and server component. Example In this scenario I'm setting up a CDROM on my Fedora 19 laptop (server) and I'm sharing it out to an Ubuntu 12.10 system ...


22

If you use strace you can see how a shell script is executed when it's run. Example Say I have this shell script. $ cat hello_ul.bash #!/bin/bash echo "Hello Unix & Linux!" Running it using strace: $ strace -s 2000 -o strace.log ./hello_ul.bash Hello Unix & Linux! $ Taking a look inside the strace.log file reveals the following. ... ...


21

As a result of the pipe in x | y, a subshell is created to contain the pipeline as part of the foreground process group. This continues to create subshells (via fork()) indefinitely, thus creating a fork bomb. $ for (( i=0; i<3; i++ )); do > echo "$BASHPID" > done 16907 16907 16907 $ for (( i=0; i<3; i++ )); do > echo "$BASHPID" | cat ...


21

Strictly speaking yes, you can always use rsync. From man rsync (emphasis mine): Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and ...


20

I'd recommend getting it directly from a DNS server. Most of the answers here all go over HTTP to a remote server. Some of them require parsing of the output, or rely on the User-Agent header to make the server respond in plain text. They also change quite frequently (go down, change their name, put up ads, might change output format etc.). The DNS ...


20

The Yocto Project is a "distribution builder". There is extensive documentation and a graphical builder, called Hob.


19

AFAIK the only way to be completely sure of security would be to write a compiler in assembly language (or modifying the disk directly yourself). Only then can you ensure that your compiler isn't inserting a backdoor - this works because you're actually eliminating the compiler completely. From there, you may use your from-scratch compiler to bootstrap e.g. ...


19

lsb_release -a is likely going to be your best option for finding this information out, and being able to do so in a consistent way. History of LSB The lsb in that command stands for the project Linux Standards Base which is an umbrella project sponsored by the Linux Foundation to provide generic methods for doing basic kinds of things on various Linux ...


18

Executables are generally opened once, attached to a file descriptor, and do not have a file descriptor to their binary reopened during a single period of execution. For example, if you execute bash, exec() generally only creates a file descriptor for the inode pointed to by /bin/bash once -- on invocation. This often means that for simple binaries that do ...


18

Is Kernel space used when Kernel is executing on the behalf of the user program i.e. System Call? Or is it the address space for all the Kernel threads (for example scheduler)? Yes and yes. Before we go any further, we should state this about memory. Memory get's divided into two distinct areas: The user space, which is a set of locations where ...


18

The last bit of the code, ;: is running the function :(){ ... }. This is where the fork is occurring. The semicolon terminates the first command, and we're starting another one, i.e. invoking the function :. The definition of this function includes a call to itself (:) and the output of this call is piped to a backgrounded version :. This props up the ...


18

Rsync can be slower than cp in some situations. For example when the destination exists and rsync ends up doing some expensive comparisons for each block, does not find equal blocks and copies the complete source file anyways. Also when destination files don't exist, rsync does not provide any advantage above cp.


18

You are comparing kernel and whole systems. Kernels are just the main central piece of a system, but not all of it. In fact there is no such thing as a Linux system per se, but there are countless "Gnu/Linux" or other Linux Kernel based systems (one being Android). Linus Torvalds choose to concentrate his work on the central piece and successfully manage ...


18

ARM is huge for linux. Aside from the Rasberry Pi and other hobbyist ARM SoC you have every Android phone and tablet and many of the Chromebooks running Linux on ARM. I couldn't find any hard numbers on total devices in use, but total android activations number somewhere north of 1 billion. The Chromebooks are Amazon's best selling laptops, though not ...


17

Here's an article on How To Geek about how ext2/ext3 allocates files on the disk. And they also have an article asking "Do you really need to defrag?" On why FAT becomes fragmented: "When you save a file to a FAT file system, [the file is saved] as close to the start of the disk as possible. When you save a second file, [the file is saved] right after ...


17

The term "field" is often times associated with tools such as cut and awk. A field would be similar to a columns worth of data, if you take the data and separate it using a specific character. Typically the character used to do this is a Space. However as is the case with most tools, it's configurable. For example: awk = awk -F"," ... - would separate by ...



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