Linux Commands
Commands
ls
cd
mkdir
cat
more
head
tail
touch
rm
How To
Change Prompt

cd - change directory command in linux



cd - change directory command in linux

syntax

cd [path to directory]

 // type "cd <path to directory>" and press enter 
 user@host:~ cd mydir/
 user@host:~/mydir 

The "cd" command is to change the current directory to the given directory, either sub directory or to the directory given in path.


to change the current directory to sub directory, relative path is enough as below


 user@host:~/mydir cd ./subdir/
 user@host:~/mydir/subdir 

examples

change directory to given path


 user@host:~ cd /home/user/myotherdir/

change directory to home directory


 // dont give path, just type "cd" and enter in terminal
 user@host:~/mydir/subdir cd
 user@host:~ 


change directory to previous directory


 // dont give path, just type "cd -" and enter in terminal
 user@host:~ cd -
 user@host:~/mydir/subdir

change directory to tmp directory


 // type "cd /tmp" and enter in terminal
 user@host:~/mydir/subdir cd /tmp
 user@host:/tmp

change directory to previous directory from tmp directory


 // dont give path, just type "cd -" and enter in terminal
 user@host:~ cd -
 user@host:~/mydir/subdir

change current directory to another directory in parent directory using relative path


 //parent directory is having 2 directories, changing from subdir to subdir2
 user@host:~/mydir/subdir cd ../subdir2
 user@host:~/mydir/subdir2


rm

rm command in linux

posted on 2019-10-24 21:34:18 - Linux Commands Tutorials


touch

touch command in linux

posted on 2019-10-23 19:41:20 - Linux Commands Tutorials


tail

tail command in linux

posted on 2019-10-23 19:10:42 - Linux Commands Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials