list of commonly used shell commands for directory management:
- mkdir: Create a new directory.
Example: mkdir mydir will create a new directory called "mydir" in the current directory.
- rmdir: Remove an empty directory.
Example: rmdir mydir will remove the directory called "mydir" if it is empty.
- rm: Remove files and directories.
Example: rm myfile.txt will delete the file called "myfile.txt". rm -r mydir will remove the directory "mydir" and its contents recursively.
- mv: Move or rename files and directories.
Example: mv myfile.txt newfile.txt will rename the file "myfile.txt" to "newfile.txt". mv myfile.txt /path/to/destination will move the file "myfile.txt" to the specified destination.
- cp: Copy files and directories.
Example: cp myfile.txt mydir/ will copy the file "myfile.txt" to the directory "mydir".
- cd: Change directory. It is used to navigate between directories.
Example: cd Documents will change the current directory to "Documents".
- ls: List files and directories in the current directory.
Example: ls will list the files and directories in the current directory.
- pwd: Print the current working directory.
Example: pwd will display the current directory path.
- tree: Display the directory structure as a tree.
Example: tree will show the directory structure starting from the current directory.
- find: Search for files and directories.
Example: find /path/to/search -name myfile.txt will search for the file "myfile.txt" in the specified path.
Each command has additional options and flags that can be used to customize their behaviour. You can refer to the manual pages for each command by using the man command followed by the command name ( e.g., man ls) to get more detailed information about their usage.