Skip to content

Commit

Permalink
Fixed username 'pi' --> 'pbl' in S0 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed May 4, 2023
1 parent 96eff74 commit c55b639
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions S0_SetUpRaspberryPi/S0_SetUpRaspberryPi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"\n",
"```bash\n",
"$ pwd\n",
"/home/pi # the output from `pwd`\n",
"/home/pbl # the output from `pwd`\n",
"```\n",
"\n",
"Another common command is `ls`, which is short for list. It prints a list of files and directories within the working directory. Try the following:\n",
Expand All @@ -217,22 +217,33 @@
" \n",
"The final command we are going to cover is `cd`, which is short for `c`hange `d`irectory. `cd` is used to naviagate the filesytem by changing the current directory (the thing printed by `pwd`). It can change the directory relative either to the old working directory or to a completely different directory if you specify the whole directory, starting with /.\n",
"\n",
"For example, the following command will change the current working directory to `home/pi/Desktop`:\n",
"For example, the following command will change the current working directory to `/home/pbl/Desktop`:\n",
"\n",
"```bash\n",
"$ pwd\n",
"/home/pi\n",
"/home/pbl\n",
"$ cd Desktop\n",
"$ pwd\n",
"/home/pi/Desktop\n",
"/home/pbl/Desktop\n",
"```\n",
"\n",
"You could do the same thing by using an *absolute* path:\n",
"\n",
"```bash\n",
"$ cd /home/pi/Desktop\n",
"$ cd /home/pbl/Desktop\n",
"$ pwd\n",
"/home/pi/Desktop\n",
"/home/pbl/Desktop\n",
"```\n",
"\n",
"Or by navigating to `~`, which is shorthand for \"home directory\":\n",
"\n",
"```bash\n",
"$ cd ~\n",
"$ pwd\n",
"/home/pbl\n",
"$ cd ~/Desktop\n",
"$ pwd\n",
"/home/pbl/Desktop\n",
"```"
]
},
Expand All @@ -248,7 +259,7 @@
"\n",
"Another command that you will probably use a lot is `sudo` (for `su`peruser-user `do`). This runs whatever command you type after it as if you were a super-user.\n",
"\n",
"You might be wondering why, as the sole user of this computer, you are not automatically a super-user. The answer is that, by default, your regular user account (username: `pi`, password: `raspberry`) does not have privileges that, say, allow you to go to some vital part of the operating system and start deleting files. Instead, to cause such mayhem, you have to prefix those commands with `sudo`. This just adds a bit of protection against accidents. For the commands we have discussed so far, you will not need to prefix them with `sudo`. However, just for interest, try typing the following:\n",
"You might be wondering why, as the sole user of this computer, you are not automatically a super-user. The answer is that, by default, your regular user account (username: `pbl`, password: given to you by the course organizers) does not have privileges that, say, allow you to go to some vital part of the operating system and start deleting files. Instead, to cause such mayhem, you have to prefix those commands with `sudo`. This just adds a bit of protection against accidents. For the commands we have discussed so far, you will not need to prefix them with `sudo`. However, just for interest, try typing the following:\n",
"\n",
"```bash\n",
"$ sudo ls\n",
Expand Down Expand Up @@ -300,7 +311,7 @@
"print('World')\n",
"```\n",
" \n",
"2. Save this as a Python program called `hello.py`. If you do not change the directory, it will be saved in the folder `/home/pi/mu_code`\n",
"2. Save this as a Python program called `hello.py`. If you do not change the directory, it will be saved in the folder `/home/pbl/mu_code`\n",
"\n",
"3. Now that you have saved it, you can run the program in Mu using the `Run` button. The result will be shown in the Python Shell\n",
"\n",
Expand All @@ -310,7 +321,7 @@
"An already saved python program does not necessarily need to be run via an editor. Another way of running a Python shell is to use the Terminal. To run your `hello.py` program, first navigate to the right directory in the terminal:\n",
"\n",
"```bash\n",
"cd /home/pi/mu_code/\n",
"cd /home/pbl/mu_code/\n",
"```\n",
"\n",
"Then tell it run the program using python3:\n",
Expand Down

0 comments on commit c55b639

Please sign in to comment.