Tag Info

Hot answers tagged

11

The kernel lists them by name in /sys, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net. E.g.: > ls /sys/class/net em1 lo wlp6so Another example: > ls /sys/class/net lo p6s1 wlan0 If you are not sure which is ...


10

Moving a file to the location of an already existing file replaces the existing file. In this case the /dev/null device file is replaced, just as any normal file would be. To avoid this use the -i (interactive, warns before overwriting) or -n (no clober) option for mv. /dev/null only performs its special function as a bit-bucket then the device is opened as ...


9

lsblk will list all block devices. It lends itself well to scripting: $ lsblk -io KNAME,TYPE,SIZE,MODEL KNAME TYPE SIZE MODEL sda disk 149.1G TOSHIBA MK1637GS sda1 part 23.3G sda2 part 28G sda3 part 93.6G sda4 part 4.3G sr0 rom 1024M CD/DVDW TS-L632M lsblk is present in util-linux package and is thus far more universal than proposed ...


9

Looking at the source code for mv, http://www.opensource.apple.com/source/file_cmds/file_cmds-220.7/mv/mv.c : /* * If rename fails because we're trying to cross devices, and * it's a regular file, do the copy internally; otherwise, use * cp and rm. */ if (lstat(from, &sb)) { warn("%s", from); return (1); } return (S_ISREG(sb.st_mode) ? ...


8

Umm, because you overwrite the special file with normal one? What did you expect to happen? dev/null is not a directory, it is a file pointing to a null device. When you mv something to it, you delete the original and replace it with whatever you moved: $ file /dev/null /dev/null: character special $ sudo mv file /dev/null $ file /dev/null /dev/null: ...


7

Nothing is stored in /dev/pts. This filesystem lives purely in memory. Entries in /dev/pts are pseudo-terminals (pty for short). Unix kernels have a generic notion of terminals. A terminal provides a way for applications to display output and to receive input through a terminal device. A process may have a controlling terminal — for a text mode application, ...


7

The files in /dev are actual devices files which UDEV creates at run time. The directory /sys/class is exported by the kernel at run time, exposing the hierarchy of the hardware through sysfs. From the libudev and Sysfs Tutorial excerpt On Unix and Unix-like systems, hardware devices are accessed through special files (also called device files or ...


7

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show


5

You could pipe through SSH. Example using dd: dd bs=1M if=/dev/disk | ssh -C target dd bs=1M of=disk.img If the network connection breaks during transfer, you can resume if you know how much was copied. For example if you're sure at least 1000MiB were transferred already (check the file size of disk.img): dd bs=1M skip=1000 if=/dev/disk | ssh -C target ...


5

If the filesystem takes over the whole disk, OS X currently uses a name like /dev/disk5. If the disk is partitioned, it adds an s# suffix, like /dev/disk5s2 for the second partition. (s is short for "slice," a BSDism functionally equivalent to a partition.) Disks are numbered sequentially in discovery order by the OS, on boot, so you may have to experiment ...


4

The files in /dev/pts are "pseudo-ttys". They're like named pipes to an extent, but they also imitate old serial-connection terminals, like VT-100s. Pseudo-ttys do the work of transferring bytes from keyboard to program, and from program to output device, which sounds simple. But that answers your explicity question: the kernel stores nothing in /dev/pts/0 ...


4

The files in /dev are device files, they are not real files. They don't, usually, have content on disk (a few representing raw disks do). There is nothing in the file. If you do ls -l /dev, you will see all there is to these "files": A name, some special bits, see first character of mode (is is not d=directory, -=regular file, l=symlink, it is c=character ...


4

This is scarcely explained in Implementing SELinux as a Linux Security Module This results in a populated selinuxfs filesystem and sets up the special null device node used by SELinux when it closes unauthorized files upon a context-changing execve. Apparently programs cannot use /dev/null directly while in SELinux-context and they needed their own ...


4

POSIX general defines three special files: /dev/tty /dev/console /dev/null In addition, / and /tmp are also defined by POSIX. /dev/zero, /dev/urandom or /dev/random are defined in some UNIX-like operating systems. Some operating systems may not define them, or implement with different names. Note POSIX direcory structure and files /dev/zero ...


3

I think you are looking for hwinfo command. This command helps you to query disk, network and other hardware information


3

Software random number generators are not the only source of entropy in the system. Actually they are not sources of entropy at all - software RNGs use external entropy sources to supply entropy to the system. The real source is always a physical one (be it a dedicated hardware RNG, temperature sensors, audio input, timing of network packets, user inputs or ...


3

/dev/dsp is part of OSS, which hasn't been part of the Linux kernel in... a very long time. It has long been supplanted by ALSA, which uses different devices, different programs, and a different API. There is an emulation layer module though. If it is available then loading the snd-pcm-oss module will enable you to use the PCM devices for OSS such as ...


3

If I run this with sudo I still get permission denied. By this statement, it sounds like you are trying a command like: sudo cat file.wav > /dev/dsp The reason you continue to get "permission denied" is that your shell first tries to open the /dev/dsp device for output, before running the command (which is sudo). To have the shell open the ...


3

In short: none of the two programs will work correctly. The output from the two programs will be merged and sent out the serial port. The input coming in through the serial port will be seen by only one of the programs (some input will end up at one of the programs, some input will end up at the other, randomly). Because of this, programs normally using ...


3

Data written to /dev/null doesn't go anywhere. Since it isn't written to any file, there is no file size to have any impact on. If a program writes to /dev/null, the system call takes place. But the system call returns almost immediately without writing the data anywhere. So there is I/O from the application's point of view, but not from the hardware's ...


3

Have you tried consulting the Xilinx wiki? Build Device Tree Blob This howto looks like it has everything you need to get what you want. There's links to a git repository with code as well as directions on how to build it. Here's the command to download the device-tree sources. $ git clone git://github.com/Xilinx/device-tree.git The Xilinx website ...


3

The RTC subsystem went through a major redesign since at least 2006 and since then doesn't have a statically assigned major number, now. This is a rather major trend in the Linux kernel for various device drivers (device-mapper for example also dynamically allocates its device-number region). The reason behind this is that the vast amount of available ...


3

If I understand you right then there is some file system on /dev/sdb that you have mounted. What matters here are the permissions in the file system that resides on /dev/sdb, the permissions of /dev/sdb are completely irrelevant for your question. Except that with permissions 0666 anyone can bypass the access control mechanisms for that file system and ...


3

A Solution: The problem is that this serial port is non-PlugNPlay, and a system do not know which device was plugged in. Anyway, after reading a HowTo I get the working idea. An *nix-OS already have in /dev/ a files like ttySn where a n ending is a number. Most of this files is dumb i.e. doesn't correspond to an existing devices. But some of those is going ...


3

Weeeeellll..... A kernel module is something very specific: A part of the kernel that's being loaded as a module (i.e. dynamically), after the core kernel starts. That can be anything. In order to use the hardware you need some parts that reside in the mostly kernel for two reasons: In order to be able to perform hardware operations that cannot be done ...


3

I can try to trap the Interrupt at a lower level and inform the gtkmm application. No, that is a kernel space activity. Fortunately, the kernel does report the outcome of certain events via interfaces accessible from userland. It's a little ambiguous in your question whether you want to detect when a block device is attached, or when a filesystem is ...


3

What is a Terminal? A terminal consists of a screen and keyboard that one uses to communicate remotely with a computer (the host). One uses it almost like it was a personal computer but the terminal is remote from its host computer that it communicates with (on the other side of the room or even on the other side of the world). Question 1 /dev/tty ...


2

/dev/ is a special directory for device files. These are abstractions, they are not real files on disk. The directory is populated at boot and subject to change to reflect existing device interfaces, which are created and destroyed by the kernel and a userspace daemon, udevd. Many of the devices so represented are virtual. This includes the entries in ...


2

Unless I get a better answer, I'm going to take this as my solution. It's very indirect but appears to work. Basically, I judged from the fact that udevd was able to make the path in /dev/disk/by-path, it must be in sysfs because to my knowledge that's all udev really does: Takes sysfs information and performs configured actions utilizing it. After ...


2

Well, after many hours of googling and asking on forums, I got it working (it seems). Anyone who wants to get nice visual and/or audio notification when some USB device is plugged/unplugged can install my script, see installation details below. First of all, answers on my own questions. 1. How to get actual title of the device attached, the same as I can ...



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