Help in using Ubuntu Terminal Console


Remote connection

To ssh to another Lunix terminal, use this command:

ssh username@host -p port

The default SSH port is 21, but you could change it to anything, i.e. 9100

Remote teminal will prompt for your password, and job done.


File/Folder functions

cp – Copy file

cp /usr/bin/file /tmp/location

mkdir – Create directory/folder

mkdir /home/chris/newfolder

rm – Delete files in folder

rm -rf /home/chris/foldertoremove

The -rf tells Linux to remove files in the folder. This will remove all files and sub folders though, so be careful. There is no undelete.

mv – Rename a file, or move a file

mv /home/chris/index.htm /home/chris/home.htm
mv /home/chris/index.htm /home/chris/site/index.htm

The first command will rename a file, and the second will move it (effectively renaming it into another directory)

pwd – see what folder you are in

pwd
/home/chris/Desktop

 

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.