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

learn more… | top users | synonyms

2
votes
2answers
29 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
34 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 ...
0
votes
2answers
54 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 ...
4
votes
2answers
90 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 ...
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, ...
1
vote
3answers
37 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
488 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
68 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
1answer
42 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
43 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 ...
0
votes
3answers
61 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
227 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 ...
0
votes
2answers
98 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
164 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
77 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) ...
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
50 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
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
1answer
206 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
106 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 ...
0
votes
1answer
80 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
150 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
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
421 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.
2
votes
2answers
250 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
133 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
79 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 ...
4
votes
4answers
3k 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
788 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
209 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
272 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
260 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
279 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
163 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 ...
1
vote
3answers
3k 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
120 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 ...
2
votes
2answers
2k 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 ...
5
votes
3answers
613 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
344 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
166 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
60 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 filetypes. ls nand2tetris/myChips/ And16.hdl And16.cmp And16.tst ...
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.
2
votes
1answer
33 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 ...
0
votes
1answer
103 views

cd and ls wont work in terminal mac.

Can anybody explain what is wrong with my terminal: $ echo $PATH =/usr/local/bin $ ls -bash: ls: command not found $ cd -bash: find: command not found Why won't these commands work? Help? ...