Questions tagged [ls]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
1k views

How do I substitute "ls -l" with the same in "dir"?

I'm using Ubuntu server using local access only SSH, but when I issue the dir command all I get is a single list of files and folders with no details, but using dir -l gives me the long list, but ...
Micheal Saunders's user avatar
-3 votes
1 answer
278 views

Why can't I access this folder?

Why can't I access the folder /website1? juozas@personal:/opt/lampp/htcdocs$ ls website1 juozas@personal:/opt/lampp/htcdocs$ cd /website1 bash: cd: /website1: No such file or directory juozas@...
Juozas G's user avatar
15 votes
2 answers
2k views

Different results for ls when accessing Ubuntu via SSH from different clients (Windows-PuTTy, Mac-Terminal)

Consider the following directory structure, printed to the screen using ls -l "$dir" ($dir is a bash variable standing for some folder on the same server, a few levels up), on a remote ...
Tom Granot's user avatar
1 vote
2 answers
424 views

Listing files of identical type with ls command can produce files with different colors

Can someone please explain to me why when listing certain files with the same extension, eg .jpg files, why they are sometimes listed green, as well as shown in pink. These are all image files. It ...
Paul Benson's user avatar
  • 1,022
0 votes
0 answers
69 views

auto colour on ls not enabled even after copying /etc/skel/.bashrc to home

Refer to a comment here I wanted to ask to the poster the question where to copy the .bashrc file to. Because copying it to the home of the user does not enable the auto color ls command. Please, can ...
user30994's user avatar
  • 101
2 votes
1 answer
12k views

Error in brand new External Hard Drive: "ls: reading directory '.': Input/output error"

This morning I was downloading some files directly to an EXTERNAL Hard Drive (1TB Seagate Hard Drive, bought a week ago) and I had to shut down the PC without unmounting the disk and while it was ...
Mario Rodríguez's user avatar
-3 votes
2 answers
8k views

Finding all .config files [duplicate]

I am new to Linux and on of my projects is to find all .config files. I made sure to be logged in as root. What command would I run to do this.
Sebastian Skokan's user avatar
0 votes
1 answer
6k views

ls command to exclude certain files [duplicate]

Can some one please help me write an ls command to list files starting with abc (abc*.txt) and exclude the ones containing _DEL_ in the name (abc*_DEL*.txt) I am trying something like this: ls abc*....
Rao's user avatar
  • 19
2 votes
1 answer
8k views

ls color white vs. green

I tried looking at What do the different colors mean in ls?, but the list doesn't state the color white. Look at the image below: What is the green and what is the white (libfuse.so and libfuse3.so)?...
Karl Morrison's user avatar
0 votes
3 answers
12k views

How can I use the ls command to find out a folder's owner and group, and what rights they each have? [duplicate]

Just switched completely from Windows to Ubuntu and am happy. I have a problem; there is a folder called /root. I want to know how I could use the ls command to find out the owner and group ...
Frank's user avatar
  • 35
0 votes
1 answer
97 views

`ls'` command opening another shell [duplicate]

I typed ls' (ls with single quote ) and it opened another shell. Which type of shell it is? what is it used for? below is the reference:
vipul jadhav's user avatar
0 votes
0 answers
49 views

What does "total = n" in the output of "ls -l" indicate? [duplicate]

ls -l total 36 -rwxrwxr-x 1 vips vips 8776 Jan 11 20:56 a.out -rw-rw-r-- 1 vips vips 52 Jan 11 21:44 filemk.sh drwxrwxr-x 2 vips vips 4096 Jan 11 22:14 hello -rw-rw-r-- 1 vips vips ...
vipul jadhav's user avatar
2 votes
0 answers
59 views

rm -r /media/externalHD --> can't boot without external HD anymore

My external HD was mounted in /media/user/TRANSFER. By mistake I typed sudo rm -r /media/theo/TRANSFER There was an error because the device was occupied and fortunately, I haven't lost my data. ...
Theova's user avatar
  • 41
2 votes
1 answer
1k views

Why does ls show wrong permissions for the group when using ACL?

I have the following script for setting permissions for the Joomla CMS directory: #!/bin/bash if [ ! -d "$1" ]; then echo "Error: Folder does not exist or no folder given." echo "" exit 1 fi # ...
Wieger's user avatar
  • 148
0 votes
1 answer
2k views

How to print parent working directory

How can I list everything in the parent directory without having to cd there. Can this be done with echo? In othere words instead of having to do this: cd .. && ls | grep somefile && ...
Max's user avatar
  • 123
19 votes
2 answers
35k views

Listing files in directory in one column

Is there a command to print the files in a directory in a single column without this additional info? Basically an ls command but with the output format of: file1.txt file2.txt file3.txt as opposed ...
Peter's user avatar
  • 193
2 votes
2 answers
395 views

List all files in dir with color-coding alphabetically (dir and files separated)

I'm looking for a command to list all files in a directory with ls command. Requirements: - Alphabetically - Folders first, then files (both alphabetically) - No timestamps or other information, just ...
Michiel Mulders's user avatar
7 votes
3 answers
3k views

show git branch in `ls -l`

Is it possible to configure the ls command so that, when I use ls -l, it appends the git branch name after the directory name, if the directory is a git repository? This way I can quickly find git ...
Michael Kim's user avatar
0 votes
1 answer
4k views

What is the meaning of `ls directory > something` [duplicate]

I don't understand the meaning of this command. ls ../slc > dates How does it work?
Lona Gy's user avatar
  • 27
3 votes
1 answer
8k views

Name of first file in directory obtained in optimal way

Ordinary when I want to show name of first file from directory I type: ls raw/all | head -n 1 But it takes long time when in directory there any many files Eg for dir with near to 900 k files we ...
Daniel's user avatar
  • 387
1 vote
2 answers
759 views

Alias to remove folder prefix from `ls` command

Sometimes ls will prefix file names with a folder name, other times it will not. The following you can duplicate on your platform: $ ls /var/lib/initramfs-tools 4.10.10-041010-generic 4.4.0-78-...
WinEunuuchs2Unix's user avatar
0 votes
1 answer
506 views

Anything like Scroll Lock key in the bash of Linux subsystem in windows 10

When I use ls or ll for some directory, the output is so long and annoyingly the cmd windows can only go back for several lines... If I use ll | less, all the color info is missing. Is there ...
Jing He's user avatar
  • 101
1 vote
4 answers
10k views

What is the difference between "ls" and "ls -p"? [closed]

Can anyone tell me what is the difference between the ls and ls -p commands in Linux?
gurupal singh's user avatar
2 votes
1 answer
6k views

Permission denied from opening directory [duplicate]

I have always wondered how you stop another user from entering a directory. I am in a local installation of GitLab and I see that in my git directory I have a repositories directory. If I try to ls or ...
user974407's user avatar
  • 2,136
1 vote
1 answer
2k views

terminal - Remove background color of text in ls (with oh-my-zsh arrow theme)

I am using zsh instead of bash in my Ubuntu Gnome 16.04 machine and I'm very frustrated with the background colors when I do ls because I can barely read the text. Here's a screenshot of my terminal. ...
sam-s3pi0l's user avatar
1 vote
2 answers
1k views

Will this break anything? alias l='ls -ltra'

Will this break anything? alias l='ls -ltra' I usually set this alias in .profile in AIX.
user696718's user avatar
23 votes
3 answers
21k views

What does the 's' in srwxr-xr-x in the 'ls' output mean?

I have a directory entry as follows srwxr-xr-x 1 ubuntu ubuntu 0 May 29 05:03 0.0.0.0= I do not know what the s means and also that is a strange file name and I wonder what it is good for. Could ...
hol's user avatar
  • 333
5 votes
1 answer
6k views

ls invalid option '2'

I have the following files (among others) in a directory. I’m running Ubuntu 16.04. 484 May 8 21:50 NA19239.vcf 484 May 9 08:50 HG01583.vcf 484 May 9 08:51 HG01595.vcf 0 May 9 15:11 HG00268-...
nak3c's user avatar
  • 153
7 votes
2 answers
1k views

strange ls -l output

This is a sample output of ls -l on my Ubuntu 17.04 box: drwxr-xr-x 2 amoro amoro 4096 kvě 6 16:26 myfile There are two parameters that I don't recognize. Counting from left to right, the 6th and ...
Antonello Moro's user avatar
3 votes
3 answers
3k views

Is it possible to rename files selected by ls?

I have some files I downloaded recently and I want to name. It is possible to do something like: rename 's/ /_/g' $(ls -t | head -n5) Actually, I would like to rename last downloaded 5 files. ...
dmx's user avatar
  • 1,977
0 votes
3 answers
4k views

How can I find files with 7 characters (and no extension) in their names?

I want to list files that contain only seven characters (without extensions) in their filename. I have these files in a directory, for example: 1234567 bar.12 dog.cat 1234567.txt tst.new big.tst ...
Yooso Lee's user avatar
10 votes
2 answers
18k views

Why isn't my zsh ls colorful?

Spin up a new 16.04 server instance, install zsh, chsh to zsh, create the default .zshrc, log back in, ls output is not in colors. The .zshrc does seem to have all the proper dircolors and LS_COLORS ...
jingx's user avatar
  • 477
1 vote
1 answer
118 views

Strange ls behaviour

When I type ls in home directory it shows names of directories with suffix / : Desktop/ examples.desktop Jupyter notebook/ peda/ Public/ and so on. So how can I fix it? EDIT: I use fish shell, type ...
Tehada's user avatar
  • 113
2 votes
2 answers
381 views

ls list files with multiple sizes

In the case we have some files with different sizes: for example one files smaller than 1 Mb and others bigger than 1 MB for example. If I use ls -l --block-size=M it will show all files with less ...
Pau Chorro's user avatar
5 votes
3 answers
17k views

What does ls -al .* command return?

Does it show hidden file names inside all directories? Or just the current directory (including any directory inside it)? I cannot understand why ls -ld .* returns different results (it shows hidden ...
BEWARB's user avatar
  • 969
8 votes
4 answers
13k views

Useful example of ls -b, --escape

I'm new to Ubuntu and I'm learning the ls arguments. I've tested the -b, --escape arguments (print C-style escapes for nongraphic characters) but I haven't found an useful example of how use it. I'...
Pau Chorro's user avatar
4 votes
2 answers
270 views

List dates of files with sed

I am trying to extract the date modified/modified last week files and folders with sed but i am strugling. Here's my opinion ls -l | sed '/codehere//g' but I have no idea how can this filtering be ...
Vladimir Danoski's user avatar
18 votes
5 answers
5k views

What does `ls --directory` stand for?

In my Ubuntu version the man ls has the next info about --directory: list directory entries instead of contents, and do not dereference symbolic links So I'm a little confused how it works. I used ...
Pau Chorro's user avatar
-1 votes
1 answer
716 views

Can't see volume when I run `ls` in teminal

this is my first problem in Ubuntu 16.04: when I run ls in terminal as you can see I can't see my volume. I have 315 GB and 104GB volumes and when I want to make a project in C Lion I can't see my ...
sosfullking's user avatar
24 votes
2 answers
2k views

What is this yellow thing with a pipe? [duplicate]

I noticed that /var/spool/nullmailer directory contains a weird trigger entity which is displayed in yellow and has a “|” suffix. It doesn't seem to be a directory (at least I can't cd into it), and ...
Arseni Mourzenko's user avatar
1 vote
1 answer
521 views

'ls' shows more files in directory than nautilus

In home directory ls shows the following: But let's look what is in Nautilus. I refreshed Nautilus many times. rm 1.1.c returns a error there is no such file in directory. What's wrong?
Elnur's user avatar
  • 113
36 votes
5 answers
24k views

Why is ls -R called "recursive" listing?

I understand that ls -R displays a listing of directories. But why is it recursive? How is recursion used in the process?
Mint.K's user avatar
  • 775
1 vote
0 answers
989 views

Why doesn't ls -lu show correct access time?

Why isn't "ls -lu" showing the access time, instead of the modification time on an ext4 file system? $ date Mon Jan 9 12:49:31 EST 2017 $ ls -lu ~/.bashrc -rw-r--r-- 1 scott scott 4326 Jan 8 18:16 /...
Scott Deerwester's user avatar
0 votes
1 answer
1k views

Ubuntu USB connection Problem

The usb connection is confirmed in the Ubuntu terminal command "lsusb", but not in command "ls /dev". I expected "ttyXXX" format, but I can not confirm it. ++++++ edit ++++++++ This image is that ...
Taein_Yoon's user avatar
2 votes
2 answers
5k views

Why won't ls display output in multiple columns, for some directories?

The ls command and the ntfs file systems have been discussed quite widely for the colours and how to tweak them using the dircolors option. However there seems more to it, which I have started to ...
Aseem Dua's user avatar
  • 133
1 vote
3 answers
157 views

Hidding some of the output of ls -l

The output of ls -lht is -rwxrwxrwx 1 root root 1.6G Jan 3 05:32 vServer.log When running ls -lht can I add in something that will only show size, mod date and file name? 1.6G Jan 3 05:32 ...
denski's user avatar
  • 331
13 votes
3 answers
3k views

Why the pipe command "l | grep "1" " get the wrong result?

As the picture illustrates, I use l to get the file in the current folder. And then I want to get the file with number 1, so I use the pipe and the grep. But why the 2 and 22 file show out? And what ...
Lee's user avatar
  • 133
19 votes
6 answers
9k views

What's the difference between ls and la? Why do they give the same output?

I entered la accidentally instead of ls to view the contents of a directory and it produces exactly the same output as ls... Why is this? Surely it doesn't make sense to have two commands that do the ...
TellMeWhy's user avatar
  • 17.5k
1 vote
1 answer
8k views

ls command not working under ubuntu 16.04

I looked up this question of ls command not working in ubuntu 14.04. I get the exact same error. ls: unrecognized option '--color=auto' BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) multicall binary. ...
randominstanceOfLivingThing's user avatar
0 votes
0 answers
258 views

Input/Output error while writing specific file to /media/<user>/<deviceName>

I transferred file f to an USB and when the transfer was complete, I ejected the drive but the system showed an error. When I reinserted the drive and did ls -l in it, it reads -????????? ? ? ? ...
uzumas's user avatar
  • 219

1 2 3
4
5
8