I searched for CD commands.

Overview

I think you use various commands such as [cd] and [ls] in your business. Since each command has an OPTION I think you can work more easily if you use it together with OPTION. This time, I investigated the basic command [cd].


cd

What is cd (change directory)? A command to change the current working directory. Used on UNIX, Windows, dos. [Chdir] is also possible.

C:\Users\wun916>dir
2020-01-21  11:12    <DIR>          Desktop
2020-01-22  12:04    <DIR>          Documents
2020-01-21  11:30    <DIR>          Downloads
2019-11-14  10:46    <DIR>          Favorites
2019-11-14  10:46    <DIR>          Links
2019-11-14  10:46    <DIR>          Music

C:\Users\wun916>cd Music   //Go to Music directory
C:\Users\wun916\Music>

cd option

--cd: Move to your home directory. cd ~, cd $ HOME

mac46:react j-lee$ pwd
/Users/j-lee/react
mac46:react j-lee$ cd
mac46:~ j-lee$ pwd
/Users/j-lee

mac46:react j-lee$ cd ~
mac46:~ j-lee$ pwd
/Users/j-lee

mac46:react j-lee$ cd $HOME
mac46:~ j-lee$ pwd
/Users/j-lee

cd option

--cd .: Move to the current directory.

mac46:react j-lee$ cd .
mac46:react j-lee$ pwd
/Users/j-lee/react

--cd ..: Move up one directory from the current directory

mac46:react j-lee$ pwd
/Users/j-lee/react
mac46:react j-lee$ cd ..
mac46:~ j-lee$ pwd
/Users/j-lee

cd option

--cd /: Move to the top level directory

mac46:app-server-side j-lee$ pwd
/Users/j-lee/react/app-server-side
mac46:app-server-side j-lee$ cd /
mac46:/ j-lee$ pwd
/

--cd-: Move to the previous path

mac46:/ j-lee$ pwd
/
mac46:/ j-lee$ cd -
/Users/j-lee/react

cd option

--Go to cd directory path: directory

//Use absolute path (root directory)
mac46:/ j-lee$ pwd
/
mac46:/ j-lee$ cd /Users/j-lee/react/app-server-side/
mac46:app-server-side j-lee$ pwd
/Users/j-lee/react/app-server-side

//Use relative path (current directory)
mac46:~ j-lee$ cd react/app-server-side
mac46:app-server-side j-lee$ pwd
/Users/j-lee/react/app-server-side
mac46:app-server-side j-lee$ 

mac46:~ j-lee$ cd ./react
mac46:react j-lee$ pwd
/Users/j-lee/react

Recommended Posts

I searched for CD commands.
[Python] I searched for various types! (Typing)
I searched for railway senryu from the data
[Python] I searched for the longest Pokemon Shiritori
I searched about Pynamodb
Mongodb Shortest Introduction (2) I searched for tens of thousands
I searched for the contents of CloudWatch Logs Agent
I searched for works that are highly evaluated by Naro
I searched for a similar card of Hearthstone with Deep Learning
I touched PyAutoIt for a moment
Convenient shortcut keys for Linux commands! !! !!
Frequently used Linux commands (for beginners)
Commands for creating SNS with Django
I read the Sudachi synonym dictionary with Pandas and searched for synonyms