Linux Basics
Commands
Sometime if you get stuck in the Linux Command Line and you have no idea what to do, these are some common and useful commands to help.
Startx - That starts the display server. Usually KDE or gnome.
cd is used to ChangeDirectory.
cd / will go all the way to the root directory
cd .. will go up a dir level (example: /home/username changes to /home)
cd ~ will go to the home dir of the user that you are logged in as.
ls - Stands for List Short and lists all the files and directories in a directory
ll - Stands for List Long and lists all the files and directories in a directory with the read/write permissions, file sizes, and dates
pwd - You might have seen pwd before durning a FTP session, It means PrintWorkingDirectory. Basically if you're in you home directory(/home/username) and you type pwd it would tell you /home/username.
cp is used to copy a file. Used like cp thisfile /home/username that will copy thisfile to your /home/username dir.
mv is the move command (Example: mv thisfile /home/thisfile that would move thisfile to /home/thisfile)
mv can also be used to rename files in the same step, mv thisfile /home/newfile moves thisfile to the /home directory and also changes the name to newfile.
rm is used to remove a file. Used like rm /home/username/deletethis then it will ask are you sure you want to remove this file? Typeing y will tell it yes I want to remove it.
mkdir is the command used to make a directory. Just type mkdir dirname and a subdirectory will be created called dirname
ln - ln is like making a short cut in windows. ln -s thisfile /home/thatfile now if you try to edit /home/thatfile it will open thisfile.
Editing Files
Sometime soon you're going to want to edit something, I would suggest using the VIM editor, More commonly called vi.
To get started with it either know where your file is and type vi /home/username/editme it will open the file to edit. Some commands are:
:q - To quit
:q! - To quit without saving.
:wq - That will write(save) to the file and then quit
:w - Will just save the file and you can continue working on it.
Pressing i will let you begin to edit the file.
After editing the file you will need to press Esc to start to enter a command like :wq to save and exit.
Shutting Down and Rebooting
To shutdown you type in the command shutdown -h now, the h stands for halt which is stop and now tells it to do it now, After you learn some more of host a server that people can login to you might need to know to tell it to shutdown at a certian time.
To Reboot you type shutdown -r now Im sure you can see the difference and guess at what the -r stands for.
Well that should be all you need to know for now, Ill write some more at a later time&date.
- author ChoaticWhisper
|