The command to list the contents of a folder/directory in Unix and Unix-like systems.
0
votes
3answers
34 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
23 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 ...
0
votes
2answers
30 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 ...
4
votes
3answers
41 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 ...
0
votes
1answer
40 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 ...
-1
votes
1answer
36 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
33 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
1answer
62 views
One line ls command
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
22 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
62 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? ...
1
vote
2answers
59 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 ...
2
votes
3answers
99 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 ...
3
votes
1answer
247 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
144 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 ...
1
vote
5answers
166 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 ...
0
votes
1answer
327 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
94 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
61 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 ...
2
votes
2answers
99 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) ...
0
votes
1answer
73 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
147 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 ...
0
votes
2answers
233 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
110 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
58 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 ...
1
vote
3answers
179 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
15 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 ...
1
vote
4answers
211 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
51 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
91 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 ...
1
vote
2answers
643 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
115 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?
0
votes
1answer
96 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
130 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
376 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 ...
4
votes
1answer
409 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
58 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 ...
2
votes
3answers
236 views
What is user/owner 24561?
So, I just installed the node.js package from nodejs.org and I was poking around to see what it installed. Over in /usr/local/bin I saw this owner 24561. I see it in a few other places too. What is ...
6
votes
2answers
354 views
Is there a tail -f equivalent for ls?
Basically the question is in the title. I want to monitor a directory for new files that are written or deleted, the way I can monitor a log file with tail -f. Is this possible?
1
vote
1answer
80 views
Formatting pwd/ls for use with scp
I have two terminal windows with bash. One is local on the client computer, another one has an SSH-session on the server. On the server, I am in a directory and seeing a file I would like to copy to ...
1
vote
1answer
222 views
Accidentally removed read permissions from folder. How do I get back in?
I wished to have a given folder and file and all descendants, write permissions.
I wished that ALL files and folders could be recursively granted he following permissions: 777
So I tried:
chmod -r ...
1
vote
2answers
146 views
How can I hide .un~ files when I run “ls” in OS X?
Is there any option I can pass to ls to hide .un~ files from the output?
I want to be able to see all files (e.g. dotfiles) except .un~ files, so I need to run ls -A and add something to hide the ...
0
votes
1answer
1k views
Compare content of directories in Linux
In Linux, if I have two directories, how I can see the differences of content in these directories?
Now I use this command:
diff <(ls -d dir1/*) <(ls -d dir2/*)
Any other idea?
0
votes
1answer
787 views
iTerm2 loses “ls” colors if I ssh to a server
Why do I lose ls' colors when I ssh to a server?
I would like those colors to be preserved. Is this possible? Should one do something on the server side?
-1
votes
1answer
374 views
ls -al list order re-arranged on osx terminal - can't we do this?
Does anyone know a way to re-arrange the ls -al returned list in a way that:
a) Directories first, files after;
and
b) Date first, name second and permissions at the end
and
c) Without losing ...
14
votes
2answers
626 views
What is the magic separator between filenames in ls output?
The output of ls (with no arguments) appears to separate filenames with linebreaks.
Evidence:
ls | grep foo works as expected, with grep treating each filename as a separate line of input.
ls > ...
0
votes
1answer
133 views
list files with full modification date
I want to produce a list of files in a directory and feed it into a script to generate database entries including their creation dates. The database is Solr, so I need to be able to translate ISO 8601 ...
4
votes
2answers
209 views
is there a way to read the cumulative size of all files in a folder?
I want to read the size of a folder from the command line. ls -lh shows all folders as being 4k, which presumably is the size of the footprint of the folder itself, rather than the contained files. ...
1
vote
1answer
295 views
“ls -t remotefile localfile” does not work over FTP
I'm interested in listing remote files (with names matching a pattern) by date, and storing this list locally. The various things I've tried follow:
ls -t SL*.txt
...is interpreted as a request ...
4
votes
4answers
5k views
how to list all files and directories in given directory with full path but not recursive?
Somehow like dir /b command but I need also hidden and system files there. Built in dir command doesn't allow to list such 'hidden' files with the rest and I must use /s to have full path in there, ...
3
votes
3answers
953 views
List files recursively and sort by modification time
How do I list all files under a directory recursively and sort the output by modification time?
I normally use ls -lhtc but it doesn't find all files recursively. I am using Linux and Mac.
ls -l on ...