12-01-2008
Device Files names and location
HI there. I am studying System administration right now and am stuck on a question that I have failed to find the answer for in my book.
The question is: Do device files need to be in the /dev directory and to they need to follow a naming convention?
My answer (so far) is that since the kernel commnicated with device files, it needs to know where they are located, so I would imagine that yes they do need to be in the /dev directory. And as a rule of thumb there are conventions that need to be followed as "best practices" such as fd, lp etc, but I could make the name whatever I wanted.
I have tried to solve this myself by:
Reading the section in the book again (and again)
Searching other forums and resource sites
played around on my system to test it myself
i.e.
1. cd /home/temp
2. sudo mknod mydev c 136 2
3. echo "testing" > /home/temp/mydev
--> Nothing happens here which would seem to re-enforce my answer that device files do need to be in the /dev dir but ca nstill be named whatever I want
So, this is where I am confused. I have attempted to solve this myself, and don't simply want the answer and that's it, but some help, clarification, point in the right direction etc.
I'm just spinning my wheels so any support would be appreciated. I have emailled my prof as well, and am just waiting as well, so thought I would post the same thing here!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
what is meant by device location codes? what is their format and how can i identify the location of a device in redhat linux? (1 Reply)
Discussion started by: docaia
1 Replies
2. UNIX for Advanced & Expert Users
I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure,
say location 1,
/home/rick/tmp_files/1-12/00-25/
here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies
3. Shell Programming and Scripting
Hi,
i have to transfer of files of User1 located in Location1 to user2 located in Location2 using shell script. Please suggest me. (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies
4. Shell Programming and Scripting
Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
Discussion started by: allways4u21
2 Replies
5. Shell Programming and Scripting
Hi,
I am new to unix and shell scripting.
Please help me in resolving the below issue.
In my shell script I have a variable which stores the different files with the path. Now I need to move all the files one by one to another location.
----
1.... (4 Replies)
Discussion started by: kpagadala
4 Replies
6. Shell Programming and Scripting
Hi
This is my third past and very impressed with previous post replies
Hoping the same for below query
How to find a existing file location and directory location in solaris box (1 Reply)
Discussion started by: buzzme
1 Replies
7. Shell Programming and Scripting
A) I would like to achive following actions using shell script. can someone help me with writing the shell script
1) Go to some dir ( say /xyz/logs ) and then perform find operation in this dir and list of subdir using
find . -name "*" -print | xargs grep -li 1367A49001CP0162 >... (1 Reply)
Discussion started by: GG2
1 Replies
8. Linux
I have a weird requirement where I have to get the files from a FTP(Lets say FTP1) location and place it on my current FTP(Lets say FTP2) location. The issue is, these are daily files (in a pattern Sales_YYYYMMDD_report.csv) and are placed every day on FTP1 and my process usually runs on Monday(eg.... (2 Replies)
Discussion started by: dhruuv369
2 Replies
9. Android
Hi,
I have a program that logs serial port data. In order to do so it requires the full device name in linux (e.g. /dev/ttyUSB0) and a baudrate.
Does anyone know how I can find out the device name in the terminal? I am trying to port this application to Android and cant figure it out.
... (22 Replies)
Discussion started by: fedora18
22 Replies
10. Shell Programming and Scripting
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
Discussion started by: dsravanam
1 Replies
LEARN ABOUT OPENSOLARIS
mknod
mknod(1M) System Administration Commands mknod(1M)
NAME
mknod - make a special file
SYNOPSIS
mknod name b major minor
mknod name c major minor
mknod name p
DESCRIPTION
mknod makes a directory entry for a special file.
OPTIONS
The following options are supported:
b Create a block-type special file.
c Create a character-type special file.
p Create a FIFO (named pipe).
OPERANDS
The following operands are supported:
major The major device number.
minor The minor device number; can be either decimal or octal. The assignment of major device numbers is specific to each system. You
must be the super-user to use this form of the command.
name A special file to be created.
USAGE
See largefile(5) for the description of the behavior of mknod when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
ftp(1), in.ftpd(1M), mknod(2), symlink(2), attributes(5), largefile(5)
NOTES
If mknod(2) is used to create a device, the major and minor device numbers are always interpreted by the kernel running on that machine.
With the advent of physical device naming, it would be preferable to create a symbolic link to the physical name of the device (in the
/devices subtree) rather than using mknod.
SunOS 5.11 16 Sep 1996 mknod(1M)