• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

Linux commands every user (power user) should be familiar with?...

brxndxn

Diamond Member
Apr 3, 2001
8,475
0
76
After playing around years ago with Redhat.. then Corel linux, then Mandrake, Slackware, Gentoo, Suse, and now finally settling on Ubuntu, I still don't feel I know enough commands to do anything useful at the command line other than editing config files with vi.

I haven't really been able to find a good OS-agnostic list of commands that a linux user should know. It seems that a common command list for Mandrake, for example, has an antirely different set of commands than Ubuntu.

So.. what are some commands I should start studying? Once I know the command, I'm sure I can find more in man pages or google.. I really want a list of common commands that every user should know. I'm sick of 'distro-specific' commands that don't exist on other linux systems.

...

cd
mkdir
rmdir
rm
vi
cp
mv

..

what else? How about some generic commands that let me see my processes and then kill them.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
check out the links in my sig also. Especially the guides aviable at tldp.org. Make sure the ones you choose to read are up to date though. It's easiest when your sitting in front of a Linux machine, of course.
 

Seeruk

Senior member
Nov 16, 2003
986
0
0
If you want a book go for Sobell's. The exact name escapes me now (it's currently in my bathroom for reading on those long stints :) ) but is something along the lines of Basic Linux Shell Commands and Programming.
 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
Originally posted by: brxndxn
what else? How about some generic commands that let me see my processes and then kill them.

the command, "top", lists the processes and the command "kill" will kill them. however, when using the kill command you have to specify the id for the process. you have to find that out by using top.
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
Originally posted by: SleepWalkerX
Originally posted by: brxndxn
what else? How about some generic commands that let me see my processes and then kill them.

the command, "top", lists the processes and the command "kill" will kill them. however, when using the kill command you have to specify the id for the process. you have to find that out by using top.

I've also seen a few systems (older Solaris builds, but you never know) that didn't have 'top'; in these cases, you can use 'ps' to view processes. 'ps' and 'kill' will be there on basically any UNIX/Linux system.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
How can you breathe without knowing grep? :)

In addition:

diff
patch
mount
umount
modprobe
insmod
su
chmod
chown
ls
startx (for X)
pwd
logout
man
linux32 (prefix to start app in 32-bit mode on 64-bit OS. useful for glib mismatches sometimes)
fdisk
locate
updatedb
uname -r (get kernel version)
ps
kill
sh
cat

These are all musts IMO. I've found good use in every one of these. I haven't used chown a whole lot though. I think it's kill -9 pid that just closes the app and gives me no bullsh!t about it.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: xtknight
In addition:

diff
patch
mount
umount
su
chmod
chown
ls
startx (for X)
pwd
logout
man
fdisk
locate
updatedb
uname -r (get kernel version)
ps
kill
sh
cat

These aren't Linux commands. ;)

These are all musts IMO. I've found good use in every one of these. I haven't used chown a whole lot though. I think it's kill -9 pid that just closes the app and gives me no bullsh!t about it.

kill -9 is dangerous, and should RARELY be used.
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
Originally posted by: n0cmonkey
These are all musts IMO. I've found good use in every one of these. I haven't used chown a whole lot though. I think it's kill -9 pid that just closes the app and gives me no bullsh!t about it.

kill -9 is dangerous, and should RARELY be used.

If a process is stuck in such a way that it's not listening to interrupts (or it's catching SIGINT and ignoring it), sending SIGKILL via 'kill -9' is basically the only way to get rid of it. But you do need to be careful, since killing some system processes with 'kill -9' can do Very Bad Things.

 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Originally posted by: n0cmonkey
These aren't Linux commands. ;)

What are they? They seem to work on my SUSE, Fedora, and Mandrake Linuxes and probably any other Linux worth its cajones...

I use kill -9 as my anger management. :p Of course, before that I'll try clicking the X 50 times, using the "force close" dialog if it ever comes up, regular kill, and finally kill -9. I doubt kill -9'ing a frozen wine app is gonna do any damage. Nothing else ever freezes. I've only had to do it once so far. Still I couldn't imagine how kill -9'ing even some really core system process would be worse than a power outage or force reboot which I've done plenty with frozen 3D apps where I can't even get to the consoles.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: xtknight
Originally posted by: n0cmonkey
These aren't Linux commands. ;)

What are they? They seem to work on my SUSE, Fedora, and Mandrake Linuxes.

Most/all of them also work on my Solaris and OpenBSD boxes. Many of them will work on Xenix (Microsoft's Unix ;)), SCO, FreeBSD, NetBSD, DragonflyBSD, HP-UX, etc.

From the history section of the man pages on OpenBSD:
A diff command appeared in Version 6 AT&T UNIX.
A mount command appeared in Version 3 AT&T UNIX.
A umount command appeared in Version 3 AT&T UNIX.
A su command appeared in Version 7 AT&T UNIX.
A chmod command appeared in Version 1 AT&T UNIX.
An ls utility appeared in Version 3 AT&T UNIX.
A man command appeared in Version 3 AT&T UNIX.
The locate command appeared in 4.4BSD.
The uname command appeared in 4.4BSD.
A ps command appeared in Version 3 AT&T UNIX in section 8 of the manual.
A kill command appeared in Version 3 AT&T UNIX.
A cat utility appeared in Version 1 AT&T UNIX.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: xtknight
Originally posted by: n0cmonkey
These aren't Linux commands. ;)

What are they? They seem to work on my SUSE, Fedora, and Mandrake Linuxes and probably any other Linux worth its cajones...

I use kill -9 as my anger management. :p Of course, before that I'll try clicking the X 50 times, using the "force close" dialog if it ever comes up, regular kill, and finally kill -9. I doubt kill -9'ing a frozen wine app is gonna do any damage. Nothing else ever freezes. I've only had to do it once so far. Still I couldn't imagine how kill -9'ing even some really core system process would be worse than a power outage or force reboot which I've done plenty with frozen 3D apps where I can't even get to the consoles.


For frozen X applications there is a command called 'xkill'. You type out xkill then click on the window... then it will kill that window. Depending on the app you may have to open up the task manager or top or ps or whatever you like using to double check that it's closed. But usually it works pretty well. 3D apps can be a bit diffferent though since they interact so much with drivers that may not be very good.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: n0cmonkey
Originally posted by: xtknight
Originally posted by: n0cmonkey
These aren't Linux commands. ;)

What are they? They seem to work on my SUSE, Fedora, and Mandrake Linuxes.

Most/all of them also work on my Solaris and OpenBSD boxes. Many of them will work on Xenix (Microsoft's Unix ;)), SCO, FreeBSD, NetBSD, DragonflyBSD, HP-UX, etc.

From the history section of the man pages on OpenBSD:
A diff command appeared in Version 6 AT&T UNIX.
A mount command appeared in Version 3 AT&T UNIX.
A umount command appeared in Version 3 AT&T UNIX.
A su command appeared in Version 7 AT&T UNIX.
A chmod command appeared in Version 1 AT&T UNIX.
An ls utility appeared in Version 3 AT&T UNIX.
A man command appeared in Version 3 AT&T UNIX.
The locate command appeared in 4.4BSD.
The uname command appeared in 4.4BSD.
A ps command appeared in Version 3 AT&T UNIX in section 8 of the manual.
A kill command appeared in Version 3 AT&T UNIX.
A cat utility appeared in Version 1 AT&T UNIX.



Also it would probably be apropos to point out that the 'killall' command in Linux is NOT the same as 'killall' on some other systems. Solaris comes to mind.

It means to litterally 'killall' your entire freaking system.. it's typically used at shutdown or reboot. :)
 

rmrf

Platinum Member
May 14, 2003
2,872
0
0
Originally posted by: SleepWalkerX
Originally posted by: brxndxn
what else? How about some generic commands that let me see my processes and then kill them.

the command, "top", lists the processes and the command "kill" will kill them. however, when using the kill command you have to specify the id for the process. you have to find that out by using top.

killall <process_name> will kill all instances of that process (in a perfect world). every once in a while I have to break out the kill -9
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Originally posted by: drag
Originally posted by: xtknight
Originally posted by: n0cmonkey
These aren't Linux commands. ;)

What are they? They seem to work on my SUSE, Fedora, and Mandrake Linuxes and probably any other Linux worth its cajones...

I use kill -9 as my anger management. :p Of course, before that I'll try clicking the X 50 times, using the "force close" dialog if it ever comes up, regular kill, and finally kill -9. I doubt kill -9'ing a frozen wine app is gonna do any damage. Nothing else ever freezes. I've only had to do it once so far. Still I couldn't imagine how kill -9'ing even some really core system process would be worse than a power outage or force reboot which I've done plenty with frozen 3D apps where I can't even get to the consoles.


For frozen X applications there is a command called 'xkill'. You type out xkill then click on the window... then it will kill that window. Depending on the app you may have to open up the task manager or top or ps or whatever you like using to double check that it's closed. But usually it works pretty well. 3D apps can be a bit diffferent though since they interact so much with drivers that may not be very good.

I miss the skull and crossbones cursor I could get up with a simple control box menu item in the good old days. How do I get that back in KDE or GNOME? KDE doesn't have it in their 'available to add' menu items.
 

BurnItDwn

Lifer
Oct 10, 1999
26,353
1,862
126
it's been said before, but I'll continue to bless it, grep is one of the most usefull tools in a *nix shell.
I use tr, sed, cut, tar, more, and awk all the time.
sort and find are pretty handy as well.
It's also imperative to know how to use the pipe.
being able to work with vi will make life easier too.

I mainly play with solaris, aix, dynix and sco boxes at work. I also linux on my server at home. I play around with little scripts every now and again, however, I wouldn't consider myself to be some type of expert. (though I'm certainly no novice)