57 Comments
- nousplacidus, on 11/26/2007, -4/+35Ahh the command line, so much more efficient than a mouse, and yet so underused.
- tightscrummy, on 11/26/2007, -1/+21And that's why you'll always be a ditch digger.
- realityiswhere, on 11/26/2007, -1/+20Former MS Employee telling you: I saw what was coming, and bailed. Linux is the future, and your DRM-addled, home-calling, crippled but beloved OS is not going to survive, whether it be to Mac, or to Linux, I don't really care. Oh, and sorry, I can't come over to your house and fix your computer :(
- vade79, on 11/26/2007, -1/+18While somewhat on the subject of bash, here's one of the most useful bash commands: "cd -", goes to the previous directory hit it twice to go back where you were....so simple and nice when moving around. (just mentioning it because when I do it I get 'wtf?'s, spreading the word)
- rmetzger, on 11/26/2007, -0/+13How about the ! ... if you type "!ps" it would run the ps command the way you ran it before. saves having to type out "ps -ax | grep abc" or w/e. works with every comand i think. or if you forget to type sudo before a comand just type "sudo !!" and it will run your last command with sudo.
- bruenig, on 11/26/2007, -1/+12Depends on what you are defining default as. /bin/sh is linked to /bin/dash, but when you open a terminal emulator, you get bash.
- oobuntu, on 11/26/2007, -2/+12good stuff - can we have more of this please?
- skyshock1, on 11/26/2007, -1/+11Use Screen. Live it, love it.
- bruenig, on 11/26/2007, -0/+9bourne again shell
Special codes is a funny phrase. If you prefer inefficiency you can get that on both windows and linux though. Your choice. If you want efficiency though, knowing some shell will get you there. Question I guess is whether you value your time or not. If not, click away. - dvdrtrgn, on 11/26/2007, -0/+9bash is also the default shell in Mac OSX... I think the switch over from tcsh happened in Panther 10.3ish?
- RSS14, on 11/26/2007, -2/+9I thought this was going to be an article about winning arguments lol
- piiscool, on 11/26/2007, -0/+6Favorite bash shortcuts:
#foo !$ -> !$ is the shell variable for the last word of the last command
eg, I can type
# ping 10.10.1.1
# telnet !$
and telnet to 10.10.1.1
Also, !! is the var for the whole line, so next time you forget sudo, just do:
# sudo !! - td4guy, on 11/26/2007, -12/+18http://bash.org/?801477
(idestroy) sigh
(idestroy) ok so
(idestroy) my friend got a handle of smirnoff vodka
(idestroy) we killed it together in like an hour
(idestroy) I went to bed
(idestroy) in boxers
(idestroy) apparently
(idestroy) I woke up and had to poo
(idestroy) instead of going to my bathroom
(idestroy) I went out into the hallway
(idestroy) into the stairwell
(idestroy) removed my boxers and placed them on the stairs
(idestroy) then took a massive liquidy ***** at the top of the steps
(idestroy) walked THROUGH it
(idestroy) leaving poopy footprints
(idestroy) left my boxers there
(idestroy) went DOWN TO THE 2nd FLOOR
(idestroy) from the third
(idestroy) banged on random people's doors
(idestroy) people came out and saw me walking down the hall naked with ***** on my ass
(idestroy) I made it to the stairs again
(idestroy) went back to my floor but down a few doors to my friends
(idestroy) there was like 15 people in their room
(idestroy) it was packed
(idestroy) I was naked
(idestroy) I went into their bathroom
(idestroy) and everyone was like what the *****
(idestroy) went into the toilet stall, tried to clean my ass
(idestroy) FELL OVER AND SMEARED ***** ON THEIR WALL
(idestroy) meanwhile someone went back to my room and got my clothes
(idestroy) and someone else found the poo
(idestroy) they brought my clothes over
(idestroy) I tried to put my shirt on my legs
(idestroy) and said THESE ARENT MY PANTS
(idestroy) so I got help with that
(idestroy) got walked back to my room
(idestroy) and went back to sleep
(idestroy) woke up the next day
(idestroy) thought it was a dream
(idestroy) called my friend paul
(idestroy) he told me all about it
(idestroy) :(
(ZS) note to self: never let idestroy have alcohol
(idestroy) there's a facebook group "who pooped on the stairs" - oobuntu, on 11/26/2007, -0/+5Actually, my colleague does a lot of bash kung-fu that i'm afraid to ask. usually they are stuff like ctrl-R emacs shortcut for searching in history. if you have someone looking over your shoulder, they won't have a clue what's going on , because the keystrokes aren't printed on the screen.
stuff like use of the ^ character to replace things in the previous line, and commands like diff config.txt{,.bak} are cool too. - BassJunkie, on 11/26/2007, -0/+4If the command line is so "awkward" explain how it can magically install a ton of programs from a single line? The only limit is usually myself as I try to remember all the apps I want to get installed, usually around 10-15 for a fresh install and it deals with the dependencies to! Got more then one app to install on windows, guess you'll have to sit there swapping CD's over or implement some sort of SMS system!
Linux does plenty of "useful" things practically from the start (like work without needing to download countless drivers!). Most everyday tasks that you need to perform can be done via the GUI but once you start learning small bits of bash and use the CLI it becomes second nature to launch a terminal for certain tasks, since switching to linux and especially since installing an Ubuntu base system without a GUI I have found myself using the CLI for more and more everyday tasks such as file copying, especially when you can get some excellent file managers such as Midnight Commander that run in a terminal window but have more of a GUI like interface (in fact some new GUI file managers still use the 2 pane Midnight Commander interface to great success) - macoafi, on 11/26/2007, -1/+5You don't have to use it if you don't want to. My family sure as hell never uses the command line, but they use Linux every day. I love the command line, though.
- sunshinex, on 11/26/2007, -0/+4Maybe by users, but most pros live in command line worlds.
- oobuntu, on 11/26/2007, -0/+4put a :p on the end in case the last command is something dangerous.
!rm:p will show the last command starting with rm without actually running it. - dvdrtrgn, on 11/26/2007, -0/+3ummm, that... is... Gold! GOLD, Jerry! (^u^) thx
- inactive, on 11/26/2007, -2/+5Admit it. You have a Linux box in your basement and you think it's slicker than a greased pig on a hot summer day.
- thushan, on 11/26/2007, -0/+3dont knock something so powerful like bash. I was *once* a anti-Linux tool. After you see how much power you get with the CLI you realise just how much you've been missing out on.
All those little utilities (awk,grep,locate, tail etc etc) come together to help you with your daily bits and bobs.
I love being able to SSH into my linux box at home and get things done remotely. No VNC/RD required:-) - wedgemartin, on 11/26/2007, -0/+3A lot of good bash features were stolen from csh, though i've converted to bash and am happy with it. Primarily, because like korn shell, you can do 'set -o vi' to have a very functional 'vi' editor on the command line.
One of the useful csh features in bash is the '^'... You can do easy substitution on commands in previous lines with ^pat^newpat - macoafi, on 11/26/2007, -0/+3Nice!
There's also !! which runs the last command again. If you forget to sudo something, you can just type "sudo !!" to re-run it with sudo - richbradshaw, on 11/26/2007, -0/+3I'll add any suggestions as they come!
Try looking at the options that shopt has, if you run shopt -p , then it gives you a list of parameters that you can set, just have a play around! - BassJunkie, on 11/26/2007, -0/+2Actually I find Bash's tab completion rather annoying, if you have more then one option it just display them and won't complete until you type in enough unique letters to narrow it down to one option. I started using Zsh a while back now and have never looked back. Once you get a decent config file (google .zshrc for loads of examples) your set and get much better tab completion i.e it will bring up each match regardless of how many letters you type.
- init100, on 11/27/2007, -0/+2You mean like the Windows command prompt? It cycles through each available completion each time you press TAB. This is extremely annoying. What if I want to see all possible completions so that I can choose one myself, instead of cycling through a hundred completions that I don't care about?
- cawpin, on 11/26/2007, -0/+2Yes, I just ran into that problem yesterday in fact. I was working on an iBook that was UPGRADED to 10.3 and, as such, the default shell didn't get changed from the default of 10.2, tcsh. As I haven't ever used tcsh, or even heard of it for that matter, it was quite confounding for a few moments when curl wouldn't work. I changed the default to bash and everything worked as expected.
- tech42er, on 11/28/2007, -0/+2***** off, prick.
- init100, on 11/27/2007, -0/+2"this is reason number 8-bajillion linux will never take over windows."
In other news, Microsoft just implemented a vastly expanded command line shell, called Microsoft PowerShell, since availability of a powerful shell had been sorely lacking on Windows. If command lines are so backward and arcane, why did Microsoft (which you seem to hold in a high regard) just implement one themselves? - p0ltergeist, on 11/26/2007, -0/+2I don't understand, but I just had to digg this up.
- blkhwk86, on 11/26/2007, -0/+2bash is amazing once you get to know everything. I have a prof who wrote a great tutorial on shell scripting and unix commands. Well, he wasn't a professor because he said he was too lazy to write his dissertation. I now go back to his lower div class web pages and take everything off them because they're still useful.
/Reason I stayed CS was this lecturer who taught well.
//Graduating in June after 4 loooonnngggg years - ostracize, on 11/26/2007, -0/+2! is the history expansion operator.
if I type:
# command-name
...
# !comm
It will automatically detect that command-name is the most recent match in my history so it will run that. - bruenig, on 11/26/2007, -0/+2You don't have to do this though which is why his point fails. You can be just as point and clicky and time wasting on linux as you can on windows if that's what you want.
- macoafi, on 11/26/2007, -1/+2You don't have to use it if you don't want to. My family sure as hell never uses the command line, but they use Linux every day. I love the command line, though.
- tech42er, on 11/28/2007, -0/+1Bash is an amazingly useful shell.
- grenden, on 11/26/2007, -0/+1Reminds me of TuckerMax.com
- crownrai, on 11/27/2007, -0/+1In bash, dbl-tap the TAB key. It will show you a list of all possible matches. Works on directory listings and on programs in your path as well.
- grenden, on 11/26/2007, -2/+3Hmmm...when I saw this in the top 10 list on the front page, I thought I was going to see something about bash.org...was I the only one? (besides td4guy)
- tech42er, on 11/28/2007, -0/+1rmetzger just said the exact same thing regarding 'sudo !!'. And oobuntu, thanks for the tip.
- tech42er, on 11/28/2007, -0/+1Stolen or borrowed?
- whodathunk, on 11/26/2007, -0/+1while :; do date ; sleep 1 ; done
- tech42er, on 11/28/2007, -0/+1It's not necessary to use the commandline, but the commandline is faster and much more powerful than the GUI.
- qwuinc, on 12/01/2007, -0/+1Neat, I use pushd/popd sometimes, but never learned that one :-)
- LargeTrout, on 11/26/2007, -1/+1You sound pretty bitter. Did Ballmer throw a chair at you too when you left? The guy you're replying to actually has a point. The average computer user doesn't want to have to figure out tonnes of esoteric commands. This is why Windows is ideal for the average home user. Yes, it's got issues; but so does every OS. Linux has very little mainstream commercial support in regards to software/games and you really need to be technically adept in order to do a lot of stuff on Linux (installing drivers for example, or getting an iPod working on some distros). I used to be a Linux fanboy but basically drifted for the reasons CJChesterson states. It was agony getting anything to work and I had to spend hours searching websites and forums. Windows works for me and does what I need it to.
- bettermentflux, on 11/26/2007, -2/+1Such as...?
- Thomaschaaf, on 11/26/2007, -2/+1Powershell!
- r0b1, on 11/26/2007, -3/+1Best thing about bash? Tab completion. Other than that, it's just like any other shell.
- stonedgeek, on 11/27/2007, -4/+1Ahh the command line. Holding back the linux desktop for everyday users for 16 years.
- MortalynFlux, on 11/26/2007, -6/+0I clicked on it thinking it was Bar Tips & Tricks. Darn. Anyone have a link to that article? I'm looking to impress this hot waitress at Dino's.
-
Show 51 - 54 of 54 discussions



What is Digg?