-3
votes
1answer
60 views

Find files using ls and wildcards

pwd : ../bin under bin I have a directory called datafiles. Use meta characters and the ls -lL command (with lower and upper case L) to list all filenames under the datafiles directory that contain a ...
3
votes
2answers
145 views

Valgrind /usr/lib files are not regular Linux files

The problem that I encountered today (on an embedded device with Linux) is that some files (specifically, the Valgrind /usr/lib files) are behaving very strange and they are not copy-able with scp ...
2
votes
2answers
158 views

Difference between `ls -c` and `ls -t`

What is the difference between -c and -t options for the ls Unix command? And how can I sort by date of creation with the ls command?
2
votes
0answers
87 views

ls does not show a hidden file (OS X)

I am using lsof to view the list of open files. One such file that it displays open is : Google 3864 malaykeshav 46u REG 1,1 470455334 32578671 ...
2
votes
4answers
90 views

Get the latest directory (not the latest file)

My folder parent has the following content: A.Folder B.Folder C.File It has both folders and files inside. B.Folder is newer. Now I just want to get B.Folder, how could I achieve this? I tried ...
4
votes
4answers
220 views

What is the Linux command to display how many file names in the directory end in two digits

What is the Linux command to display how many file names in the directory end in two digits? Using ls with a command like this : ls -l | wc –l *[0-9][0-9]
5
votes
3answers
467 views

Linux command to return all files that start with TEMP but do not end with double digits

What is the Linux command to return all files that start with TEMP but do not end with double digits? I think it should look something like this: ls -l TEMP*[!0-9][!0-9] but the results of my ...
3
votes
5answers
134 views

Look if a folder has some files of certain extention

Lets say I have a file structure: $ cd /home/Desktop $ ls -d */ Abc/ Qwe/ Zxc/ Rty/ $ Now I want to iterate through every directory and look if they have any .pdf files. Could some one please ...
1
vote
2answers
77 views

File not displayed using vi but visible with command ls -l CD*

I can do an ls -l CD* and see the following output. CDTEST userA RW RW R I am logged in as userA. But if I do an ls -l the file does not appear. If I do vi CDTEST it tries to create a new file ...
1
vote
1answer
124 views

ls: show file size with thousand separator [duplicate]

Is there some simple way to make ls display the file size number with thousand (and million, billion, ...) separator? A sample output should look like this: $ ls -lAF /bin/ -rwxr-xr-x 1 root root ...
4
votes
3answers
243 views

What could be the use case of changing modified time of a file to the future?

I was reading through the man page of ls on UNIX, specifically OS X Mavericks. This got me intrigued: If the modification time of the file is more than 6 months in the past or future, then the ...
0
votes
1answer
87 views

How can number of subdirectories and files be determined from ls -ld command? [closed]

How can number of subdirectories and files be determined from the output of using ls -ld command? I realize that this command only lists the directories.
0
votes
2answers
96 views

How can I for example list five largest files in /usr/lib -directory?

How can I for example list five largest files in /usr/lib directory? Please also add some minor explanation for each bit of code that you are using.
1
vote
2answers
262 views

In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?

Stupidly, I had been using a condition like this as part of a script: if [ $(ls FOO* 2> /dev/null) ] # if files named "FOO*" were downloaded then echo "Files found" # ... process and ...
0
votes
1answer
253 views

How to hide file size using ls command

I need to list some files in a directory using the ls command, but I need to also to hide the file sizes. How can I do that with the ls command?
2
votes
1answer
195 views

What file type categories do colors in the terminal represent in various distros (by default)?

I'm discovering new file type categories (if one can call different colors in the terminal in such a manner) almost on a daily basis. Still, I haven't found an exhaustive list of all recognized file ...
2
votes
3answers
746 views

How can a group own a file?

Whe I do ls -l, two of the fields are username of the owner and name of the owning group. The username is clear - I created the file, it is mine. However the group entry confuses me. My user is a ...
1
vote
2answers
1k views

Cheapest way to find the oldest file (recursively) from a directory under heavy load

What is the least expensive way to find the oldest file in a directory, including all directories underneath. Assume directory is backed by SAN and under heavy load. There is concern that "ls" could ...
1
vote
2answers
253 views

MacOsx - Shell - list all .php files and their octal permissions, inside a specifc folder

is it possible to list all the ".php" files located into a direcotry and their octal permissions? I would like to list them like this: 775 /folder/file.php 644 /folder/asd/file2.php etc...
8
votes
4answers
2k views

View permission / owner of full directory tree

I remember doing someting like "XXX /home/user/dir/child/file" and it returned the owner and/or permission of: /home /home/user /home/user/dir /home/user/child /home/user/child/file But I don't ...
2
votes
2answers
2k views

Linux listing files between two date without touch command

I need a command which will list the files between given date and time (YYYYMMDDHHMMSS - format) in to a text file. I don want to use touch command as its creating permission issue. I am new to this ...
1
vote
4answers
2k views

Is there a command to list files, exclude sub-directories and display size and date?

Before I begin please assume I have only basic knowledge in UNIX. Basic meaning I have only started reading about it since last week for a work related purpose. I have been experimenting with the ls ...
5
votes
1answer
1k views

`ls` command does not list latest directory contents

The Linux shell does not print up-to-date information when it comes to ls. For example I use my other processes (IDEs etc) to create some directories. However when I run an ls command I don't see ...
4
votes
2answers
518 views

Get the complement of the result of an ls command

Let's say I have a directory with multiple files, all of which are either binary files (files with no declared extensions) and source files (.c extension). I do this: $ ls and get: README.md ...
3
votes
5answers
429 views

Print non-existent files from a pipe input

I have a directory of lots of .PDF and .JPG files. There should be a .JPG file for each .PDF with the same name. I'm trying to use a command to find .PDF files that doesn't have a .JPG file. My ...
12
votes
2answers
5k views

What does the 'd' mean in ls -al results and what is that slot called?

In Linux, what does the d mean in the first position of drwxr-xr-x? And what are all of the possible letters that could be there, and what do they mean? I'm trying to learn more about the Linux file ...
2
votes
4answers
11k views

Unix Command to return all files that end with single digit and TXT extension

Which command returns all files that end with a single digit and have the TXT extension ?
16
votes
5answers
19k views

How to list all files in the size order

I would like to list all files in the order of big to small in size and the files could be present anywhere in a certain folder.
1
vote
1answer
1k views

cannot 'ls' /mnt directory

I have a CentOS-6 machine that I'm working on that is running a live database. It's having a problem with the /mnt directory. I cannot ls the directory for some reason. stat is working and shows ...
1
vote
6answers
4k views

ls: Do not show directories that match same pattern in wildcard searches, only files

Supposing I have something like the following, a typical business PC situation: drwxr-xr-x 1 whatever whoever 3 Oct 3 16:40 invoices2009 drwxr-xr-x 1 whatever whoever 4 Oct 3 16:40 ...
0
votes
1answer
833 views

Asking ls to only list files in a path that match a specific glob/regex

In Zsh: Is there a way to use ls to only list files and folders in the current directory that match a specific globbing or regex pattern? For example, say I have multiple files that start with the ...
6
votes
7answers
14k views

List only regular files (but not directories) in current directory

I can use ls -ld */ to list all the directory entries in the current directory. Is there a similarly easy way to just list all the regular files in the current directory? I know I can use find find . ...
1
vote
1answer
351 views

wdfs mount problem

I'm running Fedora/Gnome 3.4.2 64bit and I'm trying to mount a webdav file system to work with. As root, I run the command #mkdir /mnt/webdav #wdfs https://www.webiste.com:port/directory ...
5
votes
6answers
2k views

Strange case: Text file that exist and doesn't exist

I'm completely puzzled about a problem with a single plain text file in my system fedora 12. I used a known software in bioinformatics, maker, to produce lots of plain text files and one of them it ...
2
votes
3answers
587 views

Can I list only specific subdirectories?

I have a folder tree structure like arndell \_databases \_daily \_weekly claremont \_databases \_daily \_weekly monte \_databases \_daily \_weekly and I am only after all files inside ...
12
votes
1answer
6k views

ls taking long time in small directory

Running Ubuntu, I open a terminal and do sudo bash cd / ls | head -n 1000 And predictably about 20 directories are returned. However, if I do an ls, and don't pipe it into anything, the ls just ...
3
votes
2answers
5k views

List of Recently Modified Files

How can I Get a list of all files modified , say 3 months ago. I checked this question but I was not able to apply it to my scenario. I am trying this now , it seems to be working , but I know there ...
11
votes
2answers
1k views

“ls -lh” reports total size less than sum of individual sizes

Under what circumstances would ls -lh show a total that is less than the sum of the individual files? For example: $ ls -lh /var/lib/nova/instances/_base total 100G -rw-rw-r-- 1 nova nova ...
3
votes
2answers
147 views

How do I create a structured list of all the files and directories under a particular directory (recursively)?

I need to have an "image" of a file system without actual contents of the files - just all the names and the structure, so that I can read the file and know what files were stored there and how were ...
7
votes
6answers
6k views

What's the best way to count the number of files in a directory?

If parsing the output of ls is dangerous because it can break on some funky characters (spaces, \n, ... ), what's the best way to know the number of files in a directory? I usualy rely on find to ...
1
vote
1answer
315 views

file missing from Desktop screen but can be seen using “ls” under the Desktop directory

I downloaded some files onto desktop. After typing ls under the Desktop directory, I can see these files. However, I cannot see the icons on my desktop corresponding to the files I see with ls. I use ...
11
votes
5answers
15k views

Linux ls to show only filename date and size

How can I use ls in linux to get a listing of filenames date and size only. I don't need to see the other info such as owner or permission. Is this possible?
28
votes
2answers
23k views

How do I do a ls and then sort the results by date created?

In what order are the dated ordered by? Certainly not alphanumeric order. ls -lt sorts by modification time. But I need creation time.
9
votes
3answers
2k views

Why is sorting files by access time not working?

I tried to use command ls --time=atime it was working in one directory but wasn't working in another directory. I opened certain files in vim, evince and other applications but after the command file ...
4
votes
2answers
1k views

Tell if a folder/file is hidden in Mac OS X

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 ...
10
votes
6answers
5k views

What does the “number” in the owner field of files signify in linux?

I copied many files to my new linux host. I see that all files have the owner and group both set to 515. What does that mean?
14
votes
4answers
12k views

last time file opened

Is it possible to get the time when file was opened last time and sort all files in a directory by those times?