Questions relating to the Linux 'list' command (ls)

learn more… | top users | synonyms

2
votes
4answers
95 views

how can I List files in order

I had an 18GB file I needed to download on a less than great Internet connection. Torrenting wasn't an option. So I busted up the file into 100 segments, and eventually, all of it downloaded. Now I ...
21
votes
8answers
23k views

How to list all the files in a tree (a directory and its subdirs)?

For a task of mine I need to list all the files in a tree (a directory, all its subdirs, all subdirs of those, etc.). I'd prefer to see them in Nautilus or Krusader, but a command-line solution is ...
34
votes
10answers
100k views

How to move multiple files at once to a specific destination directory?

I got a bunch of files in some directory (along with many other files) that I want to move. Luckily, all the files I want to move contain a certain identifier in their names, so I can ls | grep ...
1
vote
3answers
779 views

Using the ls command on an Ubuntu 14.04.10 server to explore my files

Very new to Linux, but I thought I understood file exploration from the command line. The problem: I can't figure out how to navigate my files or directories, the console isn't displaying any ...
0
votes
1answer
26 views

Deleting an embedded string in a text file with grep or anything else via terminal

I have a text file and would like to remove '/d0/' '/d1/' ... '/d5/' from the each line of text. I know I can ls the files with '/d*/'. I figure it is grep -vE '//d*// filename > filename ...
9
votes
2answers
7k views

exclude certain files in ls

I would like to run ls and exclude certain files in the output. When I run the following command, I get all files with each on one line: $ ls -1 file1 file2 file3 temp I would like to run this ...
0
votes
2answers
39 views

Is there any command line to show tree view directory? [duplicate]

Many tutorials depict tree-view directory to show how they organize their files. Is there any command line to show such view? Is ls capable to do this?
0
votes
1answer
303 views

ls command not working in ubuntu 14.04

I was trying to use ls command in my ubuntu 14.04 but it keeps on showing the following error, ls: unrecognized option '--color=auto' BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu1) multi-call binary. ...
1
vote
2answers
26 views

When I run ls on my usb drive, every file is in the green text of executable files. Why is this?

The files are those for general consumption for the most part, pictures, documents, pdfs, etc/
1
vote
1answer
63 views

Difference between ls -l , ls -ltr and ll?

When i am using these commands , i am getting the same output but only order is getting changed for ls -ltr command. Can anyone please tell me what is the difference between the below commands? ll ...
5
votes
6answers
36k views

listing files in a directory without listing subdirectories and their contents in that directory

I want to create a list of all the files in a directory, without listing any of the subdirectories that reside in that same directory, and print that list to a new file. ls -d * > filelist will ...
2
votes
3answers
95 views

ls command by default is showing one line per file? How to change it?

When I call the ls command, I expect it to show all the files/directories in the current directory, attempting to fit as many as possible on each line. But, somehow it is showing one file per line. ...
17
votes
4answers
102k views

How to Search for Files Recursively into Subdirectories

I am trying to look for all XML files in a particular directory and all sub-directories (recursively) inside it. ls -R *.xml is only listing files in the current directory. I am quite sure, the ...
6
votes
3answers
15k views

How can I direct a pipe input to ls command?

When I type sth. like that find . -name *foo* | ls -lah it gives me a ls-output of 'pwd' like I had no file(s) given to 'ls'. To simply use ls -lah $( find . -name *foo* ) works well (when the ...
2
votes
2answers
44 views

How to list all files in a hard disk with 'find'?

I'd like to list all the files in HDD including size, last modified date and absolute path. idea format : [file size] [last modified date] [absolute path] [ filename] I tried: ls -lhR | awk -v ...
7
votes
3answers
495 views

What does the “size” of a symlink represent in ls output?

I'll start by example: $ ls -l dir1 total 4 -rw-r--r-- 4 maythux maythux 1650 2008-01-10 16:33 file lrwxrwxrwx 1 maythux maythux 7 2008-01-15 15:17 symfile -> file symfile is a symlink of the ...
1
vote
1answer
51 views

List files/direcotries according to their modification time

How can I list files or directories according their last modification time either in ascendant or descendant way ?
1
vote
3answers
43 views

How do I direct a file to be stored in a different folder?

So I'm trying to direct a file to be created in another folder (let's say on my Desktop) from my bin directory. I made a text file with all the files in the directory using ls > textfile but this ...
-2
votes
2answers
43 views

Command to list only output files of gcc operation? [closed]

I have a directory with many c programs and some other files. After performing gcc -o output_name filename.c on c files i have respective output files in the same folder. What terminal command and ...
3
votes
2answers
82 views

locate command finds a file's path, but the file does not exist in that path [duplicate]

I have written: locate Origin90SR2DVD.iso And I received the path where that file is located: /home/david/Origin90SR2DVD.iso Then I have written: cd /home/david I have run: ls -lrth And ...
18
votes
10answers
46k views

How to show only hidden files in Terminal?

I have a directory that contains thousands of files, some of them are hidden. The command ls -a list all files, including hidden ones, but I need just to list hidden files. What command should I ...
35
votes
4answers
17k views

Difference between 'dir' and 'ls' terminal commands?

I've been trying to find the difference between using the dir and ls commands in terminal. I know ls is the traditional unix method of viewing the files in a directory, and that dir is the windows ...
1
vote
1answer
55 views

How can I list mp3 files that have a leading period?

I have mp3 files in a directory. For this example, let's assume they are these 3: Enter Sandman.mp3 ...And Justice For All.mp3 St. Anger.mp3 How can I list (ls is highly preferred) all ...
-3
votes
2answers
83 views

What does this mean in my program? -exec ls -s {} [duplicate]

-exec ls -s is part of my program just want to know what does -s {} mean. This is my whole program, I know what it does: find $root -type f -exec ls -s {} \; | sort -n | tail -n 15 >> ...
0
votes
0answers
16 views

Looking for info on the output of “ls -l” [duplicate]

So I used ls -l on a directory of mine. The output was this: What does the single number in the second row mean and how can it be changed? I could not find info about this in man pages.
1
vote
1answer
118 views

One command for ls and cat functionality?

Okay guys, this is an experimental question warning! I often confuse cat and ls when quickly working on the console. Not because I forget their meanings, no. Just because I type without deeply ...
0
votes
1answer
85 views

ubuntu folder permission changed to drwsrwsrwt and nautilus shows files and terminal doesn't

I am having wierd situation. I am using ubuntu 14.10. I can open all directories in nautilus but when I try to list files in terminal, only one directory get listed. I can traverse through the ...
2
votes
1answer
93 views

Recursive directory listing of /proc

I'm trying to obtain a recursive directory listing of my filesystem using the command $ ls -alRc from root directory. Everything is running fine except the /proc directory listing, which results ...
1
vote
3answers
61 views

How do I djvubind on ls and grep result?

How do I djvubind only files that are in ls | grep -P "page\\d\\d\\d.tif"?
1
vote
0answers
21 views

browse images in the same order by ls or nautilus?

I sort the images in a dir according to some order (e.g. their timstamp) in nautilus, and then I wonder how to browse them in the same order in eye of gnome or some image viewer? Similarly, If I ...
0
votes
4answers
120 views

Shouldnt .bashrc run every time I log in?

Newish to Ubuntu so forgive if I word things oddly... All I really want to do is have my ls command changed to ls --color=always -ragX Got that solved... Alias will do nicely. Now, to have that run ...
0
votes
1answer
103 views

ls --color=auto is not working?

Why ls command is not showing color in Ubuntu 14.04.2? ...previously it worked... My alias report>> jharvard@appliance (~): alias alias cp='cp -i' alias gdb='gdb -q' alias ll='ls -l --color=auto' ...
12
votes
2answers
18k views

How do I change the color for directories with ls in the console?

On my console the color for directories is such a blue, that it is hard to read on a dark background. How can I change the color definitions for ls?
2
votes
1answer
49 views

Why does 'echo *' give different results than 'ls *'?

For example, if you are in home directory and type ls *, you will have all the directories listed, and below the name of the listed directory, the files that it contains. On the other hand, if you ...
7
votes
2answers
2k views

Difference between ls -l and ll?

I'm relatively new to programming as a whole and some tutorials have been telling me to use ls -l to look at files in a directory and others have been saying ll. I know that ls is a short list, but is ...
0
votes
0answers
7 views

getting countbroken>0; won't update

running Ubuntu on an WIN7 Inspirion, that will not boot up. Ubuntu has been working ok, till a few weeks ago. It wouldn't update software. Error was COUNTBROKEN>0. (or BROKENCOUNT>0) Would appreciate ...
0
votes
1answer
502 views

Why do I not see my /bin, /var, (etc.) directories in my root partition?

I recently bought a VPS and when I log in as a root user, I dont see the /boot, /bin, /var, etc. directories. Why is this? This is what I see when I use my ls -la command in the terminal. I am the ...
0
votes
0answers
60 views

ls command not showing latest file

I just did a mysqldump on my Ubuntu EC2 server. If I browse the directory in Filezilla, I can see the dump file, but not when I run the ls command in terminal. Why is this happening?
1
vote
1answer
46 views

Finding files in sub directories

Still a newbie. Using a clean machine, purchased from System 76 with Ubuntu 14.04 LTS installed. Got it mid-May of 2014. Why can't I find files in the current and its subdirectories? I've tried ...
9
votes
5answers
4k views

How to find all PDF files in directories and their subdirectories?

I want to list all PDF files in the directories of the current working directory. What command can do this? I remember a combination of ls and */*.pdf but don't remember what exact combination.
0
votes
1answer
47 views

Long listing a Directory

2 Questions: 1) How should I long list a directory. Kindly guide me if there's are multiple options to do this .? 2) How do I sort based on the file size?
2
votes
1answer
31 views

Longlisting Files & Directories

I would need to know if there's a way to differentiate files & directories . Note : Without using longlisting
1
vote
4answers
195 views

Selecting from list like array (without name by number)

After I ls and see the list, is there anyway to process a document without typing its name? For example instead of typing rm damnSoLongFileName, can I type something like rm [1]? I mean is there ...
1
vote
2answers
285 views

ls to show dates and times in UTC

How do I get the ls command to show its dates and times in UTC, instead of localtime? I don't want to permanently change the local time for my system to do this.
1
vote
1answer
985 views

print contents of a directory structure (filesystem) to CSV on the command line

How can I catalog the contents of a filesystem to a CSV file? This is particularly useful for removable media. I've found a couple links that point in this direction: AskUbuntu.com: listing files ...
0
votes
0answers
24 views

new user problem loading brother driver dcp-340cw

when running linux-brprinter-installer it finnishes with "Error csh ls required" can anyone help? just loaded ubutu 14.04 (lost windows 8,1) very new to linux
1
vote
1answer
75 views

The colors when doing “ls” at my ubuntu server diappeared just like that

OK I know it's a super stupid question but driving me crazy! I just had new 14.10 VPS setup and while setting up some basic initial stuff in the terminal out of sudden "ls" command stopped showing any ...
1
vote
2answers
69 views

Open directory from ls result

I have a problem, I would like to pipe ls and cd together. I create shell pipe like: cesta = ls -lat | awk 'NR==2 {print $8"/"}' cd $cesta But it doesn't work. Could you help me. And I didn't ...
0
votes
0answers
60 views

Nautilus shows different permissions (than `ls`) for linked directory

I'm using Ubuntu 12.04 and i have changed one of my folders permission . when i do ls -al in that directory it shows me : total 48 drwxr-xr-x 6 root root 4096 Nov 3 05:14 . drwxr-xr-x 30 root ...
3
votes
2answers
1k views

ls on home directory very slow

A while ago, I accidentally created hundreds of thousands of files in my home directory which I subsequently deleted. Since then however, running ls in my home directory has been extremely slow ...