Session 1 - Part I Flashcards
On any computer everything is stored in a
file system
What is a file system? - (2)
A file system is the organizational structure employed by operating systems to manage and store data on storage devices.
It establishes a hierarchical arrangement for organizing files and directories, facilitating efficient data access and retrieval.
What analogy is often used to describe the structure of a file system, and what is its ‘trunk’ equivalent?
A file system is often likened to a tree structure, where the ‘trunk’ represents the ‘base’ of file system.
The ‘base’ of the file systems is commonly denoted by computer as:
single slash ‘/’ character or known as ‘root directory’
What is a root directory? - (2)
The root directory is the highest-level directory in a file system hierarchy, serving as the starting point of directory tree from which all other directories and files branch.
It is denoted by a single forward slash (/)
Diagram of file system at YNiC
What is the path of the file “Thesis.doc” provided in the diagram?
The path of the file “Thesis.doc” is /home/alex/.
Why is it important to avoid certain ‘funny’ characters like spaces, question marks etc… in file system names?
Spaces and exclamation marks have special meaning to coders so when using them to name files in file system it becomes very complicate to manage and navigate to files in file system using code as using special characters on the file
Naming file in file system using ‘funny characters’ example
My Cat Pictures!.doc
What advice is given regarding file naming conventions in the notes, and why is it important to follow such conventions? - (2)
The notes suggest avoiding ‘funny’ characters like spaces and question marks in file names, advising the use of underscores instead.
This practice is crucial to prevent complications in file management and ensure seamless navigation within the file system.
Example of following conventions when naming files in file system
So instead of: My Cat Pictures!.doc
use…
My_Cat_Pictures.doc
What special character precedes commands executed within the Colab code cells, and what does it signify? - (2)
Commands executed within Colab code cells are prefixed with the ‘%’ sign, indicating that they are special commands (not Python).
These commands allow users to perform various non-Python operations within the notebook environment
What command is used to change the current directory within a Colab code cell?
The ‘%cd’ command is employed to change the current directory within a Colab code cell
what argument does %cwd require?
It necessitates specifying the desired directory it wants to change the current directory to as its argument.
What does %cwd / mean?
Changes the current directory to the ‘root’ directory of the file system
What does the ‘%pwd’ command do within a Colab code cell?
The ‘%pwd’ command in a Colab code cell prints the present working directory, revealing the current location within the file system.
What does %pwd stand for?
‘Print Working Directory’ or ‘Where am I?’
What does %cd stand for?
Change Directory
What command is used to list the contents of the current directory within a Colab code cell?
The ‘%ls’ command
What does %ls represent in Colab code cell?
‘List’
What does %ls -lt represent in Colab code cell?
%ls -lt’ stands for ‘List - Long, sorted by time’
How can one list the contents of the current directory in a ‘long’ format sorted by ‘time’ within a Colab code cell?
To list the items in the current directory in a ‘long’ format sorted by ‘time’ within a Colab code cell, the ‘%ls -lt’ command is used.
The directories exist in a
‘tree’
What will this code give you?
%cd /
%pwd
%ls
%ls - lt
- (3)
%pwd = given /
%ls - lists all contents of current working directory (from bin@ to cuda-keyring)
%ls-lt (output starting from total 100) - lists all contents of current working directory by working out file size and sorts them by date