AstonJ

AstonJ

Which command line tools do you use?

I’ve been watching Prag Dave’s Elixir course and I noticed he uses tree:

Tree is a recursive directory listing program that produces a depth indented listing of files. Color is supported ala dircolors if the LS_COLORS environment variable is set, output is to a tty, and the -C flag is used. With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn. Upon completion of listing all files/directories found, tree returns the total number of files and/or directories listed.

On Mac install with: brew install tree

EG:

$tree
.
├── README.md
├── lib
│   └── hangman.ex
├── mix.exs
└── mix.lock

You can use the options to ignore directories or files.

Any other cool command line tools you know of or use?

Most Liked

dimitarvp

dimitarvp

In short, a heck ton of them. I can write a series of articles about which tools I use. I made it a credo to gather as much as possible CLI and TUI tools and become master at them. The latter part still eludes me – not enough time and energy still – but I have become quite the small encyclopaedia of CLI/TUI tools.

Waiting for Aston’s “you should write a blog about it Dimi!”. :003:

Hallski

Hallski

Another one for tree, rg and jq.

Some others:

Maartz

Maartz

I like a tool called tl;dr.
It gives you basic knowledge of many commands.
On macOS it’s a good’ol brew install tldr
They also have a nodejs client, so it can be installed with npm.

EG:

❯ tldr grep

grep

Find patterns in files using regular expressions.
More information: <https://www.gnu.org/software/grep/manual/grep.html>.

- Search for a pattern within a file:
    grep "search_pattern" path/to/file

- Search for an exact string (disables regular expressions):
    grep --fixed-strings "exact_string" path/to/file

- Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
    grep --recursive --line-number --binary-files=without-match "search_pattern" path/to/directory

- Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
    grep --extended-regexp --ignore-case "search_pattern" path/to/file

- Print 3 lines of context around, before, or after each match:
    grep --context|before-context|after-context=3 "search_pattern" path/to/file

- Print file name and line number for each match:
    grep --with-filename --line-number "search_pattern" path/to/file

- Search for lines matching a pattern, printing only the matched text:
    grep --only-matching "search_pattern" path/to/file

- Search stdin for lines that do not match a pattern:
    cat path/to/file | grep --invert-match "search_pattern"

If a command does not exist, you can add it with a PR on their repo.
It’s a community-based FOSS tool.

Saves me a ton of time in googling and reading man pages.

Popular General Dev topics Top

justinjunodev
Figured this would be a cool topic and maybe provide some inspiration for those who are just starting to work from home. Feel free to sha...
New
AstonJ
I just watched this: (tldr: remove bad choices so you don’t need to use willpower) It got me thinking about ways to incre...
New
AstonJ
What do you think needs fixing in the digital / computer science sphere?
New
chasekaylee
Hi everyone! I have been in the professional industry for ~2 years now coming from a boot camp. I started a base foundation by programmin...
New
AstonJ
If you could work on any project, what would it be? :upside_down_face:
New
Exadra37
Have you ever wanted to build something but you had no idea what to do? Just as authors sometimes have “writers block” it’s also true for...
New
AstonJ
Slightly different to the What does your mobile phone home screen look like? thread, what is your lock screen image?
New
TwistingTwists
Hello Fellow developers, I have been trying to wrap my head around How difficult would it have been to be a dev 20-30 years ago? I have...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
DevotionGeo
Few days ago I watched Felienne Hermans’ video at Manning titled How to read confusing code. She was pointing out that new developers are...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1132 25355 750
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New