ls is short for "list," which when used in Unix or Unix-like operating systems will display a list of files. Options can be added in order to change the way this command works or how it displays the information back to the user. The Windows counterpart of ls is dir, or in powershell, ...
3
votes
1answer
90 views
How to physically reorder files `03.mp3 01.mp3 02.mp3` (`ls -f`) in a directory?
The physical order of the files matters when I copy them onto my USB stick and listen in car mp3 player. Most of my music album folders are unsorted, e.g. ls -f may produce:
03.song3.mp3
01.song1.mp3
...
2
votes
1answer
41 views
Screen “dies” whenever “ls” is executed
I'm running Screen 4.00.03 on my RHEL 5 server. Wheneven I open a new screen and execute ls the screen dies. This only happens in this server and not in other servers. What is causing this problem?
...
1
vote
3answers
149 views
Linux 'ls' - what does the * mean?
When I do a ls in a folder, I sometimes get entries like:
a.txt*
b.txt
b.txt~
I believe:
~ means that it's a swap copy, however what does the * mean?
3
votes
1answer
56 views
Can I use my own Java program as a command in Windows?
I've developed a Java program which does the same task as the ls command in Linux.
After developing it, I was thinking about using it as a command in the DOS prompt.
Does Windows allow this? If it ...
2
votes
1answer
45 views
why don't ls -lrt `find .` and find . -exec ls -lrt {} \+ produce the same output?
I'm trying to sort files by date, including those that reside in subdirectories. I got it to work by using:
find . -exec ls -lrt {} \+
which I found somewhere on StackOverflow. My initial try was ...
1
vote
1answer
32 views
ls sorted from right to left
Example list sorted from left to right.
DATA2
DATA4
FILE1
FILE3
Example list sorted from right to left.
FILE1
DATA2
FILE3
DATA4
How do I do this?
2
votes
1answer
36 views
mouse interaction with ls output - click to open
I would like to be able to (double) click a file from the ls output and open it with the associated program. Anyone knows a way to do this?
Mouse-console interaction is possible with GPM and links ...
0
votes
2answers
45 views
What is a simple standard command line way of getting 'ls' to produce file permission in octal?
Any know a standard way, other than 'stat' to produce octal output for file permission from 'ls'?
Standard way of using stat (on OSX) is:
stat -f '%A %a %N' *
where * can be any file pattern that ...
1
vote
1answer
122 views
ls: cannot access /directory/path/*.rar: No such file or directory
From the following results it appears the *.rar is being taken literally, and not expanded. man glob gives no detail as to how it expands. Would someone kindly explain why?
~/Films $ls "Night of ...
3
votes
1answer
48 views
How to have Linux ls command show second in time stamp
Something annoying about ls -l command is it shows only hour and minute for a file(like 08:30). How can I see the second portion(like 08:30:44)?
man 1 ls and search for 'second' does not give any ...
1
vote
1answer
103 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.
2
votes
3answers
142 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 ...
2
votes
1answer
90 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?
2
votes
2answers
185 views
How to `ls` a remote folder?
This one uses Samba:
$ ls smb://192.168.5.4/wdtvlivehub/abc
ls: cannot access smb://192.168.5.4/wdtvlivehub/abc: No such file or directory
I somehow managed to do it by;
Browsing to the remote ...
1
vote
3answers
301 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 )
1
vote
1answer
97 views
List files beginning with underscores first when using `ls -l`
I'm using ubuntu (natty), and when I use ls -l, the files are listed, but apparently the sorting algo ignores any special characters. For ages I've used underscores to mark special folders. And it ...
0
votes
1answer
47 views
Why does ls-l not display locate as a symbolic link?
I ran the command ls -l /usr/bin/locate and from what I have read it is a symbolic link to slocate. Attached is a screenshot of what is displayed. As you'll see it is different to the results above ...
0
votes
2answers
62 views
How can I have ls follow the content of a directory like tail -f does on a file
I want to basically continuously update the file list of a directory similar to how tail does with the -f flag on a file.
is there any reasonable way to do this?
0
votes
3answers
47 views
what is the command for listing files/dirs recursively of specific directories
suppose in my current directory, I have 50 sub-directories. Now, I am interested only in about 20 of those sub-directories (whose names match a pattern). I would like to recursively list the contents ...
2
votes
2answers
110 views
Changing the order of columns displayed with `ls`
Is it possible to change the order of displayed columns when running ls -l on *nix (or dir on Windows)?
For example, I'd like to see the date modified, then the name, then other fields (or select ...
1
vote
4answers
165 views
Alternatives to cd/ls for command line navigation?
I generally work a fair amount from the command line in order to launch vim, git, ssh and so on. However, I find the Finder's columnar view more natural for browsing through my files. Unfortunately, ...
1
vote
1answer
70 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 ...
0
votes
0answers
106 views
Why can't I open a text file I just created?
I'm on Fedora distro server and OSX on Mac as client connected via crossover cable using a local IP. Fedora is serving web pages and the Mac is browsing and connected via ssh on the terminal. I was ...
0
votes
2answers
110 views
Why doesn't ls -lh show the total size of all the files and directories in each directory?
For example, it shows the kernel as being 18M but the Applications folder as being 3.8K
BSD/Darwin
5
votes
2answers
445 views
Icon? file on OS X desktop
When I ls my Desktop from terminal (by using ls ~/Dekstop), I see a file, Icon?. As far as I can tell, it's empty (nano Icon? shows nothing). It doesn't show up on my actual Desktop, and open Icon? ...
0
votes
0answers
60 views
MacVim prints 'ls' output whenever run via the 'mvim' command
Whenever I launch MacVim via the mvim command, I get the output of ls ~ printed to my terminal repeatedly for as long as I'm using MacVim:
$ mvim base.theme.bash
$ ActiveGSLocalData Music ...
1
vote
1answer
225 views
Mac OS X: Is there a straightforward way to color ls output according to Finder label colors?
I have a client with a directory tree that has a number of high-level directories that I need to have on my local development machine. I rarely look at them unless something goes awry.
I've marked ...
0
votes
2answers
59 views
How to do an ls as if you were in the group 'other'?
In a linux system, I've done a chmod o+r -R mydir/ and I want to check that users in the 'o' group are able to read the contents of mydir. How can I do an 'ls mydir' as if I were a user in the other ...
8
votes
1answer
488 views
Making ls aware of “hidden” file flag
Is it possible to make ls aware of the hidden file flag on Mac OS X?
Currently, a simple ls -lO produces:
$ ls -lO
total 0
drwxr-xr-x@ 84 danielbeck staff - 2856 29 Mai 22:44 Applications
...
3
votes
1answer
57 views
Specific ls output
Right now I'm calling the the following command ls -R and am receiving an output like this:
.:
file.txt script.php
./dir:
file.txt other.java
Is it possible to get the output to look like this:
...
2
votes
1answer
145 views
what does the First character (number) mean in ls -l on OSX Snow Leopard?
I've included an abreviated sample of ls -lasF output from OSX 10.6.7 - the man page for ls does not discuss the first number (0,8,16,32,48,80,376) per line that is shown in this output. (/etc links ...
2
votes
3answers
359 views
Filter ls output based on file size
I want to filter the output of the ls command based on file size. Any .jpg or .png files greater than 100KB should be reported in the output.
I've been able to filter the .png / .jpg files, but I'm ...
2
votes
1answer
238 views
How to remove the @ / extended metadata of a file?
I know that the @ in
-rwxrwxrwx@ 1 me staff 0 16 Mai 10:55 myLog.txt
means, that there is some extended metadata attached.
Fine. Doesn't interest me.
I need to know how to remove it ?
I ...
0
votes
2answers
225 views
`ls /users/applications` is not listing my applications on OS X
I would like to install xdebug here on my Mac (Macbook pro 8,1 13" running OS X 10.6.6), but I need to get into my applications folder in order to get to my phpize file.
When I type % cd ...
0
votes
1answer
371 views
ls | cut to produce a desired output [closed]
Use ["ls -l /etc" ]and direct you output to the cut command to extract the name of the files and then sort the result. All as a single line command using "|".
Yes this is a homework question but I ...
3
votes
1answer
304 views
In ls, how can I remove bg color for sticky bit
How can I remove the background color for the sticky bit.
LSCOLORS looks like this export LSCOLORS="Gxfxcxdxbxegedabagacad"
Using oh-my-zsh
Edit: As suggested I tested LSCOLORS="" ls but the colors ...
4
votes
2answers
340 views
How do I limit the number of displayed lines through ls?
Let's say I have a command
ls -Bgclt /somwhere/in/the/past
How do I limit the output to show me only first 2 files? (except for having only 2 files in that directory)
0
votes
2answers
197 views
chained commands to create directories on a remote server
To get rsync cronjob working, I need to first create the dir tree on the remote server before running rsync. The local directories shall mirrored (w/o content) to the remote server. I'm strugglying to ...
1
vote
3answers
586 views
Recursive ls with conditions
Why can't I use a command like this to find all the pdf files in a directory and subdirectories? How do I do it? (I'm using bash in ubuntu)
ls -R *.pdf
EDIT
How would I then go about deleting all ...
1
vote
2answers
58 views
Error with find and ls
I'm trying to use find and ls to sort files based on date, however, it's not doing anything. Here's my command:
find ./.BUBackups -name "test*" -exec ls -t {} \;
I also tried:
find ./.BUBackups ...
2
votes
1answer
2k views
ls | grep | rm — How to format this command?
I'm trying to delete a bunch of files in a certain directory (on Mac OS X using Terminal)
ls | grep \([1-9]\) | xargs rm
should do the trick, but it doesn't. I'm trying to delete any file with a ...
0
votes
3answers
291 views
Show both ctime and atime in ls output
Can I get both ctime and atime in ls output? Seems I can only pass one --time=ctime or --time=atime argument (the second is ignored). Is there any other way?
3
votes
2answers
302 views
How to diff file names in two directories (without writing to intermediate files)?
I am trying to do something along the lines of:
diff `ls -1a ./dir1` `ls -1a ./dir2`
But that doesn't work for obvious reasons. Is there a better way of achieving this (in 1 line), than this?
ls ...
1
vote
3answers
283 views
How to list recursively all files with timestampsand fullpath?
I want to list recursively all files in given direcotry, with their fullpath and their timestamps.
Something like this:
10:30 Dec 10 2010 /tmp/mydir/myfile
I've tryied with:
find . -type f -exec ...
3
votes
4answers
181 views
How to turn off --classify option in ls command?
My ls command is aliased to have certain options automatically applied, including --classify (same as -F) Normally this is fine and I don't want to screw around with my .bashrc file.
Just this one ...
1
vote
4answers
456 views
Run an ls without getting the full path
I want a simple list of files in a directory that is not my current directory. I run ls /other/directory/*.txt and get:
/other/directory/file1.txt
/other/directory/file2.txt
I want:
file1.txt
...
0
votes
3answers
274 views
how to display only Permissions and file names using ls command
and how to list all files in a directory including full path, owner, group and permissions for each file
2
votes
2answers
1k views
Unix - List all directories and subdirectories, excluding directories without files
I would like to list all the directories and sub directories in and below the current path. Since I only wanted to display directories I came up with the follwing command:
find -type d -exec ls -d1 ...
1
vote
1answer
150 views
What is the difference between 'ls *.py“ and ”ls *py"?
This happens in cygwin (CYGWIN_NT-5.1 MYPC 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin)
First command, ls *.py shows nothing
$ ls *.py
ls: cannot access *.py: No such file or directory
First ...
3
votes
1answer
425 views
What does the + mean in the ACL output of “ls -l”?
ls -l
-rwxr-xr-x 1 root root 885 2010-07-08 13:55 /etc/backup-number-of-files*
-rwxrwxr-x+ 1 levchuk Users 1067 2010-08-30 14:37 /etc/backup-running-time*
Please notice the + on the 2nd ...