-5

In a UNIX filesystem, if the inode of the root directory is in the memory, what are the sequence of disk operations needed to remove a file in Desktop?

While I am trying to solve a question in textbook, I have seen this question but I could not solve it . Can anyone help me ?

If you know much about Unix, can you tell me what are sequence of disk operation needed for creating a file in Desktop ?

Levon
  • 138,105
  • 33
  • 200
  • 191
user1414276
  • 87
  • 2
  • 2
  • 5
  • 1
    A file system consits of disk blocks. For removing a file four (maybe five) different *types* of disk blocks are involved. 1) Name them. Now for every type 2) write out the operations that are needed. 3) now, try to invent the correct order. – wildplasser May 27 '12 at 14:01

1 Answers1

3

Use rm to remove files in Unix. e.g.,

rm file_to_delete

or better yet if you are uncertain about working in Unix

rm -i file_to_delete        

which will prompt with the name of the file to be deleted to confirm the operation.

The file_to_delete can be in the current directory, or in some other directory as long as the path is properly specified.

See rm man page for more information.

As for creating a file, you can create an empty file with the touch command. I.e.,

touch some_file

will create an empty file named some_file. Again, this can be in the current directory, or any directory with the path specified.

For more information see the touch man page.

Your questions wasn't quite clear to me, so if this doesn't answer it please add a comment or (better yet) consider possibly rephrasing your original question or at least the title of your question (removing a file in unix)

Levon
  • 138,105
  • 33
  • 200
  • 191