Skip to main content

Command Palette

Search for a command to run...

DAY1: Linux

Published
2 min read

Kernel is the heart of operating system. it manages: Device, memory, process management and handling system.

ls

ls: command stands for list. using this we can list files and folders.

To know where I am?

  • To know where we currently working in which folder/directory we use "pwd" (present working directory)command. it will show the complete location, for ex: C://user/Folder/text.json. In Windows to know the location we just use right click and in properties, we can simply check.
pwd

Change directory(cd):

Now to change the folder/directory in Linux we use the 'cd' command. To navigate back and forward we use the cd command.

here, first we have checked through pwd that we are in tests folder, then we do cd ..

to navigate back one folder. then cd ../.. to navigate back two folders.

cd ubuntu/bundle : to go to bundle folder.

cd
cd ..
cd ../..
cd ubuntu/bundle
cd bundle/

ls -ltr:

ls -ltr

ls -ltr: View Reverse Output Order by Date.

it will give info. like whether its a directory or file and date timestamp.

if it starts with 'd' then its a directory and if starts with -rw then it is a file.

Create File:

touch file1

To just create a file we can use above command.

vi file2

A new file is created and an editor will be open to read and write a file.

Now to write in a file:

  1. Press Esc key

  2. press 'i'

  3. Write something in a file : "Hello DevOps"

  4. Then again Esc

  5. :wq to save the file

To know more about Shell scripting go through the playlist:

cat :

To see what is written inside the file we use cat command

cat file1
cat file2

mkdir

To create a directory we use this command

mkdir folder1
rm -r folder1

To remove this dir we use rm - r command.

Other commands:

free -g
// to know the memory
nproc
// No of cpu 
df -h
// to check disk size
top 
// to check everthing in one place using top cmd to manage memory