Playing with Debian

Wednesday, 13th February 2008 at 12:50pm

Some simple commands for Debian

I thought I should make a post so that I have something to check back to when I've forgotten some commands for stuff. Everything here is pretty basic, really and you should make an effort to remember them.

These commands are all case sensitive, as far as I've worked out.

cd – this changes the directory you're in. If you're logged in as your user (which you should be) then just typing the command will take you back to your home directory. At the moment that will be pretty empty. If you put a directory as a parameter after you write "cd", you'll go to that directory. For example, if you type "cd /etc/" you'll get taken to the /etc/ directory.

Terminology note for Windows users: Stop calling them "folders". You'll get laughed at. They're "directories" on Linux.

ls – (that's "L", but lower case, of course) this outputs all the things that are in the directory you're in. It doesn't output them very pretty, so instead you can do "ls -lh" and that will output the same thing, but each file is on its own line and you'll get some data about it. If you want to check what's in a directory you're not currently in, you can just add the directory path at the end.

su – sometimes you'll be in a situation where you need to be logged in as root. But I've already told you not to be in root all the time, and you should stick with that. "su" stands for "switch user". Just typing that command on its own will allow you to act as root for a little while. You'll be requested for root's password though. You can switch to other user's too, by putting their username after the command.

Remember, when you've finished, come back out of root by typing "exit".

nano – the default text editor on Debian (etch at least) is "nano". You can get to it by typing "nano", and you'll have a blank text editor. It's pretty low feature so don't expect to be cutting and pasting a lot at the moment. You can edit a file by putting its path after the command.

Don't go editing  things you don't understand though!

I'll add more later, but for now I've been using that linux help site I linked to earlier.

Comments

Your name: Your URL:

Body:

User comments

Andrew McKay says:

You should find yourself a good resource on vi and become one with it. All self-respecting *n*x people know how to use and some will use it in preference to others. It's hideous, it's arcane and it makes no sense but at some point you could easily find yourself logged in to a box which has no other text editor and have to make changes.

I never learnt how to use it but if I was ever serious on thinking of getting a job where *n*x would be used then I'd do so.

Also...instead of typing 'exit' when you want to get out of 'su' you can just hit ctrl-d and it logs you out and back to your normal user. Hit ctrl-d again and it will close PuTTY.

Read some previous entries