Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*"
Favorites infavorites:mine
Status closed:yes
Types is:question
Exclude -[tag]
For more details on advanced search visit our help page
Results tagged with Search options user 25985

The shell is Unix's command-line interface. You can type commands in a shell interactively, or write scripts to automate tasks. Use this tag for questions applying to /bin/sh and most compatible shells (ash, bash, ksh, zsh, …). For shell scripts with errors, please check them in before posting here.

If you have a preferred invocation of date, you can set an alias: alias date='date +%Y%m%d%H%M' Now whenever you type date, you'll get the output of date +%Y%m%d%H%M. You don't have to use the sam …
answered Nov 3 '13 by goldilocks
To copy somefile to otherplace/somefile_ with modification date appended (eg, 2012_12_06): cp somefile otherplace/somefile_`stat --printf=%y somefile | sed -e 's/ .*//'` Probably easiest if you put …
answered Dec 6 '12 by goldilocks
If you set a script file executable: chmod o+x And include the appropriate shebang (#!/bin/bash) at the top, you do not have to invoke it with bash. See man chmod for an explanation of o+ …
answered Jan 3 '13 by goldilocks
Sometimes I find its information seems to expand that by --help help cd and cd --help are fundamentally different. help is a command built into the shell, and it provides information about other … commands that are built into the shell, meaning, they are not executables of their own, they are features of, e.g., bash. This can get a little confusing since some built-in commands also have …
answered Jul 11 '14 by goldilocks
/bin:/usr/bin and there is an executable gotcha in both directories, the one in /usr/local/bin will be used by default. You can now -- in this same file, in another shell config file, or from the … new shell. There is a limitation in that if you want to append something that was prepended (i.e. move a path within $PATH) or vice versa, you'll have to do it yourself. …
answered Apr 12 '14 by goldilocks
Instead of ctrl-c, move to the beginning of the line and do this: $ history -s "git commit -am 'FOO-123: fix issue with dorks around bars'" Hit enter. It won't execute, but it's now the last line …
answered Mar 20 '13 by goldilocks
It's a file test operator. -d /some/path means "return true if /some/path is a directory". ! is negation, so ! -d /some/path means "return true if /some/path is not a directory".
answered Sep 10 '13 by goldilocks
I'd like a way to add things to $PATH, system-wide or for an individual user, without potentially adding the same path multiple times. One reason to want to do this is so that additions can be made i …
asked Apr 12 '14 by goldilocks
I've been playing around with the fish shell for a few days and I like it. In order to start fish in a terminal via a quicklauncher or menu, I'm using a script like this:1 #!/bin/sh export SHELL … =/bin/fish exec konsole # <- KDE's terminal emulator If I run this script from the command-line, it does what's expected: starts a konsole whose shell is fish. But run from a KDE launcher, $SHELL
asked Dec 31 '14 by goldilocks
It does work. & forks the shell, starting a new process (you could think of it as & exit, except of course that syntax actually means something else). exit is a shell built-in that ends the shell … process -- in this case the new backgrounded shell. > exit & [1] 1709 > ps -p 1709 PID TTY TIME CMD [1]+ Done exit There's your job. It's done. It worked. …
answered Aug 15 '13 by goldilocks
It's no more or less strange than the fact that we have an upper and lower case alphabet to start with. If you look in /usr/bin, you'll notice a (very) few executables exploit capitalization. A case …
answered Jan 4 '13 by goldilocks
They aren't the same. $* is a single string, whereas $@ is an actual array. To see the difference, execute the following script like so: > ./ one two "three four" The script: #!/bin/bash …
answered May 12 '14 by goldilocks
since it's unquoted, if $1 is (e.g.) "hey x", the shell will will see x = x, so this construction is still not safe. The purpose of the x = x check is to determine if a variable is empty. A more …
answered Jun 11 '14 by goldilocks
I am looking for information pertaining to what will transmit the fastest, given the same server. There should not be any significant difference because the bottleneck is the network speed. In …
answered May 16 '14 by goldilocks
"Are there other reasons to recommend against this?" Of course: (3) Because one day I hope to add to the foundations built by the [-----------] and paranoid people who chastise others for aliasi …
answered Mar 5 '13 by goldilocks

15 30 50 per page