INTRODUCTION TO UNIX
kernel is the core of the operating system that controls all the tasks of the system while the shell is the interface that allows the users to communicate with the kernel. shell accepts and interprets commands through a CLI(terminal)
Linux Commands we use extensively :
pwd : Which shows the path of the current working directory
ls: Lists the files and folders in the directory
cd: Move us from one directory to other
cd ..: It takes us one step back in the directories path
ls -l: Lists the long-format files and directories
clear : Which clears the screen
Manipulating the files:
touch file.txt: which creates file name called file.txt
echo “text you want to input to file ” > file.txt: you can input the text directly into file.txt through this command
head file.txt: which shows the first 10 lines of the file
tail file.txt: which shows last10 lines of the file
cat file.txt: shows the text inside the file
nano file.txt: nano editor opens the file.txt
grep search word <targetfile>: used to search for a string in a file.
mv file.txt file2.txt: it is more of like cut and paste of a file, file.txt will be renamed to file2.txt
cp <source path of file> <target path> : we can copy the files
we can make these commands powerful by options for example
ls -la: which shows all the hidden files and all files in long format
ls -S: which will display files in decrement manner of size
we can write our command in this way “ls -laS” also
cat file.txt | grep “search for the word”: which shows the lines consists of the search word.