...
Ex: Starting at / (root), what is the absolute path to the bits folder?
...
...
Answer:
Expand | ||
---|---|---|
| ||
/usr/include/bits/ |
...
Ex: Starting in the home folder what is the relative path to the Jan folder?
...
...
Answer:
Expand | ||
---|---|---|
| ||
arcc-t05/workshop/data/2023/Jan/ |
Commands: <command --help>
...
Command
...
Description
...
pwd
...
Code Block |
---|
pwd: pwd [-LP]
Print the name of the current working directory. |
...
cd
...
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
If you are following along as part of a scheduled training or bootcamp, please replace the arccanetrain directory with the project directory you’ve been provided for your specific training/bootcamp. If you are training independently, please use your own project folder, but contact arcc-help@uwyo.edu if you would like a copy of the files and directories used in our examples. |
Commands:
Used to perform certain operating system tasks through the Command Line Interface, as directed by the interpreter (as opposed to a Graphical Interface Interpreter we would usually use).
...
<command --help>
Command | Description | ||
pwd |
| ||
cd |
| ||
ls |
| ||
mkdir |
| ||
mv |
|
...
Commands: <command --help>
Command | Description | ||
cp |
| ||
rmdir |
| ||
rm |
|
...
pwd: Print the name of the current working directory
Info |
---|
If you get lost, then you can jump back to the home folder. |
...
Code Block |
---|
[arcc-t05@blog1 ~]$ pwd /home/arcc-t05 |
...
cd: Change the shell working directory
Info |
---|
Start by navigating back to home. |
...
Code Block |
---|
[arcc-t05@blog1 home]$ cd .. [arcc-t05@blog1 /]$ pwd // |
...
cd: Change working directory (cont)
Info |
---|
Navigate into the |
Code Block |
---|
[arcc-t05@blog1 /]$ cd opt [arcc-t05@blog1 opt]$ pwd /opt |
Info |
---|
Question: Did we define an an absolute or relative path? |
...
Answer:
Did we define an an absolute or relative path?
Expand | ||
---|---|---|
| ||
When we print out the working directory, we are presented with a ' |
...
cd: Change the shell working directory
...
Info |
---|
Question: Did we define an absolute or relative path? |
...
Answer:
Expand | ||
---|---|---|
| ||
Relative path, since we specified the full path, starting with root: |
...
Info |
---|
Navigate up two levels: |
...
How can you return to your home folder?
What command do you use if you’ve forgotten where you are in the folder hierarchy?
How can you list what is in a folder as well as any subfolders?
Go back through the command related slides are try for yourself.
...
Answers
1: How can you you return to your home folder?
Expand | ||
---|---|---|
| ||
|
...
|
2: What command do you use if you’ve forgotten where you are in the folder hierarchy?
Expand | ||
---|---|---|
| ||
|
3: How can you list what is a folder as well as any subfoldersa folder as well as any subfolders?
Expand | ||
---|---|---|
| ||
|
...
File Ownership and Permissions
What does the output of ls –l
mean?
Code Block |
---|
[arcc-t05@blog1 ~]$ cd /project/arccanetrain/intro_to_linux [arcc-t05@blog1 intro_to_linux]$ ls -al total 54 drwxrwsr-x 4 salexan5 arccanetrain 4096 Oct 6 08:09 . drwxrws--- 40 root arccanetrain 4096 Oct 6 08:09 .. drwxrwsr-x 2 salexan5 arccanetrain 4096 Oct 5 11:19 clusters drwxrwsr-x 6 salexan5 arccanetrain 4096 Oct 5 14:56 data -rw-rw-r-- 1 salexan5 arccanetrain 874 Oct 5 15:30 fruits.txt -rw-rw-r-- 1 salexan5 arccanetrain 34472 Oct 5 10:57 software.csv -rw-rw-r-- 1 salexan5 arccanetrain 1603 Oct 6 08:08 vegatables.txt -rw-rw-r-- 1 arcc-t05 arccanetrain 26 Oct 5 07:20 workshop_all.txt -rw------- 1 arcc-t05 arccanetrain 23 Oct 5 07:20 workshop_me.txt |
...
Note |
---|
No one, other than |
...
If we change directories, and go to /project/arccanetrain/intro_to_linux, what permissions do the contents of this directory have?
Code Block |
---|
[arcc-t01]$ cd ../intro_to_linux [arcc-t01]$ ls -al # -rw-rw-r-- 1 arcc-t05 arccanetrain 26 Oct 5 07:20 workshop_all.txt |
Info |
---|
Any user within the Everybody can read it. Do you want anyone outside of this project to be able to read this file? |
...
Code Block |
---|
[]$ cd /project/arccanetrain/ [arccanetrain]$ cd arcc-t05 [arcc-t05]$ touch test.txt # Do you get a “Permission denied”? # Navigate into the intro_to_linux folder. [arcc-t05]$ cd ../intro_to_linux [intro_to_linux]$ cat workshop_all.txt Everybody can read this. [intro_to_linux]$ cat workshop_me.txt # Do you get a “Permission denied”? # Can you cd into the /opt folder? # Justify your answer. # Can you cd into the /root folder? # Justify your answer. |
...
Answers
...
Can
...
you
...
cd
...
into
...
the
...
/opt
...
folder?
...
Expand | |||
---|---|---|---|
| |||
Yes |
Can you cd into the /root folder?
Expand | ||||
---|---|---|---|---|
| ||||
No |
...
Next Steps
Previous | Workshop Home | Next |