Say we had this directory tree.
/ etc/ httpd/ httpd.config/ home/ "username"/ bar/ root/
So if we wanted to go from etc to bar in one line we would use the following steps. first we run pwd to see that we are in the etc folder.
[allent@localhost etc]$ pwd /etc
This confirms that we are in the etc directory.
We then run this command which will move us first to the root directory, then to the home directory, then to the user directory then to the directory we want.
[allent@localhost etc]$ cd /home/allent/bar
This command then returns us here
[allent@localhost bar]$
Which is where we wanted to be in the first place.
Linux is an adaptable Operating System that uses a tree data structure to orient itself and its files. If you tell it to go to the root which is denoted as / you can go anywhere
in the computer as long as you have the right permissions.
You may also want to look at the following videos that give an in depth look at Create Update Delete and Retrieve operations in BASH and Linux. There are some minor differences between CENTOS and the BASH Command line but they are not to hard to adapt.
Linux Shell Command Arguments
Linux Server Administration - Secure Shell Server Overview
Linux File Management
NetSecProf Youtube Profile