Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > The Community > The Coffee Lounge
Reload this Page A word to Linux newbies.
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Coffee Lounge General chat about anything that goes, a good place to introduce yourself and say hi, tell a Joke, or just relax.

Site Navigation
Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 02-16-2008   #1 (permalink)
Just Joined!
 
Lich's Avatar
 
Join Date: Feb 2008
Posts: 21
A word to Linux newbies.

A note to those of you new to Linux, and even the veterans. Save this info in your mind, and never forget it. It might save you a nervous breakdown.

When you are following online instructions or advice on how to do something in the terminal, be very, very, very careful about anything that removes a file or directory. This is the "rm" command, and can possibly be followed by the -r or -f or both, i.e., -fr

Yesterday, I was following some instructions, and I was therein asked to remove a directory. I used the rm -fr command (which is to say I forced the deletion without confirmation and did it recursively so all files inside that directory were deleted too). I erred in the path of the directory, and lost quite a lot of very important, and system critical data. Although it's not impossible to recover it, the chances of success are virtually zero without very advanced knowledge of your system.

So I spent most of my night recovering, needless to say. I was able to piece-meal everything back together from old CD's with data I had saved at one point, my flash drive, and the Ubuntu install CD. But it was a pain in the ass.

Be very careful with your commands. Linux demands a certain amount of self accountability. I'm sure there are those out there who make some critical mistake in Linux and are turned off because of it, not realizing that in Linux-land, the system actually does what you tell it to...
Lich is offline   Reply With Quote
Old 02-16-2008   #2 (permalink)
Trusted Penguin
 
MikeTbob's Avatar
 
Join Date: Apr 2006
Location: Cowtown, Texas
Posts: 2,469
It absolutely sucks that you had to learn this the hard way. Glad you were able to get it fixed.
__________________
All new Users please read: FAQ
MikeTbob is online now   Reply With Quote
Old 02-16-2008   #3 (permalink)
Linux Guru
 
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,633
I must confess I usually man command_name or info command_name first before following instructions. That way I think I know what the results are going to be. (still has not saved me from some stupid mistakes!)

There are plenty of commands which can result in major issues if not used carefully. Press the tab key twice in a terminal and you will be prompted something along the lines ...
Code:
Display all 1978 possibilities? (y or n)
Trying to remember all options for all commands is not practical, I find the more I use linux the more I use the man and info commands!

Being an ex-DOSer I did have a bad habit of trying command_name -h ... but after I got a shock with a command which ignored the -h and executed anyway I stopped doing that.
Jonathan183 is offline   Reply With Quote
Old 02-16-2008   #4 (permalink)
Trusted Penguin
 
MikeTbob's Avatar
 
Join Date: Apr 2006
Location: Cowtown, Texas
Posts: 2,469
Quote:
Originally Posted by Jonathan183 View Post
I must confess I usually man command_name or info command_name first before following instructions. That way I think I know what the results are going to be. (still has not saved me from some stupid mistakes!)

There are plenty of commands which can result in major issues if not used carefully. Press the tab key twice in a terminal and you will be prompted something along the lines ...
Code:
Display all 1978 possibilities? (y or n)
Trying to remember all options for all commands is not practical, I find the more I use linux the more I use the man and info commands!

Being an ex-DOSer I did have a bad habit of trying command_name -h ... but after I got a shock with a command which ignored the -h and executed anyway I stopped doing that.
Try using another hyphen
fdisk --h
rm --h
__________________
All new Users please read: FAQ
MikeTbob is online now   Reply With Quote
Old 02-19-2008   #5 (permalink)
Just Joined!
 
Join Date: Feb 2008
Posts: 0
Great advice. And be careful at what you do as root - do user activities logged in as a normal user!

Quote:
Originally Posted by Lich View Post
A note to those of you new to Linux, and even the veterans. Save this info in your mind, and never forget it. It might save you a nervous breakdown.

When you are following online instructions or advice on how to do something in the terminal, be very, very, very careful about anything that removes a file or directory. This is the "rm" command, and can possibly be followed by the -r or -f or both, i.e., -fr

Yesterday, I was following some instructions, and I was therein asked to remove a directory. I used the rm -fr command (which is to say I forced the deletion without confirmation and did it recursively so all files inside that directory were deleted too). I erred in the path of the directory, and lost quite a lot of very important, and system critical data. Although it's not impossible to recover it, the chances of success are virtually zero without very advanced knowledge of your system.

So I spent most of my night recovering, needless to say. I was able to piece-meal everything back together from old CD's with data I had saved at one point, my flash drive, and the Ubuntu install CD. But it was a pain in the ass.

Be very careful with your commands. Linux demands a certain amount of self accountability. I'm sure there are those out there who make some critical mistake in Linux and are turned off because of it, not realizing that in Linux-land, the system actually does what you tell it to...
surferb is offline   Reply With Quote
Old 02-19-2008   #6 (permalink)
Trusted Penguin
 
daark.child's Avatar
 
Join Date: Apr 2006
Location: South Yorks, UK
Posts: 3,663
Good advice.I also learnt the hardway when I was a Linux newbie. I intended to delete a file in /usr/local and entered something like " / usr/local/somepath". I realised my error within seconds but I had lost most of the commands in /bin so had to reinstall because I did not have a backup.
daark.child is offline   Reply With Quote
Old 02-19-2008   #7 (permalink)
Linux Enthusiast
 
Manchunian's Avatar
 
Join Date: Dec 2007
Location: France but my heart stays in Britain
Posts: 645
Here's what could happen!
__________________
Distribution: Archlinux
Processor: Celeron 2.6 GHz; Ram: 750 MB
Graphics card: Nvidia GeForce4 MX 440-SE
Mother board: Columbia 4
Manchunian is offline   Reply With Quote
Old 02-19-2008   #8 (permalink)
Super Moderator
 
Dapper Dan's Avatar
 
Join Date: Oct 2004
Location: The Sovereign State of South Carolina
Posts: 3,759
Send a message via AIM to Dapper Dan
I think all of us have had mishaps at some point using the rm -rf command. I lost a whole directory myself once in the same way! Now, whenever using rm -rf, I stop and visually inspect the exact command for errors before pressing enter. Thanks for the informative and useful information. We all can stand reminding about these things from time to time.
Dapper Dan is offline   Reply With Quote
Old 02-19-2008   #9 (permalink)
Just Joined!
 
fatra2's Avatar
 
Join Date: Mar 2005
Location: Switzerland
Posts: 21
Quote:
do user activities logged in as a normal user!
From my experience, this is the best way to prevent critical damage. I am talking about computing in every sense, and with every platforms. Whether you are using Linux, Mac, MSWindows or any other OS, you should never ever do normal work as root.

I believe this is the best anti-virus on the market. If you don't have the administrator's rights, how can a virus get installed.

Cheers
__________________
Linux rules, but as much as a beautiful day on the ski slopes.
fatra2 is offline   Reply With Quote
Old 02-20-2008   #10 (permalink)
Linux Engineer
 
jayd512's Avatar
 
Join Date: Feb 2008
Location: Louisville, KY
Posts: 835
Quote:
Originally Posted by surferb View Post
do user activities logged in as a normal user!

Indeed! I've made a fair amount of mistakes because I didn't follow this rule, and learned the right things the wrong way And I can't tell you how many times I have to help clean up a machine for friends or family because they won't use a regular profile for normal work. they just don't wanna take the minute or two to switch profiles/accounts.

Oh well... What can ya do?
jayd512 is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Job Search
keyword location
Post a Job »
job title, keywords or company
city, state or zip jobs by job search

Similar Threads
Thread Thread Starter Forum Replies Last Post
TFT Monitor goes black when I try to run suse eval CD Metalbarthug Mandriva Linux Help 16 11-01-2005 05:28 AM

Free Magazines
Free eBook:"Vulnerability Management for Dummies"
Get all the Facts and See How to Implement a Successful Vulnerability Management Program.
subscribe
Google vs The World: The Battle of the Message Security Vendors
With such a powerful name behind it, Google Message Security stands out in a sea of products that do exactly the same thing - or so they say. So when it comes right down to it, how does the Google selection stack up against the rest of messaging security's big guns?
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 01:02 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0