RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

rm

Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

rm [man page] - remove files or directories

2. Synopsis

rm [OPTION]... FILE... 

3. Frequently used options

-i, --interactive
prompt before any removal
-f, --force
ignore nonexistent files, never prompt
-r, -R, --recursive
remove directories and their contents recursively

4. Examples

Interactive remove is very useful option.

rm -i foo.bar 

interactive rm option prompts before overwrite
rm -f ( force) option removes also files which are non-existent and never prompt.

rm -f foo.bar 

rm force -f option

Even that rm command was not constructed to remove directories by default you can force rm to remove directory and all files in inside by -fr option combination. Be very careful with this command it can do lots of damage:

rm -fr dir/ 

rm - force remove files and directories

Sometimes you need to make rm command to do not accept any other options. Lets assume that we have a file called "-i" and we need to remove it. In this case we nee to use "--" options wich will instruct rm command to not accept any other options.

rm -- -i 

rm - do not accept more options
Or we might need to remove filename which starts with meta character. In this case we need to escape this meta character with "\". For example to remove $rm file we issue command:

rm \$rm 

rm files with meta characters

Share this linux post:

Submit rm in Delicious Submit rm in Digg Submit rm in FaceBook Submit rm in Google Bookmarks Submit rm in Stumbleupon Submit rm in Technorati Submit rm in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download