Wednesday May 22
Jul
25/08
Your 3 Favorite Linux Commands?
Updated on Thursday, 31 July 2008 09:35

Here’s a fun Friday post…

Some of you may know I’ve been preparing to brush up on my *nix skills. A couple of our new solutions are running on Linux platforms and I feel compelled to understand any platform I’m working with inside and out… I know, it’s a bit OCD.

But to be honest, I haven’t really touched a Linux platform for about 10 years, since I was one of the three students running the Sun network over at NCSSM. I still remember the humorous ‘root’ ‘of all evil’ admin name that we used and the password, iaceo (in mixed caps), which was a Latin word for (I think) to lie dead. (Please correct me if you know what it means).  When you’re 17, these things are amusing.

I’ve kept my ls-ing and cd-ing over the years, but will be brushing up on the grep-ing and tail-ing ;)

So with any system, I think we all have our favourite commands that we use daily and are part of our daily arsenal. I’m working out mine but wanted to hear from you…

What are your 3 favorite Linux commands?

And is there 1 obscure one you really love (or hate)?

 

# # #

Related Content


25 Comments
  1. CommentsSecurity Shoggoth   |  Friday, 25 July 2008 at 4:33 pm

    My three favorite Linux commands:

    1. nc – Netcat rocks.
    2. perl – The ultimate programming language IMO. Fast, effective and powerful. And all from the command line.
    3. clear – I really hate screens full of junk. :)

    Obscure command I love? Well, I love strings but I’m not sure how obscure that is.

  2. CommentsMike Fratto   |  Friday, 25 July 2008 at 4:59 pm

    1) tcpdump I mostly use Linux boxes for servers and I am constantly troubleshooting stuff. tcpdump is your friend.

    2) screen You can have multiple terminals open from a single console, SSH, or telnet session. best part, if you close the connection or get dropped, you can just get back to the box, type screen -dr to have all of your windows and programs just the way you left them. Great for tailing a log file or running tcpdump searching for rare events.

    3) lsof Learn this to investigate the dusty corners of your system. Open files, open sockets, what opened sockets, etc.

    Obscure: 2&>1 is not a command, but dumps stderr to sdtout. Some *nix proggies dump useful information to sdterr.

  3. Commentstodd   |  Saturday, 26 July 2008 at 4:42 am

    1. top
    2. mii-tool
    3. man :-)

  4. Commentschristian   |  Saturday, 26 July 2008 at 10:36 am

    1) I have to go with the "screen" command too, very useful.
    2) grep
    3) curl. I’m such a curl fan, I use it on windows too.

    Don’t really know what I’d count as obscure. Maybe all the crazy sed and awk stuff that you can do?

  5. CommentsKarsten   |  Saturday, 26 July 2008 at 2:55 pm

    Well, the one and only most important command is of course the
    "read mail really fast": rm -rf
    (no, don’t try this at home … ;-) )

  6. CommentsSteve PInkham   |  Saturday, 26 July 2008 at 4:37 pm

    1)vim. Can’t live without it.
    2)ruby/irb. For when bash scripting just won’t do.
    3)hg. For change management, and rolling back from the "oh crap" moments.

    Obscure commands? xargs is the shell scripting swiss army knife, but it’s not really obscure. Then again when you talk to Unix weenies, nothing is really obscure. ;-)

  7. Commentskp   |  Sunday, 27 July 2008 at 12:53 am

    less: is more (and lets you browse before vi)

    script: cuz sometimes you need evidence (and an electronic memory)

    dd: because sometimes you need to capture the whole damn thing just the way it is.

  8. CommentsJJ   |  Sunday, 27 July 2008 at 2:27 am

    Karsten,
    lmao..

    Okay kids- do NOT try Karsten’s fav (unless you want to delete everything) ;)

    -jj

  9. CommentsJack Daniel   |  Sunday, 27 July 2008 at 2:40 am

    tcpdump
    scp
    ssh

    Not that obscure, but not as known as it should be, iftop. I would be lost without it.

  10. CommentsMichael Wilde   |  Sunday, 27 July 2008 at 3:01 am

    top
    vi
    grep

    obscure one: set -o vi (lets use use vi at the command prompt to go back, forward, and edit like you’re in vi)

  11. Commentsjason   |  Sunday, 27 July 2008 at 4:12 am

    find
    grep

  12. CommentsChristian   |  Monday, 28 July 2008 at 12:58 am

    How could I forget Vi! I’m totally adding a fourth.

    4) Vi

  13. CommentsLeigh Honeywell   |  Monday, 28 July 2008 at 3:30 am

    I can’t sing the praises of screen enough. Until the server was physically moved from the US to Canada, I had one screen session with an uptime of nearly a year.

    Other favourites are wget with the UA set to Interweb Exploder for malware acquisition without trashing my reversing environment, and mutt for old-skewl email :)

  14. CommentsLeigh Honeywell   |  Monday, 28 July 2008 at 3:32 am

    OH AND… GNU ddrescue ( http://www.gnu.org/software/ddrescue/ddrescue.html ) for being the best damn hard disk recovery tool money can’t buy. I’ve saved countless (ok, like 3) nearly-dead drives from an expensive trip to the clean room with this command.

  15. Commentsjason   |  Monday, 28 July 2008 at 3:53 am

    that last comment was also supposed to have

    "insert your favourite scripting language here"

  16. Commentsax0n   |  Monday, 28 July 2008 at 2:14 pm

    lsof – useful for finding any open files (even IP sockets!) and tracking down problems.

    awk – In the right hands, it’s very powerful. can sort, parse, format and search. Things you’d pipe through multiple cut/grep/sort pipe mazes you can often nail down with one line of awk.

    find – learn ALL the command-line switches and how they differ between Linux, Solaris, AIX and BSD.

    There are too many "obscure" commands and packages to even list. Knowing how to efficiently use the mundane together is more important, IMHO.

  17. CommentsJJ   |  Monday, 28 July 2008 at 3:07 pm

    These are all great!

    Someone was telling me about an index-type command to allow you to search all files, regardless of the dir they were in…

    Any ideas what that was?

    -jj

  18. CommentsLeigh Honeywell   |  Tuesday, 29 July 2008 at 3:31 am

    JJ: that undex-using command would be locate. It uses a database which is set on many distros to update daily at 3am, so if you’ve made more recent changes and want to re-index, you’ll want to run a sudo updatedb first :)

  19. Commentsglyphe   |  Tuesday, 29 July 2008 at 7:24 pm

    I looked over the commands everyone submitted. Its a great list but the one I use often that isn’t listed is apropos. Its a great for searching for commands when you don’t know their exact names.

  20. CommentsJJ   |  Tuesday, 29 July 2008 at 8:40 pm

    Leigh,
    That’s exactly the cmd I was thinking of- thanks!

    -jj

  21. CommentsJJ   |  Tuesday, 29 July 2008 at 8:41 pm

    The aprapos sounds interesting too… have to check that one out.

  22. Commentsjolenzy   |  Sunday, 10 August 2008 at 4:45 pm

    That would be “exit” command :)

  23. CommentsXXX   |  Friday, 05 March 2010 at 10:05 pm

    dd
    lsof
    grep
    and obscure is hexdump

  24. Commentslog69   |  Friday, 09 July 2010 at 5:09 pm

    ne
    screen
    pstree -n
    ;)

  25. Commentssocaln   |  Wednesday, 04 April 2012 at 7:31 am

    Awk
    sed
    Vim

    Obscure command = fg


Leave a Reply






More Content

Find more of my content at
- Low Tech Hacking book
- Dark Reading
- Network Computing
- IANS
- SearchSecurity
- TechTarget

Get Social

RSSFacebookLinkedinYoutube