Giter VIP home page Giter VIP logo

the-art-of-command-line's Introduction

Hi! My work and interests lie at the intersection of AI, engineering, writing, and knowledge tools.

I believe the purpose of technology is to improve our collective knowledge and intelligence and to solve human problems. A bit more about me:

  • Tech: I’ve worked on conversational AI systems since early days at SRI with the original Siri team. I’ve built search engines with prominent ex-Google engineers. I have a broad interest in the theory, the practice, and the human elements of software engineering, and the history of software and AI. Even longer ago, I studied mathematics at Berkeley. Tech stacks I've used the most are a variety of frameworks in Web, React, JS/Node, Python, Java, C/C++, Lisp, and (yes) Prolog.
  • Engineering: Have been a founding engineer and eng leader at several startups in AI, SaaS, and web search (some failed, some successful).
  • Writing: Wrote and edited few popular guides (2M+ readers), including The Art of Command Line (which is apparently with 140K+ stars a top-40 most popular GitHub repo of all time), equity compensation, and AWS. I’ve also edited (and published) about a dozen books by other authors.
  • Recent work: I started and built much of Holloway, a platform that has rebuilt the digital book publishing process with dozens of in-depth, web-based guides in entrepreneurship, creativity, and personal growth. We also publish print books. I love to talk to authors, experts, and anyone who cares about sharing high-value knowledge.
  • Inspiration: The technologist I most admire is Doug Engelbart. His work is as relevant today as it was 50 years ago. By sharing a vision of what was possible, he shaped how we use software for decades. I feel privileged to have met him a few times.
  • Random: In sometimes random ways, I try to learn a few things about many topics and many things about a few topics. My interests include good books of all kinds, startups, AI, software engineering, obscure programming languages, logic and foundations of mathematics, philosophy, product design, typography, psychology, mental and physical health (and their interactions), fitness and nutrition, trail running and wilderness backpacking, natural history (especially of the California mountains and deserts), fingerstyle guitar, 15th-18th century lute music, early American blues, Brazilian Portuguese, truth, kindness, and some other arcana.

Find me:

Please say hello if you think you should! I'd be glad to hear from you if we share interests. If you're trying to reach me, note I sometimes fall behind on messages. I don't mind reminders and more detail or context in a message helps. :)

the-art-of-command-line's People

Contributors

aaossa avatar anna-d avatar bishopwolf avatar clumsylee avatar dmytro avatar dspinellis avatar ericguirbal avatar fernandoalmeida avatar gernd avatar jlevy avatar lakshmipathi avatar llyaudet avatar lsrom avatar mark-i-m avatar mihaimaruseac avatar mkwardakov avatar mudongliang avatar niltonvasques avatar olegberman avatar petk avatar psycho7 avatar s1syphos avatar snowcat8436 avatar spmbt avatar stepan0904 avatar timacs avatar timothyqiu avatar uggla avatar ungsik-yun avatar xuchunyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

the-art-of-command-line's Issues

Man pages

I think having a section explaining the basic usage of man pages would be good.

Stuff like usage, topics, searching, etc

Remove Vi/Vim bias.

Learn at least one text-based editor well. Ideally Vim (vi), as there's really no competition for random editing in a terminal (even if you use Emacs, a big IDE, or a modern hipster editor most of the time).

Specifically...

as there's really no competition for random editing in a terminal (even if you use Emacs

This simply isn't true, it should be redacted.

I suggest something a little more balanced.

Learn at least one text-based editor well. Ideally Vi/Vim or Emacs, so you can immediately use your editor from the a terminal. Be aware the Vi/Vim will almost always be part of any standard *nix distribution.

Mention 'tee'

The tee command is quite useful if you want to watch the output and write it to a logfile at the same time.

Remove fortune, ddate, and sl

I propose removing fortune, ddate, and sl commands due to their limited usefulness, and having nothing to do with the ideology of The Art of Command Line.

Add uname

Probably uname -a. Perhaps near lsb_release.

Awk one-liner duplicates an earlier example

In "Processing files and data":

Know basic awk and sed for simple data munging. For example, summing all numbers in the third column of a text file: awk '{ x += $3 } END { print x }'. This is probably 3X faster and 3X shorter than equivalent Python.

In "One-liners":

  • Summing all numbers in the third column of a text file (this is probably 3X faster and 3X less code than equivalent Python):
      awk '{ x += $3 } END { print x }' myfile

Note on scp and rsync

There seems to be no mention of scp or rsync, which I use on a fairly regular basis. Would it make sense to add it in here?

MacOS-specific section

While not the focus of the guide, there are a handful of macos commands that should be added in their own section:

  • open and open -a to open desktop apps
  • pbcopy and pbpaste to copy and paste values into other apps
  • mdls to list metadata

Others?

Everyday use, may want to mention vi mode

At the top of every day use there's an example of several keyboard shortcuts for deleting words and erasing the line. That's in the emacs cli mode, which is the default, but you can also use the vi mode. This allows you to use the vi macros for navigation, which can be much more fluid when the user is accustomed to vi or vim. Just an idea!

Newbie Guide - Linux Basics

First i don't want to advertise my blog here.

I'm creating issue just because i feel my notes helps some peoples.
If you still thinking i'm advertise here feel free to close/delete this issue.

Before few days, I tried everyone to explain some basics linux like cp, mv and from where to get help, how to use vim etc.

I thought to create my blog and publish all my notes so i've to just give them url when they want some help.

Newbie Guide - Linux Basics

Linux Ideas and History
Linux Usage Basics
Running Commands and Getting Help
Browsing the Filesystem
Users Groups and Permissions
Bash & Shell Scripting
Standard IO & Pipes
Text Processing Tools
VIM - An Advance Text Editor
Basic System Configuration Tools
Investigating and Managing Processes
Configuring the Bash Shell
Finding and Processing Files
Network Clients
Advanced Topics in Users Groups and Permissions
The Linux Filesystem
Package Management
System Logs and SELinux
System Initialization
Deadly Linux Commands

All above topics are covered at https://miteshshah.github.io/linux/basics/

Add jot

And merge/combine with seq, probably in main section, not obscure section.

Mention iotop

Machine hogged down with disk I/O, which process is responsible?
Often it won't show up high in top because it will be mainly waiting for I/O and therefore not consuming many CPU cycles.

iotop shows which processes are using disk I/O the most.

Mention the builtin "help"

As the guide is so Bash-centric I suggest mentioning the builtin "help" command, as it can be the only source of extra info for some commands (other builtins)

For example, disown is mentioned so I tried to find out more about it

$ man disown
No manual entry for disown
$ disown --help
bash: disown: --: invalid option
disown: usage: disown [-h] [-ar] [jobspec ...]
$ disown -h
bash: disown: current: no such job
$ help disown
disown: disown [-h] [-ar] [jobspec ...]
    Remove jobs from current shell.

    Removes each JOBSPEC argument from the table of active jobs.  Without
    any JOBSPECs, the shell uses its notion of the current job.

    Options:
      -a    remove all jobs if JOBSPEC is not supplied
      -h    mark each JOBSPEC so that SIGHUP is not sent to the job if the
        shell receives a SIGHUP
      -r    remove only running jobs

    Exit Status:
    Returns success unless an invalid option or JOBSPEC is given.

man latin

"man ascii" is mentioned, for western europe "man latin1" is also very helpful.

Consider adding comm command

What it does (excerpt from man comm):

NAME
       comm - compare two sorted files line by line

SYNOPSIS
       comm [OPTION]... FILE1 FILE2

DESCRIPTION
       Compare sorted files FILE1 and FILE2 line by line.

       With  no  options,  produce three-column output.  Column one contains lines unique to FILE1, column two
       contains lines unique to FILE2, and column three contains lines common to both files.

       -1     suppress column 1 (lines unique to FILE1)

       -2     suppress column 2 (lines unique to FILE2)

       -3     suppress column 3 (lines that appear in both files)

Include information about bashrc

I'm willing to write a piece on that if it is needed. Let me know if required.
Aliases, keybindings, custom Prompt Statement can be mentioned briefly.

Typo about glob expansion character []

In section Basics:

- Learn about file glob expansion with * (and perhaps ? and {...})
+ Learn about file glob expansion with * (and perhaps ? and [...])

{} is for grouping commands.
[] is for file glob expansion.

Additional "everyday use" keyboard shortcuts and useful commands

C-a and C-w are emacs commands, and there are even more! One can use C-e to move to the end of the line and C-b and C-f to move one character. But one of the most useful is C-p to move up one line to the previous command (and analougue to that there is C-n to move down a line). To me it is more convenient than using the up-arrow key.

file, type, whereis, whatis and apropos were very useful to me while exploring the linux system.

ls | wc -l is useful for counting files in a directory.

Great stuff you've got so far, I will link people to this document when they want to learn the shell!

key bindings

Please try to distinguish between normal, unixy key bindings (like ^U), and editor-specific key bindings, like ^K, ^A, and ^E. There is little point to learning emacs key bindings for shellish things, when vi knowledge is another heavy prerequisite for modern administration.

Better examples of search/replace

We have some examples of search/replace, but they are too simple.

  • Should show a capturing group, e.g. sed with \1 in it and/or perl or repren alternatives.
  • Maybe even one with an arbitrary transform on the group (like upper- or lower-casing).
  • Another with multiline search replace, e.g. "foo,bar,baz" -> "foo\nbar\nbaz"

tail -f -F as a must.

In Basics section.

tail -f (or even better, less +F),
tail -f -F (or even better, tail -f -F),

Better than tail -f is also tail -f -F which gives a perfect way to deal with long tail -f regardless of logrotate mechanisms. It avoid to be surprised by rotations logs, ie, seeing no more log lines while there are ones, and allow long time tails. A must, once tasted.

Command tail follows several files permanently. Command less +F does not, one has to go to next file. Not better than less in that case.

Use sed to "replace all occurrences"

The current suggestion for replacing text in a file is to use perl, e.g.:

perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt

When I need this, I use sed -i, e.g.:

sed -i.bak 's/old-string/new-string/g' my-files-*.txt

Is there a reason users should prefer perl? Could that be documented (at least in this issue, if not in the document itself)?

ctrl-u

ctrl-u deletes from the cursor position to the beginning of the line. (I think that's a useful distinction versus "the whole line".)

Nice write-up.

diff (and patch)

diff is great to not only compare files but also entire directories.

It could help to also mention patch and xdelta.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.