Shell or SSH Commands and Beginner 101 Course
Using Shell or SSH connection to interact with your Linux server could be the most powerful tool you can have. This is because when you connect via this interface you are actually working from inside your server and this gives you more power and control over whatever you are doing.
To start off you need to contact your server provider and tell them that you want shell access enabled in your account. Some companies like goDaddy use telephone to confirm, others ask you to fax or email a copy of your drivers license. Most of them will have one way or another to do this.
After this you will need to get a telnet application like Putty which is Freeware by the way. Once you download this open it and enter your web address in the input box then click connect. It will ask you for your username and password, they are usually the same as your main hosting account credentials. After this you are good and it, very simple correct.
This interface looks like your regular MS-Dos Command Prompt, and don’t be scared it is very simple to use. Here is a list of commands to get you startes
- pwd
- Show you the directory you are in
- ls
- Shows you the files that are in your current directory
- ls -al
- Shows you all the files in the current directory with file permissions, sizeξmodificationξdate, owner and group names and name
- cd /directoryname
- Changes current folder to a new destination
- df
- Gives you a report of free space
- rm {file}
- Removes a File
- rmdir /directoryname
- Removes an empty Directory
- rm *
- Removes all non-protected files in your current directory
- rm -r
- Removes all non-protected files in your current directory and sub folders using recursion. Protected files will ask you for permission
- ftp {ftp address}
- Connect to an FTP server
- get {filename}
- Dowload a file from the ftp connection
- put {filename}
- Upload a file using the ftp connection
- cp {filename} {newdir}
- Copy a file into a new directory
- cp * {newdir}
- Copy all files from current directory into a new directory
- cp *.txt {newdir}
- Copy al .txt files into a new directory
- vi {filename}
- Opens the basic text editor and opens the file
- mv {filename} {newdirectory}
- Moves the file(s) to a new directory
- mkdir {newdirectory}
- Creates a new folder or directory
- mkdir -p {directory1}/{directory2}/{directory3}
- Creates multiple nested folders in one shot
- who
- Tells you who is connected to your server
- cat /proc/meminfo
- Shows your system’s available memory
- history
- This command will give you the last 10 commands you entered
This is just a list to get you started. Shell access is the only way that you will have complete control over what you and your applications are doing. You will be able to do much more from there so start geting used to it. There will be a series of tutorials that I will create about using the Shell Command Line so come back to check on us, my next Shell entry will be a tutorial in how to transfer files the right way, and without even using yourξbandwidth.
Please leave any comments or questions below.
Thank You,
Gilberto Cortez