Pages

Thursday, June 29, 2017

15 Practical Examples of ‘cd’ Command in Linux

In Linux ‘cd‘ (Change Directory) command is one of the most important and most widely used command for newbies as well as system administrators. For admins on a headless server, ‘cd‘ is the only way to navigate to a directory to check log, execute a program/application/script and for every other task. For newbie it is among those initial commands they make their hands dirty with.

cd command in linux
15 cd command examples in linux
Thus, keeping in mind, we here bringing you 15 basic commands of ‘cd‘ using tricks and shortcuts to reduce your efforts on the terminal and save time by using these known tricks.
Tutorial Details
  1. Command Name : cd
  2. Stands for : Change Directory
  3. Availability : All Linux Distribution
  4. Execute On : Command Line
  5. Permission : Access own directory or otherwise assigned.
  6. Level : Basic/Beginners
1. Change from current directory to /usr/local.
avi@tecmint:~$ cd /usr/local
avi@tecmint:/usr/local$ 
2. Change from current directory to /usr/local/lib using absolute path.
avi@tecmint:/usr/local$ cd /usr/local/lib 
avi@tecmint:/usr/local/lib$ 
3. Change from current working directory to /usr/local/lib using relative path.
avi@tecmint:/usr/local$ cd lib 
avi@tecmint:/usr/local/lib$ 
4. (a) Move one directory back from where you are now.
avi@tecmint:/usr/local/lib$ cd - 
/usr/local 
avi@tecmint:/usr/local$ 
4. (b) Change Current directory to parent directory.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1nBWuP
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment