cd (change directory) command is used to change the current working directory in Linux.
Current working directory: Current working directory is also known as present working directory. It is a directory (folder) where the
Use the pwd
command to know current working directory / present working directory.
pwd
Syntax for cd command
cd [option] directory_name
change from current working directory to a new directory
cd command can be used to change from current working directory to a specific directory
cd File_name
Change to the parent directory
cd command can be used to change the current working directory to parent directory. To change from current working directory to parent directory use the following command.
cd ..
Change to root directory
cd command can be used to change to root directory from current working directory. To change to root directory from current working directory use the following command.
cd /
Change to home directory
cd command can be used to change to home directory from current working directory. To change to home directory from current working directory use the following command.
cd ~
or
cd
cd dir1/dir2
A |
adduser | addgroup | alias | anacron | apt | aptitude | arp | at | atq | atrm | awk |
B |
basename | banner | batch | bc | bg | bzip |
C |
cat | cal | cd | chgrp | chown | cksum | chmod | clear | cmp | comm | cp |
D |
date | dd | df | diff | dir | dmidecode | du |
E |
echo | eject | env | exit | expr |
F |
factor | find | free |
G |
grep | groups | gunzip | gzip |
H |
head | history | hostname | hostnamectl | htop | hwclock | hwinfo |
I |
id | ifconfig | ionice | iostat | ip | iptables | iw | iwlist |
J |
K |
kill | kmod |
L |
last | less | ln | locate | login | lp | ls | lshw | lscpu | lsof | lsusb |
M |
man | mdsum | mkdir | more| mv |
N |
nano | nc | neofetch | netcat | netstat | nice | nmap | nproc |
O |
openssl |
P |
passwd | pidof | ping | pr | ps | pwd | pstree |
Q |
R |
rdiff-backup | reboot | rename | rm | rmdir | rnmod |
S |
scp | shred | shutdown | sleep | sort | split | ssh | stat | su | sudo | sum |
T |
tac | tail | talk | tar | tee | time | tree | top | touch | tr |
U |
unalias | uname | uniq | unzip | uptime | users |
V |
vim | vi |
W |
w | wall | watch | wc | wget | whatis | whereis | which | who | whoami |
X |
xargs |
Y |
yes | youtube-dl |
Z |
zcmp | zdiff | zip | zz |