LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 05: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: 31
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, 06: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, 07: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, 08: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, 12:42 AM   #5
KWTm
Member
 
Registered: Jan 2004
Distribution: Kubuntu 14.04 (Dell Linux-preinstalled laptop + 2 other laptops)
Posts: 117

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 01:06 AM.
 
Old 04-29-2004, 03: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, 04: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, 04: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: 31
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, 04: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: 31
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



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 02:37 PM
linux commands help kyborg Linux - Newbie 4 09-28-2004 01:31 AM
Linux commands Delmarc Linux - Newbie 9 10-22-2003 10:39 PM
Linux commands Shikha Linux - General 3 11-27-2002 09:40 AM
Linux Commands AMDPwred Linux - General 23 01-11-2002 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:59 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
Open Source Consulting | Domain Registration