Linux CLI Basics

Accessing Linux CLI via SSH

To access Linux or FreeBSD command line interface you can use SSH (secure shell) protocol. There are many software clients which can be used to access SSH. Most popular is Putty. Donwload here . If you are on Windows, just download putty.exe and run it without installation.

  1. Enter your server IP address in "Host Name (or IP address) field"
  1. Check the Port. default is 22
  1. Click "Open"

The key confirmation window will appear. If you are using public PC, do not save the key, only accept once. If you are using safe PC, you can save the key to avoid this message appearing again at each connection.

Enter password when prompted.

The shell will appear with prompt similar like this:

Last login: Fri Mar 11 12:55:23 2011 from

Basic Commands

In Linux shell commands are entered one by one. You need to press "enter" after each command. Usually, if the command is successful, there may be nothing displayed, but the prompt for next command.

List of common commands:

list all files and subdirectories in current directory
cd <directory>
change to directory named <directory>
print the name of current directory
cp <oldfile> <newfile>
copy <oldfile> to <newfile>
rm <file>
delete (remove) file. The operation is not reversible!
exit from CLI (also closes SSH connection)

Editing files

There are several text editors available in most Linux environments. Easy to use editor for beginners is "nano". For example, if you need to edit file named file.txt, then type:

nano file.txt

editor screen will open. Below the editscreen are list of available commands. They are executed by holding <Ctrl> key. Useful commands:

save changes after editing
quit editor
get help

Last modified 7 years ago Last modified on Mar 11, 2011, 4:30:46 PM

Attachments (1)

Download all attachments as: .zip