go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  The rm command
 
Subject: The rm command
Author: Unix
In response to: Create / Delete File on Unix / Linux
Posted on: 10/06/2011 09:24:13 PM


rm (short for remove) is a Unix / Linux command which is used to delete files from a filesystem.

The syntax is as follows:

rm -f -r {file-name}

where:
  • -f: forcibly remove file
  • -r: remove the contents of directories recursively


  • To remove a file called foo.txt, enter:
    $ rm foo.txt

    Note:
  • Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place)

     

    > On 10/06/2011 09:22:33 PM Unix wrote:

    The cat command

    To create a text file called foo.txt, enter:
    $ cat > foo.txt
    Hello world!
    press CTRL+D to save file

    To display file contents, type
    $ cat foot.txt


    The vi command
    $ vi foo.txt
    Hello world!
    press Esc+:+x+Enter to save file

    Note:
  • Usually, on most filesystems, creating a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place)




    References:

  •  


     
    Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.