Favourite shell/command line reference?

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Does anyone have a favourite shell/command line reference you could recommend? I haven't found one I really like yet. I'm a bit of a n00b with this stuff so something more straightforward or basic would be good for me Smiling

They have: 5 posts

Joined: Feb 2008

the most resourceful one I use is TOP Smiling

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

You're talking Linux/Unix, right? Are you looking for a list of commands or more information on a specific command?

If you are looking for help on a specific command, my favorite references are the manual pages (or 'man' pages). For example, if you need help on the 'cp' command, type 'man cp'. For help with understanding the man pages, type 'man man'. Laughing out loud

Here are some basic commands to learn.

Otherwise, I don't have a one specific reference, 'cept Google. Smiling

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Google is what I use as well. It also helps to keep a file of useful commands and some sample arguments.

The advice to use man pages is a good one, they can be a little esoteric, it takes a few tries to get the lingo. Once you understand you'll be able to 'get' most man pages.

Do things in a more task-orientated way, when you want to know how to do something in GNU+Linux, Google it: linux directory list for example. Or you can come on here and ask us. Smiling

a Padded Cell our articles site!

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Okay. I have been using this tutorial site but it's really broken up across pages.

I have found some wikipedia references to be really helpful so I should look there as well.

One thing I was trying to do the other day was remove certain types of files (*.LCK) recursively through directories. Maybe that's not possible.

man would be fine if I knew what to look up!

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Quote: One thing I was trying to do the other day was remove certain types of files (*.LCK) recursively through directories. Maybe that's not possible.

It's possible with a little scripting. This thread should help. Be careful though because the rm (delete) command is dangerous.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Off the top of my head, I would use:

find . -type f -name '*.LCK' -print0 | xargs -0 rm -f

Yeah! Feel t3h p0w4h!

Errrr, and make sure you cd into the right directory first, and do a test run. As pr0gr4mm3r said: rm is dangerous. I once typed in: rm -rf / by accident once, whilst logged-in as root, totally hosed everything! I was impressed at t3h p0w4h of GNU+Linux though, Windows would have stalled and moaned about locks on open system files, but those GNU tools munched the lot down, and the system continued to work, even with nothing on the hard drive! Well it worked until I tried to run a program, then died, I was impressed though (mostly at my own stupidity). Laughing out loud

a Padded Cell our articles site!

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

See, this is why I need a good reference.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Quote: I once typed in: rm -rf / by accident once, whilst logged-in as root

Shocked Shocked I hope there was nothing important on that drive! I ran that command once on a tinker box just to see what happened. I was also amazed at how it didn't crash. I've read stories on how sys admins kept servers up for days with crashed hard drives. Granted, the servers only routed traffic and handed out DHCP leases, but still impressive.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.