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
Ec2 instance Linux
pwd -> to know on which directory you are working
PWD-Print Working Directory
whoami -> It will show the currently logged-in user.
ls-> List the files in a directory
mkdir->to create directory
mkdir . (filename)-> to create a hidden directory
ls -a -> to know hidden files under a directory.
rmdir->to remove directory
cd-> to change the working directory.
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}
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
To remove the directory which is having files
rm -r directory name
Creating the nested directories means folders inside folders. Here is the command mkdir -p
nested folders
To create multiple directories at a time. Here I have created 3 separate folders at a time using the command mkdir.
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)
permissions of directories
#linux #linuxbasics #devopscommunity #devops #devopsengineer #linuxcommunity #linuxtips #linuxcommands #linuxworld
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