Earlier quoted context omitted.
sh, the Bourne shell mode of pdksh? Isn't that a little too limited? pdksh (/bin/ksh) though is great, yes. I'm in general a big fan of the OpenBSD userland: straightforward and very, very well-documented. Real manpages, no religious "The full documentation for xyz is maintained as a TeXinfo manual" crap. A well-conceived featureset and good docs are key to properly learning a platform. OpenBSD taught me a lot about…
Also worth noting that native borne shell was always slightly slower than korn shell. Though been a long time since I checked that one out, though did on few systems and found it to be so. But there again csh was also about then, distant memory in for many that one. Also anything that will run script wise on bourne will run as is under korn. Though you may well find that it is historical, which one a user picks shell…
Unix Tricks
141–150 of 166 posts
Re: Unix Tricks
#142I call this one sshping. while sleep 0.1; do nc -w 1 -z host 22; done Useful when waiting for systems to boot.
$ until-success ssh ...
If you have my sysadmin-utils installed:Re: Unix Tricks
#143Earlier quoted context omitted.
In Linux with bash (and probably other shells that are bash-compatible), you can use vi to edit any of the commands in your command history, and then execute the edited version. Do this at the command prompt, or once in your ~/.bash_profile to make it permanent: set -o vi After that, you can search for any of the commands in your history, edit it, and then execute the edited command, by doing this: At the prompt, typ…
Yes, that is also a solution. However, you cannot use vim so if you're used to vim, it might feel limited without certain commands. You're also missing eventual plugins. It's better than nothing though.
At the shell, it's true that you're limited to vi-style controls (so no text objects like ci").
However, once you press 'v' in normal mode you can drop into either vi or vim - this only depends on what $EDITOR is set to[1].
Re: Unix Tricks
#144Ctrl+r is fine when you're looking for something recent, but this one is useful when you're looking through a long list of similar commands. alias hist='history | grep' Use it like this: $ hist git 9543 git add toto 9544 git commit 9545 git log 9546 git log 9548 git add -A 9549 git commit 9550 git log 9633 git pull 9955 cd dev/git 9957 git grep copyof 9958 git grep copyof 9959 git pull By the way, do you know you can…
Re: Unix Tricks
#145 alias ..="cd .."
alias ...="cd ../.."
# etc
and of course `cd -` to jump to previous directoryRe: Unix Tricks
#146I would add: TOOLS ... * 'tree' instead of 'ls -R' ...
Which package would that be in?
Also this bash function from Mathias Bynen's famous dotfiles is a fantastic shortcut for colorised (and more) output from tree. https://github.com/mathiasbynens/dotfiles/blob/master/.funct...
Re: Unix Tricks
#147Re: Unix Tricks
#148Earlier quoted context omitted.
There's no good way to refer to the entire DOS/Windows command shell lineage without confusion, but that's what I meant. I don't technically use DOS at all anymore. I think "that system" is easier to understand in it's entirety and find your way around than Unix, although it has been getting progressively more complex for years. I actually use OS X most of the time now (plus Linux on servers and Windows for 3D stuff)…
> I think [DOS] is easier to understand in it's entirety and find your way around than Unix Yikes, I recently had to do a bit of development on a windows box and I found the command-line tools (not to mention CMD itself, which seems to have stopped development in 1993) to be absolutely awful. I could barely survive without Cygwin, git bash, etc giving me some semblance of a functional shell setup. I guess it's differ…
http://blogs.msdn.com/b/powershell/archive/2007/03/19/monad-...
Re: Unix Tricks
#149Earlier quoted context omitted.
>You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Are you escaping your color codes in PS1 correctly? Bad: PS1="\033[1;32m \w \033[m $" Good (notice the extra \[ and \]): PS1="\[\033[1;32m\] \w \[\033[m\] $"
Mine seems escaped as hell, but still gets wrapped. Anything I'm missing? edit: couldn't get UTF-8 branch symbol to be properly displayed here, but this is how it looks: http://i.imgur.com/zuq24gV.png?1 function fancyPrompt { local bgBlue="\[\033[48;5;31m\]" local fgBlue="\[\033[38;5;31m\]" local fgWhite="\[\033[38;5;231m\]" local bgDarkBlue="\[\033[48;5;24m\]" local fgDarkBlue="\[\033[38;5;24m\]" local bgDarkGray="\…
Re: Unix Tricks
#150Earlier quoted context omitted.
Wow, DOS users still exist? Which one? FreeDOS? Back in the late 90s when I first moved to Debian from Windows, growing up with a DOS CLI made the transition far easier to me (and having some FTP exposure didn't hurt either).
There's no good way to refer to the entire DOS/Windows command shell lineage without confusion, but that's what I meant. I don't technically use DOS at all anymore. I think "that system" is easier to understand in it's entirety and find your way around than Unix, although it has been getting progressively more complex for years. I actually use OS X most of the time now (plus Linux on servers and Windows for 3D stuff)…
cmd.exe? Powershell?