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

learn more… | top users | synonyms

1
vote
3answers
310 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
207 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 ...
0
votes
2answers
1k 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
65 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
62 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.
2
votes
2answers
607 views

How can I make “ls” show dotfiles first and preserve unicode filenames?

$ export LC_ALL=en_US.UTF-8 $ ls -al total 24 drwxr-xr-x 6 pi pi 4096 Jul 23 16:34 . drwxr-xr-x 9 pi pi 4096 Jul 23 16:33 .. drwxr-xr-x 2 pi pi 4096 Jul 23 16:33 .A drwxr-xr-x 2 pi pi 4096 Jul 23 ...
1
vote
3answers
274 views

Pipe with ls command

When I want to know if a command is a link or not, I do like following. $ which locate /usr/bin/locate $ ls -l /usr/bin/locate lrwxrwxrwx 1 root root 24 5月 3 2012 /usr/bin/locate -> ...
0
votes
2answers
89 views

ls command thinks directory is file

I have a directory brothers which contains files John.txt and Max.txt. I can cd into and out of directory brothers with no problems. However, when I'm in brothers superdirectory (one level up) and I ...
5
votes
4answers
8k views

How to rename multiple files in a directory in some pattern in Linux?

I have a directory which has files with random names. What I want to do is rename the files with file1, file2 and so on.The lexicographically smaller file name should be numbered with smaller number. ...
2
votes
2answers
3k views

Print full path of files and sizes with find in Linux

Here are the specs: Find all files in / modified after the modification time of /tmp/test, exclude /proc and /sys from the search, and print the full path of the file along with human readable size. ...
1
vote
1answer
355 views

Is there a way to limit maxdepth for ls -Rhal?

Is there a way to limit maxdepth in a ls -Rhal command? I am aware of find . -maxdepth, but I want to be able to get the file information that comes with ls -Rhal.
5
votes
2answers
822 views

How to use GNU parallel with gunzip

I have a directory full of .gz, I want to expand each archive in parallel with GNU parallel. However I did not achieve anything. I tried parallel 'gunzip {}' ::: `ls *.gz` parallel gunzip `ls *.gz` ...
5
votes
1answer
445 views

Linux shows several folders with the exact same name

I recently used a mac to copy several files and folders to a USB drive (ext4 through ExtFS), and now in Linux (Xbian) two folders in the root of the drive are shown four times. The output of "ls ...
0
votes
1answer
600 views

ls not using the LS_COLORS environment variable

I am using the configuration below for ls. I have changed the $LS_COLORS variable to display directories as cyan colored using di=01;36. However, when I run ls, directories show in purple. If I run ...
3
votes
2answers
465 views

Always run a command after another command

With zsh (and oh-my-zsh), is it possible to always run a command after a certain other command? I want to always run an ls after cding to a directory, rather than running cd example; ls every time. I ...
3
votes
3answers
11k views

How to display file details (size, date, etc.) from Linux “locate” command?

The (slow) Linux “find” command has an option, “-ls”, to display size, date, etc. like the “ls -l” command. But the “locate” command doesn’t seem to have that. So how can I get the equivalent ...
0
votes
2answers
198 views

How can I restore the man page for ls (/usr/share/man/man1/ls.1.gz)?

I was messing around with the man page files whereupon I accidentally deleted ls.1.gz, which describes the man page for ls. Is there somewhere where I can download a copy of this file which I can ...
4
votes
2answers
7k views

Recursively list full absolute path of files with permissions in Linux

I have done a bit of searching online, and I am trying to find a way to recursively list all files with their absolute path and with their permissions. I want to do this so that I can grep out what I ...
7
votes
3answers
2k views

List file range with UNIX wildcards

Say for example I have the following files in my working directory: mjk0001.fits, mjk0002.fits, ... numerically increasing all the way to mjk9999.fits. Is there a way to use UNIX wildcards to list or ...
1
vote
1answer
694 views

Why directories size are different in ls -l output on XFS file system?

I can't understand why ls -l show folder size less then block size. For example: [user@01 NEW]$ ls -l total 4 drwxr-xr-x 5 root root 78 Apr 22 00:43 controllers drwxr-xr-x 14 root root 4096 Apr ...
0
votes
1answer
397 views

Listing files by last accessed time?

How can I list files according to the last time they were accessed? So far I haven't seen a command that can list them by time. I need it to display files that have been last accessed last ...
0
votes
1answer
73 views

Colorize ls-output by filetype [duplicate]

Every once in a while I have to list some files (~20-50) in Bash on Linux || Mac. These files are from four different file types. ls nand2tetris/myChips/ And16.**hdl** And16.**cmp** ...
3
votes
2answers
122 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.
2
votes
1answer
36 views

List directories without erroring if none exist

I have a rather strict set of specs for a directory listing that I need: It must list the directories in the current directory It must list purely the basename (no "./", no trailing slash) It ...
1
vote
2answers
456 views

ls executes slowly on remote server

I have a very strange problem, one that may be too difficult to diagnosis without machine access, but maybe someone here may be able to help. I am using OS X, and on my local machine ls executes ...
6
votes
3answers
1k views

what does it mean a red filename shown with black background?

I have a compilation problem, and when I check my lib/ directory I get this output from "ls": What the red/black combination mean? I checked in the output of "dircolors -p" as suggested here ...
4
votes
1answer
790 views

Why does `ls` without any arguments (only flags) give me “no such file or directory”?

When I pass --color=always to ls, it occasionally outputs a number of No such file or directory errors, like this: ~/svn/projects/submm/adda/scat$ /bin/ls --color=always ls: cannot access ...
-2
votes
3answers
522 views

A file which is not a dir nor a file

This may look like a weird question, but I just got this output for a file (directory?) in my system. This may be a trivial or well-known error, but for me, this file (directory?) called ...
4
votes
5answers
7k views

How to display the file contents recursively?

I always have to submit the source codes in my printed assignment report. I have to copy and paste my course codes into the document and I find that it is an annoying task. I want to solve this "copy ...
2
votes
1answer
4k views

Linux: ls -l prints only question marks:

I have a problem with listing of some directory with ls -l: $ ls -l ./directory -????????? ? ? ? ? ? file001.txt -????????? ? ? ? ? ? file002.txt and just ls works good: $ ls ...
0
votes
1answer
384 views

Unix - Find files with the same name under a directory using ls

I want to list all suhosin.ini files under /etc/php5/ directory. The thing is that the 3 of them are one level deeper in the directory tree. I want to combine these two to one command # ls ...
1
vote
1answer
100 views

Directory Listing error ONLY in port 22 (SFPT)

I suddenly get this error using SFTP: Status: Connecting to 64.207.146.82... Response: fzSftp started Command: open "root@64.207.146.82" 22 Command: Pass: ********* Status: Connected to ...
3
votes
2answers
475 views

How to make ls command not show Icon? files?

I have a folder (say, Downloads) with a custom icon. When I execute cd Downloads and then ls, it displays Icon? Subfolder1 Subfolder2 How can I make the ls command skip (thus not showing) ...
2
votes
1answer
353 views

List directories first with MinGW ls

I have recently started using MinGW instead of Cygwin on my Windows 7 machine, and I am having a little issue with MinGW's ls. In Cygwin, ls has a --group-directories-first option that, obviously, ...
0
votes
2answers
315 views

Unix list absolute file name

Given an arbitrary single argument representing a file (or directory, device, etc), how do I get the absolute path of the argument? I've seen many answers to this question involving ...
1
vote
2answers
2k views

How come the ls command prints in multiple columns on tty but only one column everywhere else?

Even after using Unix-like OSes for a couple years, this behaviour still baffles me. When I use the ls command in a directory that has lots of files, the output is usually nicely formatted into ...
1
vote
2answers
463 views

Get all files from a directory without read permissions?

In Linux/Unix, if I am inside a directory of another user, but cannot view the contents of the directory by typing "ls," how do I get a copy of all the files? Is the only way to guess what the file ...
0
votes
1answer
116 views

Email file and folder list with size?

I am trying to get a list of all files and folders with there sizes (upto 1st level, i.e. file and folder names with there sizes in current directory) emailed to me via an python script. I got the ...
3
votes
3answers
2k views

How do I `cd` and then* `ls` automatically in linux?

I have found myself keep doing cd some_dir quickly followed by ls for quite some time now, and have been trying to write a bash alias to let me do this, such as: alas cd="cd $@; ls"; Problem with ...
0
votes
2answers
27 views

Change to xth directory terminal

Is there a way in a unix shell (specifically Ubuntu) to change directory into the xth directory that was printed from the ls command? I know you can sort a directory in multiple ways, but using the ...
2
votes
4answers
1k views

Linux: How to find all files with the same name different filetype and move them

I have a dir with hundreds of images, some most of them are raw format (ending in CR2), but for some I've converted them to jpg, so I have both CR2 and JPEG. How do I get all the files that end both ...
0
votes
0answers
59 views

Why does a directory appear when viewing the home folder but not when I use the command line in Linux?

It's an odd problem in that when I browse the home folder I see the directory 'Jquery' however when I use the command line nothing appears. I have used the commands ls | less, find . -iname jQuery, ...
0
votes
1answer
145 views

Discrepancy in file size on disk and ls output

I have a script that checks for gzipped file sizes greater than 1MB and outputs files along with their sizes as a report. This is the code: myReport=`ls -ltrh "$somePath" | egrep '\.gz$' | awk ...
4
votes
2answers
3k views

What does the number after Unix/Linux file permissions like “-rw-rw-r--. 1 ” mean in “ls -l” output

Can any one explain "-rw-rw-r--. 1 " and give some "detailed" information on ls -lart command. Why does the number change after "-rw-rw-r--. 1 " <----
1
vote
2answers
199 views

How do I list only source code files when I type ls on OSX?

when I type ls, I don't want to see .o files because everytime I ls, It see X.cpp X.h X.o, how do I not list .o files?
1
vote
1answer
316 views

What's permission 's'?

I did a ls on my /bin in OS X. I got the following output. What's the 's' permission in rcp line? /Users/snihalani/.oh-my-zsh on master at 11:12AM ➜ lsa /bin --------------.oh-my-zsh-------------- ...
3
votes
1answer
376 views

ls -l shows file size 0 of files in /proc, but cat produces content

# cat /proc/version Linux version 2.6.18-308.8.2.el5.028stab101.1 (root@rhel5-build-x64) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Sun Jun 24 20:25:35 MSD 2012 # ls -l /proc/version ...
1
vote
2answers
820 views

How do I recursively list the contents of all files in a repository (extension-agnostic) into a single text file?

I know that using "ls -R ." in bash you can recursively list the filenames. Can I use some similar command to list the contents of each file just the way their names are displayed using the ls ...
15
votes
3answers
2k 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 ...
0
votes
1answer
85 views

Bash Profile Coloring

I would like to make a few changes to my bash profile. Changes I would like include: Coloring Files: I would like files with the execute permission bit set to be colored green. I would like to ...