answersLogoWhite

0


Best Answer

Treating devices as files makes it much simpler to perform raw data operations on them. For example, to make a copy of your hard drive, you could simply do

dd if=/dev/hda of=/dev/hdb

And it would make an exact copy of your hard drive onto another disk.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why does Unix treat all devices as files?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which os treats hardware as a file system?

UNIX Q.How are devices represented in UNIX? A.Devices in UNIX are represented by files. These are special files located in the )dev directory. Hence in UNIX, every piece of hardware is a file. This device file allows us to access the hardware.UNIX represents all devices as files. These files are located in the directory /dev. That is why the devices and other files are accessed in a similar way.Devices file which is specified as 'block special file' with some similar characters of a disk file. A device which is specified as a 'character special file' with some characteristics that is similar to a keyboard.For instance, the following command; Less -f /dev/hda is not a file in the 'real' sense. When read, it is actually reading directly from the first physical hard disk of your machine.


What is the rm -rf command in unix?

Recursively removes all files from the directory and all under it.


What is the command for listing all files ending in small letters in unix?

Try the following: ls *[a-z]


Would the ls -a command show hidden files?

Yes, in Linux or Unix, this command will show all files including hidden files in the current directoryl. In general, hidden files are files whose name begins with a period "."


How do you copy all the files from etc directory to oracle in unix?

You will need to be more clear about the target - is 'oracle' a directory?


What is the significance of home directory in Unix file system?

It's where all settings, documents, private files, etc. are located.


Explain the concept of privileges and its significance in unix?

Privileges, in regards to computer science terms, are permissions granted by a system to allow certain data or files to be accessed or used. In UNIX, all files and data are assigned a set of permissions by the system. The files or data can be read, modified, and executed depending on the set of permissions assigned to the user.


What is the unix command to search the files extension 'txt' in their names in a directory and all its subdirectries?

Unix really doesn't use file extensions, but if you want to look for them recursively, then use: ls -R *txt


What are hidden files and how can they is displayed in UNIX?

A hidden file is any file or directory that starts with the character '.' (period). It is designed to eliminate common files from showing with the 'ls' command. Using the -a option for 'ls' will show all files.


What folder do you look in for information to modify a device file in Linux?

Answer:Linux and Unix store their devices in /dev. Character and Block devices are there (all devices for that matter).That said, it should be understood that devices are treated somewhat differently under Linux/Unix than some other operating systems. On a Linux/Unix system, all devices are treated as a file, hence the /dev directory and all of the files that reside in it. You may notice that an 'ls -al' listing of /dev produces different output than it does in other directories. Instead of file sizes you'll see the device major and minor numbers. These are represented by the bold type below for the console device.crw------- 1 root root 5, 1 Sep 11 10:41 consoleIf you write a program to open the /dev/console and write to it, whatever is written to the device will show up on the machine's console terminal. [JMH]


How do you append at the beginning of a file name for all files in a folder using Unix command?

Somewhat unclear exactly what you want to do; please be more specific.


Show sorted list of files in your home directory those contain the word 'computer 'inside them?

In UNIX, type `grep -l computer *`. This should list the names of all files that contain the word 'computer' in alphabetical order.