954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How are devices represented in UNIX?

How are devices represented in UNIX?

mixplates
Newbie Poster
Banned
4 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
 

As far as I understand it, everything is treated as a file in Unix and Linux. Even devices and running processes.

Typically, the file-system entries for all connected hardware/devices can be found in the /dev directory (and its sub-directories). If you open up a terminal and cd to /dev and then use ls -a -l , you can see which files refer to which devices.

There are two types of devices, block and char. Block devices tend to be things like RAM and hard-drives and char devices are pretty much anything else.

I don't know much more than that myself atm, so I can't really elaborate further, but I hope this helps!

JasonHippy
Master Poster
769 posts since Jan 2009
Reputation Points: 590
Solved Threads: 125
 

get more info about linux here and how to recover deleted files

jkthomas
Newbie Poster
23 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

Devices are represented in the file system under the /dev directory.

rubberman
Posting Virtuoso
1,559 posts since Mar 2010
Reputation Points: 277
Solved Threads: 178
 

All devices wil ble listed in cd /dev/

ls -l will show you all the devices

PepperAdmi
Newbie Poster
12 posts since Jul 2011
Reputation Points: 10
Solved Threads: 2
 
How are devices represented in UNIX?


These are called block devices and their location are /dev/...

manojsamtani
Light Poster
Banned
37 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
Infraction Points: 5
 

All devices, be they block devices (disc drives etc), character devices (serial devices, modems), or other (network ports, memory, etc) are all represented as special files in /dev/. For example, the "bit bucket" where you can put a command's output that you aren't interested in is /dev/null. If you want to erase a disc, you can read from /dev/zero and write to the physical device. For example, you have a thumb drive that you plug into the system (unmounted) that is registered as /dev/sdx. Then you can wipe the device with the command: dd if=/dev/zero of=/dev/sdx

rubberman
Posting Virtuoso
1,559 posts since Mar 2010
Reputation Points: 277
Solved Threads: 178
 

Hi

Devices in UNIX are represented by files. These are special files located in the dev directory.

ppt123
Newbie Poster
5 posts since Dec 2011
Reputation Points: 7
Solved Threads: 1
Infraction Points: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: