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 9191

The ls command lists the contents of a directory.

10
votes
1answer
Say I have folder "foo" residing, the home directory. I want to get some info of it, owner, group, permissions, etc... I then do this to try to get the information: cd ~ ls -l foo Of course it … now lists the info of the contents of "foo" Then I could do something like this cd ~ dir=foo ls -l $foo/.. | awk 'BEGIN { dir="'$foo'" } { if($9 == dir) { print $0 } }' But isn't there an easier way to do this? …
asked Aug 18 '11 by Tyilo
1
vote
3answers
I want to do something like this, but it doesn't save the variable after the piping ends: fs=( ) echo ${fs[@]} ls -A1 | while read f do echo ${fs[@]} fs+=( "$f" ) echo ${fs[@]} done echo … ? Update: Can't use *, becuase i need hidden files Can't just use fs=($(ls)), while sometimes the file/dir names will have spaces in them …
asked Jul 19 '11 by Tyilo
7
votes
Found the solution here: https://stackoverflow.com/questions/7112599/ls-get-information-of-the-directory-specified-only-not-info-about-the-sub-file/7112619#7112619 Which basically is ls -ldO foo and then you just append | awk '{ print $5 }' to make it display the information …
answered Aug 18 '11 by Tyilo
10
votes
3answers
I know you can set or unset the hidden flag of a folder/file by doing chflags hidden foo.txt and chflags nohidden foo.txt. But is there anyway of telling whether the folder/file is currently hidden o …
asked Aug 18 '11 by Tyilo
15
votes
8answers
Say I have the following output from ls -l: drwxr-xr-x 2 root root 4096 Apr 7 17:21 foo How can I automatically convert this to the format used by chmod? For example: $ echo drwxr-xr-x | chmod-format 755 I'm using OS X 10.8.3. …
asked Apr 7 '13 by Tyilo