The ls command lists the contents of a directory.
2
votes
1answer
767 views
LS_COLORS settings for specific types of files
I'm trying to set up my color scheme for ls, and I'm having trouble finding information about exactly what parameters I have to work with, or where those come from. And especially setting colors for ...
2
votes
2answers
49 views
syntax of ls --hide= and ls --ignore=
ls --hide and ls --ignore provides the possibility leave out files defined through regular expressions set after the --ignore= part. The latter makes sure that this option isn't turned off via -a, -A. ...
2
votes
1answer
279 views
How does wc -l `ls` give the actual number of lines?
Can anyone explain to me how does this command work.
wc -l `ls`
while this command gives the total number of java lines or txt lines.
2
votes
1answer
66 views
Local, regular file causes `stat` or `ls -l` to hang
I've seen a few different questions about ls hanging. It's usually because they use the -l switch, which causes a stat on the file, which in turn is a bad symlink or pointing to an NFS mount or some ...
2
votes
1answer
934 views
Find the disk-space usage of a directory and all it's files [duplicate]
Possible Duplicate:
How to know the size of a directory?
If I run
ls -lh
then any given directory is just shown as 4.0K. How can I can make it consider the files the directory refers to ...
2
votes
1answer
377 views
ls in glorious 256 colours [closed]
Apart from the ls colors solarized theme, is there any other ls colour themes out there that you would recommend for a dark background with a urxvt terminal?
2
votes
2answers
1k views
How to change the colour of embedded terminal in linux mint 12 to be able to use `ls` and `byobu`?
I'm using Linux Mint 12 and am having problems with the embedded terminal in gedit.
Using the default themes I'm unable to use 'ls' and 'byobu' as in part of their output foreground and background ...
2
votes
3answers
945 views
Really strange FAT32 file listing problem
I'm mounting a FAT32 drive on my NAS (which has a USB port), and hitting a strange issue when I use the ls command on the drive root:
ls: cannot access ???²é?u.g: Input/output error
ls: cannot ...
2
votes
2answers
211 views
Is it possible to change the spacing between files using ls
I'm fairly new to unix and I was wondering if there's some attribute of ls that I can use to change the spacing between the files. Currently I've aliased my ls to output ls -G, so that I have colored ...
1
vote
7answers
227 views
Convert ls -l output format to chmod format
Say I have the following output from ls -l:
drwxr-xr-x 2 root root 4096 Apr 7 17:21 foo
How can I automatically convert this to the format used by chmod?
For example:
$ echo drwxr-xr-x | ...
1
vote
1answer
329 views
How can I make ls show information about the directory specified only, not info about its sub-files or folder contents?
Say I have folder "foo" residing, the home directory. I want to get some info of it, owner, group, permissions, etc...
I then do this to try to get the information:
cd ~
ls -l foo
Of course it now ...
1
vote
1answer
74 views
starting vim with command substitution
I am working on a project on two different machines - one running Mac OSX 10.8.3, and one running Red Hat Enterprise Linux. On my Mac, I can do this:
vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))
and ...
1
vote
1answer
231 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 ...
1
vote
3answers
204 views
Display a menu of files names and let the user select a file by entering a number
I have created a script that allows the user to select a file by copying and pasting that file. Then perform a grep on that file. I want to know is it possible to put a number in front of each files ...
1
vote
4answers
260 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 ...
1
vote
3answers
73 views
ls command - define number of columns
Is there a way to define the number of columns in ls output?
I got this far: ls -C sorts in columns and ls -1 produces one column. --tabsize = option to produce two columns resulted in what looks ...
1
vote
1answer
87 views
What is a sure fire way to find all files and/or path that contains 2 keywords?
I was doing a
find . -iname '*sitesearch*' | grep demo
because I know the file should be some/path/SiteSearch/demo/SiteSearch.html, but it turned out a person put the file in as ...
1
vote
4answers
286 views
No such file or directory error when using xargs
I have some files with .mkv extension and I want to calculate their total size using du -h. Some of the files are preceded by whitespace characters.
ranveer@ranveer:~$ ls *.mkv
...
1
vote
5answers
1k 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 ...
1
vote
4answers
2k views
ls list files not matching given string in filename
I have a directory in which lot's of files (around 200) with name temp_log.$$ are created with several other important files which I need to check.
How could I easily list out all the files and ...
1
vote
2answers
239 views
List info about files/directories with spaces
I am trying to use ls to get information about files and directories. My current command fails to properly get the name whenever a file/directory has a space.
I am using this to list all ...
1
vote
3answers
2k 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
5answers
224 views
Identify folder in bash
I was trying to learn how to identify only folders within a folder on the main level.
example:
main
-folder 1
-folder 2
-folder 3
I started with this script:
#!/bin/bash
...
1
vote
1answer
182 views
Very basic question, ls a different directory and save file
I seriously can't understand where I'm going wrong with his question. The first part is.
List all the file and directory names in /etc which have 1 or more numbers in their name. Remember to use ...
1
vote
1answer
68 views
ls -ld /dir, Solaris [duplicate]
Always when I run ls -ld /dir the output give me the size = 512 even if there are files in it or not.
but when I run du -sh the output give me the actual size of the directory including its content.
1
vote
2answers
190 views
Ignore all matches to negated extglob pattern in recursive ls
I would like to recursively list all files in a directory which match a given input pattern using ls. (Oh, and this is in Bash).
The only way I can think of to do this using ls is to shopt -s extglob ...
1
vote
1answer
224 views
Please explain the output of the ls -all command
This is one of the many similar lines from the output from ls -all
lrwxrwxrwx 1 subhrcho dba 25 Dec 6 01:36 beam-server.jpr -> .ade_path/beam-server.jpr
What does the above signify ? I am ...
1
vote
2answers
1k views
Solaris + display file time stamp [year][month][day]
I have Solaris 10 machine
I need to verify time stamp of some file in my Solaris machine
And to get the following format
[year][month][day]
Example of working command on Linux
ls -l ...
1
vote
1answer
262 views
List all chflags file flags?
Is there a way to see a file's flags, such as hidden, schg, etc? I've got an rwxrwxrwx file that I can't edit, and I think a flag might be responsible.
1
vote
3answers
519 views
Ls with spaces + variables
I want to do something like this, but it doesn't save the variable after the piping ends:
fs=( )
echo ${fs[@]}
ls -A1 |
while read f
do
echo ${fs[@]}
fs+=( "$f" )
echo ${fs[@]}
done
echo ...
1
vote
2answers
64 views
Directories are listed twice
I have something odd.
I creates some directories using a very simple script :
... create all directories ( running under a user that has the correct rights )
e.g :
mkdir -p ...
1
vote
1answer
114 views
Why ls -lrth and ls -ltch gives different results
I was trying to find the time of database backup. Normally i use
ls -ltch
But this time i used
ls -lrth
It gave me different result for One file and all date-stamps were same for both ...
1
vote
2answers
198 views
Displaying the last N modified files?
How can I list the 10 most recently modified files of a certain extension, not all files, or the files modified during the last 2 days for example?
1
vote
2answers
83 views
Are there any pitfalls to overriding ls?
Is there anything to watch out for if you wanted to override ls? Is there a more reliable way of getting pagination out of ls?
For example:
function ls() { command ls -hp $@ | more; }
1
vote
1answer
429 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
1answer
222 views
How can I list LS_COLORS in colour?
I recall that eval "dircolors -b" used to display the colours that LS_COLORS was using, based on the file types or extensions. It was not simply the colour values that were displayed but the colours ...
1
vote
1answer
435 views
What does @ sign mean in 'ls' output on Mac OSX Lion terminal? [duplicate]
Possible Duplicate:
what does the @ mean in ls -l?
What does the @ sign mean in the following "ls" output?
-rw-r--r--@ 1 root wheel 489 Jan 4 13:14 boot.plist
1
vote
1answer
228 views
colorizing ls output based on filename
i'm on freeBSD and trying to colorize ls output, so i've added
alias ls ls -lhG
setenv LSCOLORS gxfxcxdxbxegedabagacad
to my .cshrc
and it works. but what i really want to - is to be able ...
1
vote
1answer
47 views
mark or color empty directories for `ls`
ls's -F flag allows to see the types of file and distinguish directories. Is there a way to add a functionality to distinguish an empty directory?
1
vote
1answer
66 views
Total vs listed directories [duplicate]
On a server when I type in ls -al I get a list of the directories
-bash-3.2$ ls -al
total 12
drwxr-xr-x 3 root root 0 Feb 13 2011 .
drwxr-xr-x 4 root root 4096 May 11 2011 ..
drwxr-xr-x 55 ...
1
vote
1answer
290 views
M-x ansi-term colors in Emacs 24.x
I have noticed that some colors in LS_COLORS don't work when running a shell inside M-x-ansi-term in Emacs.
For exmaple;
di 00 94
is supposed to turn on bold on light blue on directories on ...
1
vote
1answer
186 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 ...
1
vote
2answers
404 views
dircolors “missing second token”
I'd like to customize the colors of ls and as far as I understand the way to go is with dircolors.
I did:
dircolors > ~/.dircolors
Immediately after this I launch a terminal and get this error:
...
1
vote
1answer
168 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 ...
1
vote
1answer
475 views
Difference in file listing for SSH and SFTP [closed]
I have SSH access to a server and I have never bothered to use SFTP until now.
I transferred a file using FileZilla to the server. However, the weird thing is that the file doesn't show up when I ...
1
vote
0answers
134 views
How can I list only the directories present in a directory using ls? [duplicate]
Possible Duplicate:
Is there any option with 'ls' command that I see only the directories?
I have a directory with a lot of files but only a few directories.
To get a list of only ...
0
votes
3answers
50 views
How to delete directory ' :q!'? [duplicate]
Accidentally, i have got this directory created in my home,
drwxr-xr-x 2 ubuntu ubuntu 4.0K 2012-09-06 07:27 :q!/
I want to remove this somehow. I have tried using escape characters in double ...
0
votes
1answer
391 views
Alias for directory listing sorted by time modified in reverse order
When I need to find my recently used files, this command:
ls -lt
lists in ascending order (by time), when there are lots files, I need to scroll to
the top to see needed files, because wont fit in ...
0
votes
1answer
58 views
wc - setting a terminating character
I've got that far: wc --files0-from=FILE lets one get the word count of a list of files. Each entry in this list mus be terminated with an ASCII NUL character.
Question: A way to set a terminating ...
0
votes
1answer
418 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 ...
