...
What the file system is, and a typical organization / hierarchy.
Some high-level comparison to that of Windows.
Absolute vs relative paths.
Commands:
pwd
,cd
,ls
,mv
,cp
,mkdir
,rmdir
,rm
History:
history
File Ownership and Permissions.
...
Note |
---|
|
...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Expand | ||
---|---|---|
| ||
arcc-t05/workshop/data/2023/Jan/ | ||
Panel | ||
panelIconId | 1f642 | panelIcon | :slight_smile
...
Commands:
...
If you are following along as part of a scheduled training or bootcamp, please replace the <project-name> 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:
...
Info |
---|
Commands are 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). |
Note |
---|
The next couple of parts list and briefly summarize the commands we will be covering within this section:
We will then follow up with examples on how to use them. |
...
<command --help>
Command | Description | ||
pwd |
| ||
cd |
| ||
ls |
| ||
mkdir |
| ||
mv |
|
...
Code Block |
---|
[~]$ cp myfile02b.txt folder01/ [~]$ ls folder01/ folder02 folder03 myfile02b.txt myfile.txt |
...
cp: folders
Info |
---|
Navigate home and try copying the |
Code Block |
---|
[~]$ cp folder01 cp: missing destination file operand after 'folder01' Try 'cp --help' for more information. [~]$ ls folder01 folder02 myfile02b.txt myfile.txt [~]$ cp folder01 folder04 cp: -r not specified; omitting directory 'folder01’ |
...
rmdir: Remove the DIRECTORY(ies), if they are emptyif they are empty
Info |
---|
The |
Code Block |
---|
[~]$ ls Desktop Documents Downloads folder01 folder04 myfile02b.txt myfile02.txt [~]$ mkdir folder05 [~]$ ls Desktop Documents Downloads folder01 folder04 folder05 myfile02b.txt myfile02.txt # Can remove folder05 since it is empty. [~]$ rmdir folder05 [~]$ ls Desktop Documents Downloads folder01 folder03 myfile02b.txt myfile02.txt [~]$ rmdir folder04/ rmdir: failed to remove 'folder04/': Directory not empty |
...
rm: Remove (unlink) the FILE(s)
Info |
---|
Look at one way at removing a folder that itself contains folders and files. |
Code Block |
---|
[~]$ cd [~]$ cd folder04 [folder04]$ ls folder02 myfile02b.txt myfile.txt [folder04]$ ls folder02/ [folder04]$ # ‘folder02’ is empty. [folder04]$ rmdir folder02/ [folder04]$ ls myfile02b.txt myfile.txt [folder04]$ rm myfile.txt [folder04]$ ls myfile02b.txt [folder04]$ rm myfile02b.txt |
...
Code Block |
---|
[folder04]$ ls
[folder04]$
# ‘folder04’ is now empty.
[folder04]$ cd ..
[~]$ rmdir folder04/
[~]$ ls
Desktop Documents Downloads folder01 myfile02b.txt myfile02.txt
# This has taken a lot of individual steps.
# Can we do this |
Note |
---|
This has taken a lot of individual steps. Can we do this quicker? |
...
rm: folders and file(s)
Info |
---|
Take a further look at the |
Code Block |
---|
[~]$ cd [~]$ rm folder01/ rm: cannot remove 'folder01/': Is a directory |
...
Code Block |
---|
[~]$ rm -r folder01/
[~]$ ls
Desktop Documents Downloads myfile02b.txt myfile02.txt
# Can remove multiple files.
[~]$ rm myfile02b.txt myfile02.txt
[~]$ ls
Desktop Documents Downloads
# Alternatively we could have removed above 2 files with: rm myfile*
# * is a wildcard, so the rm myfile* will remove all starting with the characters "myfile" |
Info |
---|
Alternatively we could have removed the above 2 files with: The |
...
rm: WARNING
From the command-line there is NO trash bin!
Using rm
/rmdir
is FINAL!
...
history
Info |
---|
The |
Code Block |
---|
[~]$ history --help
history: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
Display or manipulate the history list.
...
[~]$ history
...
219 rm -f folder01/
220 rm -r folder01/
221 ls
222 rm myfile02b.txt myfile02.txt
223 ls
224 history
# Repeat command ‘223’
|
Info |
---|
You can repeat a command. Lets repeat the command labelled |
Code Block |
---|
[<username>@blog1 ~]$ !223 ls Desktop Documents Downloads |
...
Exercises: Navigation
Info |
---|
Questions:
|
...
Note |
---|
Only user |
...
Exercises:
...
Permissions
Info |
---|
Questions: In all cases be able to justify your answer.
|
...
Expand | ||||
---|---|---|---|---|
| ||||
No. There are no permissions set for
|
...
...
Previous | Workshop Home | Next |