Linux commands for beginners mostly used in devops

For this, I have created an AWS account and launched the ec2 instance Linux os. connected the command prompt

ssh -i "keypair. pem" user @ dns name

No alt text provided for this image

Ec2 instance Linux

pwd -> to know on which directory you are working

No alt text provided for this image

PWD-Print Working Directory

whoami -> It will show the currently logged-in user.

No alt text provided for this image

ls-> List the files in a directory

No alt text provided for this image

mkdir->to create directory

No alt text provided for this image

mkdir . (filename)-> to create a hidden directory

ls -a -> to know hidden files under a directory.

No alt text provided for this image

rmdir->to remove directory

No alt text provided for this image

cd-> to change the working directory.

No alt text provided for this image

cd-change directory

files creation: Touch, cat and vim commands

touch -to create the empty files.

touch file{1..5}.txt to -> to create multiple files at a time

eg: file1.txt ,file2.txt file3.txt file4.txt file5.txt

cat -to create files and read files. {ctrl+d is to save}

No alt text provided for this image

head -n [file name]-> To view content from top of file

Tail -n [file name]-> to view content from the bottom of the file

To remove empty directory

rmdir command

No alt text provided for this image

To remove the directory which is having files

rm -r directory name

No alt text provided for this image

Creating the nested directories means folders inside folders. Here is the command mkdir -p

No alt text provided for this image

nested folders

To create multiple directories at a time. Here I have created 3 separate folders at a time using the command mkdir.

No alt text provided for this image

different directories using mkdir

To know the permissions of the files or directories here is the command ls -l. It will show the permissions, owner, size, and last modified date for each.I have created 3 directories executed the command ls -l and changed the permissions of the folders. Read, write and execute for user, group and others as well using the chmod command. Let's check the below image.

Note: here drwx indicates d means directory (folder)

No alt text provided for this image

permissions of directories

#linux #linuxbasics #devopscommunity #devops #devopsengineer #linuxcommunity #linuxtips #linuxcommands #linuxworld

0
Subscribe to my newsletter

Read articles from vaheeda begum sheik directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

vaheeda begum sheik
vaheeda begum sheik