Here listing is the identify of the listing the place you want to go.
CD Command Examples
1. Write a unix/linux cd command to vary to residence listing?
Just merely sort cd command on the unix terminal and then press the enter key. This will change your listing to residence listing.
Now i’m within the /usr/native/bin listing. After typing the cd command and unix window, you’ll go to your house listing.
Here pwd command shows the current working listing.
2. Write a unix/linux cd command to return to 1 listing?
The cd .. adjustments the listing to its dad or mum listing by going again one degree. The house between the cd and .. is should.
> cd ..
3. Write a unix/linux cd command to return to 2 directories?
The cd ../../ takes you again to 2 directories. You can prolong this cd command to return to n variety of directories.
> cd ../../
4. Write a unix/linux cd command to vary the listing utilizing absolutely the path?
In case of adjusting listing utilizing absolute path it’s a must to specify the total listing path. Absolute path directories at all times begin with a slash (/). An instance is altering your listing to /usr/bin from your house listing.
> cd /usr/bin
5. Write a unix/linux cd command to vary the listing utilizing the relative path?
In relative path, it’s a must to specify the listing path relative to your present listing. For instance, you might be in /var/tmp listing and you wish to go to /var/lib listing, then you should use the relative path.
> cd ../lib
Here the cd ../lib, first takes you to the dad or mum listing which is /var and then adjustments the listing to the lib.
6. Write a unix/linux cd command to vary again to earlier listing.
As an instance, i’m within the listing /residence/matt/paperwork and i modified to a brand new listing /residence/matt/backup. Now i wish to return to my earlier listing /residence/matt/paperwork. In this case, you should use the cd – command to return to the earlier listing.
> cd /residence/matt/backup
> cd -