Linux VPS tutorial for windows user!

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
I am making this thread so that i can get a quick access to all those commands which i have learned by searching over internet. If you have some more or similar commands then post it here. but please keep it simple. don't go too advance. I am a novice! :p

assume that the directory names are dir1, dir2 .......

To create a directory: mkdir dir1

To change directory: cd dir1

To go back in previous directory: cd ..

To remove an empty directory: rmdir dir1

To remove a non empty directory: rmdir -rf dir1

Copying directory or file: cp dir1 dir2

Renaming directory or file: mv dir1 dir2

If you like this simple tutorial please visit http://www.chatindia.co.in . The link is in my signature.

Don't forget to correct and add some more commands.


---------- Post added 06-19-2011 at 08:17 AM ---------- Previous post was 06-18-2011 at 11:35 PM ----------

Suppose you want to unzip document.zip in the same directory
unzip document.zip

Suppose you want to unzip document.zip in different directory new whose location is /home/new

unzip document.zip -d /home/new

To edit a file

nano filename


If you like this simple tutorial please visit http://www.chatindia.co.in . The link is in my signature.

Don't forget to correct and add some more commands.
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Instead of using rmdir, just use rm with the rf flags.

rm -rf file/directory

(f is forceful, r is recursive)

Also: There are already lists like this around, and they cover a lot more - but this is a good start.

http://ss64.com/bash/
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
Instead of using rmdir, just use rm with the rf flags.

rm -rf file/directory

(f is forceful, r is recursive)

Also: There are already lists like this around, and they cover a lot more - but this is a good start.

http://ss64.com/bash/

I read and used that command as well but i forgot at the time or writing cause i have not written it anywhere. Thanks for sharing.

and i want to proceed slowly with only those commands which are mostly used. don't wanna bug my head with commands which are only used by experts.

---------- Post added at 09:07 AM ---------- Previous post was at 09:06 AM ----------

edited!!!
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
nano is a good lightweight editor that comes default with most (all?) VPS templates here that's reasonably easy to understand. To edit a file, type "nano filename", then move around the cursor and type. Save is Ctrl-O and exit/quit is Ctrl-X, as is shown in the help text at the bottom

Also worth mentioning is the -h flag (e.g. rm -h or cp -h) to show concise help, or man (man cp, man somecommand) to show advanced help for commands.
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
I was about to post "nano" in my next post. :) and you posted it. its a nice coincidence. :)

I need somebody to post about chmod. and how to move the entire directory along with its subdirectory from one location to another. if you know please post it.

Edit: added to the first post!
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
file: chmod (value)/+x file

folder: chmod (value)/+x -R folder/

example:

chmod 644 index.php

chmod +x shell.sh

chmod 644 -R folder/


(You might want to look at chown too)

Moving an entire directory (recursive move):

mv -R folder/ newlocation/
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
chmod

file: chmod (value)/+x file

folder: chmod (value)/+x -R folder/

example:

chmod 644 index.php

chmod +x shell.sh

chmod 644 -R folder/


(You might want to look at chown too)

Moving an entire directory (recursive move):

mv -R folder/ newlocation/

Thanks!

I found some more commands.

To check free memory

free -m

In order to see where all your memory is going

ps aux
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
how to untar

tar -zxvf yourfile.tar.gz
 
Top