The tag has no wiki summary.

learn more… | top users | synonyms (1)

56
votes
18answers
161k views

How do I find out what hard disks are in the system?

I need to know what hard disks are available, including ones that aren't mounted and possibly aren't formatted. I can't find them in dmesg or /var/log/messages (too much to scroll through). I'm hoping ...
32
votes
3answers
3k views

Why are network interfaces not in /dev like other devices?

I'm mostly curious, but why aren't network interfaces in /dev? Are there any other kinds of devices that aren't represented as a node under /dev?
24
votes
4answers
15k views

What is the mknod command used for?

I just started using Ubuntu as my main OS and I wanted to learn about things I should not do, and learn by the bad things people have done in the past. I came across these email about horror stories ...
23
votes
2answers
5k views

How to create /dev/null?

I successfully deleted my /dev/null. How can I restore it? The OS is Ubuntu.
23
votes
1answer
2k views

What do the device files in /dev actually do?

(Not a duplicate of Understanding /dev and its subdirs and files) I was browsing around my filesystem and for the first time I took a second to analyze my /dev directory. I was surprised by the ...
18
votes
3answers
1k views

mv a file to /dev/null breaks dev/null

If I do: touch file; mv file /dev/null as root, /dev/null disappears. ls -lad /dev/null results in no such file or directory. This breaks applications which depend on /dev/null like SSH and can be ...
15
votes
2answers
3k views

Manipulating `/dev/video`

I'd like to take the video stream from /dev/video0, apply some effects or changes and make the result available on /dev/video1. /dev/video0 ---> Apply Effects ---> /dev/video1 For example, mplayer ...
14
votes
2answers
2k views

bash script to detect and record mouse movements?

I need to be able to record the mouse movements every so often (every .2 of a second for example) and have them in a coordinate representation instead of a diff. I found the following script: ...
14
votes
3answers
2k views

Monitor what is being sent to /dev/null?

Just for fun: Is there a way to monitor/capture/dump whatever is being written to /dev/null? On Debian, or FreeBSD, if it matters, any other OS specific solutions are also welcome.
12
votes
3answers
4k views

Understanding /dev and its subdirs and files

$ ls -l /dev/stdin /dev/fd/0 lrwx------ 1 tim tim 64 2011-08-07 09:53 /dev/fd/0 -> /dev/pts/2 lrwxrwxrwx 1 root root 15 2011-08-06 08:14 /dev/stdin -> /proc/self/fd/0 $ ls -l /dev/pts/2 ...
10
votes
4answers
4k views

Can I setup a loopback audio device?

If I can send audio to the output devices, then I can record the same audio as a wave. With filesystems, you can just setup a loopback filesystem and write binary data on a file instead of a device. ...
10
votes
2answers
7k views

How do mouse events work in linux?

This is mostly out of curiosity, I'm trying to understand how event handling works on a low level, so please don't reference me to a software that'll do it for me. If for example I want to write a ...
10
votes
2answers
5k views

set baud speed for tty

How do I set the baud speed for a specific tty (in this case a serial port)? I tried using stty -F /dev/tty.iap ispeed 19200 But get the error Invalid argument for every speed I try (2400, 4800, ...
10
votes
4answers
3k views

Shell command to read device registers?

On a single-board computer running Linux, is there a way to read the contents of the device configuration registers that control hardware? I think it would be a wrapper for inw(), more or less. I'm ...
9
votes
4answers
7k views

Find out what device /dev/root represents in Linux?

On linux, there is a /dev/root device node. This will be the same block device as another device node, like /dev/sdaX. How can I resolve /dev/root to the 'real' device node in this situation, so ...
9
votes
2answers
517 views

How can I find available network interfaces?

This is in regard to linux, but if anyone knows of a general *nix method that would be good. I booted a system yesterday with an ethernet cable plugged in. "NetworkManager" is not installed, so once ...
9
votes
1answer
686 views

What happens when I do “cat debian.iso > /dev/sdX”?

I'm creating a live-USB and don't understand precisely: what happens when I copy a file (or even a file system) directly to a device node (as opposed to a file system)?
9
votes
4answers
4k views

If I connect a physical device, how can I ever know which device file belongs to it?

Say I plug in several USB drives which don't get automatically mounted. How can I find out which device file belongs to which physical device, so I can mount it for example? I'm running Mac OS X but ...
9
votes
1answer
711 views

What driver is behind a certain device file?

Given a device file, say /dev/sdb, is it possible to determine what driver is behind it? Specifically, I want to determine what driver my storage devices are using. fdisk -l lists 2 devices: /dev/sda ...
9
votes
2answers
9k views

What are character special and block special files in a unix system?

How are character special files and block special files different from regular files in a Inix-like system? Why are they called “character special” and “block special” respectively?
9
votes
3answers
5k views

Mount printers at /dev/usb and still use CUPS

Due to a new version of CUPS, I suddenly lost the direct path to my printers that was previously available under /dev/usb/lpXXX. I used this to print directly from the command line. echo "test" > ...
8
votes
2answers
5k views

How does cat know the baud rate of the serial port?

I regularly use cat to view debugging information in the console from my FPGA development board over the serial connection, but I never have had to tell linux what the baud rate is. How does cat know ...
8
votes
2answers
3k views

How can I tell whether a network interface is physical (device) or virtual (alias)?

I have a small home router running OpenWrt (Kind of embedded Linux for routers). It has five Ethernet ports, one labeled WAN and four labeld LAN 1 to 4. It has the following Network Interfaces defined ...
8
votes
4answers
879 views

Why does “cat ttyUSB0” not produce output?

I connected an infrared receiver to a USB port ... (the last line of dmesg tells device file) $ dmesg [10496.596063] usb 7-2: new full-speed USB device number 2 using uhci_hcd [10496.751112] usb 7-2: ...
7
votes
3answers
4k views

what is stored in /dev/pts files and Can we open those?

I am curious to know that what is stored in /dev/pts/ files . Can we open those files ? According to my knowledge /dev/pts files are created for ssh or telnet session .
7
votes
1answer
5k views

Understand output of `udevadm info -a -n /dev/sdb`

I plug an external HDD into my laptop. I try to find out the information by $ udevadm info -a -n /dev/sdb Udevadm info starts with the device specified by the devpath and then walks up the chain of ...
7
votes
1answer
4k views

using devtmpfs for /dev

I have noticed the following option in the kernel: CONFIG_DEVTMPFS Device Drivers -> Generic Driver Options -> Maintain devtmpfs to mount at /dev And I see that it is enabled by default in ...
7
votes
2answers
1k views

wlan number assignment

How or where does Linux determine the assignment of a network device? Specifically, wlan0 or wlan1 for wireless USB devices. I plugged in a TP USB wireless a while ago, and it was assigned wlan0. I ...
7
votes
1answer
96 views

How to find which serial port is in use?

The Question: I plugged in a device (i.e. GSM modem) through a serial port (a.k.a. RS-232), and I need to see with which file in /dev/ filesystem this device was tied up, to be able to communicate ...
6
votes
2answers
841 views

What’s the difference between a “raw” and a “cooked” device driver?

Does this concept only apply to terminal drivers (which is what most sites cover) or to any driver in general?
6
votes
1answer
4k views

How to Reset/Cycle Power to a PCIe Device?

I have a PCIe device that only works correctly when the computer is fully powered off then on again. Issuing a simple reboot or reboot -p command does not appear to cycle the power to the PCIe card, ...
6
votes
1answer
548 views

USB connect/disconnect notification

I use Linux Mint 13 MATE, and I'm trying to set up notifications when I plug/unplug devices. First of all, I found udev-notify package, but unfortunately it almost doesn't work for me: it works for ...
5
votes
1answer
2k views

Writing /dev/random to file?

If you ran the following, what would happen? cat /dev/random > ~/randomFile # don't run Would it be written until the drive runs out of space, or would the system see a problem with this and ...
5
votes
3answers
591 views

How to get my USB key to auto mount

I'm currently working in a command line only environment. When I plug my USB key in, I see a new device file in /dev: ... sdi sdi1 ... If I simply sudo mount /dev/sdi1 /media/tmp, and umount it ...
5
votes
3answers
1k views

Mounting a device — role of /dev, /media and /mnt, and the mount command [closed]

I have several closely related questions about what happens when I insert a CD. The files on the CD /media/Ubuntu\ 11.04\ i386/, but from what I've seen /dev/cdrom is also involved. What is the ...
5
votes
2answers
2k views

Can I share a device from under /dev across hosts?

Here's the situation. I have a video device /dev/video0 on a VMware Server and I want to access this device from within a virtual machine. However for whatever reason I can't connect the device ...
5
votes
4answers
519 views

Testing, from a script, if audio devices are in silent?

Is there a default program where I can check if my audio devices are in silent? Edit: By silence, I mean that if there is something playing on that (not just activated or opened) Something like ...
5
votes
3answers
3k views

Prevent claiming of novelty usb device by usbhid so I can control it with libusb?

I have a USB rocket launcher that I wish to experiment with through libusb. However, libusb cannot claim the interface; presumably because the output of usb-devices lists 'usbhid' as the driver for ...
5
votes
3answers
3k views

RHEL: Creating stable names for network interfaces

We have a RHEL 5.5 box with 8 interfaces. And the eth interface naming is flip flopping. Sometimes eth0 comes up on physical port 7th, and sometimes on another physical port. We want the naming to ...
5
votes
2answers
240 views

Can I query which processes (if any) are currently accessing the microphone?

I'm running Debian (technically Raspbian), trying to get a Star-Trek style voice-command system. I've got it mostly up and running, but in the interests of privacy and all that jazz, I don't want my ...
5
votes
2answers
4k views

What causes /dev/disk/by-label to be populated?

I've noticed that Linux distributions typically have a /dev/disk/by-label directory, but this isn't always the case (For example, the CirrOS Linux test image doesn't have one). What's required on a ...
5
votes
1answer
928 views

How to be notified when a USB device was plugged?

My system have to auto-mount for usb devices, how can I be notified when a usb device is plugged? Where can I read more about? I would like to treat that using shell script or C.
5
votes
1answer
145 views

Does the suid bit have any meaning for device files?

Does the suid bit have any special meaning for device files in Linux ?
5
votes
2answers
1k views

Why are there so many virtual terminal devices?

I've been reading the Advanced Linux Programming book and it mentions about virtual terminals which, if I understood it correctly, it is a Linux-specific feature (not in Unix) to allow multiple login ...
5
votes
2answers
1k views

How can I create a direct 8khz audio pipe in Ubuntu?

I'm interested in creating musical programs like these: http://www.youtube.com/watch?v=GtQdIYUtAHg&feature=player_embedded Essentially these programs just generate sequences of integers, which ...
5
votes
2answers
322 views

Unclaim a device

So I am using Ubuntu and trying to use some hardware which I had some problems with before. The problem before was that the company who made my hardware sold their internal parts to another company ...
5
votes
1answer
367 views

Does the kernel delete entries in /dev on an initramfs?

I have a fully custom, minimal, embedded Linux (vanilla, 3.3.8, i486, Vortex86dx) system that boots from an initramfs image. No standard distribution scripts are used, just a single rcS file that does ...
4
votes
2answers
7k views

ttyUSB0 permission changes after restart

I'm trying to install a device. I plug in the device which creates a ttyUSB0 file. When I open it in the program I need it for, it says the permission is denied. I type in terminal sudo chmod 666 ...
4
votes
1answer
717 views

Difference between /dev and /sys/class?

What is the difference between the device representation in /dev between the one in /sys/class? Is one prefered over the other? Is there something one offers and the other doesn't?
4
votes
2answers
452 views

How to take sha-1, sha-256 or MD5 of CDs / DVDs?

I just tried burning both a Debian CD and a Debian DVD from their .iso files and I've got a weird behavior: the checksum of the CD is correct but the one of the DVD ain't. Here's what working: ...