0% found this document useful (0 votes)
3 views6 pages

Linux Essentials

The document provides an overview of Linux commands and concepts, including file ownership, process management, and network communication. It covers essential commands like SSH, PuTTY, and various text manipulation tools, as well as the types of processes in Linux. Additionally, it explains network interface configuration and tools for interacting with external servers.

Uploaded by

Mariam Nasr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Linux Essentials

The document provides an overview of Linux commands and concepts, including file ownership, process management, and network communication. It covers essential commands like SSH, PuTTY, and various text manipulation tools, as well as the types of processes in Linux. Additionally, it explains network interface configuration and tools for interacting with external servers.

Uploaded by

Mariam Nasr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Mariam Nasr

started at 14 november Ended at …

Certified Linux Practitioner


Some Linux commands
chown  change file ownership
dd  copies data from an input to output
ps  list running processes in the system
sudo  runs command as super user
ifconfig  display or configure network card related information. Use ip
address instead
apt-get  used to install, configure, and remove package on Debian and its
derivatives.
iwconfig  used to display ir configure wireless network card related info.
Passwd  change the password if no parameters provided, change the
password of the current user

Lesson 1
What is SSH?
The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating
network services securely over an unsecured network.
- Any network service can be secured with SSH
- SSH is running by default on port 22 but it is not always the case

What is Putty?
PuTTY is a free and open-source terminal emulator, serial console, and network file
transfer application. It supports several network protocols, including SCP, SSH, Telnet,
rlogin, and raw socket connection.

$ ssh username@ip_address -p port_number

Lesson 2

Basic commands
 whoami → This command prints out your current user
 id → This command prints out your UID, GID, and also all the groups that your
current user is in
 hostname → This command prints out your machine’s hostname (Generally
defined in /etc/hosts)
 Uname -a → This command prints out your Operating system’s kernel version and
Architecture
 Wc Command
Wc command is used to count the number of words, lines, and characters.

Lesson 3
 To install a package we can use the command `sudo apt-get
install packagename`.
 To remove a package we can use the command `sudo apt-get
remove packagename`.
 To update the package database we can use the command `sudo
apt-get update`.
 To update all the packages to their latest version, we can use the
command `sudo apt-get upgrade`.

Lesson 4
Text manipulation tools:
Sort  sort byASCii
Tr  translating or deleting characters. It supports a range of transformations
including uppercase to lowercase, squeezing repeating characters, deleting
specific characters and basic find and replace.
Uniq filters out the repeated lines in a file
Cut  cutting out the sections from each line of files and writing the result to standard
output.
Now let’s assume we want to print the first three bytes of each line to do that we
can use the command
`cut -b 1,2,3 filename`
Now let’s assume we want to print the first word and the third word of each line to
do that we can use the command
`cut -d “ ” -f 1,3 filename`
Awk  enables a programmer to write tiny but effective programs in the form of
statements that define text patterns that are to be searched for in each line of a
document and the action that is to be taken when a match is found within a line.

awk options 'selection _criteria {action }' input-file

Base64 encoding algorithm

Lesson 5
What is a process?
A process is an instance of a program currently running in the form of a thread(s).
Linux Process Manipulation
Foreground Processes
A foreground process is any command or task you run directly and wait for it to
complete. interactive processes

Background Processes
Unlike with a foreground process, the terminal does not have to wait for a background
process to end before it can run more processes.
Within the limit of the amount of memory available, you can enter many background
commands one after another. non-interactive/automatic
Run background process using bg command

Types of Processes

1. Parent process:
The process is created by the user on the terminal. If it was created directly by the user
then the parent process will be the kernel process.
2. Child process:
This is a process created by another process (by its parent process).
3. Orphan process:
when the parent process is killed before the termination of the child process, the child
processes become orphan processes, with the parent of all processes “init” process
(PID 0), becoming their new PID.
4. Zombie process:
A process that is killed but still shows its entry in the process status or the process table
is called a zombie process. They have Zero CPU consumption.
5. Daemon process:
They are system-related background processes that often run with the permissions of
root and services requests from other processes, they usually run in the background
and wait for processes they can work along with for ex print daemon. A Daemon
process can be recognized if it has “?” in its TTY field (6th column)

Creation of processes in Linux


ps -f l

exec()  replaces the current process


frok()  create process

Lesson 6
Network communication
Display and Modify Information Associated to a Network Interface

"ip" command
It is a tool used to configure and analyze a network interface, to bring
interfaces up or down, assign and remove addresses and routes, manage
ARP cache, and much more.

 To view all the interfaces and the assigned ip address, subnet and default
gateway we can use the command
ip address, ip addr or ip a

 To display information about a single network interface, use ip addr show


dev
e.g ip addr show dev eth0

 To add an IP address to a network interface on your machine, use ip


address add dev
e.g sudo ip address add [Link]/24 dev eth0.

 To delete an IP address from a network interface on your machine, use ip


address del dev
 To take down an interface use ip link set e.g sudo ip link set eth0 down.
 To take up an interface use ip link set e.g sudo ip link set eth0 up.

 To display information about an interface, use the “ifconfig” command

Ifconfig = ip

 To take down an interface use ifconfig down e.g sudo ifconfig eth0
down.
 To take up an interface use ifconfig up e.g sudo ifconfig eth0 up.
 To modify the MAC address of an interface use;
ifconfig down
ifconfig hw ether [Link]
ifconfig up
ifconfig

Interact with External Servers from the Terminal


Ping Command: used to check whether a network is available and if a host is
reachable.

 Ping [option] `hostname`

 Curl: tool to transfer data to or from a server, using any of the supported
protocols (HTTP, FTP, IMAP, POP3, SCP, SFTP, SMTP, TFTP, TELNET, LDAP
or FILE).
This tool is preferred for automation since it is designed to work without user
interaction. curl can transfer multiple files at once.

curl [options] [URL]


 Wget: This is the non-interactive network downloader that is used to download
files from the server even when the user has not logged on to the system and it
can work in the background without hindering the current process.

wget [options] [URL]

You might also like