Linux tips

Tips for me, that is.

Because Linux seems to love to be driven by uncooperative, fiddly commands with little sense towards what they’re used for, I figure I should write down any I learn.

sudo su - student
Will get me into the student account on WDM.

vi (filename)
When all you want is to edit the text and you can’t double click a file… Using it is another problem altogether though.

ssh (place) -X
Allows you to SSH into a machine with graphical stuff permitted. Not everything should be run through the terminal!

MORE!
wc -l
Counts the number of lines in a file. Counts empty lines too.

Need a command for saving only 10% of a file. I’m pretty sure Linux would have something like that.

sed -n '10p'
Displays the 10th line from the file.

This entry was posted on Wednesday, March 18th, 2009 at 4:49 pm and is filed under Academic. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  1. Mike
    3/19/09 @ 4:50 pm #
  2. Mike
    3/19/09 @ 5:12 pm #

    Ugh – maybe this’ll be helpful:

    ESC takes you to vi’s “console”

    To save w/o quitting: ESC then :w

    Save and quit: ESC then :wq

    Get the original file (since last save): ESC :e!

  3. Mike
    3/20/09 @ 2:38 pm #

    Forgive me, I’m going to use this as well..

    Press insert after a save to go back into editing mode. Press insert if editing stops working at any time.

  4. Sam
    5/4/09 @ 1:00 pm #

    ‘nohup nice ./run-cyc.sh &’ will get Cyc running on WDM

    ‘top’ shows the current processes running. Can kill a process by pressing ‘K’ (I think) and using 9 as the number.

Leave a Reply