LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2004, 06:59 PM   #1
Squall
Member
 
Registered: Jan 2004
Location: The land of the free and the home of the brave
Distribution: Slack 10
Posts: 239

Rep: Reputation: 30
All who are new to linux: please do the following commands!


first, pick a texteditor
first of all type:
Code:
cp .bashrc .bashrcbackup
Code:
name_of_text_editor .bashrc
go to an empty line and type
[code]alias rm='rm -i"[/code[
you'll thank me when the time comes.
I'm too lazy to explain what I just did, but if someone asks, I'll gladly do it.
 
Old 04-28-2004, 07:13 PM   #2
bordi
LQ Newbie
 
Registered: Apr 2004
Location: Brazil
Distribution: slackware
Posts: 8

Rep: Reputation: 0
yoo

I apreciate your post i trust u with all my heart and believe that someday i will need it.... but if u explain i will be less ignorant

let me know your thoughts
 
Old 04-28-2004, 08:56 PM   #3
esears
Member
 
Registered: Mar 2004
Location: Iraq, Baghdad
Posts: 32

Rep: Reputation: 15
It just makes rm into interactive mode and confirms if you really want to delete that file or not.
 
Old 04-28-2004, 09:16 PM   #4
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
You did a rm -rf /* right?

I would be unhappy to
 
Old 04-29-2004, 01:42 AM   #5
KWTm
Member
 
Registered: Jan 2004
Distribution: Kubuntu 10.04 (Dell Linux-preinstalled laptop + a desktop); Maemo 5 (N900 phone computer)
Posts: 116

Rep: Reputation: 21
another way

A simpler way might be:
Code:
cp .bashrc .bashrcbackup

echo "alias rm='rm -i'" >> .bashrc
Note the placement of the period --the filename is not "bashrc" but ".bashrc", and also note the spaces and which quotes are double and which are single. The above command copies your ".bashrc" file into a backup, and then adds the line
Code:
alias rm='rm -i'
onto the end of your ".bashrc" file without needing an editor. This way, every time you type the "rm" command (to delete files), you're really typing "rm -i", which will ask you whether you are sure.

The command "rm -rf /*" mentioned above will delete every single file on your drive, and is only recommended for masochistic nerds who have nothing better to do.

Last edited by KWTm; 04-29-2004 at 02:06 AM.
 
Old 04-29-2004, 04:53 AM   #6
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You may also want to add these lines that prevent writing over existing files:
Code:
alias mv='mv -i'
alias cp='cp -i'
Håkan
 
Old 04-29-2004, 05:06 AM   #7
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
I have all these in by default in root account
 
Old 04-29-2004, 05:34 PM   #8
Squall
Member
 
Registered: Jan 2004
Location: The land of the free and the home of the brave
Distribution: Slack 10
Posts: 239

Original Poster
Rep: Reputation: 30
Yes, that is indeed what it does.
Kwtm, I could do it that way, but it'd be less work I'm bad at finding shortcuts to do things.

But, PLEASE NOTE: do NOT type
Code:
echo "example" > .example
Make sure it has two ">"'s only one will wipe the file clean, THEN add that to it
 
Old 04-29-2004, 05:35 PM   #9
Squall
Member
 
Registered: Jan 2004
Location: The land of the free and the home of the brave
Distribution: Slack 10
Posts: 239

Original Poster
Rep: Reputation: 30
More info, you may be flabbergasted when you type "ls", this is because ANY FILE WITH A PERIOD IN FROM OF IT IS A HIDDEN FILE/DIRECTORY.

To view these "hidden" files type "ls -a"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux commands zexter Linux - Newbie 5 11-04-2004 03:37 PM
linux commands help kyborg Linux - Newbie 4 09-28-2004 02:31 AM
Linux commands Delmarc Linux - Newbie 9 10-22-2003 11:39 PM
Linux commands Shikha Linux - General 3 11-27-2002 10:40 AM
Linux Commands AMDPwred Linux - General 23 01-11-2002 01:23 PM


All times are GMT -5. The time now is 07:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration