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

learn more… | top users | synonyms

1
vote
1answer
26 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 ...
2
votes
1answer
23 views

How can I group the files in a directory based on their file size

I have a directory where I am writing lots of files but I know each of them fall under one of the 3 pre-determined memory sizes based on what I write. Any file I write may be either 300KB or 129.1MB ...
3
votes
2answers
265 views

“ls” with one-digit pattern gives me strange results

I'm running Ubuntu as VM in VMWare Fusion on MacPro: ayakovlev@ubuntu:~$ uname -a Linux ubuntu 3.11.10.3 #1 SMP Thu Mar 6 15:31:54 EST 2014 x86_64 x86_64 x86_64 GNU/Linux The command below outputs ...
-1
votes
2answers
29 views

No command is working, edited .bashrc file

I edited .bashrc file with PATH value, but when I open a new terminal after this, none of command is working. When i am opening a new terminal its giving : bash: export: `/usr/lib/java/jdk1.7.0_51': ...
2
votes
0answers
137 views

after ssh session : -bash: /bin/ls: no such file or directory

I've logged into my Ubuntu server from work via putty under Windows. Right away I noticed something weird. I could not use the ls command. Got: -bash: /bin/ls: no such file or directory I didn't pay ...
0
votes
1answer
37 views

List Video Filename and Duration for multiple files in folder and subfolders with path too if possible

I need to get a list of filenames and path along with the duration of the file. All are video files. Some files are in subfolders as well. I need the list sorted according to duration. My goal is to ...
1
vote
3answers
60 views

Output Directory Contents to File

I have a directory html. I would like to output the files of the directory, including the path, to a file. You can do something like this with the command: ls -R scripts/html > out.txt But the ...
1
vote
1answer
35 views

Strange terminal navigation when logged in as new user

I am not even sure how to ask this properly.. I am using EC2 Ubuntu 12.04 I added a new user sudo useradd -g admin admin sudo adduser admin sudo Changed shudders so I can use new user without ...
1
vote
2answers
95 views

ls command without username?

I want to use ls --full-time -lnG but do not wish to list the user names at all. Is there any way to do this? I would consider -n and -G optional if it is conflicting with getting this done.
2
votes
2answers
115 views

Using ls and cd comands on network folders

Super-new linux/terminal user here- Is it possible to use ls and cd comands directly on directories within a public folder on a NAS, or does the share need to me mounted within the root directory ...
2
votes
2answers
41 views

Independence between sudo and the instruction it receives as an argument

I don't understand why the directory dir1 isn't shown with the same colour. Although this may look unimportant, it seems to me that this is a violation of the so oftenly mentioned principle of ...
0
votes
3answers
41 views

what is the command to be able page up/down a long text?

i keep forgetting and I am not sure how to look this up if for example i want to see the ls commands --help, its very long i remember there's a command that allows you to go up and down on the ...
0
votes
2answers
186 views

ls command very slow after deletion of thousand files on a directory

I have a dir under /home/myuser dir which an application stores and deletes millions of temporary files. When I do ls on this dir (now it only has a hundred files only) it is too slow (actually I do ...
1
vote
3answers
36 views

Confused with the alias solution?

I am trying to define alias for a group of commands counting recursively and displaying the number of all sub-directories encountered for any working directory (including ones with invisible file ...
1
vote
1answer
30 views

Having problem with alias?

I am trying to define alias for a group of commands counting and displaying the number of all files in account’s space with the names starting with g, t, and w. I got the result with the following ...
0
votes
0answers
18 views

Is ls printing wrong information for read-only NTFS mount?

I have this entry in my fstab (note the ro option) UUID=XYZ /win ntfs defaults,ro 0 0 ls / -l reads drwxrwxrwx 1 root root 8192 Nov 7 10:41 win If I try to copy something into ...
1
vote
1answer
138 views

meaning of “ls -la” color

I'm using Ubuntu12.04 and I've created two directory symbolic links. By using ls -la, console shows source directory with light blue and target directory with blue. But only one of them target ...
0
votes
0answers
127 views

Difference between ls and dir [duplicate]

Why does the output of ls appears in colour while the output result of dir command comes colorless? What's difference between the ls and dir?
5
votes
3answers
632 views

List all files that do not have extensions

I want to list all files in a directory that don't have extensions. For example: $ ls a.txt b c.pdf d e.png $ ls -someOption b d What command I can use instead of ls ...
4
votes
3answers
542 views

create a list of files located in multiple directories

I have a set of data files (*.all) located in different folders Documents/rawdata/Geob1005/1.all, 2.all, 3.all,...,n.all Documents/rawdata/Geob1006/A.all, B.all, C.all,...,Z.all and so ...
0
votes
1answer
441 views

How to list all files within subdirectories without the path?

I have 1000 directories and 5-15 sub directories within them containing mp3 files. I want to make a list of all the songs without their paths. Is it doable? Or is there a way to obtain the word after ...
0
votes
1answer
309 views

how can I recursively run chmod -x?

So I have my music collection living on my 12.04.2 server. This Collection has traveled with me over the years from a Windows machine to a MacBook Pro, and then finally to where it is today on the ...
0
votes
1answer
76 views

mouse stopped working, checked htop, and HOLY WOW my kcore file is 140 petabytes!! (see screen shot)

My mouse suddenly stopped working on my Ubuntu plex server v12.04 LTS. It still works as a remote plex server so I'm not too concerned. But I did try to login locally with it and ran htop to see if I ...
0
votes
1answer
303 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 ...
2
votes
3answers
3k 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 ...
3
votes
4answers
7k 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 create ...
4
votes
1answer
274 views

Nautilus sort order with ls

I am creating image sprites and have neatly named around 100 files. I am using the following to generate an image sprite from individual images: convert $(ls -w 1000) +append sprite.png I have just ...
1
vote
1answer
581 views

Using alias to change ls to ls-l changes(or disables) the colors of ls output

I've used alias to change ls to ls -l, but the colours change to the normal font of the terminal (also tried ls -l before the alias command and the colours appeared fine). What is wrong? Thank you
5
votes
3answers
614 views

Can ls -l be made to separate fields with tabs rather than spaces to make the output useful in a spreadsheet?

How can the output of ls -l be modified to separate fields using tabs instead of spaces? I want to paste the output into a spreadsheet; the padding with a variable number of spaces makes it difficult ...
2
votes
2answers
147 views

How can I list the files in other (non-current) directory?

If ls lists the content of the current directory, is there a similar command that list the content of a non current directory, without using cd?
26
votes
2answers
3k views

Why does ls -l output a different size from ls -s?

I can't figure out why I'm getting the following results: ls -l tells me the size of a given file (HISTORY) is "581944": $ ls -l HISTORY -rw-rw-r-- 1 waldir waldir 581944 Feb 22 10:59 HISTORY ls ...
0
votes
0answers
88 views

Unable to execute run command in terminal; run: command not found

i tried to run the following command as user1@server1.com:- run "server_name" 'ls -lt /home/nextag/live' and it gave the following error:- -bash: run: command not found server1 is a jump server for ...
1
vote
1answer
187 views

How to make ls produce ISO 8601 format

In older versions of Ubuntu, like 9.10, ls(1) produced ISO 8601 format by default, in the way ls -l --time-style=long-iso does it. With 12.04, we're back at the older Unix style. Thus replacing ...
0
votes
0answers
38 views

How check directories that i have rights to copy in terminal?

How check directories that i have rights to copy in terminal? Sometimes when i do ls -la, i see drwxrwsrwx 4 ownername dirname ... but i tried to do scp -r into my own machine, but i get ...
0
votes
1answer
319 views

Bash command: ls -lah not showing /etc directory?

Ok guys, elementary question. I was poking around my server, and I noticed that when I 'ls' the / directory, /etc folder is not displayed. Why is that? I can very easily cd into it, but why is it ...
5
votes
2answers
232 views

Colorize hardlinks in ls output?

How can I colorize hardlinks myself? Turns out on an old Ubuntu 10.04 I have, this happens by default (same .bashrc and .profile in use), whereas on the newer Ubuntu 12.04 it doesn't. This is the ...
9
votes
2answers
478 views

What are = and | in the output of “ls -F”?

I am working on creating a 'cheat sheet' of shell commands. I am currently researching the ls command and its flags. For the -F flag I know what the majority of the appended indicators mean but for; = ...
2
votes
2answers
3k views

How to list text files without a .txt file extension?

For example, how can I replicate ls *.txt when my text files are missing the .txt ending, and as far as extensions go appear the same as many other types of file? Alternatively, is it possible to ...
2
votes
2answers
312 views

use output from alias command as filename to open in vi

I set up an alias this morning to help finding the latest log file in a directory. My alias looks like alias latest="ls -lat | grep ^- | awk '{print \$8}' | head -1" In my research so far this ...
1
vote
0answers
136 views

No boot or grub file after using ls command

I had xubuntu installed, i believe version 12.04 and then tried to dual boot with backbox. It worked from the flash drive but upon installing it onto the hard drive, I could no longer boot backbox. I ...
1
vote
3answers
2k views

List files of particular extension

Ok this is strange. I am using this code, ls *.prj To list all the files with the .prj extension in the dir but I am getting this error, bash: /bin/ls: Argument list too long I eventually ...
10
votes
8answers
33k 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 ...
0
votes
1answer
1k views

Creating a new file with touch command actually creates eight unlisted files?

Have a look at this screenshot: Pardon for my language used when I installed Ubuntu. Anyways, it is beyond my imagination how come creating an empty file actually creates eight files, alas, the ...
0
votes
1answer
320 views

'ls' and file managers hang on home directory after installing KDE

Today I installed KDE on my Ubuntu 12.04 using: apt-get install kubuntu-desktop Everything is running fine, apart from one very strange issue: it seems impossible to list the files in my home ...
10
votes
4answers
1k views

What is the significance of '*' (star, asterisk) in the file listing results?

I have noticed that some of my files have an asterisk at end. Does the asterisk at the end have any particular significance? I think they are mostly executable and displayed in green by the ls ...
3
votes
1answer
174 views

Directory permission

I am running 12.04 x64 server on ext4 disk. There are two user groups 'A' and 'B'. For a specific directory, I would like to give its all permissions to user group 'A'. Also I would like to give only ...
6
votes
2answers
530 views

What does the l command do?

There is a command l available on my machine which appears to do nothing. which l also produces no output. Is this a real command, and does it actually do anything?
1
vote
1answer
257 views

Right way to colorize ls?

Sometimes ago, I used Ubuntu and had colorized ls, grep "out of the box". Now I install KUbuntu and ls is plain text by default. I tried to discover something about it and notice that there is ...
1
vote
1answer
89 views

Why are “ls” and “stat” returning different ownerships for the same object?

This is in a continuation of question here I run this command as root user chown someuser:someuser /mnt/my-address and then # ls -l /mnt/my-address response is total 16 drwx------ 2 root root ...
0
votes
1answer
234 views

Can I change the default of “block-size” in commands?

Several commands use --block-size 1K as the default and I find myself counting numbers. Is there a way to automatically and permanently change the block-size of commands like du,ls,df to greater ...