This is the second part of "Linux Series of DevOps". You can find first part here .
➔ Open Terminal
➔ Know where you are? Present Working Directory
➔ Create a directory/folder in your home directory.
➔ Change your current working directory to linux-practices(Go to linux-practices folder).
➔ Create some more directories and list them with 'ls' command.
➔ Create some empty files with
touch command and list them.
Absolute path and Relative path
What is a path?
A path is a unique location to a file or a folder in a file system of an OS. A path to a file is a combination of / and alpha-numeric characters.
What is an absolute path?
An absolute path is defined as the specifying the location of a file or directory from the root directory(/). In other words we can say absolute path is a complete path from start of actual filesystem from / directory. Some examples of absolute path:
- /home/imran/linux-practices/ - /var/ftp/pub - /etc/sam ba.smb.conf - /boot/grub/grub.conf
If you see all these paths started from / directory which is a root directory for every Linux/Unix machines.
What is the relative path?
Relative path is defined as path related to the present working directory(pwd). Suppose I am located in /home/imran and I want to change directory to /home/imran/linux-practices. I can use relative path concept to change directory to linux-practices.
➔ We use
cp command for copying directories from one location to another.
➔ Moving files from one location to another.
➔ Removing files and directories.
➔ Install vim editor according to your operating system (centos or ubuntu). Here, I use centos.
➔ Open up a file in vim editor
i to enter into insert mode
=> type few lines => hit
=> type :
➔ Read file with
VI Visual display editor
VIM Visual display editor improved
This is command mode editor for files. Other editors in Linux are emacs, gedit , vi editor is most popular
It has 3 modes:
1 Command Mode
2 Insert mode (edit mode)
3 Extended command mode
Command mode means that you can use keyboard keys to navigate, delete, copy, paste, and do a number of other tasks—except entering text.
In INSERT mode, you type text.
In extended mode, We do advanced features, such as save and quit, search and replace, and customization options.
Note: When you open the vim editor, it will be in the command mode by default.
FILES TYPES IN LINUX
Symbolic links are like desktop shortcuts we use in windows.
Create a soft link for /var/log directory in our current working directory.
Thanks for reading. I would love to connect with you all on Twitter .