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)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 88983

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 http://shellcheck.net before posting here.

0
votes
If using GNU grep, then the -o option may be relevant: $ echo '-rwxr-xr-x 1 bv90 dkas 153698 Nov 18 13:08 WE994002.CCD' | grep -o '[^ ]*\.CCD$' WE994002.CCD This assumes that the file name you want …
answered Dec 1 '15 by dhag
6
votes
Try xargs -n1 -p ls -sh. Using what is in your question, xargs ls -sh -n1 -p, everything is passed to ls, rather than some of the options being used by xargs.
answered May 13 '15 by dhag
2
votes
This 'T' indicates the sticky bit. You can use something like chmod a+t to set it.
answered Sep 10 '15 by dhag
2
votes
~ (in my case). All those have special meaning for the bash shell, and should be protected if they are meant for awk instead. Try the following instead (I also altered the awk script to fit your … within single quotes within double quotes, but the shell only concerns itself with the outer quotes). Note that I also avoid parsing the output of ls. …
answered Mar 30 '15 by dhag
6
votes
If what you are after is to call gunzip on every file with a name ending in .gz anywhere within your current directory, this should do it: find . -type f -name '*.gz' exec gunzip {} + The more gene …
answered Dec 15 '15 by dhag
0
votes
Hardcoding your specifications, one way would be to compute line and column numbers from the offset (ignoring newlines), and use those values to select the proper line and highlight the proper column. …
answered Nov 3 '15 by dhag
3
votes
Instead of a temporary file, you could use of your shell's support for process substitution (this assumes bash, zsh or some implementations of ksh (the feature was introduced by ksh88)): awk -f ./scr …
answered Dec 14 '15 by dhag
2
votes
You did nothing wrong: ^etc indeed asks grep to only print lines that start with etc, and your file appears to contain no such line, which explains the empty output. If, instead, you meant to search …
answered Feb 14 '17 by dhag
3
votes
Here is an excerpt from the documentation for bash: When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes … the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. Since you have already checked the contents of .bashrc and …
answered Feb 3 '17 by dhag
2
votes
This is slightly beyond the powers of what shell aliases provide (assuming bash). You could define a function: function tail() { if [ "$1" == '-f' ]; then shift less +F …
answered Mar 30 '15 by dhag
0
votes
For starters, this probably doesn't do what you mean to do: cp"$name" >> file.bak This will attempt to call a command whose first two characters are cp, and the rest are the value of $name. Such a …
answered Nov 30 '15 by dhag
0
votes
keyboard input to sh: (echo test; cat) | (read x; /bin/sh) or perhaps: (echo test; cat) | ./main That probably won't be as nice as running a shell directly, however; detecting that its input isn't a terminal, it will probably disable its line editing capabilities. …
answered May 12 '15 by dhag
2
votes
You could run: rm '#korpus.txt#' Quoting will prevent your shell from interpreting # as a start of comment character. However, if this file is being held open by some process, deleting it will do …
answered Dec 14 '15 by dhag
2
votes
I'm surprised nobody has mentioned GNU parallel yet. Using it, the command would be as simple as: find -type f -name '*.wav' -print0 | parallel -0 lame {} {.}.mp3 This asks to replace each input fi …
answered May 4 '15 by dhag
2
votes
It sounds like setting CDPATH could get you close to what you are asking: cd cd [-L|[-P [-e]] [-@] [directory] Change the current working directory to directory. [...] If the shell
answered May 14 '15 by dhag

15 30 50 per page