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.

4 Replies to “Linux tips”

  1. 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!

  2. 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.

  3. ‘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

Your email address will not be published. Required fields are marked *