<P> The cd command, also known as chdir (change directory), is a command - line OS shell command used to change the current working directory in operating systems such as Unix, DOS, OS / 2, AmigaOS (where if a bare path is given, cd is implied), Windows, ReactOS, and Linux . It is also available for use in shell scripts and batch files . The system call that affects the command in most operating systems is chdir that is defined by POSIX . The command is analogous to the OpenVOS change_current_dir command . </P> <P> A directory is a logical section of a file system used to hold files . Directories may also contain other directories . The cd command can be used to change into a subdirectory, move back into the parent directory, move all the way back to the root directory or move to any given directory . </P> <P> Consider the following subsection of a Unix filesystem, which shows a user's home directory (represented as "~") with a file ("text. txt") and three subdirectories . </P> <P> If the user's current working directory is the home directory ("~"), then entering the command ls followed by cd games might produce the following transcript: </P>

How to use cd command in linux with examples