Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add my notes on chapter 1 of working the command line #23

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions working-the-command-line/chapter1/index.md
Expand Up @@ -82,7 +82,15 @@ There is more to the definition of "The Long Format" that you can find in the ma
> - minute file last modified,
> - and the pathname.

### `-F`
#### Understanding the permission details

The first column, on the left, will present a series of letters and dashes that correspond to the file permissions.

The first character is the file type (`-` for a regular file, `d` for a directory, and `l` for a symlink). Then, there are three groups of special characters regarding the permissions of the `user`, the `group`, and the `other` categories. Each trio is composed of the letters `r`, `w`, and `x`, which stands for read, write and execute permissions, respectively. When that category doesn't have a certain type of permission, the letter is replaced by a `-`.

> For instance, a `drwxr-xr-x` code indicates that the file is a directory, the `user` has read, write and execute permissions, while the `group` and the `other` categories, only have permissions to read or execute.

### `-F` or --classify

> Display a slash (‘/’) immediately after each pathname that is a directory, an asterisk (‘\*’) after each that is executable, an at sign (‘@’) after each symbolic link, an equals sign (‘=’) after each socket, a percent sign (‘%’) after each whiteout, and a vertical bar (‘|’) after each that is a FIFO.

Expand Down Expand Up @@ -120,7 +128,7 @@ working-command-line

When inside `working-command-line` type `cd chapter1` will move you into the `chapter1` directory. To move back up to the parent directory, enter `cd ../`. For each level you want to move up the tree, add another `../`. So, to get to the parent directory of `working-command-line` from within `chapter1`, type `cd ../../`.

When a directory or filename includes space characters, you need to either wrap the entire name in doublw quotes or, escape each space with a backslash.
When a directory or filename includes space characters, you need to either wrap the entire name in double quotes or, escape each space with a backslash.

```bash
cd "folder with spaces"
Expand All @@ -135,12 +143,13 @@ One way of searching your history is by pressing `Ctrl+R`

```bash
bck-i-search: _ # Start typing your search. Once you find the command, press enter to execute it
bck-i-search: _ # Start typing your search.
Once you find the command, press enter to execute it
```

> NOTE: You can press `Ctrl+C` to exit our of search mode
> NOTE: You can press `Ctrl+C` to exit out of search mode.

Let’s say we run `ls -l` and press enter but then realize we wanted to run `ls -lt`. You could simple type it our or, you can do something like this:
Let’s say we run `ls -l` and press enter but then realize we wanted to run `ls -lt`. You could type it out or you can do something like this:

```bash
ls -l # press enter
Expand Down