Questions tagged [character-special-files]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

rsync won't sync with at symbol (@) in path [duplicate]

I'm trying to rsync a folder on a remote server (Synology) to my server (TrueNAS), but the path has the at/email symbol (@) in it and I think rsync is throwing an error (below) because it's confused ...
user avatar
1 vote
0 answers
66 views

MITM / Proxy for Character devices

I have a character devices file, say /dev/X and I would like to capture every interaction which goes in and out of /dev/X. I'm looking for a way to create some kind of MITM/Proxy to that file. Edit: ...
user avatar
4 votes
1 answer
124 views

Does a Linux block special file have a corresponding character special file

Simple codger question from the days of UNIX... Does Linux have character special files which correspond directly to a block special file? Back in my day 👴🏻 each disk in UNIX had both a block ...
user avatar
2 votes
1 answer
461 views

How to prevent /dev/null file's permission change or corrupted?

I use this command to check whether gpg password is valid or not: gpg -o /dev/null --local-user $KEY_ID -as <(echo 1234) This is a hacked command to check gpg password that I posted here. I can ...
user avatar
  • 335
1 vote
4 answers
382 views

Char devices and filesystem nodes

I've been reading this book: https://lwn.net/Kernel/LDD3/. Here, the authors distinguish between 3 types of device files, namely char, block, and network devices. In page 6 of the first chapter, I ...
user avatar
1 vote
1 answer
120 views

what will the kernel do when an USB mouse inserted in Linux PC?

I am trying to write a kernel module which loads upon detection of USB Mouse. I am new to this stuff, I googled for this issue but couldn't find any appropriate solution. can anyone please explain ...
user avatar
4 votes
2 answers
5k views

What do device type numbers mean?

file /dev/* prints the description of a bunch of files as "block special (M/N)" and "character special (M/N)", where M and N are numbers. For example: $ file /dev/null /dev/null: character special (1/...
user avatar
  • 46.8k
9 votes
1 answer
486 views

Which Unix-like system really provides the /dev/tcp special file?

I know /dev/tcp/<host>/<port> is a magic path handled specifically by some shells in redirections. But according to man bash: If the operating system on which bash is running provides ...
user avatar
4 votes
2 answers
391 views

Use character device over ssh

I have been looking for a good answer to this question for some time now. I am trying to remotely control a robot with an Xbox controller. The challenge is that the controller is to be connected to ...
user avatar
  • 143
0 votes
1 answer
281 views

Use /dev/ramX as their corresponding special devices?

With ls -l, I found a series of devices like ram0, ram1 etc. I looked at the output closely and (for example) brw------- 1 root root 1, 3 Jan 6 11:34 /dev/ram3 crw-rw-rw- 1 root root 1, 3 Jul 15 ...
user avatar
  • 2,882
1 vote
1 answer
604 views

How do I read USB data from a character device

I need to write a "character device" that reads data from an arduino and writes that data to a log file. I have been searching this subject for hours and I have seen a couple of ways to make this work,...
user avatar
  • 11
2 votes
1 answer
2k views

How to write to a character special device?

Due to a broken udev setup on a machine from which I'm trying to rescue data (see this post of mine) I'm trying to write to a "character special" device corresponding to a USB flash drive, but am ...
user avatar
4 votes
2 answers
874 views

Character devices for disks on Linux

Why do other UNIX systems need character devices for storage devices when Linux does not? Other UNIX OSes (AIX, HPUX, Solaris and macOS) use something like '/dev/rdisk#' and '/dev/disk#' for storage ...
user avatar
2 votes
1 answer
56 views

Create a file whose content is handled by a program

I want to create a special file, of which the content will be generated upon reading from, and processed upon writing to. There should be a background process handling the file. A pipe is not ...
user avatar
  • 2,882
10 votes
3 answers
2k views

Is it possible to expose TCP tunnel in Linux as special character device?

Recently I found in QNX documentation that it allows to set up message based IPC between processes on separate physical machines by using serial device (dev/serX) and it made me wonder: Is it ...
user avatar
  • 1,213
6 votes
1 answer
847 views

Is there a difference between u and c in mknod

From man mknod on Linux: c, u create a character (unbuffered) special file Why are there 2 letters for the same function? Is there any subtle difference, or they are completely alike?
user avatar
  • 4,238
5 votes
3 answers
2k views

How to tell if a character special file would block if read from

I would like to be able to tell if a character special file would block if a character were read from it without actually reading a character from it. Can this be done?
user avatar