This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes top 20 linux commands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "top 20 linux commands" Watch "top 20 linux commands" New topic
Author

top 20 linux commands

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20660
    ∞

I've never been a power linux user, just bopping along and getting by. Once in a while my ignorance shows ...

Is there a web page out there that would list the top 20 or maybe top 50 linux commands for the bash shell? Or maybe the top things one might want to do? Maybe I could print that out and have it handy.

I have ls and ll down. I do cd and mkdir without a problem. I even use cp and mv a lot.

I forgot about "ps" today. I tried "echo $CLASSPATH" today and it came up blank, so I must have done it wrong. I could use a refresher on aliases cuz everybody here uses "ct" for the clearcase tools, but "which ct" didn't work. "whereis ct" did nothing also. So I'm suspecting an alias. I don't really need to know what ct really is, but I feel like it helps to have a somewhat better understanding.

I've used linux, solaris, aix, etc. many times over the years (remember sco and interactive unix?) but never really mastered any shell.

It just seems like there could be a one page thing that could answer 95% of my questions.

Any suggestions?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9050
    
  10
http://www.mediacollege.com/linux/command/shell-command.html
http://infodamina.net/linux/linux-command.html


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Not a web page, but I really like Linux Desk Reference. Particularly useful is the way they group commands by function - if the first command you look up doesn't do what you want, chances are good there's something one or two pages away which does.

Incidentally for your problem with a possible alias, you can just type "alias" with no args, and you should get a list of all aliases which have been set so far.


"I'm not back." - Bill Harding, Twister
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
At work ct is an alias for cleartool, a shell like thing for clearcase (Rational ClearCase). Is that what they are using? Are you hearing words like vobs, views, branches, merges, checkin and checkout?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
cleartool summary


cleartool can be found in a directory path containing the word "atria".
So try "find / -name atrea" or "find / -name cleartool"

or even just "alias"
[ October 20, 2005: Message edited by: Barry Gaunt ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Table L-2 in this appendix to the Advanced Bash Scripting Guide has proved handy when bringing new people onto my projects. Actually the whole guide is very handy -- it shows you how to do an awful lot of useful stuff.

"which" should tell you that a command is an alias for something and tell you what for.


[Jess in Action][AskingGoodQuestions]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
30 useful Unix commands
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Originally posted by Paul Wheaton:
I tried "echo $CLASSPATH" today and it came up blank, so I must have done it wrong.

Any suggestions?


I'm running linux 12 h / day, mostly for programming Java, and don't have any classpath set.
I was surprised to see that it is needed to specify the current working directory on windows, but it's not needed on Linux.


http://home.arcor.de/hirnstrom/bewerbung
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20660
    ∞

Wow! Five responses within the first 30 minutes! I love this site!

About three minutes after posting my question, a guy comes in and says "do a find on ...." so I had to have him tell me exactly what to type ...

Marilyn, good quickie lists! Thanks!

Jim, thanks for the alias tip - that worked great!

Barry, you are spot on about clearcase. Using Jim's trick, ct appears to not be an alias. I've made a list of the main ct things I need to do, so so far I think I'm okay there.

Ernest, ooooooo - that's a good one. I remember DOS stuff for some reason. I tried the "which ct" and got ascii puke with "grep" in there somewhere. An alias that doesn't show up when I type "alias"?

Barry, I like this list. I think I'm gonna copy six or seven that I have a hard time remembering and pin it up.

Thanks everybody!
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20660
    ∞

What might be three or four good uses of grep in bash?
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20660
    ∞

Here's a good one ... how to list all running java processes. I know it's a mix of "ps" and "grep" with a pipe ....
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20660
    ∞

what's the dif between "man" and "help"?

I remember that in older versions of linux that the man pages were unreliable.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[Paul]: Here's a good one ... how to list all running java processes. I know it's a mix of "ps" and "grep" with a pipe ....

ps -al | grep java

You might want to man ps to verify the ps options; at the moment I have access to cygwin and OS-X, not linux.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[Paul]: Marilyn, good quickie lists! Thanks!

I'm sorry - did you just thank Marilyn for a quickie?
Peter Rooke
Ranch Hand

Joined: Oct 21, 2004
Posts: 805

You might like the apropos command. Gives you information on various related commands, by searching the whatis database. Sometimes you just can't recall the correct command (with its lack of vowels!). For example try:
. Of course "apropos", is not that easy to remember ;-)

I also like the way that using bash (or sh), you can hit the tab key and the shell will try to auto complete a command or its argument.

---------------------
"Unix is the answer, but only if you phrase the question very carefully. Unix is user-friendly. It's just very selective about who its friends are. Unix: It's not just 'User-Unfriendly', it's 'Proactively User-Hostile' ! "


Regards Pete
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923



phone Virginie


find errors in logfiles


find the class for a java-method:

[ October 22, 2005: Message edited by: Stefan Wagner ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Paul Wheaton:

I tried "echo $CLASSPATH" today and it came up blank, so I must have done it wrong.
...
...
What might be three or four good uses of grep in bash?


env | grep PATH
will show you any environment variables with "PATH" in the name.

alias cl='clear;ls'
Clear screen then list files..
[ October 22, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

rm -rf directory

removes a directory and its contents. always useful.
Mahesh Rana
Ranch Hand

Joined: Sep 05, 2001
Posts: 139
Find any file using

locate file_name

locate is a database driven utility (Included in Redhat distributions).
[ November 04, 2005: Message edited by: Deep Narsay ]

SCJP2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: top 20 linux commands