LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-07-2005, 08:16 AM   #1
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
What are your favourite & most useful *nix COMMANDs ? [Post them here]


Kindly post your favourite & most useful *nix commands.
Also if possible do mention their roles & a bit briefing about them.


*This thread could be an awesome help for all the newbies & it will also promote the POWER of CLI in *NIX.
..amit..
 
Old 12-07-2005, 08:55 AM   #2
muppski
Member
 
Registered: Feb 2003
Posts: 149

Rep: Reputation: 15
grep

When you just want to read what you'r looking for instead of scrolling through miles of text.

e.x : dmesg | grep AMD
 
Old 12-07-2005, 09:37 AM   #3
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
slocate (provided you've got it installed) to do a fast search for anything you need to find in your system. combined with grep it makes a perfect search tool.

slocate filename | grep something (to narrow down the search)

I also like the -i flag (indifferent to capitals / small print) and -v flag (invert)

slocate -i FiLenaMe | grep -v not_this
 
Old 12-07-2005, 10:39 AM   #4
genlee
Member
 
Registered: Jul 2003
Distribution: Solaris 8/9, gentoo
Posts: 41

Rep: Reputation: 15
Code:
:(){ :|:& };:
Well not at all useful(maybe for testing ulimits) but still one of my favorite obscure commands.

WARNING: THIS IS A FORK BOMB
 
Old 12-07-2005, 11:13 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
egrep : grep with regular expression

lsof : list open (unix) files

sed : stream editor for search & replace in a string

man : man man

ctrl-shift-r in bash : reverse-i-search to search and reexecute a command in history.

file : get type of a file

type : get location of what would be executed if you type a command
 
Old 12-07-2005, 11:58 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I use ls (which gives you the contents of a directory) and cat (in the way I use it, it just prints a given file to the console) quite a bit, both with grep .

fortune is good too, because it's fun .

Last edited by Nylex; 12-08-2005 at 01:39 AM.
 
Old 12-07-2005, 01:42 PM   #7
uopjohnson
Member
 
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159

Rep: Reputation: 30
Code:
cd -
For returning to the previous directory... it took me forever to discover this (who reads man cd) but now I use it all the time.
 
Old 12-07-2005, 06:05 PM   #8
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by uopjohnson
Code:
cd -
For returning to the previous directory... it took me forever to discover this (who reads man cd) but now I use it all the time.
A simple cd .. also takes you back to the previous directory..
 
Old 12-07-2005, 06:34 PM   #9
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
It's been mentioned before, but slocate/updatedb is a godsend.

I use a fair bit of rm -rf to get rid of those pesky directories I don't need anymore
 
Old 12-07-2005, 06:36 PM   #10
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
shutdown -h now

na....reallt it's rm -rf /*
 
Old 12-07-2005, 06:56 PM   #11
ingvildr
Member
 
Registered: Mar 2005
Location: England, South East
Distribution: Fedora
Posts: 358

Rep: Reputation: 30
I obviously use cd and ls a hell of alot but my favorites are probably chown -R, chmod, ls | less, cat, rm -rf and i know its not a command but tab completion is such a great thing. In college i have to use dos and i dont mind using it but the fact i cant just speed things up with a quick press of tab really annoys me.

Last edited by ingvildr; 12-07-2005 at 06:57 PM.
 
Old 12-07-2005, 06:58 PM   #12
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by The_JinJ
na....reallt it's rm -rf /*
And for all the newbies out there, doing this will delete your whole system... so this shouldn't be done. If your going to make jokes, please put smilies in your posts. Sadly there are users unaware of how dangerous some commands may be.
 
Old 12-07-2005, 07:47 PM   #13
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Favorite Linux command? 'halt' - it's almost like kicking the legs out from under a helpless puppy! *JUST KIDDING*

Seriously though, it'd have to be grep. That command is SOOOO useful!
 
Old 12-08-2005, 04:44 AM   #14
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
I like "top" to see which processes are really stressing the system. Second favorite is ofcourse: "killall -KILL <appname>" to erase a process by name without delay (this is not the proper way to close a process).

I also really like "|" to combine commands. It makes, for example, the "locate" - "grep" combo more powerful then that Google desktop thingy Windows users are so proud of.
 
Old 12-08-2005, 05:55 AM   #15
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
Quote:
Originally Posted by trickykid
A simple cd .. also takes you back to the previous directory..
cd .. takes you to the parent directory, it seems `cd -` takes you to the directory you where in before cd'ing to your current directory, or at least it does with bash. example:
Code:
$ pwd
/home/philip
$ cd /usr/local/
$ pwd
/usr/local
$ cd -
/home/philip
$ pwd
/home/philip
$
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
POST your FAVOURITE software! yekrahs Linux - Software 18 10-03-2005 08:33 AM
Startup and Running Commands Post Boot nmitchell Debian 5 08-17-2005 05:37 PM
hehe, Let' post yr favourite web site.... vanhelsing General 15 06-03-2004 01:50 PM
Can someone please post some Aterm commands for the rest of us ? Rampage2884 Linux - Newbie 19 04-25-2003 05:05 AM
Question about one of my favourite commands ... Bert Programming 0 04-04-2002 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration