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 20626

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.

1
vote
A simple solution that avoids parsing of ls and also works with spaces: shuf -en 30 dir/* | while read file; do echo $file done
answered Aug 30 '17 by scai
26
votes
reading the whole file might be exactly what you want. For example in order to cache it so that later reads will be significantly faster. The shell can't know your intention. Similarly, a C compiler will never optimize out reading a file, even if you don't look at the stuff you read. …
answered Mar 10 '14 by scai
9
votes
Option --group doesn't support any arguments unless you intend to create the given group. But it seems like you cannot add a new user and a (different) new group at the same time. What are you trying …
answered Mar 3 '14 by scai
3
votes
I would expect cp to use less CPU when copying locally because it doesn't use diffs whereas rsync can reduce writes when using diffs. Compression should be avoided locally because you have to read and …
answered Jul 31 '12 by scai
2
votes
For a plain list of IPv4 addresses a simple cut should be enough: cut -d "." -f -2 tmp_exim | sort -u
answered Feb 28 '14 by scai