The command to list the contents of a folder/directory in Unix and Unix-like systems.

learn more… | top users | synonyms

1
vote
1answer
1k views

How to use wildcards with ls without listing directory contents?

ls typically displays only the files and folders in the present directory. But once you add a wildcard it starts searching in sub-directories. example: $ ls fight_folder file1 file2 $ ls ...
2
votes
2answers
36 views

How to list only ordinary files on UNIX

I'd like to list only ordinary files (not directories or symlinks) using ls from GNU tools. So far I have only some hackish greps. Is there an option or better way of doing that? Edit: I need more ...
1
vote
1answer
35 views

Completely hide files on Linux

i was wondering if there's a way to prevent a ls -a command to display certain files to certain user/group The criteria could be: if the file is hidden and the user/group has no read access, then ...
3
votes
5answers
2k views

Listing everything else than *{.tex, .aux} by ls

How can you ls everything else the the files *{.tex, .aux}? I run unsuccessfully ls -I".tex"
5
votes
2answers
651 views

ls version number sorting Mac OS X

Is there an equivalent to ls -v in Mac OS X that will do version number sorting? In Mac OS X, ls -v does NOT do version number sorting, but the Finder seems to.
0
votes
2answers
55 views

ls command - long format field separator

Is there a way to use a different field separator for the long output of ls? I have problems in parsing the output of ls -l because some fields, in my case the group, contain spaces. I went through ...
2
votes
2answers
136 views

Where does the “l” command come from on my system?

My Ubuntu allows the use of l as a command to print out the current directory much like ls except that it is actually better in that it specifies which are folders, files, and executables. Is this an ...
4
votes
2answers
93 views

What is the modification date ls reports for directories in Bash shell?

When I run ls -l in Bash shell, it lists a modification time for both files and directories. As noted in this thread, the modification time for directories does not reflect all of its contents. It ...
3
votes
1answer
53 views

What causes files to use up more more disk space than the file size suggests?

du was showing some drives with much less space than I was expecting, and ls -alh also showed the sum at the top to be a factor of three more than the sum of the individual files. Following this ...
21
votes
7answers
3k views

What does the @ mean on the output of “ls” on OS X' terminal?

When doing an ls in a directory I get the following output: drwxr-xr-x@ 12 xonic staff 408 22 Jun 19:00 . drwxr-xr-x 9 xonic staff 306 22 Jun 19:42 .. -rwxrwxrwx@ 1 xonic staff 6148 25 ...
23
votes
0answers
19k views

ls -la symbolics… what does that last symbol mean?

Possible Duplicate: what does the @ mean on the output of ls on os x terminal? when I type ls -la I get this familiar output... drwxr-xr-x+ 38 kent staff 1292 Nov 6 11:09 . ...
0
votes
0answers
28 views

What does the at sign mean when listing files with ls? [duplicate]

When copying files with cp command on Mac OSX Mavericks and then looking at them ls command I sometimes see an @ sign in the listing. What does it mean please? For example: # cp -v ...
2
votes
1answer
21 views

Search .zip files for sizes

I have a directory with many .zip files. I wish to search through them to match an uncompressed file size (I am trying to find which .zip my file originated in, and the name's been changed). IDEALLY, ...
5
votes
5answers
13k views

how to list all files and directories in given directory with full path but not recursive?

Somehow like dir /b command but I need also hidden and system files there. Built in dir command doesn't allow to list such 'hidden' files with the rest and I must use /s to have full path in there, ...
1
vote
3answers
38 views

Linux - Open nth File LIsted

I'm Ubuntu, I do ls and get a list of files. How would I open the nth file in the list in VIM in reference to its position from the ls command, and not its name? I want to do this cause a directory ...
1
vote
3answers
526 views

Ls command in bash script says 'No such file or directory'

The following is the script I am running #$1 - Argument declare IPATH="sample/" declare F=$IPATH$1 echo $F ls $F The input is ./script.sh "Fil*" The echo output is - sample/Fil* when I run the ...
0
votes
1answer
27 views

Supressing backup files in a ls command not working

How do I suppress backup files displayed in ls? I've already tried - ls --ignore-backup and ls -B Neither suppress the back-up files created by the editors. Am I doing something wrong? or Is there ...
1
vote
1answer
69 views

Find the largest file in directory without size in output

I need to find the biggest file Only one file should be listed Search should work in given directory and subdirectories Output should display absolute path to the file with filename find "$PARAM" ...
2
votes
3answers
3k views

How to recursively list all files with timestamps and full path?

I want to recursively list all files in a given directory, with their full path and their timestamps. Something like this: 10:30 Dec 10 2010 /tmp/mydir/myfile I've tried with: find . -type f -exec ...
2
votes
1answer
43 views

find -mtime fails to return results that ls -l show are there

On a Red Hat Linux system, I have a directory with several hundred files. I wanted to delete all files older than 24 hours. I did the deletion using find . -type f -mtime +1 -delete. Trivial stuff, ...
1
vote
3answers
72 views

Show thumbnails in Mac terminal?

Some time ago I've googled nice screenshot of Mac terminal How it can be possible? Special terminal application or special settings of ls?
-2
votes
2answers
44 views

Output of ls command

22387281 -rwxr-xr-x 1 john ce0814 8936 5 Oct 13:54 frk 22379635 -rw-r--r-- 1 john ce0814 322 5 Oct 13:53 frk.c 22445178 -rwx------ 1 john users 4 7 Oct 12:05 log.txt What are the first and third ...
1
vote
5answers
5k views

How to list files by file owner in Unix command?

I need to list all of the files my WD sorted alphabetically by the file owner name. Does ls have something for this?
0
votes
3answers
64 views

Get the last file name in a variable in bash?

In a directory, I have the following files: myfile_v01.txt myfile_v02.txt myfile_v03.txt How to make a bash script that detects the value of the last version and put the filename of this last ...
0
votes
1answer
249 views

List files of folder page by page with LS command

I'm wonder if there is some way to list all files of a folder by ls, I know how to use ls for a folders which are small but if list of files doesn't match with the screen size what should I do? there ...
16
votes
7answers
13k views

ls -d is not displaying directories. Is there a way to get ls to only display directories instead of files and directories

Is there a way to get ls to only display directories instead of files and directories From the man page. -d, --directory list directory entries instead of contents, and do not ...
326
votes
6answers
203k views

How can I sort the output of 'ls' by last modified date?

How can I sort the output of ls by last modified date? I can't find the answer on Google without digging around, an there is no answer on Stack Overflow either.
3
votes
2answers
115 views

One line ls command to display symbolic links

How can I use just one single ls command to display all symbolic links in my /dev directory? I know ls -l and that's about it.
0
votes
1answer
72 views

What can I use as parameters to specify the output behavior of `ls`?

What is the ls command that will produce the following output? 478661 .gconf/ 478662 .gconfd/ 450001 .gimp-2.4/ 450006 .gksu.lock 478706 .gnome/ 478664 .gnome2/ 478667 .gnome2_private/ 478669 .gnupg/ ...
0
votes
2answers
102 views

Unable to get ls to recognise LS_OPTIONS or LS_COLORS?

Trying to get --color=auto as the default ls argument. $ ls --version ls (GNU coreutils) 8.21 … $ echo $LS_COLORS ...
2
votes
2answers
169 views

In linux, how do you get a total size of a folder for files that are 1MB and up

Hi im doing some cleaning up on my server and i want to know how would i get the total size of a folder of files that are 1mb and up and also 1mb and below. I got as far as: ls -lh | grep 'M ' But ...
1
vote
1answer
83 views

How to make `ls` color its output by default, without setting up an alias?

I don't want an alias (alias ls='ls --color'), and I had previously set this up on Mac OSX using CLICOLOR environment variable which magically brought colors to ls. Now I am on Linux (Arch x86-64) ...
26
votes
7answers
19k views

Unix: ls, how to sort first directories then files etc

I would like to use ls command to first show direcotries and then files. I tried ls -la | sort -k 1 But I got a wrong order.
0
votes
2answers
57 views

What does the * mean next to a filename in the ouput of the command ll? [duplicate]

I have a doubt related the output of ll command. When, in my shell, I execute the ll command I obtain this output: -rwxrwxr-x 1 andrea andrea 104215 ott 15 15:56 atmosfs* Why I have the * next to ...
1
vote
2answers
40 views

Subdirectories in prompt?

I'm working on making my prompt as useful as possible. Right now, it contains the date, time, and directory, along with a colored divider line so I can easily see where each batch of input starts. I ...
0
votes
1answer
51 views

On executing ls bar you see a list of 10 files of which bar is one of them. How can that happen? [closed]

I came across this question in an exercise in a UNIX textbook and can't seem to figure it out
6
votes
2answers
907 views

How can I make “ls” show dotfiles first?

Somewhere along the way I screwed up my ls command and now I get this ordering when running $ ls -AhHl --color=auto -rwxr-xr-x 1 clang clang 640 Mar 1 02:46 apple-touch-icon-precomposed.png ...
1
vote
1answer
207 views

ls -l output difference between files and directories?

I looked at IBM's site and read the definition for ls -l, but could not find an answer to my question. When issuing an ls -l command on AIX, what is the explanation for the different 'file size' ...
0
votes
2answers
108 views

ls -l | wc -l output is different when redirected to a new file

"ls -l | wc -l" outputs "1+no. file/directories"(extra one for the first line). However when I run the command ls -l | wc -l > temp (when output is redirected to a new file temp). The value stored in ...
5
votes
2answers
954 views

How can I get colors with “ls -l | more”?

ls -l gives me color coded output. Folders are blue, executables green, etc. These colors are gone when filtering thorough | more. Anyway to achieve both paged output and colors?
0
votes
1answer
81 views

Ignore NTUSER.DAT files when ls on Git Bash?

I use Git Bash as my terminal on Windows. When I ls in my Home directory, I see some NTUSER.DAT entries, which I assume are system files. They don't appear when I run dir in the default Windows ...
3
votes
1answer
153 views

what does this output of ls mean?

sysadmin@ubuntu /etc $ ls vsftpd* vsftpd-users.db vsftpd.conf vsftpd.conf.backup vsftpd: vsftpd.pem what is this vsftpd: vsftpd.pem part, and what does it mean? I never seen such before. does it ...
37
votes
5answers
39k views

How to list folders using bash commands?

Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
0
votes
0answers
101 views

Linux with Lustre file system: slow listing of directory contents after millions of files created and deleted

I ran a script that created millions of files in a directory. I have since deleted the files, but ever since then, it takes ~6 seconds to list the few contents in the directory. This is in CentOS 6 on ...
0
votes
2answers
363 views

How do I interpret “total 18” in the output of the “ls -l” command in Solaris10?

auyantepui# ls -l total 18 drwxr-xr-x 2 root sys 512 May 23 13:11 READMEs/ drwxr-xr-x 2 root sys 1024 May 23 13:11 bin/ drwxr-xr-x 2 root sys 512 May 23 13:09 docs/ drwxr-xr-x 2 ...
0
votes
2answers
427 views

Show mounted USB device on Linux

I want to find /dev/ location of a USB device. The main thing is, it's not a drive or any other mass storage , it is basically only a USB modem and wvdial can not detect it. So I just want the ...
1
vote
1answer
55 views

What does # mean in ls output

when I do an ls on a director I get an output like xxxx@l70:~/mail$ ls inbox #inbox# What does the # mean in this context?
0
votes
2answers
53 views

What does the @ at the end of access rights stand for? [duplicate]

When I ls -la, one of my folders has the following notation drwxr-xr-x@ 28 what does @ stand for? For the record, I am using OSX.
8
votes
7answers
16k views

Tell `ls` to print only the base filename

This is the default behaviour of ls ls /net/nas/data/languages/pypm/sites/rex/free/2.6/*/pool/v/vi/virtual*1.4.4*pypm ...
16
votes
2answers
8k views

How do I interpret the results of the `ls -l` command?

I want to learn about the meaning of values for example first line; drwxr-xr-x 2 ataka root 4096 2008-11-04 16:58 ataka is ataka here the owner of directory ? kioutsovkm@orkide:/users/lnxsrv2/ee$ ...