Skip to content
Snippets Groups Projects
Commit 1f95081c authored by Michael Marsh's avatar Michael Marsh
Browse files

added cp, mv, and dd to the filesystem quick-ref

parent bf025c93
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -38,6 +38,39 @@ Moving Around ...@@ -38,6 +38,39 @@ Moving Around
| popd | Pop the top of the directory stack, cd'ing to the new top | | popd | Pop the top of the directory stack, cd'ing to the new top |
Moving, Copying, and Extracting Pieces of Files
-----------------------------------------------
| *Command* | *Result* |
| --------- | -------- |
| cp *a* *b* | Create a copy of file *a* named *b* |
| mv *a* *b* | Rename file *a* so that it is now *b* |
| dd if=*a* of=*b* | Dump the contents of input file *a* to output file *b* |
For all of these the files may be in any directory, so to move a
file `foo` up a directory, you could run
mv foo ../foo
or just
mv foo ../
`dd` is an extremely powerful tool, and `if` and `of` are only the
beginning of its options. Either can be omitted, and use STDIN or
STDOUT as the default. Here's another simple example:
dd if=/dev/zero of=foo bs=1024 count=5
This will create a file `foo` with the first 5kB of `/dev/zero`,
which will provide you with as many NULL bytes as you request. Give
this a try, and then run
xxd foo
See the manpage for `dd` for all options. It's well worth you time
to learn more about this command!
File Permissions File Permissions
---------------- ----------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment