Essential Linux command line tasks?

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
(This was originally in reply to Nosferatu's KDE thread, but was getting too OT)

I think that all of the folks around here that have a lot of Linux (or other *NIX) experience have seen enthusiastic newcomers get bogged down trying to do fancy stuff in X/KDE/GNOME before they understand some rather important fundamentals about the system. Obviously, there's a huge amount that such crusty old-timers could say is "essential," but I was hoping we could develop a list of 10 tasks that every Linux newbie should know how to do before doing anything else. 10. No more, no less. Keep it simple and achievable (so no grepping, unfortunately).

I'll start...

1) Navigate and view directories, and have a basic clue about what the filesystem looks like
2) Edit text files (easy editor suggestions, please... pico, maybe?)
3) Move, copy, and delete files (now that you can create some test files with an editor)
4) Add and remove users
5) Change basic permissions on files
6) Mount and unmount disks.
7) Know how to use the package system for your distro
8) Compile and install a kernel (?)
9) View and kill processes
10) Make simple command pipes (e.g. ls | less)

For the fun of it, if you suggest something else, tell me which of mine you'd remove. Perhaps after a little enjoyable bickering, we could come up with a valuable reference that would get people started on the right track.
 

Derango

Diamond Member
Jan 1, 2002
3,113
1
0
actualy, that looks good. Try nano for an easy text editor, although the only editor thats garunteed to be installed on any linux system is vim, which is the exact opposite of easy :)
 

LNXman

Senior member
Jul 27, 2000
404
0
0
MAN PAGES!!! WHERE ARE THE MAN PAGES!!????!!!??? ;)
Some researching (i.e. reading/net surfing) so that the end-user can understand what he/she is about to do and what are going to be some of the implications from screwing up. This should be part of the list as well, I think.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Knew I forgot something - I was gonna include man pages, but somehow they leaked out of my head before they hit the screen. Would that replace #8 (kernel compilation), then?
 

LNXman

Senior member
Jul 27, 2000
404
0
0
To be honest, that should be #1, because it applys to almost everything. Without the man pages, how are you going to know/understand what you are about to do?


/edit:fixed typo
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Ah... I wasn't really intending any particular order, though #2 and 3 kind of turned out that way. Ordering them would be a good thing, though.
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
updatedb/locate, and grep

netstat, and the init script structure

the Universal Intalation Procedure (just made that up)
tar -zxvf package
cd package
./configure --help
./configure --options --you-found --in-help
make
make install

bart
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
I would take build/install kernel off that list. It's rarely something a newbie will need to do with modern distros.

I'm not sure why you don't want to include grep though. Of course, you probably don't want to bury a newbie with the whole regular-expression business. But basic grep is simple, and often the first thing I really miss when working on an MS system.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
ergeorge: true, simple grepping is not hard to do, but I think 1) newbies rarely deal with files that are large enough to bother with it, 2) rarely know exactly what they're looking for, which quickly leads to 3) uncertain grepping means knowing basic quoting and regular expressions. Very useful stuff, but not very self-contained. I'd want novices to feel that these tasks can be "mastered," though we know there's always complexity lurking behind even the simple things. As for the kernel, I'm already conceding that slot to knowing man pages and documentation.

Buddha Bart: hmm, locate?... what would you replace in my list? I was thinking that locate or find might be possiblities, but I'll stick with what's there unless you can convince me. I suppose it could be included in filesystem navigation, though. Netstat and init scripts - I was wrestling with security implications, too. This is hard, though distros seem more out-of-the-box secure than they used to. Unfortunately, learning SysV init purely on the command line is not so easy. I guess I'd be breaking my own rules to suggest that as an optional task #11 for people on dedicated connections. What do other people think, here? As for the Universal Installation Procedure, the less said the better...


 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0


<< (This was originally in reply to Nosferatu's KDE thread, but was getting too OT)

I think that all of the folks around here that have a lot of Linux (or other *NIX) experience have seen enthusiastic newcomers get bogged down trying to do fancy stuff in X/KDE/GNOME before they understand some rather important fundamentals about the system. Obviously, there's a huge amount that such crusty old-timers could say is "essential," but I was hoping we could develop a list of 10 tasks that every Linux newbie should know how to do before doing anything else. 10. No more, no less. Keep it simple and achievable (so no grepping, unfortunately).

I'll start...

1) Navigate and view directories, and have a basic clue about what the filesystem looks like
>>


absolute must :)


<< 2) Edit text files (easy editor suggestions, please... pico, maybe?) >>


pico or nano. nano is a pico clone, and is under the GPL. vi is okay, vim is great :) i'd say you should learn at least the basics of vi, its not that hard.


<< 3) Move, copy, and delete files (now that you can create some test files with an editor) >>


mv cp rm, also get to know the man pages for all the different options that you will be using. touch works nicely for creating files too :p


<< 4) Add and remove users >>


useradd and/or adduser, pretty straightforward


<< 5) Change basic permissions on files >>


the chmod number codes are hard to catch on to and remember. i have understood them for a long time but i still dont totally remember them. i do alot of ls -l'ing to check file permissions as i try to get them right :p


<< 6) Mount and unmount disks. >>


pretty essential


<< 7) Know how to use the package system for your distro >>


i think rpm is horrible for newbies. constant trips to rpmfind.net, taking care of dependencies, i hate rpm. apt is easy, as is gentoo's ports, but the installs for both of those keep newbies away for the most part.


<< 8) Compile and install a kernel (?) >>


like ergeorge said, i wouldnt say its necessary, but its good to know.


<< 9) View and kill processes >>


killall 0wnz j00!


<< 10) Make simple command pipes (e.g. ls | less) >>


yeah piping to more, and grep and other things have tons of uses. also using the > and <, and >> and <<. knowing how to send processes to the background using bg, fg, ^Z, and the & sign. && and ; are important to know too.

knowing how to use cat is pretty important, although its not exactly hard to use so you have no excuse not to know :p

for example, a good way to learn how cat and the device/filesystems work together is to cat random files to /dev/dsp. also cat'ing to other terminals like "cat "hello" > /dev/tty1", not to mention viewing certain files in /proc like /proc/partitions, /proc/cpuinfo, /proc/interrupts. scanpci, lspci, its REALLY hard to narrow it down to 10 things. :p
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
sorry, didn't realize i was stuck to 10 (suppose i should read a wee closer)

I can't really think of any of yours to replace but living in the 'ghetto ass land of slackware' that I do, "locate" is a major lifesaver in "where the f*uck is that config file in this grabastic nonstandard setup"

On second thought, i'd replace your kernel setup with netstat/init scripts. You very rarely have to upgrade your kernel, but you often install stuff, install a new version of stuff, etc. And to know exactly where it starts from, how to set some options, and how to check if you've got any unknown things accepting connections, are pretty important in linux. One of the drawbacks of linux's ability to be completely remotely administered is that it has the ability to be completely remotely administered. As a newbie you can't just take security as some difficult thing to look into later. A basic knowledge of what services (and versions thereof) are accepting connections is a really simple way to keep a box secure. That and keep "involved" with the community to find out if an exploit has been found. Sometimes its as simple as reading slashdot. Or checking your distro's website every few days.

I'm rambling..... 10's too small for a list.... linux is to effing complicated (in a mostly good way)

bart
 

Garet Jax

Diamond Member
Feb 21, 2000
6,369
0
71
I think this is a great thread.

One of the hardest things I have struggled with in learning Linux is to find things to learn. There is so much about Linux I don't know that I have no idea what is out there.

I decided to make a Linux firewall and router for my home network. I am at the stage where my firewall and router pieces are working. I am now ready to install Apache and JServ to make it a webserver as well. Once this is done, I go back to the "Now what?" question.

The problem still remains that I don't know what I don't know and hence don't know what I need to learn.

Any suggestions on overcoming this problem?
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0


<< I think this is a great thread.

One of the hardest things I have struggled with in learning Linux is to find things to learn. There is so much about Linux I don't know that I have no idea what is out there.

I decided to make a Linux firewall and router for my home network. I am at the stage where my firewall and router pieces are working. I am now ready to install Apache and JServ to make it a webserver as well. Once this is done, I go back to the "Now what?" question.

The problem still remains that I don't know what I don't know and hence don't know what I need to learn.

Any suggestions on overcoming this problem?
>>


think about things you dont understand. ever wonder what's going on behind the scenes when XYZ happens? well, go find out.

or just move to other stuff for the time being, like me. i'm learning linux, C, HTML (just polishing my skillz ;)) and PHP, sometime in the future MySQL....the list goes on and on, and when i finish those things, theres plenty of other things to learn. :p
 

Armitage

Banned
Feb 23, 2001
8,086
0
0


<< The problem still remains that I don't know what I don't know and hence don't know what I need to learn.

Any suggestions on overcoming this problem?
>>



Sometimes it's just experience ... things you run across in the course of doing something else.

Also, hanging out in forums & newsgroups, watch slashdot/linuxtoday/freshmeat can teach you lots of stuff also.
 
Mar 14, 2002
54
0
0



<<

<< 4) Add and remove users >>


useradd and/or adduser, pretty straightforward
>>



as long as you stay away from vipw ;)




<<

<< 6) Mount and unmount disks. >>


pretty essential
>>



On top of this, I think learning how to edit /etc/fstab is crucial ... being able to do "mount /cdrom" is a lot better than having to learn the syntax for "mount -t iso.... /dev/hda2 /mnt/cdrom && ln -s /mnt/cdrom /cdrom"




<<

<< 7) Know how to use the package system for your distro >>


i think rpm is horrible for newbies. constant trips to rpmfind.net, taking care of dependencies, i hate rpm. apt is easy, as is gentoo's ports, but the installs for both of those keep newbies away for the most part.
>>



packages are evil. debian isnt any better than rpm (especially with multiple branches ... and their showstoppers that keep showing up on their unstable branch) .... source, especially for beginners.... ./configure && make && make install isnt that hard




<<

<< 9) View and kill processes >>


killall 0wnz j00!
>>



just remember that real unix's dont allow things like "killall -HUP inetd"



<<

<< 10) Make simple command pipes (e.g. ls | less) >>


yeah piping to more, and grep and other things have tons of uses. also using the > and <, and >> and <<. knowing how to send processes to the background using bg, fg, ^Z, and the & sign. && and ; are important to know too.

knowing how to use cat is pretty important, although its not exactly hard to use so you have no excuse not to know :p
>>



exactly ... the way i started learning how things worked was writing shell scripts to parse log files ... things like "grep specialpage.html /usr/local/etc/apache/logs/httpd-access-logs | wc -l >> ~/counter.txt" got me started on all the important things.
 

Nosferatu

Senior member
Oct 9, 1999
588
0
0
Nice thread. From my thread I was copying and pasting your command line commands and archiving them for future use. I suppose the list of ten things you mention, I need to go look up. In the mean time I have that Linux book that was suggested to me coming soon. I will learn Linux if it kills me. :D