Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux_wiki:create_delete_copy_and_move_files_and_directories [2016/02/28 22:56] billdozor created |
linux_wiki:create_delete_copy_and_move_files_and_directories [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 3: | Line 3: | ||
**General Information** | **General Information** | ||
- | About this page/how-to/ | + | Basic file/directory manipulation. |
---- | ---- | ||
+ | |||
+ | ===== Creating ===== | ||
Create new file " | Create new file " | ||
Line 12: | Line 14: | ||
</ | </ | ||
+ | \\ | ||
Create three files | Create three files | ||
<code bash> | <code bash> | ||
Line 17: | Line 20: | ||
</ | </ | ||
+ | \\ | ||
Create new directory | Create new directory | ||
<code bash> | <code bash> | ||
Line 22: | Line 26: | ||
</ | </ | ||
- | Rename file or directory | + | \\ |
- | <code bash> | + | |
- | mv dir1 newdir | + | |
- | </ | + | |
- | * Renames " | + | |
Create new directory tree | Create new directory tree | ||
<code bash> | <code bash> | ||
Line 35: | Line 34: | ||
* -p => Make parent directories if needed | * -p => Make parent directories if needed | ||
+ | \\ | ||
View directory structure in tree outline | View directory structure in tree outline | ||
<code bash> | <code bash> | ||
Line 48: | Line 48: | ||
├── otherdir | ├── otherdir | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Renaming ===== | ||
+ | |||
+ | Rename file or directory | ||
+ | <code bash> | ||
+ | mv dir1 newdir | ||
+ | </ | ||
+ | * Renames " | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Removing ===== | ||
Remove empty directory | Remove empty directory | ||
Line 54: | Line 68: | ||
</ | </ | ||
+ | \\ | ||
Remove directory recursively | Remove directory recursively | ||
<code bash> | <code bash> | ||
Line 60: | Line 75: | ||
* -r => recursively | * -r => recursively | ||
* -f => force, do not prompt for confirmation | * -f => force, do not prompt for confirmation | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Copying ===== | ||
Copy file2 into dir2 | Copy file2 into dir2 | ||
Line 66: | Line 85: | ||
</ | </ | ||
+ | \\ | ||
Copy directory dir2 and its contents into newdir | Copy directory dir2 and its contents into newdir | ||
<code bash> | <code bash> | ||
Line 71: | Line 91: | ||
</ | </ | ||
* -r => recursively | * -r => recursively | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Moving ===== | ||
Move file1 into dir1 | Move file1 into dir1 |