Working with Directories
Command | Syntax (Example) | Description |
---|---|---|
cd | cd [path] | Changes directory to the specified path. |
cd .. | Changes to the parent directory of the current directory. | |
cd - | Changes to the previous working directory, prior to the last cd command. | |
cd | Changes to the home directory of the current login ID. | |
cd ~ | Changes to the home directory of the current login ID. | |
dir | See the ls command. | |
ls | ls [path] | Lists the contents of a directory. |
ls -l (ll) | Lists the files in long format, displaying all file attributes. | |
ls -a | Lists all files (including hidden files, sometimes referred to as dot files). | |
mkdir | mkdir <directory> | Makes a new directory. |
pwd | Displays present working directory. | |
rmdir | rmdir <directory> | Removes a directory. |
Get Special Edition Using Linux®, Sixth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.