Questions tagged [devices]

devices refers to questions about the Unix/Linux device special files, normally these are under /dev. Do not use this tag for physical devices (for that use e.g. usb or pci).

A device under Unix/Linux is a file, normally located in directory structure under /dev. These special files are not located on the filesystem, but handled by device specific device drivers.

Do not use this tag to indicate physical device such as USB Bluetooth dongle (, ) or PCI devices ()

821 questions
285
votes
16 answers

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 there's a way to use /dev or /proc to find out…
xenoterracide
  • 57,918
  • 74
  • 184
  • 250
162
votes
3 answers

When to use /dev/random vs /dev/urandom

Should I use /dev/random or /dev/urandom? In which situations would I prefer one over the other?
Tom Hale
  • 28,728
  • 32
  • 139
  • 229
128
votes
7 answers

How are "/dev" Linux files created?

There are special files in Linux that are not really files. The most notable and clear examples of these are in the dev folder, "files" like: /dev/null - Ignores anything you write to the file /dev/random - Outputs random data instead of the…
IQAndreas
  • 10,145
  • 21
  • 59
  • 79
116
votes
9 answers

Why is /dev/null a file? Why isn't its function implemented as a simple program?

I am trying to understanding the concept of special files on Linux. However, having a special file in /dev seems plain silly when its function could be implemented by a handful of lines in C to my knowledge. Moreover you could use it in pretty much…
Ankur S
  • 1,208
  • 2
  • 7
  • 17
114
votes
6 answers

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 it started I went to look for the name of the…
goldilocks
  • 86,451
  • 30
  • 200
  • 258
106
votes
3 answers

What is stored in /dev/pts files and can we open them?

According to my knowledge, /dev/pts files are created for ssh or telnet sessions.
user2720323
  • 3,549
  • 7
  • 24
  • 26
104
votes
3 answers

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 Unix-like system? Why are they called “character special” and “block special” respectively?
Geek
  • 6,548
  • 15
  • 46
  • 70
96
votes
3 answers

What does the letter 'u' mean in /dev/urandom?

I understand that reads to /dev/random may block, while reading /dev/urandom is guaranteed not to block. Where does the letter u come into this? What does it signify? Userspace? Unblocking? Micro? Update: Based on the initial wording of the…
Tom Hale
  • 28,728
  • 32
  • 139
  • 229
92
votes
4 answers

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?
andyortlieb
  • 1,021
  • 1
  • 7
  • 6
79
votes
9 answers

Why do we need to mount on Linux?

I understand what mounting is in Linux, and I understand device files. However I do not understand WHY we need to mount. For example, as explained in the accepted answer of this question, using this command: mount /dev/cdrom /media/cdrom we are…
Greeso
  • 893
  • 1
  • 7
  • 8
72
votes
3 answers

How to create /dev/null?

I deleted my /dev/null. How can I restore it?
LanceBaynes
  • 39,295
  • 97
  • 250
  • 349
72
votes
3 answers

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 /proc/self/fd/0 crw--w---- 1 tim tty 136, 2 2011-08-07 09:54…
Tim
  • 98,580
  • 191
  • 570
  • 977
62
votes
5 answers

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 that UNIX & Linux sys admins had done on their own…
Mark Tomlin
  • 735
  • 1
  • 6
  • 7
59
votes
1 answer

Difference between /dev/null and /dev/zero

When trying to redirect to /dev/null and /dev/zero, the output it is discarded. It seems both /dev/null and /dev/zero accept and discard all input. So, what is the difference between /dev/null and /dev/zero?
Pandya
  • 23,898
  • 29
  • 92
  • 144
47
votes
2 answers

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 with it. Unfortunately there is no newly created…
Hi-Angel
  • 4,778
  • 4
  • 28
  • 45
1
2 3
54 55