The Art of Command Line
51–60 of 134 posts
Re: The Art of Command Line
#52[1] http://www.amazon.com/Unix-Power-Tools-Third-Edition/dp/0596...
Re: The Art of Command Line
#53Earlier quoted context omitted.
I can't remember ever encountered a unix-like system without "vi" installed. I've used (and set up) machines running FreeBSD, DragonflyBSD, OSX, Ubuntu, Debian, RHEL, ... Plenty of those didn't have emacs, especially on first boot, when you're most likely to need to modify network configuration files in order to get online to install new packages in the first place... Edit: By "vi" I mean that somewhere in the path t…
> I can't remember ever encountered a unix-like system without "vi" installed. Default Ubuntu install.
Re: The Art of Command Line
#54So this is tangentially related by why do people seem to push Vi? Nano is a perfectly serviceable editor. If I need to do extensive editing I always end up loading it into Atom, Sublime or some other editor anyway. I've never really had to use a console editor for more than 10s of lines.
"I don't understand why everyone doesn't do things exactly like I do using only tools I like" is a really stupid way to look at the world.
"Use vi, nothing beats it." == "I use x and I like it just fine."
If that was your intention, my mistake. It's just not apparent.
Re: The Art of Command Line
#55cat hosts | xargs -I{} ssh root@{} hostname glad to know this one :-) echo y | xargs -Ix echo x how tricky!
As the article mentions, especially useful when combined with the -P flag for paralellism.
cat urlpaths.txt | xargs -I{} -P wget domain.com/{}
Another handy trick, is to use `sh -c` or `bash -c` to include multiple commands with xargs. cat dirs.txt | xargs -I{} sh -c 'cd {}; touch file;'Re: The Art of Command Line
#56There's no reason to learn vi if you know Emacs. If you claim that Emacs isn't installed everywhere, guess what: Neither is vi. If you want an "installed everywhere" editor, learn ed. If you're willing to take an editor with you (or otherwise make sure a specific editor is everywhere you are), there's no reason it has to be vi.
vi is a posix requirement, emacs is not. If the system you're working on has ed, it'll have some version of vi or vim as well.
"Of course, we are not absolutely compelled to use ed, since V7/x86 comes with the full-screen editor vi (as well as the related line editor ex), but getting access to vi in this context would involve mounting the /usr filesystem and changing various environment variables and settings to allow editing in full-screen mode. Some basic ed skills are particularly useful in the V7 world, and most of all when one is involved on system administration tasks." [2]
Re: The Art of Command Line
#57Earlier quoted context omitted.
I can't remember ever encountered a unix-like system without "vi" installed. I've used (and set up) machines running FreeBSD, DragonflyBSD, OSX, Ubuntu, Debian, RHEL, ... Plenty of those didn't have emacs, especially on first boot, when you're most likely to need to modify network configuration files in order to get online to install new packages in the first place... Edit: By "vi" I mean that somewhere in the path t…
> I can't remember ever encountered a unix-like system without "vi" installed. Default Ubuntu install.
Re: The Art of Command Line
#58I think this will glob unless you escape the asterisks. Also on my system (debian 8) I need to put the directory to search first, or not at all:
find . -iname \something\
find -iname \something\
edit: hackernews ate all my asterisks
Re: The Art of Command Line
#59If you learn bash, and you learn vi, then the next most glorious addition is: set -o vi Then you have vi keys in your shell. And it is marvelous.
Instead of that, create the following file:
~/.inputrc (tilde slash dot-inputrc)
And in that file put at least this:
set editing-mode vi
Now every program that you run that a) has its own command line, and b) uses the readline library (there are a lot) has vi commandline editing. psql, mysql, telnet, lftp, and many more.
man bash has a section on READLINE. For example, in man bash search for
editing-mode
Re: The Art of Command Line
#60> StrictHostKeyChecking=no And welcome to MITM haven. This is awful advice if you care about the first S in SSH.