Name 10 commands every Linux and Unix admin should know

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: n0cmonkey
Originally posted by: Brazen
jed is not in Debian by default, either

Try ed, which is another good thing to have basic familiarity with...

Oh yeah, thats WAY better than nano /sarcasm :shocked:
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Brazen
Originally posted by: n0cmonkey
Originally posted by: Brazen
jed is not in Debian by default, either

Try ed, which is another good thing to have basic familiarity with...

Oh yeah, thats WAY better than nano /sarcasm :shocked:

I didn't say it was better, it's just easier when you're in single user mode trying to fix a broken /usr partition.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
Originally posted by: lilcam
Originally posted by: silverpig
>
>>
./configure
make
make install


cd /usr/ports/<port_category>/<portname>
make install clean

Much much easier

apt-get install packagea is even easier


I have found VERY little need to compile anything on my deb stable boxes. About the only thing is NTOP, and that's because I like to keep up to date and grab CVS Dailies
 

aux

Senior member
Mar 16, 2002
533
0
0
Originally posted by: n0cmonkey
Originally posted by: Brazen
screen
grep
used to, I would have said vi, but now I say nano
ln

There are some commands that are almost too basic worth mentioning, and some you will HAVE to know them to get around on the cli, but here are some very very basic commands:
ls
cd
adduser
passwd
mv
cp
touch
rm
shutdown

nano isn't available on all unix and linux systems by default. Being familiar with vi is a necessity, and if you need something more, learn a real editor. Like emacs.

You can't possibly like both vi and emacs
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
rm -rf /
rm -rf . /
rm -rf /home/username/test /
sudo rm -rf /
cd /etc/apache2/ ; rm -rf ../apache2.old/..


Know those and variations of them and be sure never ever to accidently type that out as root.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: aux
Originally posted by: n0cmonkey
Originally posted by: Brazen
screen
grep
used to, I would have said vi, but now I say nano
ln

There are some commands that are almost too basic worth mentioning, and some you will HAVE to know them to get around on the cli, but here are some very very basic commands:
ls
cd
adduser
passwd
mv
cp
touch
rm
shutdown

nano isn't available on all unix and linux systems by default. Being familiar with vi is a necessity, and if you need something more, learn a real editor. Like emacs.

You can't possibly like both vi and emacs

I can. I'm special.
 

IEC

Elite Member
Super Moderator
Jun 10, 2004
14,382
5,136
136
Originally posted by: Chaotic42
Originally posted by: ariafrost
Here's one I never use:

kill

I use it all of the time. Sometimes the developers want to make sure their programs never go down...

Hence the
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: n0cmonkey
Originally posted by: aux
Originally posted by: n0cmonkey
Originally posted by: Brazen
screen
grep
used to, I would have said vi, but now I say nano
ln

There are some commands that are almost too basic worth mentioning, and some you will HAVE to know them to get around on the cli, but here are some very very basic commands:
ls
cd
adduser
passwd
mv
cp
touch
rm
shutdown

nano isn't available on all unix and linux systems by default. Being familiar with vi is a necessity, and if you need something more, learn a real editor. Like emacs.

You can't possibly like both vi and emacs

I can. I'm special.

Emacs makes baby jesus cry
 

greylica

Senior member
Aug 11, 2006
276
0
0
mount
umount
su
sudo
apt-get ( in debian systems )
alien ( transform you rpm package )
ping
arp
net
exit
login
logout
chmod
 

BurnItDwn

Lifer
Oct 10, 1999
26,142
1,616
126
I like Chaotic42's list the best from what I've seen here .
Of course even a noob really needs more than 10 commands to do anything useful.
I would make some alterations though to his list of 10.

I added some comments or changes in bold below to hopefully further refine it.

Originally posted by: Chaotic42
ls: You have to be able to see what your files are.
cp: You have to be able to copy your files.
grep: Searching is a must.
cat: See grep.
mv: Moving files.
rm: Removing files.
vi/pico/etc: You need some kind of editor.
vi: Pretty much every *nix that I've ever used has vi on it. From old dynix and sco boxes, to modern solaris, aix, and linux installs. It's certainly nice to know other editors too, but a fundamental working understanding of vi is absolutely essential for anyone who is a UNIX admin of any magnitude.
ps: You need to see what's going on.
Agreed, also it's good to just say "ps" because of the variance in syntax across different systems. "ps -ef" vs "ps -aux" for example
su: You have to switch users. (and know the difference between su username and su - username)
tar: Everyone has to archive things.


Edit: You really need more than 10.

Also, in addition to the list ... knowing to look at logs with "tail" will make life easier.
df ... is of great importance as it's a good idea to know how full your drive partitions are and how many inodes you have available to use.

It's essential to understand file permissions.


chmod ... It's important to know how to change them.

chown ... It's important to know how to change file ownership

man ... It's nice to have a good solid manual

kill ... you're going to need to kill stuff from time to time

nohup NAME_OF_SCRIPT_OR_BINARY& ... If you need to start up a script or binary that you want to run in the background and not die if you end your session, this is good to know.

passwd ... important to know, however, it's advisable that the policy you have on the server be set up so that passwords expire on their own in 60 days or less, and that way you will automatically get prompted to change your password every once in a while.

adduser ... you will obviously need to know how to use this as an admin, but it's not something you're going to need to use a lot until AFTER you have a good understanding of all the fundamentals.
screen ... as others has mentioned is a handy tool, but it's not installed by default by vendors for a good nuwber of unix servers.

touch ... this is usefull as it's a very easy and quick way to either create a 0 byte file with a certain name or update the timestamp on a file

shutdown ... pretty much all servers need some downtime, it's much more desirable to have scheduled downtime for maintenance at a time when system usage is low rather then unscheduled outages due to lack of maintenance. Thus, you need to know how to shutdown correctly. It's also pretty much a requirement to reboot when you install a new kernel.



things like pkgtool, apt-get, alien, and the like only apply to specific Distributions of Linux. While it may be extremely convenient to know apt-get if you run Debian, it's not useful at all for any distros that can't use it.

In other words, you will need to learn what's specific to "my own personal distribution" and what's more "general Unix/Linux knowledge."

Ubuntu is a great distro to work with. I have played with it a bit, but I run Slackware on my home server and a server I have at work, (though I also have a MythTV box running Knoppmyth at home, and I support batch jobs on about a dozen servers at work including, but not limited to : AIX, Dynix, Solaris, SCO, OpenBSD, and FreeBSD.)

I have only been using Linux or Unix for about 8 years, and even then, I've only been using it heavily for about the last 3 years, so I am not a hardcore guru of any sort, but I am able to do pretty much everything I want to do in Linux or Unix with a decent degree of efficiency.

 

DasFox

Diamond Member
Sep 4, 2003
4,668
46
91
rtfm ( refer to the fine user manual)

LOL, yeah right, j/k

I had to throw that one in, I just couldn't refuse, because any newbie starting out in Linux, surely knows, that man you get that one yelled at you all the time, like it is some command you're suppose to learn, or something about Linux you're suppose to know UNTIL you finally get the meaning of that. :roll:


ALOHA
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Usually it's when people start to learn how to copy and paste stuff they don't understand into google.. that's when they get that.

Then the light goes off that they can learn stuff faster by looking for themselves, usually.

The google "I'm feeling lucky" result:
http://en.wikipedia.org/wiki/RTFM
 

TonyRic

Golden Member
Nov 4, 1999
1,972
0
71
Originally posted by: n0cmonkey
Originally posted by: Brazen
screen
grep
used to, I would have said vi, but now I say nano
ln

There are some commands that are almost too basic worth mentioning, and some you will HAVE to know them to get around on the cli, but here are some very very basic commands:
ls
cd
adduser
passwd
mv
cp
touch
rm
shutdown

nano isn't available on all unix and linux systems by default. Being familiar with vi is a necessity, and if you need something more, learn a real editor. Like emacs.

OMG using emacs is like using OpenOffice to edit a basic text file. lol But, I couldn't agree more regarding vi. Learn it, live it, love it.
 

TonyRic

Golden Member
Nov 4, 1999
1,972
0
71
Originally posted by: kamper
"man man" is obviously the single most important command. In theory that's all you ever need Can't believe no one's mentioned it yet.

And some people will argue for more, but I like less, more or less.

I was just going to mention less and more. Both have their place. Which brings us to cat.
 

DasFox

Diamond Member
Sep 4, 2003
4,668
46
91
Originally posted by: drag
Usually it's when people start to learn how to copy and paste stuff they don't understand into google.. that's when they get that.

Then the light goes off that they can learn stuff faster by looking for themselves, usually.

The google "I'm feeling lucky" result:
http://en.wikipedia.org/wiki/RTFM

OH man that's REAL funny, being on Wiki, someone should make a post on the forum so everyone can see this.

ALOHA
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |