trying out some coding stuff
Dec. 2nd, 2022 03:37 pmthat i've never done before. I know some html, don't really know css but can make it do stuff for me, but for the first time I messed around in terminal & managed to find file directories and make it list out files that I have. I know, it's super basic lol :) but it was cool to see stuff happen when I typed! ah, not even list files in directories, I also got it to tell me when the files were created. Awesome.
Let's see if I can remember what the commands were:
cd [finding certain folders through paths]
ls [list]
ls -l [that's an L] [for showing the date created etc]
yay!
also figured out a small little issue that was confusing me for a bit. For a while I was having trouble where the path wasn't working, say
/folder1/folder2/folder 3
it was like "never heard of that place."
Then I managed to google & find out that, of course, it was getting all tripped up by the space. Of course! why would it think those were the same thing? I know it because I know what I named my folders but the computer doesn't. A folder with a space in the name has to be written like this:
/folder 1/folder2/"folder 3"
kind of self-evident. But also. cool! I figured it out :)
Let's see if I can remember what the commands were:
cd [finding certain folders through paths]
ls [list]
ls -l [that's an L] [for showing the date created etc]
yay!
also figured out a small little issue that was confusing me for a bit. For a while I was having trouble where the path wasn't working, say
/folder1/folder2/folder 3
it was like "never heard of that place."
Then I managed to google & find out that, of course, it was getting all tripped up by the space. Of course! why would it think those were the same thing? I know it because I know what I named my folders but the computer doesn't. A folder with a space in the name has to be written like this:
/folder 1/folder2/"folder 3"
kind of self-evident. But also. cool! I figured it out :)
no subject
Date: 2022-12-03 05:14 am (UTC)The space-in-filename thing and "the computer" is a bit tricky. Under the hood, lots of functions for dealing with filenames are just fine with it containing a space. But you're not a programmer calling functions, you're a user interacting with one specific computer program, the shell (probably /bin/bash if default Linux or /bin/zsh if a Mac), and _it_ expects spaces separating all the interesting units in the commands you give it. Thus the need to quote names with spaces in them. Likewise, ? and * are treated specially by the shell, so a command like 'curl http://foo.com?name=Alice' needs to be 'curl "http://foo.com?name=Alice"' to keep the shell from trying to do something with the ?.
Also useful exploration:
man ls -- 'manual page' for the ls command. Most other file commands have man pages too. Commands built into the shell may not.
set -- by itself, dumps out all the environment variables. 'set | more' or 'set | less' more useful for seeing them all.
no subject
Date: 2022-12-08 07:54 pm (UTC)