Skip to main content

Questions tagged [character-special-files]

Filter by
Sorted by
Tagged with
1 vote
1 answer
61 views

cat vs. view and execution of file containing diacritics uploaded from Windows to Linux with WinSCP

I have a DE_CopyOldToNew.sh file that was created in Windows. The file is then uploaded to Linux using WinSCP. The file contains a whole bunch of cp commands that copies files to a new folder with a ...
Rico Strydom's user avatar
3 votes
0 answers
63 views

Why can't I open a character special file created on my ext4 partition?

As a test, I did sudo mknod test c 5 2 in my Downloads folder, which had the effect of creating a file like /dev/ptmx. However, cat test gives me No such file or directory. However, sudo mknod /dev/...
DrownedSuccess's user avatar
0 votes
0 answers
18 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 ...
crashintoty's user avatar
1 vote
0 answers
147 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: ...
Aviel Fedida's user avatar
4 votes
1 answer
256 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 ...
Andrew Wolfe's user avatar
6 votes
1 answer
2k 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 ...
MaXi32's user avatar
  • 453
2 votes
4 answers
2k 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 ...
Suraaj K S's user avatar
2 votes
1 answer
480 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 ...
Desarrollador Rucha's user avatar
3 votes
2 answers
8k 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/...
l0b0's user avatar
  • 52.1k
9 votes
1 answer
701 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 ...
Sylvain Leroux's user avatar
4 votes
2 answers
675 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 ...
Slippers's user avatar
  • 143
0 votes
1 answer
458 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 ...
iBug's user avatar
  • 3,568
2 votes
1 answer
832 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,...
acon__'s user avatar
  • 21
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 ...
Josh Hansen's user avatar
4 votes
2 answers
1k 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
66 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 ...
iBug's user avatar
  • 3,568
10 votes
3 answers
3k 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 ...
Lapsio's user avatar
  • 1,323
6 votes
1 answer
952 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?
user123456's user avatar
  • 5,108
6 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?
Charles Stewart's user avatar