Tag Info

Hot answers tagged


ls -t or (for reverse, most recent at bottom): ls -tr The ls man page describes this in more details, and lists other options.


Turns out this feature is not Apple-specific. This is a feature of BSD systems in general. /* Root is -A automatically. */ if (!getuid()) f_listdot = 1; Initially I was able to trace it back to the sources of 4.4BSD-Lite. It was already present in this FreeBSD commit from 1994 which is importing those sources. The feature is also present in OpenBSD ...


I do so love *nix and love seeing the inventiveness that goes into some of these replies... Mine's not nearly as fancy on GNU Linux : alias ls='ls --color -h --group-directories-first' Given that I'm more comfortable with my linux CLI apps, I tend to also update coreutils on OSX : brew install coreutils alias ls='/usr/local/bin/gls --color -h ...


What is it? It's name is actually Icon\r, with \r being the carriage return 0x0D. If letting the shell autocomplete the path in Terminal, it yields Icon^M, ^M being \r. Icon^M is a file existing in all directories that have a custom icon in Finder. If you change a directory's icon e.g. in its Get Info dialog by pasting an image into the icon in the upper ...


You can use: ls -d -- */ Since all directories end in /, this lists only the directories in the current path. The -d option ensures that only the directory names are printed, not their contents.


Does your version of ls support the --time-style option? If so: ls -la --time-style=full-iso blah -rw-r--r-- 1 root root 0 2011-11-08 18:02:08.954092000 -0700 blah


ls is actually separate from Bash. Mac OS X has a BSD version of ls, which requires -G on the command line, or CLICOLOR (and perhaps LSCOLORS) in the environment. See man ls for more info.


It means that the file is executable. A classifier is shown when -F is passed to ls via the command line or otherwise.


Is ataka here the owner of directory? Well, yes (third column), but it also happens to be the name of the directory (last column). +-permissions that apply to the owner | | +-permissions that apply to all other users | | | | +-number of hard links | | | | | | +-size ...


Your expectations are based upon DOS Think/Windows Think and are wrong. On MS-DOS, Windows, and indeed a few other IBM/Microsoft operating systems, wildcard expansion is done by the command itself, and things like the /a option to the dir command act as attribute filters during wildcard expansion. dir expands wildcards like *, which the command interpreter ...


It indicates that the file has extended attributes. Use ls -l@ to see them. You can use xattr to edit these attributes. xattr -h will give you the inline help for it.


Simple - you pipe the output through head: ls -Bgclt /somwhere/in/the/past | head -n 3 You use -n 3 instead of -n 2 because of the 'total' line at the top of the ls output.


Try adding export LC_COLLATE="C" in your dotfiles, or changing the LC_ALL assignment to: export LC_ALL="C" This controls the way sorting on character level works — while the default would be to sort dotfiles inline, this will make sort list dotfiles first. To go further, quoting the GNU Coreutils manual (emphasis mine): If you use a non-POSIX ...


Stephen Martin's response gave a warning, and listed the current folder as well, so I'd suggest find . -mindepth 1 -maxdepth 1 -type d (This is on Linux; I could not find -maxdepth and -mindepth in the POSIX man page for find)


Off the top of my head, I think is has something to do with the file having extended attributes available. Here's a link to a similar discussion: http://discussions.apple.com/thread.jspa?messageID=5791060 So if you see a file with an "@" when you do an ls, try doing this: xattr -l <filename> That should show you the extended attributes. You can ...


Or does it know when its output is being piped to another command, and format its output differently in this case? Yes. From the full manual (available through info ls if the documentation is installed): If standard output is a terminal, the output is in columns (sorted vertically) and control characters are output as question marks; otherwise, ...


You were close. In bash you want process substitution, not command substitution: diff <(ls -1a ./dir1) <(ls -1a ./dir2)


Short version: rm *\([1-9]\)* Do not pipe ls to xargs. Instead, pipe find ... -print0 to xargs -0, in order to avoid such problems. find . -maxdepth 1 -name '*([1-9])*' -print0 | xargs -0 rm ...which can be written as: find . -maxdepth 1 -name '*([1-9])*' -exec rm {} \; and: find . -maxdepth 1 -name '*([1-9])*' -delete which can further be ...


I'd use find dirname -not -empty -ls, assuming GNU find.


For a complete answer here is what I use: ls -lrth Put this in your startup script /etc/bashrc and assign an alias like this: alias l='ls -lrth' Restart your terminal and you should be able to type l and see a long list of files.


From the ls(1) man page on Mac OS 10.6.1: If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. Otherwise, if the file or directory has extended security information (such as an access control list), the permissions field printed by the -l option is followed by a '+' character. ...


You can usels -d */, or ls -d .*/ for hidden directories.


Note: Due to legacy licensing reasons, most GNU/Linux distributions don’t include the original vi program as written by Bill Joy. Instead, the vi command is provided by running Vim in vi-compatibility mode. The following answer is based on running Vim with its vi-compatibility mode. Modifying a read-only file Vim warns the user if they modify the buffer of ...


Open the terminal window and type: alias ls='ls -G' Then hit Enter and done!


Ignacio Vazquez-Abrams has already explained about the *. As for the executable-looking emulator that you can't actually execute, this can happen when the dynamic loader requested by emulator doesn't exist. You can check what kind of file emulator is with the command file emulator, and check what dynamic loader and libraries it needs with ldd emulator (any ...


From info ls: `-F' `--classify' `--indicator-style=classify' Append a character to each file name indicating the file type. Also, for regular files that are executable, append `*'. The file type indicators are `/' for directories, `@' for symbolic links, `|' for FIFOs, `=' for sockets, `>' for doors, and nothing for regular ...


Try watch. Taken from here: watch -d ls -l A friend and I tried this a moment ago, it seems that the highlighting doesn't really work correctly, it will highlight a seemingly random selection. I've tried this in an OS X Terminal ssh'd to a RHEL5 machine and my friend has tried in a Ubuntu GUI terminal. Unfortunately inotifywait is not present on the ...


Here's a link to the source code. Note /* Root is -A automatically. */. This is a feature in Apple's version of BSD ls.


This answer was previously posted on Stack Exchange, before I noticed the question was being moved. Each numbered point in your quote applies in turn to each of the three characters. If the first character is 'r', the file is readable If the second character is 'w', the file is writable If the third character is 'x/s/S', the file has the ...

Only top voted, non community-wiki answers of a minimum length are eligible