Skip to content

Commit

Permalink
content: update linux tips
Browse files Browse the repository at this point in the history
  • Loading branch information
TrebledJ committed Oct 25, 2024
1 parent 1c5b19e commit d81797d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ dirname ~/.bashrc
```sh {data-lang-off .command-line data-prompt="$" data-filter-output="# "}
pushd # Push current directory, for easier returning.
popd # Return to directory on top of stack.
dirs # List history of dirs.
```
{% alert "success" %}
Expand All @@ -308,6 +309,12 @@ popd # Return to `~/a/b/c`.
`less` is a powerful text viewer (read-only), with capabilities to navigate, search, and filter lines in a file or long text.
Get some help. See all commands:
```sh {data-lang-off}
h
```
#### less - Nice Options
```sh {data-lang-off .command-line data-prompt="$" data-filter-output="# "}
less file.txt
Expand All @@ -322,6 +329,8 @@ less -I file.txt
less -N file.txt
```
You can turn on/off these options *inside `less`* by typing `-I<Enter>`, `-R<Enter>`, or `-N<Enter>`. This is useful if you forget to turn them on beforehand (e.g. after curling a web request).
#### less - Navigation
```sh {data-lang-off}
j # Line down.
Expand Down Expand Up @@ -568,6 +577,13 @@ Obligatory.

Okay, that's enough vim.

### Useful Things

Set line numbers.
```sh {data-lang-off}
:set number
```

## Hacky Hack Hack

### Generate Bytes
Expand Down

0 comments on commit d81797d

Please sign in to comment.