eHow launches Android app: Get the best of eHow on the go.

How To

How to Remove a File in Unix

Contributor
By Kristen Leigh Grubb
eHow Contributing Writer
(0 Ratings)

With a few simple commands typed into a terminal window, you can remove any Unix file permanently.

Difficulty: Easy
Instructions

Things You'll Need:

  • Any Unix Variant

    Instructions

  1. Step 1

    Open a terminal window.

    The terminal window is usually found under utilities in the Start Menu.

  2. Step 2

    Go to the directory where the file is located. For the purposes of this article we are going to assume the article is named 'mydocument.txt' and can be found in /home/user/Documents.

    cd /home/user/Documents
    or
    cd ~/Documents

  3. Step 3

    List the contents of the directory, to ensure that your document is there.

    ls -a

    The -a option tells the ls command to show all files, including hidden files.

  4. Step 4

    Remove the file with the command:

    rm mydocument.txt

  5. Step 5

    Exit the terminal with the command:

    exit

Tips & Warnings
  • You can remove the file without changing directories by specifying the exact path of the file: "rm /home/user/Documents/mydocument.txt".
  • There is no undelete command in Unix. If you are not sure that you really want to delete the files, use the Graphical User Interface (GUI) and place the file in the Trash folder. This folder acts the same as the Recycle Bin in Windows.
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics