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

Week 9 - CLI Linux

This document discusses accessing and using the command line interface in Linux. It explains how to open the terminal application, basic commands like cd, ls, and pwd, and provides examples of using commands like sudo, ifconfig, apt-get install, and chmod. The document also outlines exercises for students to complete involving creating directories, setting file permissions, and summarizing their results.

Uploaded by

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

Week 9 - CLI Linux

This document discusses accessing and using the command line interface in Linux. It explains how to open the terminal application, basic commands like cd, ls, and pwd, and provides examples of using commands like sudo, ifconfig, apt-get install, and chmod. The document also outlines exercises for students to complete involving creating directories, setting file permissions, and summarizing their results.

Uploaded by

victor chandra
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Operating System

Week 9 – LINUX - Command Line Interface

Program Studi Teknik Informatika


Fakultas Teknik – Universitas Surabaya
Outline
 Command Line Interface on Linux – Tools:
 Access Command Line Tools via Lubuntu Search Box
 Give Administration Access rights on the CLI
 General Command Line Syntax
 Command Line Exploration
Command Line Interface
• What is Command Line Interface?
– An interface on OS that is used to receive commands in a certain line.
– All OS, such as Windows, Linux, MAC-OS, etc., They definitely have this
feature

Do you still remember any command line on Windows OS?


Try to make a list of it!
How to Access Command Line Interface via
Lubuntu Search Box
• CLI (short for Command Line Interface) contained in LINUX, can be
accessed with the name "terminal“.
• How to find the "terminal". Here are the steps:
Lubuntu has the following interface.
1. Press the “windows” button on your
keyboard or press the Lubuntu logo
on the bottom left
2. Later ubuntu will issue a textfield
like a search field on windows
3. Type "terminal"Exit the terminal.

Similar to windows.
Search Box ubuntu
• You can search for anything
related to programs,
systems or files in the
search box such as user
controls, terminl, documents,
etc
CLI
• It says: “linux-dosen@linuxdosen....”
• What does that text mean?
– 'linux-dosen' is the name of the user who accesses the CLI.
– The username is related to access rights too.
– ‘linuxdosen-To-be-filled-by-……‘ is the name of the installed linux
computer/server

NOTES:
Even though there is only 1 user in a Linux OS, it doesn't
mean that when you open the CLI, you can install it directly.
There needs to be a special syntax to make the user as the
main administrator (in this case called root)
Basic Command (CLI) on Ubuntu
Linux Windows Penjelasan
sudo su Right click on CMD and Set a user a 'super user do' or 'root' or 'superadministrator' of the
sudo bash run as administrator ubuntu OS

ifconfig ipconfig Checking the IP addess of your PC/Device


cd cd Change directory, move form one particular/current
directory/folder
cd .. cd .. Go to up directory, go to parent-directory from current position
ls dir Displays the contents of the directory at the current position
pwd echo %cd% Prints the current working directory path, starting from the root
apt-get Download and double Download a specific package (installer) and then install it
install clicks
chmod Right click from To determine the permissions of a particular folder
{argument} directory, then change
permission
sudo su / sudo bash

The 'exit' syntax, the session as


'root' will automatically disappear
and return to normal user access
ifconfig
What is the IP address of the computer?
‘cd’ , ‘ls’ dan ‘pwd’

What does this error


mean?

What do these
color differences
mean?
Apt-get install
Get CONCLUSION from these case!

Why does the


case show a
failure in the 'apt-
get install'
syntax?

Why does the


case show
success in 'apt-
get install'
syntax?
Set proxy on terminal

Run the command line!


Set proxy on terminal
‘ls -l’ and ‘chmod’

1. The user wants to know the contents in the Desktop folder. Users use 'ls -l' to find out a comprehensive
description of the folder and files in it, including file permissions
2. Found a folder named 'test' which was created 12 April 2018 pk. 19.27 created by 'root' and updated by 'root'.
Have file permissions 'drwxr-xr-x'. What the code means can be seen in the explanation of file permissions
3. To change file permissions, the user uses the syntax 'chmod 777 test’
4. When to review uses 'ls -l' then the code changes to 'drwxrwxrwx'
‘ls -l’ and ‘chmod’

See examples.
desktop has the most different code. What do you think it means?
Folder and File Permission on Linux
Important ‘code’ that you need to know:
drwxrwxrwx
Divided to:

d rwx rwx rwx


Code Explanation:
d: Its a directory
rwx: Read Write Execute for User/Owner
rwx: Read Write Execute for Group
rwx: Read Write Execute for others (not the owner of the file
and the users in the group, but anybody apart from this)
Pola drwxrwxrwx
drwxrwxrwx
The file is a directory that has read, write and execute permissions from all user, group
or other access. For such a setting, it is necessary to write chmod 777
drwxr-xr-x
The file is a directory that has read, write and execute permissions for User/Owner
access, but for Group or other access, just read and execute it. Unable to modify the
file/folder. For such a settings, it is necessary to write chmod 755
drw-r-----
The file is a directory that has read and write permissions for User/Owner access, but
Group access can only read and other access does not have any access. No one can
run/execute the file. For such settings, it is necessary to write chmod 640
EXERCISE – 75 MINUTES
Part 1 (30 minutes)

• Create a folder called “FolderOS[your KP]”, for example: FolderOSC.


Pay attention to uppercase and lowercase letters.
• Then you go to the directory with the "folderosc" syntax. Did an error
occur? Why?
• Find min. 5 CLI syntax in addition (new syntax, other than the list) to
described in slide no.8 (Basic Command).
• Make a table look like slide no 8 with the columns “Linux syntax”,
“Windows syntax” and the description
Part 2 (15 minutes)
Instruction:
Should use CLI
Should documented every step screenshot.
1. Go to your Desktop directory.
2. You are logged in as 'root’
3. Create 2 directories with the format “Doc1” and “Doc2”.
4. On Doc1, set permission to all access can do any action
5. On Doc2, set permissions so that only root can read, edit and execute. For the group only
view and edit. For others can't do anything
6. Show the result of customizing your permissions

• Exit CLI
– Act1.1. Create 1 new document file inside the directory point no. 4
– Act1.2. Create 1 new document file inside the directory point no. 5
– Is there any difference in the results of 'Act1.1' and 'Act1.2'. Give your reasons.
Part 3 (15 minutes)
Instruction:
Should use CLI
Should documented every step screenshot.
1. Go to your Desktop directory.
2. You are logged in as a regular user (not as root)
3. Create 2 directories with the format “My_Document1” and “My_Document2” .
4. On My_Document1, set permission so that all access can do any action
5. On My_Documents2, set permissions so that only users can read, edit and execute. For the
group only view and edit. For others can't do anything
6. Show the result of customizing your permissions

• Exit CLI
– Act2.1. Create 1 new document file inside the directory point no. 4
– Act2.2. Create 1 new document file inside the directory point no. 5
– Is there any difference in the results of 'Act2.1' and 'Act2.2'. Give your reasons explanation.
Conclusion (15 minutes)
• Create a report document, consists all report about your activity from
activities Part 1 - 3
• Create a conclusion paragraph about what do you get from your
activities.

You might also like