Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Answer: There are a number of ways…

# Move to your home folder and copy int this location. # The “.” marks the current working directory.
Code Block
Info

Method 01: Move to your home folder and copy into this location.

The . marks the current working directory.

Code Block
[arccanetrain]$ cd 
[~]$ cp -r /project/arccanetrain/intro_to_linux/ .
cp: cannot open 'intro_to_linux/workshop_me.txt' for reading: Permission denied
[~]$ ls
Desktop  Documents  Downloads  intro_to_linux
# Move into the 
Info

Method 02: Move into the /project/arccatrain/

folder

and

copy

from

there

into

your

home.

# The “~” is short for your home folder.


Remember, the ~ is short for your home folder.

Code Block
[~]$ cd /project/arccanetrain/
[arccanetrain]$ cp -r intro_to_linux/ ~
cp: cannot open 'intro_to_linux/workshop_me.txt' for reading: Permission denied
[arccanetrain]$ ls ~
Desktop  Documents  Downloads  intro_to_linux
# Why do we see the cp related permission denied?
Note

In both cases you do not have permissions to copy workshop_me.txt - this is intentional and a good remind to check the permissions/ownerships of files.

Question: What do you notice about the permissions of this file?

Code Block
# -rw-------  1 arcc-t05 arccanetrain      23 Oct  5 07:20  workshop_me.txt
# What happens to this file? It does not get copied
Info

Only the owner of this file (arcc-t05) has permission to read/write, and thus copy this file.

Any other user can not copy this file, and thus it will not be copied as part of everything else.

...

View the content of files

...