Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

Github - Classroom - and - Linux - Commands

This document provides instructions on basic Linux commands for navigating directories, manipulating files and permissions. It explains commands like ls, cd, cp, rm, mv, mkdir, cat, zip, unzip, ssh, scp and chmod. An exercise is included to practice using these commands to create, move and modify files and directories.

Uploaded by

hi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Github - Classroom - and - Linux - Commands

This document provides instructions on basic Linux commands for navigating directories, manipulating files and permissions. It explains commands like ls, cd, cp, rm, mv, mkdir, cat, zip, unzip, ssh, scp and chmod. An exercise is included to practice using these commands to create, move and modify files and directories.

Uploaded by

hi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Hacettepe University

Computer Engineering Department

Using
BBM103 Introduction to Programming Lab 1

Fall 2018
Signing Up to GitHub Classroom
Signing Up to GitHub Classroom

Fill textboxes and click sign in


button to authorize

Click to sign up unless you have an educational account


Signing Up to GitHub Classroom

You MUST create


your account with
your IDs beginning
with ‘b’.
Signing Up to GitHub Classroom

There are two


options. We
recommend that
you choose the 1st
option unless you
need a private
repository.
Signing Up to GitHub Classroom

Open your mailbox to


verify your github
account.
Signing Up to GitHub Classroom

Click the link provided within the mail content


Signing Up to GitHub Classroom
Signing Up to GitHub Classroom
Joining BBM103 Classroom

Now authorize github


account.
Joining BBM103 Classroom

Assignment title

You should accept the assignment activated to


push(submit) your works
Joining BBM103 Classroom
Joining BBM103 Classroom
Hacettepe University
Computer Engineering Department

How to Use the


Linux Command Line
BBM103 Introduction to Programming Lab I

Fall 2018
The Shell & Terminal

• The Shell is a program that takes commands from the keyboard and
gives them to the operating system to perform.

• Terminal Emulator is a program that opens a window and lets you


interact with the shell.
Basic Commands

• When you open a terminal emulator, by default you are in the home directory of
the logged in user.

• You will see the name of the logged in user


followed by the hostname.

• $ means you are logged in as a regular user


• # means you are logged in as root.
pwd
• pwd prints the full path of your current working directory.
ls, ll
• You can list all directories and files inside the current directory by using the ls (or
ls -l; ll for listings including information such as the owner, size, date last modified
and permissions) command.
cd
• The cd command is used to change the current directory.

• To change to the parent of the current directory use cd ..

• To return directly to the home directory use a tilde as the argument:


Manipulating Files
•cp - copy files and directories
•rm - remove files and directories
•mv - move or rename files and directories
•mkdir - create directories
•cat - create new file, concatenate files

10/19/2018
cp
• cp copies files and directories. In its simplest form, it copies a single file:
cp (cont.)
• You can specify the full path to where you want to copy your file:
rm
If you want to delete any file or directory the command is 'rm' (for
files) and 'rm -r' (for directories).
mv
• mv command moves or renames files and directories depending
on how it is used.
mkdir
• If you want to create new directories the command is mkdir.

10/19/2018
cat
cat stands for Concatenate (birleştirmek). It is used to create new file (with or
without content), concatenate files and display the output of files on the standard
output.
zip & unzip
• zip and unzip commands create and extract zip archive files respectively.
• The * character serves as a "wild card" for filename expansion. By itself,
it matches every filename in a given directory.
• Most executable programs intended for command line use provide a
formal piece of documentation called a manual or man page. A
special paging program called man is used to view them.
ssh
• ssh (Secure Shell client) is a program for logging into a remote
machine and for executing commands on a remote machine.
scp
• scp allows files to be copied to, from, or between different hosts. It uses ssh for
data transfer and provides the same authentication and same level of security
as ssh.

A simple example that illustrates how to send a file to dev space.

scp <localfile> <username>@dev.cs.hacettepe.edu.tr:/home/ogr/b****/<directory>


About chmod
• chmod is used to change the permissions of files or directories.
• Example: chmod 777 myFile
# Permission rwx
read, write and
7 rwx
execute
6 read and write rw-
5 read and execute r-x
4 read only r--
3 write and execute -wx
2 write only -w-
1 execute only --x
0 none ---
Exercise
• All tasks must be performed using linux commands:
1) Make a new directory named playing_with_linux_cmd
2) Change your current working directory to the newly created one.
3) List the contents of this directory to see that it is empty.
4) Create a new text file jibberish.txt and write something funny in it before closing it.
5) Create another new text file README.txt and write your life motto in it.
6) Copy jibberish.txt into a text file named wise_sayings.txt
7) Delete jibberish.txt
8) Print out the content of wise_sayings.txt
9) Create a new directory named my_precious and move wise_sayings.txt into that newly created
directory. List the content of the current working directory to make sure that you have successfully moved the
file.
10) Change the permission of the file wise_sayings.txt to read, write and execute.
11) Change your working directory to the parent directory of playing_with_linux_cmd
12) Zip playing_with_linux_cmd as gameover.zip
13) Use scp command to copy this zipped folder from your local computer to your home directory on our remote
server dev.cs.hacettepe.edu.tr

You might also like