diff --git a/content/guides/running_applications/linux_file_permissions.md b/content/guides/running_applications/linux_file_permissions.md new file mode 100644 index 0000000000000000000000000000000000000000..18e63a5996c8c6786a49dfd258e61fe593496635 --- /dev/null +++ b/content/guides/running_applications/linux_file_permissions.md @@ -0,0 +1,48 @@ ++++ +title = "Linux File Permissions" +description = "How to view and change file permissions with Linux commands" +weight = 20 ++++ + +- [Opening a Terminal Window] (#opening-a-terminal-window) +- [Listing File Permissions] (#listing-file-permissions) +- [Changing File Permissions] (#changing-file-permissions) + +## Opening a Terminal Window +----------------------- + +Use your local terminal to connect to a cluster, or open a new terminal window on [Crane](https://crane.unl.edu). + +Click [here](https://hcc.unl.edu/docs/quickstarts/connecting/) if you need help connecting to a cluster +with a local terminal. + +Click [here](https://hcc.unl.edu/docs/guides/running_applications/jupyter/) if you need +help opening a new terminal window within JupyterHub. + +## Listing File Permissions + +Type the command `ls -l` to list the files and directories with file permissions for your current location. + +{{< figure src="/images/LinuxList.png" >}} + +The first character denotes whether an item is a file or a directory. If 'd' is shown, it's a directory, and if '-' is shown, it's a file. + Following the first character you will see some +combination of r,w,x, and -. The first rwx is the ‘read’ ‘write’ ‘execute’ file permissions for the creator + of that file or directory. A ‘-‘ instead means a particular permission has not been granted. For example “rw-“ means the + ‘execute’ permission has not been granted. The next three entries are the permissions for ‘group’ and the last three are the + permissions for everyone else. + + Following the file permissions are the name of the creator, the name of the group, the size of the file, the date it was created, and finally +the name of the file. + + +## Changing File Permissions + +To change file permissions, use the command "chmod [permissions] [filename]" where permissions are indicated by a three-digit code. +Each digit in the code correspondes to the three digits mentioned above in the permissions printout: One for the creater permissions, +one for the group permissions, and one for everyone else. The command is interpreted as follows: 4=read 2=write 1=execute and any combination of these is given by summing their codes. +Each chmod command will include 3 codes. +For example, to give the creator of mars.txt rights to read, write and execute, the group rights to read and execute, and everone else only the right to read, +we would use the command `chmod 754 mars.txt` + +{{< figure src="/images/LinuxChange.png" >}} diff --git a/static/images/LinuxChange.png b/static/images/LinuxChange.png new file mode 100644 index 0000000000000000000000000000000000000000..efebff6048804e7ca6f0d94e8837f2584015a97e Binary files /dev/null and b/static/images/LinuxChange.png differ diff --git a/static/images/LinuxList.png b/static/images/LinuxList.png new file mode 100644 index 0000000000000000000000000000000000000000..f8a3bd521c2ea0c2acad9975d994b7731d54005c Binary files /dev/null and b/static/images/LinuxList.png differ