Command to list information about files.

learn more… | top users | synonyms

-2
votes
0answers
37 views

How can I capture two columns of ls output in a bash script [migrated]

I want to create a script to delete any directories with numeric groups. What I have so far captures and analyzes the group: #!/bin/bash re='^[0-9]+$' for x in `/usr/bin/ls -l /var/indexes | sort ...
0
votes
1answer
24 views

cygwin find -ls behaviour like ls [closed]

I use cygwin find with -ls (find . -ls) option to have a list of files with full path. Due to UTF-16 (windows XP in this case) converted to en_UTF-8 under cygwin, special charactere like accent are ...
4
votes
1answer
274 views

`ls` causes Segmentation Fault on a specific directory

I used $HOME/.local as prefix to install some applications without root access. There is one directory inside $HOME/.local that I can't execute ls command: [tuananh@server lib]$ ls Segmentation fault ...
-3
votes
2answers
173 views

Remove all files in directory except last 20

I have question why is my cmd for "removing all files in directory except last 20" not working within cron but in command prompt yes. * * * * * ls -1tr /home/testusr/test | head -n -20 | xargs -d ...
1
vote
2answers
80 views

how to pipe results from LS to CD in ubuntu

I'd like to ls for the latest created directory in a given directory (we create a new folder for each release) and then cd to that directory. I'd like to create an alias for this so I don't have to ...
0
votes
1answer
71 views

ls -l shows constantly updating log files with few minutes old time stamps (modified time)

I gave the command ls -lt to see which log files are constantly being written into, since if they are being written into, the modified time will almost be very close to date command's output. But ...
0
votes
0answers
39 views

Clarifying what modifies atime and the impact the find command might have

So on a regular basis I clear out files from my server which have an atime +160 with a command such as: (technically to delete old files but avoid any file that might have been accessed recently) ...
0
votes
0answers
104 views

du, df and ls report wrong free / used space [duplicate]

We have an Ubuntu 12.04 server running on a VMware ESXi host, with multiple partitions, running Zimbra 8 (mta/ldap only). One of partitions is a 30GB partition mounted as /opt/zimbra/data. I had a ...
0
votes
4answers
98 views

How can I make ls and xargs combined omit path

I have a folder called lib. In that folder are some files. I want to obtain all the names of the files that end in .jar, and concatenate them into a line, separated by spaces. I don't want the path ...
0
votes
1answer
1k views

Input/output error reading USB backup drive on CentOS 6.4

I'm suddenly seeing some strange behaviour on our USB backup drive that doesn't make sense to me: (2013-10-21 14:58:23 [root@newdc /]$ cd /mnt/backup/ (2013-10-21 14:59:03 [root@newdc backup]$ ls -la ...
4
votes
1answer
545 views

sudo fine, sudo ls not working (command not found)

On Ubuntu 13.04 running in EC2, all commands through sudo work fine except ls. Here are some example commands to illustrate the issue: ubuntu at host in ~ $ sudo ls sudo: command: command not found ...
-3
votes
1answer
445 views

Centos 5.4 - ls command not showing files on ftp server

I have installed ftp and vsftpd on my CentOS 5.4 through yum install ftp and yum install vsftpd. I have also created one ftp user with adduser ftpuser command. And here comes my problem. ...
0
votes
1answer
99 views

Correctly predicting the amount of disk usage with find/ls/stat and df?

I'm trying to programatically calculate the number of files that can fit on a drive. The drive uses LUKS/ext4 and has a block size of 4096. Below is a df printout of the drive. Filesystem ...
0
votes
2answers
50 views

How can I get ls to print output as it goes along?

It seems that under most situations ls will read the whole directory before producing any output - typically because it needs to sort or columnise the output. Normally this is fine but when reading a ...
-2
votes
1answer
419 views

ls: cannot access file : No such file or directory. [closed]

In the shell script, I will have to access the binary logs stored in /usr/local/mysql/data. but when I do this, STARTLOG=000002 ENDLOG=000222 file=`ls -d ...
5
votes
3answers
9k views

changing colors of files/dirs in linux ls

I use putty with a black background and was wondering if there was or is a way to change the colors of the dirs which are dark blue. i noticed DIR_COLORS.xterm and DIR_COLORS do they play this role? ...
3
votes
1answer
140 views

After emptying a directory with 60,000 small files, ls -l still shows large directory size?

Here is the ls -l after I did rm -f inside the cur and new directories. I expected the directory "sizes" to shrink back to the default "4096". [root@example Maildir]# pwd ...
-4
votes
1answer
141 views

linux + change/edit file without effecting on file date [closed]

I want to edit some file in my linux for example ls -ltr /etc/some_file -rw-r--r-- 1 root root 188 Jul 1 2010 sysstat . echo "Server101_IP=187.0.98.4" >> /etc/some_file . I ...
0
votes
2answers
1k views

linux\solaris + print specific date format from file

subject - print file date on solaris as format: yymmdd ( yy - year , mm - month , dd - day ) on Linux machine I type the following command in order to get: file date as the following: ls -l ...
0
votes
3answers
240 views

How to find largest files in a dir - ignoring directory sizes

I want to do something like this du -a | sort -rn | head But I want to extract files only, ignoring directories. To be clear, I want to traverse through all sub-directories but I don't want to ...
1
vote
2answers
249 views

How to redirect ls to the cd command

I want to do ls | grep something and cd to the one thing that is listed. I tried with | and searched, but nothing found. Is it using xargs?
4
votes
1answer
52 views

Glob Not Match?

How to list files that don't match a glob? E.g., let's say I have a directory that contains hundreds of files, 97% of which have the filename extension .png. I know I can list the PNG files with: ...
2
votes
1answer
249 views

Cannot open files modified with Cygwin on Windows, clue in ls -l output

I can no longer open the tabs.html and tabs.js files indicated in the output below (2nd and 3rd out of four). Using cygwin I applied a patch to them. I believe the clue is in the ls -l output. ...
1
vote
2answers
82 views

linux or solaris match files with uniq syntax

how to match all files that start with the string OS_PATCH and ended with .gz remark - the solution must to fit Linux and Solaris OS this task could be by find command or maybe with ls with ...
-1
votes
2answers
138 views

remove files starting with dash

I have (by mistake) created several files starting with a dash in my home directory. I can not select them nor delete them. # ls -lht -rw-r--r-- 1 root root 325 Mar 22 16:33 -s-vmstat-overall ...
-1
votes
3answers
107 views

List files and directories in linux [closed]

I am not very familiar with Linux. I have got root access of a server. When I run the command "ls" then it displays nothing. No error no information nothing. When I run "ls -l" it displays "total 0" ...
3
votes
5answers
9k views

How do I exclude directories when listing files?

How do I exclude directories when listing files in the current directory? ls . ^ will include directories in the listing.
2
votes
1answer
506 views

'ls' taking a long time to list 20 subdirectories

I have a directory (my_dir) which has 20 sub directories. Every time I run 'ls' or try to autocomplete a file name in this directory my IO usage goes to 100% and it takes very long time (10 mins) to ...
5
votes
2answers
2k views

FreeBSD: How to know real file size on zfs with compression on?

I'm using zfs on my FreeBSD 9.0 x64 and pretty happy with it, but I find it hard to count directory real, not compressed, size. Surely I can walk over the directory and count every file size with ...
2
votes
2answers
235 views

Is there a way to ls -l with like a -f option (like tail -f)?

Suppose I am extracting a huge file or slowly building up a huge file. Is there a way to have ls -lh "on" much like tail -f, so that I can constantly see the size of the file grow until I decide to ...
1
vote
0answers
253 views

Why does a file on an NFS mount seem to cache randomly, but no longer be cached when running `ls`?

Here's the mount configuration of an NFS mount, we'll call it server2, gotten from running cat /etc/mtab: <ip1>:/mnt/fs101 /mnt/fs101 nfs ...
1
vote
3answers
827 views

cd or ls not found?

All commands have been working until a few days ago on our Ubuntu server. When running ls or cd it returns bash: /bin/ls: No such file or directory. How can this be fixed?
5
votes
1answer
108 views

Who is the “author” of a file (Gnu “ls” manual)

In the manual for Gnu "ls," I see this: --author with -l, print the author of each file Does anybody know what the “author” of a file means in this context? This is (maybe?) not the ...
1
vote
4answers
994 views

Cannot remove or list directory (ls or rm) Linux - Debian

I have a log file directory at /var/log/apache2/vhosts on a Debian dedicated server. Every day I split the main access_log into respective vhostname.com_access_log files in /var/log/apache2/vhosts In ...
4
votes
3answers
464 views

Why might `ls --color=always` be slow for a small directory?

For a certain directory DIR on my system, the ls --color=always takes about 8 seconds, although it contains less than 10 files and subdirectories. Without the color argument it takes no time. Why ...
0
votes
2answers
155 views

-h not working for 'ls' command in Sun SPARC

I was trying this command for listing files in human readable form: $ ls -lh ...
13
votes
2answers
2k views

What does the new full stop / period mean in the RHEL6 ls output?

We have scripts looking at the output of ls -l output for permission information that have been failing recently on RHEL v6 systems which appear to be showing an extra . at the end of the permission ...
16
votes
4answers
6k views

What is the difference between du -h and ls -lh?

I am having a difficult time grasping what is the correct way to read the size of the files since each command gives you varying results. I also came across a post at ...
1
vote
2answers
3k views

Why does ls -lh and ls -ldh give me varying file size?

Why is that there is a difference in the file sizes as denoted in the screenshot i.e. the total file size under ls -lh is 44k whilst the size of the folder is only 4k? Am I reading it incorrectly?
3
votes
2answers
2k views

df showing wrong disk size

Df -h is showing a wrong empty space on my server, for one of the disks: /dev/sda2 450G 393G 34G 93% / Cpanel shows that it has only 34GB free, but there is a lot more. A few ...
1
vote
2answers
48 views

echo with each parameter on its own line

I would like an output similar to ls -1d, but I don't want to check if each file exists. I would prefer to just list the files. I could use echo, but echo only puts a space between files. How can I ...
0
votes
4answers
3k views

Absolute path with ls?

How can I make the ls command show a file's full path instead of just its filename? With all its options, there must be a way, right?
9
votes
2answers
922 views

What does the “@” sign mean in ls -l output?

I have this output on MacOSX: $ ls -l total 40 -rwxr-xr-x@ 1 levente staff 52 30 Sep 15:38 pl -rwxr-xr-x 1 levente staff 675 14 Feb 17:07 plplay -rwxr-xr-x@ 1 levente staff 662 26 Jan 14:13 ...
6
votes
2answers
4k views

Ubuntu - * at the end of filename?

In Ubuntu 10.10, showing a file listing using ll will occasionally show files with a * appended to the name of the file. What does this star mean?
2
votes
2answers
2k views

PuTTY pscp directory listing - can you specify a different file date/time format?

I'm using pscp.exe from PuTTY with the -ls option to get a directory listing via STDOUT to a perl script. The output I get is this: Listing directory /path/to/my/directory drwxr-sr-x 2 234 ...
5
votes
3answers
2k views

ls gives me “illegal option”

I recently installed zsh and now whenever I ls or ls -l or ls anything I get "illegal option". Not sure where to start looking to fix this.
2
votes
5answers
820 views

ls returns nothing only in certain directories

I have a raid drive mounted here: /data/ And certain directories like this one: /data/somedir/somesubdir/ when I run ls w/ or w/o any flags, terminal doesn't return anything. It does not ...
3
votes
1answer
978 views

cp -R source_dir/* dest_dir/ does overwrite files?

I am trying to copy, recursively, the content of a directory to another using: cp -Rv source_dir/* dest_dir/ It seems that everything work ok but when I list that directory with ls -l the change ...
4
votes
1answer
1k views

Folder size is greater than 4K on ext3

Lets say we have a default formatted ext3 filesystem, I run under the assumption that folders take 4K of space on the disk. But, what does it mean when a folder is bigger than 4K? Here is a pic of ...
2
votes
1answer
453 views

ls -al stalls in an ssh session

I have a very strange problem when I log into a remote machine using ssh. Here's the scenario: I log into a remote machine using ssh (this machine in not in the local lan) I do ls (it works) I do ls ...