Unix tip

Discussion in 'General Software' started by hyper_raider, Dec 31, 2006.

  1. hyper_raider

    hyper_raider shutdown -h now

    Here is a good tip i learned a couple of days ago. If you are in the command line and you are using the command less like this

    Code:
    less <filename> 
    It will print out the content of the file on to the screen but if you hit 'v' it will bring you to your favorite editor so that you can edit your file

    :mrgreen:
     
  2. djspinnet

    djspinnet Newbie

    Ouh.

    When I saw the title I was expecting something more than just less or more.. thought those were rudimentary commands.

    Then again, apart from maybe Ken, who's actually gonna appreciate it in ARP? 99.95% of users here are pure Windoze users :D

    That said, I don't mind giving ARP-ians who are interested, a crash course in UNIX. Serious :D
     
  3. hyper_raider

    hyper_raider shutdown -h now

    Start with simple tips first and then go on to harder ones :)
     
  4. djspinnet

    djspinnet Newbie

    Oh? Simple?

    Here's a tip for the simplest command ever... ls.

    ls -lS. Sort by filesize and in long format. 9/10 people who use UNIX on a regular basis that I know don't even know what -S is for. most common are -a, -l, -F, -h, -o. In fact, I have ll aliased to ls -lahoF :)
     
  5. belikethat

    belikethat Just Started

    thanks.......
     
  6. peaz

    peaz ARP Webmaster Staff Member

    I'm sure there are more linux users here who read Tech ARP than you think :):beer:
     
  7. djspinnet

    djspinnet Newbie

    Well, that was based on my judgement from the responses I got from my UNIX article last time. Things may have changed and some people may have tried Linux after that (if yes, hallelujah! :D)

    But from my observation of the active forumers, not really :)

    Say, Ken. I remember owing ARP a Part II to that UNIX article.. you guys still want it? I might be able to squeeze some time to write it over the next few weeks. I remember it was supposed to be on simple and (power) text manipulation/editing in Linux.. stuff like vi/vim, emacs, and filters and stream editors..
     
  8. peaz

    peaz ARP Webmaster Staff Member

    Sure why not :) I've always have problem remembering how to work around the commands of VI
     
  9. djspinnet

    djspinnet Newbie

    Hmmm... you using vi or vim?

    :D

    vi makes me want to pull my hair off. vim is still my favourite text editor until today, although TextMate (Mac only) is able to do most things that vim can do.

    You'll be amazed at the things vim can do..
     
  10. fyire

    fyire Newbie

    Well, the problems with remembering the vi commands tends to decrease the more often you make use of it.

    Thing is, despite how arcane vi can seem to be, one has got to admire the design of the thing too, considering how it had stood the test of time. You will not find a better editor to be used in situations where resources, especially bandwidth is limited, such as the situation now.

    One useful thing to remember when trying to decipher the arcaneness of vi is the layout of the usual qwerty keyboard too. the vi editor commands allows those commands to be entered with minimal movement of the hands.
     
  11. hyper_raider

    hyper_raider shutdown -h now

  12. djspinnet

    djspinnet Newbie

    Hmm, Ken, if you've noticed, the commands are linked closely to the command letter itself,

    for example,

    dd - delete
    p - paste
    g - go to line

    ...

    and so forth.

    Here's a better formatted document of common vi/vim commands
     

    Attached Files:

  13. Adrian Wong

    Adrian Wong Da Boss Staff Member

    If you ask me, the trouble with the lack of acceptance of any platform is really not so much about whether the platform is good or bad. Rather, it's the lack of coverage on it, and the lack of evangelists preaching its virtues.

    No matter how good Linux or UNIX is, unless people can see just how easy it is, why should they try it? People don't like the unknown. It frightens them. :mrgreen:

    So, if we want to spread word about Linux or UNIX, it might start with articles.. guides.. that show people how easy it is to start using them. I don't think newbies would really migrate to a new platform simply because it's less vulnerable to viruses, crashes, etc. Like every human being, they just want to take the easiest path. :mrgreen:

    If you ask me, we should come up with articles and guides like...

    1. [OS] Installation Guide
    2. [OS] Tweaking Guide
    3. [OS] Hints & Tips Guide

    Preferably all these guides should have plenty of screenshots and pictures.
     
  14. fyire

    fyire Newbie

    Something interesting for a thought too. Newbies to computers can actually handle linux better than those who've used computers for a few years :p

    And I'm not kidding here. When I first got my parents their first iBook, I tried a little experiment. I dumped in Linux first and used a rather minimal Windowmaker WM, and my mum had far less grumbles compared to when she was using Windows XP for the 6 months before that.

    But of mileage may vary too, depending on what the needs are.
     
  15. zy

    zy zynine.com Staff Member

    it depends on what you are doing :haha:
     
  16. fyire

    fyire Newbie

    Well, yeah, that's what I said. Anyways my point is in that most migration issues lies in the difficulty in adjusting to a differing way of doing things.
     
  17. hyper_raider

    hyper_raider shutdown -h now

    Actually not all vim commands are intuitive, example:

    ZZ - Save and close
    zf - create fold
    zc - close fold

    But i still like it :)
     
  18. belikethat

    belikethat Just Started

    i hate vim
    i use notepad ++ and than convert to unix format :p
    i know i am spoilt :p
     
  19. hyper_raider

    hyper_raider shutdown -h now

    Kids and your crazy editors :p
     

Share This Page