Tag Info

Hot answers tagged

123

As far as I know, the only condition under which sl shows the current directory is when you mistype it as ls.


95

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 ...


59

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 ...


54

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 ...


45

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, ...


43

Looking at the RFC for TCP: RFC 793 - Transmission Control Protocol, the answer would seem to be no because of the fact that a TCP header is limited to 16-bits for the source/destination port field.      Does IPv6 improve things? No. Even though IPv6 will give us a much larger IP address space, 32-bit vs. 128-bits, it makes no attempt ...


41

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 ...


37

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. ...


32

It can. There are 2 different out of memory conditions you can encounter in linux. Which you encounter depends on the value of sysctl vm.overcommit_memory (/proc/sys/vm/overcommit_memory) Introduction: The kernel can perform what is called 'memory overcommit'. This is when the kernel allocates programs more memory than is really present in the system. This ...


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 ...


30

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. These UARTs are most likely one of the many features of your motherboard's chipset. Serial UARTs ...


29

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 ...


28

Lemma: sl prints a steam locomotive Lemma: Valid file names cannot contain forward slashes (although paths can) Lemma: The steam locomotive contains forward slashes: $ touch ' ( ) (@@) ( ) (@) () @@ O @ O @ O > (@@@) > ( ) > (@@@@) > > ...


27

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 ...


26

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. ... ...


26

Here's a patch to fix that bug :) diff --git a/sl.c b/sl.c index 2eeceb3..f2213ad 100644 --- a/sl.c +++ b/sl.c @@ -37,6 +37,7 @@ #include <curses.h> #include <signal.h> #include <unistd.h> +#include <stdlib.h> #include "sl.h" int ACCIDENT = 0; @@ -71,6 +72,13 @@ void option(char *str) int main(int argc, char *argv[]) { ...


25

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. ...


24

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 ...


23

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 ...


23

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 ...


23

You can check the source code here - https://github.com/mtoyoda/sl, alas there is no other options other than the ones documented and sadly nothing that will actually print the names of files. So it looks like @sfyn's answer is the correct one.


22

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


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 ...


21

Use rsync(1): rsync \ --remove-source-files \ --chown=unicorn:unicorn \ /home/poney/folderfulloffiles /home/unicorn/


20

Emptying the buffers cache If you ever want to empty it you can use this chain of commands. $ free && sync && echo 3 > /proc/sys/vm/drop_caches && free total used free shared buffers cached Mem: 1018916 980832 38084 0 46924 355764 -/+ buffers/cache: 578144 ...


19

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 ...


19

One possible way, although it would take an exceedingly long time in practice, would be to go back to the roots. Development of GNU began in 1984, and the original version of Minix (which was used during early Linux development for bootstrapping purposes) was released in 1987. This entire answer is based on your premise that "[you] or others have the ...


19

The POSIX standard only defines three distinct timestamps to be stored for each file: the time of last data access, the time of last data modification, and the time the file status last changed. That said, modern Linux filesystems, such as ext4, Btrfs and JFS, do store the file creation time (aka birth time), but use different names for the field in ...



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