❌

Reading view

There are new articles available, click to refresh the page.

Docker installation on Linux and practice

$ sudo apt-get update

$ sudo apt install docker.io

(asking you to choose between y/n - choose y)

$ docker --version
to check the verstion

Pull an image from the Docker hub using the following command:
$ sudo docker run hello-world

$ docker images
to see a list of all images on your system.

$ docker run busybox
run a Docker container based on this image docker

$ docker run busybox echo "hello from busybox"
Docker client dutifully ran the echo command in our busybox container and then exited it

$ docker ps
The docker ps command shows you all containers that are currently running.

$ docker ps -a
list of all containers that we ran

$ docker rm 305297d7a235 ff0a5c3750b9
clean up containers once I'm done with them

$ docker rm $(docker ps -a -q -f status=exited)
This command deletes all containers that have a status of exited

$ docker container prune
This will remove all stopped containers

Here's a list of some commonly used Linux commands:

Here's a list of some commonly used Linux commands:

ls - list the contents of a directory
cd - change the current working directory
pwd - print the current working directory
mkdir - create a new directory
rmdir - remove an empty directory
touch - create a new empty file
cat - concatenate and print the contents of files
echo - display a message or the contents of a variable
cp - copy files or directories
mv - move or rename files or directories
rm - remove files or directories
chmod - change the permissions of files or directories
chown - change the owner of a file or directory
man - display the manual page for a command
df - display disk usage information
du - estimate the disk space used by a file or directory
top - display information about the running processes
ps - display information about the currently running processes
kill - terminate a process
sudo - run a command with superuser privileges
apt-get - package manager for Debian-based systems
yum - package manager for Red Hat-based systems
pacman - package manager for Arch-based systems
ln - create a symbolic link
find - search for files that match specified criteria
grep - search for patterns in text files
sort - sort the contents of a file
uniq - remove duplicate lines from a file
wc - count the number of lines, words, or characters in a file
tar - create or extract compressed archive files

This is by no means an exhaustive list, but it should give you a good starting point for exploring the world of Linux commands.

Installing Apache Web Server

Installing Apache Web Server on Linux Mint

to check the update
$ sudo apt-get update

this command to install Apache.
$ sudo apt-get install apache2 apache2-utils

The following commands will cause Apache to start when the server starts-up and start the service for the first time:
$ sudo systemctl enable apache2
$ sudo systemctl start apache2

Verify Apache Service Status on your Linux

$ hostname -i (give you the ip address)

enter the ip address in the web browser

"Ubuntu Logo Apache2 Ubuntu Default Page"

Installing LibreOffice Linux Mint

Installing LibreOffice Linux Mint

$ sudo apt update
enter the password

$ sudo apt install libreoffice
press "Y" to continue installing LibreOffice

$ libreoffice --version
to check the installed version

User commands of linux

sudo adduser username

To add a new user

sudo passwd -l 'username'

To change the password of a user

sudo userdel -r 'username'

To remove a newly created user

sudo usermod -a -G GROUPNAME USERNAME

To add a user to a group

sudo deluser USER GROUPNAME
To remove a user from a group

File Permission commands

ls -l to show file type and access permission
r read permission
w write permission
x execute permission
-= no permission
Chown user For changing the ownership of a file/directory
Chown user:group filename change the user as well as group for a file or directory

Linux Commands and description for practice

ls
Lists all files and directories in the present working directory

ls -R

Lists files in sub-directories as well

ls -a

Lists hidden files as well

ls -al

Lists files and directories with detailed information like permissions,size, owner, etc.

cd or cd ~
Navigate to HOME directory

cd ..

Move one level up

cd /

Move to the root directory

cat > filename

Creates a new file

cat filename

Displays the file content

cat file1 file2 > file3
Joins two files (file1, file2) and stores the output in a new file (file3)

sudo

Allows regular users to run programs with the security privileges of the superuser or root

rm filename
Deletes a file

man
Gives help information on a command

history
Gives a list of all past commands typed in the current terminal session

clear

Clears the terminal

mkdir directoryname
Creates a new directory in the present working directory or a at the specified path

rmdir Deletes a directory

❌