Laman

Tuesday, November 22, 2011

GUIDE: SSH Basic Command


I have had people asking me about SSH commands, and the basic commands, to at least get them going.
The list below is not meant to be a complete SSH guide, but more so a list of some of the basic commands and what they do, as well as the proper formatting for the command.
I’ll start with what I think is the most basic, and work my way up.

Command: cd
Format: cd /directory/you/want/to/go/to
This command is the most basic, and widely used.  The cd command is used to move to the directory you specify.

Command: cp
Format: cp /directory/you/want/to/copy /directory/where/you/want/to/copy/to
The cp command will copy the file or folder you specify in the first portion, to the location you specify in the second portion.


Command: mkdir
Format: mkdir /directory/you/want/to/create
mkdir creates the directory or folder you specify



Command: rmdir
Format: rmdir /directory/you/want/to/delete
The rmdir command deletes the directory or folder you specify.


Command: mv
Format: mv /directory/you/want/to/rename/or/move /new/directory/name/or/location
The mv command will rename or move the file stated in the first portion to the name or location stated in the second portion.


Command: rm
Format: rm filename.pl
The rm command will move the file specified.


Command: tar cvf
Format: tar cvf filename.tar.gz /directory/you/wish/to/archive
This command will tar zip the files in the directory specified in the second portion into a tar file specified in the first portion.


Command: tar -xvf
Format: tar -xvf filename.tar.gz
The tar -xvf will extract all files from the tarball specified into the directory you are currently in.


Command: zip
Format: zip yourfile.zip /file/or/folder/you/want/to/zip
This will create a zip file, with the name specified in the first portion from the file or directory listed in the second portion.


Command: unzip
Format: unzip yourfile.zip
This command will unzip or un pack the named zip file, into the directory you’re currently in.


Command: Ls
Format: Ls /directory/you/wish/to/list/files/
The Ls command lists files, and folders within the directory you specify


Command: Ls -f
Format: Ls -f /directory/you/wish/to/list/files/
This will add a forward slash to the directory names within the directory you specify


Command: Ls -a
Format: Ls -a /directory/you/wish/to/list/files/
This will show “hidden” files in the directory you specify


Command: Ls -l
Format: Ls -l /directory/you/wish/to/list/files/
This command shows detailed info about each file in the directory you specify.

1 comment:

Anonymous said...

wuih,,
mudeng banget gue soal kyk ginian,,, :p

Post a Comment