Skip to main content

Questions tagged [ls]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

chocking rights on directory with command ls -l gives total 0

I'm trying to understand why a NAS cannot be mounted. When i run this mount command i have : mount -t cifs //10.XX.XX.XXX/Dir1 /nas -o credentials=/config/cred,uid=$(id -u),gid=$(id -g),vers=3.0 ...
Ret3i's user avatar
  • 13
4 votes
2 answers
1k views

ls -la gives strange output

What could be the reason for this?
D-T's user avatar
  • 487
0 votes
0 answers
344 views

ls and find give "invalid argument" when passing no argument

I have an external hard drive, formatted with NTFS. On it I have one folder with about 100,000 files, totalling about 140GB (excluding overhead). I'm finding that I can no longer list the files in the ...
falsePockets's user avatar
-1 votes
1 answer
409 views

How to obtain a list of all the files recursively without listing the directories to which the files belong and sort the list of files alphabetically? [duplicate]

I only managed to list the directories themselves with ls -a or the files sorted by directory with ls -aR
Nuno Fonseca's user avatar
0 votes
0 answers
56 views

I have problem in listing (ls command ) file when make shared folder in vmware

I wanted to make a shared folder with this tutorial from medium. but after doing that and when I wanted to check for the files I shared, this just happened ls command output simultaneously folder &...
Mohammad's user avatar
1 vote
0 answers
496 views

Changing LS_COLORS in Ubuntu 22.04 works in terminal but not permanently in .bashrc

I am learning linux thoroughly, I have downloaded my first VM with vmware-fusion on my mac m1. I have tried many times to update the .bashrc file but the one thing that is not changing for some reason ...
theMyth's user avatar
  • 111
0 votes
2 answers
117 views

Issue with touch -t command when setting specific dates

I'm encountering an issue when using the touch -t command in the terminal. My goal is to adjust the access and modification dates of a file named "testShell00" to a specific date in the ...
Jonatha Costa's user avatar
0 votes
1 answer
408 views

Input/output error without disk failure

1 month ago I ran a python program on my ubuntu server which downloaded videos and cut them into images. I used urlretrieve to download the files and then I used opencv to cut them into single frames: ...
janbmull's user avatar
0 votes
1 answer
129 views

Thunar and ls different file size

I have a complete android userdata partition image on disk and it shows 48.9 GiB on Thunar but only 3.8 GB in ls and Baobab. How is it possible ? Thanks
darkon11's user avatar
0 votes
1 answer
31 views

Weird Arrow elbems showing up in Caja

Wierd Arrow emblems are showing up in Caja, also in ls in Terminal these directory are highlighted light blue, but it seems that they are not a link at all. Output of ls: Gui: I'm using Ubuntu MATE ...
someuser's user avatar
0 votes
0 answers
499 views

ls: cannot access X: No such file or directory

When I try to use the command "unzip " on any folder I immediately get the line unzip ls: cannot access 'tmp': No such file or directory ls: cannot access 'tmp': No such file or directory ^C ...
anon's user avatar
  • 1
0 votes
0 answers
264 views

How to configure Bash to use lsd for tab-completion?

For the sake of the question, assume I'm on the most-recent (stable) LTS release of Ubuntu. I've installed a replacement for the ls command. In this case, that replacement is lsd. The same question ...
cocomac's user avatar
  • 3,534
1 vote
5 answers
384 views

list items correctly in bash with a space in their name

I have for example following Files: test1.txt test2.txt test space.txt I use the following command: output=$(ls -l --time-style=long-iso | awk '{print $8, $6}') And I get following output: test1.txt ...
Chuck's user avatar
  • 19
3 votes
2 answers
3k views

Ubuntu commands aren't working

My Ubuntu seems a bit weird. cd and mkdir work fine, but instructions other than ls and rm do not. I'm not sure what the problem is. Isn't there another way to initialize this path? I have solved the ...
nooblinux's user avatar
2 votes
3 answers
880 views

How to remove all files with a pattern except the recently created file

How to remove all files with a pattern except the recently created file ls -l total 655748 -rw-r--r-- 1 jetty jetty 120579643 May 10 19:59 2023_05_10.jetty.log -rw-r--r-- 1 jetty jetty 115205809 May ...
user352290's user avatar
0 votes
1 answer
1k views

Why do `ls` and `du` commands show a different size for the same file? [duplicate]

I am currently using Ubuntu 20.04. When I check a file's size using the du command, I get the following output: ubuntu@ip-172-31-49-39:/myxfs$ du -h newquota 4.0K newquota With the ls -la command, ...
Alakananda S's user avatar
6 votes
1 answer
850 views

Why does ls show different size for some directories (not 4k)?

While ls shows most directories having a size of 4.0K, some directories have different sizes, as shown in the output below: drwxr-xr-x 8 root root 4.0K Aug 13 2022 room drwxr-xr-x 2 root root 138 ...
randall's user avatar
  • 71
-2 votes
1 answer
137 views

Can you execute multiple commands in the shell without the use of '&&', '||' or ';'? [closed]

Without the use of '&&', '||' and ';' - Can you write a 2-line Linux script that lists all files (even ones hidden) in the current directory and the parent of the working directory and the /...
Paballo Mogane's user avatar
0 votes
3 answers
408 views

Bash command based file manager

Is there a way I could run 'ls' command, and be able to navigate through the results using the arrow keys, and selecting with spacebar, possibly going back by pushing escape? Is it something that can ...
824NZ's user avatar
  • 9
0 votes
0 answers
295 views

Check if network drive is mounted in a timely manner

I have a network drive mounted through cifs with the following configuracion in fstab: /ip/drive /local_path cifs username=username,password=password,acl,rw 0 0 I need to know as soon as possible if ...
Ulisha's user avatar
  • 1
-3 votes
1 answer
590 views

Trying to pipe, redirect, or use `grep` or similar commands in a sftp environment

How can i limit the ls command output to display only the most recent X number of files created within a folder in a sftp environment ? tail, grep, or > >> (redirect commands) are not ...
GreuDeFumat's user avatar
4 votes
2 answers
546 views

Is there any way to control ls output format

I have a directory contains some svg images among its contents. I list them with following ls command to save the output in a file: ls *200px.svg > animList.js The output file looks like: file1-...
SaidbakR's user avatar
  • 789
0 votes
2 answers
357 views

Can't view file in parent directories with a script

I have a script that looks for files in the present working directories and says if a file is a file or a directory for file in $(ls | sort) ; do if [ -d $file ] then ...
Volodya Shulga's user avatar
0 votes
1 answer
411 views

Why is the size of a symlink equal to the size of it's path string?

I've read a different question regarding this where the answer was that a symlink stores the name and target + a few bytes for other metadata. Using "ls -l dir" on ext4, why does the symlink ...
Navy's user avatar
  • 3
0 votes
0 answers
22 views

permission files option ls -l

I have problem to access to several files in a same directory. Printout of ls -l: -rwxr-x--- 1 -rwxr-x---+ 1 I can access to the second file but not the first one. What does this "+" ...
kwen38's user avatar
  • 11
0 votes
1 answer
5k views

Why does "ls --all --recursive -1 *.htm*" only list files in current directory?

In Terminal I do this command: ls --all --recursive -1 *.htm* or this: ls -a -R -1 *.htm* But it only lists the html-files in the current directory...?! According to 'man ls' that option has this ...
Henrik R.'s user avatar
  • 1,059
0 votes
1 answer
2k views

"cat ls" messes up my terminal's characters [duplicate]

when I go to my /bin directory and do cat ls it messes up my whole terminal's characters, even my input gets messed up and I have no option but to restart the terminal. I was just watching a toturial ...
JohnDoeVI's user avatar
0 votes
1 answer
2k views

What are columns in ls -la? [duplicate]

I can't find what are columns when I use ls -la For example: -rw------- 1 myuser root 3272 may 14 16:30 my_file -rw------- 1 - access rights myuser - owner of the file? root - ? 3272 - ? may 14 16:30 ...
adroit.levees.0r's user avatar
0 votes
1 answer
158 views

Bash STRING != STRING not working with string split from `ls`

I have a bash code which assigns all files into a variable, splits the string by a space and loops over them like this: $ ls README db_password.example db_username.example files_str=$(ls) files=(${...
Daniel Katz's user avatar
1 vote
1 answer
567 views

Lists only hidden files in my home directory in long format? [duplicate]

I don't want to list recursively the sub directory as well. I have tried following but it did not worked correctly. ls -lad ~/.* ls -la ~/.*
Life rocks's user avatar
0 votes
1 answer
2k views

How can I change directory text color in C shell?

I want to change directory color in cshell. So I copied /etc/DIR_COLORS file to my ~$home and named .dir_colors. I modified that file but it doesnt change the text color. If I source that file then ...
Cho's user avatar
  • 1
0 votes
3 answers
1k views

Nested dollar $ signs for sustitution

I want to avoid creating temporary variables and get ls element by index. Here's what I tried so far echo ${"$(ls)"[2]} But I'm getting bad substitution error.
antshar's user avatar
10 votes
1 answer
2k views

Why does the "ls -l /bin" command show only 1 file?

The ls /bin command shows many files. I need to get a detailed list. But the ls -l /bin command shows only 1 file. Tell me, please, what is wrong?
Tetiana's user avatar
  • 117
0 votes
2 answers
2k views

How to determine the parent of a process like "ls"

I've read methods of determining the parent of running processes but how would I determine the parent of a process thats lifecycle is too short to run a command like pstree without the process already ...
georgelid6's user avatar
-2 votes
1 answer
285 views

Getting the total size of my five largest files in bash

I am trying to get the total size of my five largest files found in a directory but I am not getting du to work on my list. I have two ways of finding and sorting, the five largest files. #!/bin/bash ...
Delpux's user avatar
  • 1
4 votes
2 answers
5k views

`ls` with wildcard with subdirectories

When I execute a command ls *, it will show files in the current directory directories in the current directories files and directories in the directories in the current directories. When I do use ...
Tom's user avatar
  • 685
-1 votes
1 answer
47 views

Supposed to see '~' when listing file in directory

I'm working on a assignment for school and I'm having an issue getting this portion to work properly. The assignment is having me create a file in the CLI, open and edit the file in GEDIT without ...
KAi tiE's user avatar
0 votes
0 answers
928 views

ls or ll listing without permissions and hardlinks

I need recursive listing of directories for my DVD backups. The prefect format is following: Name of the directory: subdirectory0/ subdirectory1/ size date time name0.txt size date time name1.sh size ...
xerostomus's user avatar
  • 1,030
3 votes
1 answer
1k views

How to set to Black background

Ver: Ubuntu 21.04 In order to change the color scheme, I have set as follows in my .bashrc; export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;96;40m\]\w\[\033[00m\]\$ ' setterm -term linux -back ...
Mohan's user avatar
  • 61
1 vote
0 answers
2k views

ls -a or ls -lR shows empty result

at my /usr/local/lib/python3.8/dist-packages, I run sudo ls -a and it shows empty: $ sudo ls -a . .. With ls -lR it also shows empty: $ sudo ls -lR .: total 0 But there is actually stuff there when ...
Phạm Huy Phát's user avatar
0 votes
1 answer
340 views

why is /bin/ls linking to libpthread?

so strange, is ls multi-threaded somehow? what could ls possibly need libpthread for? ldd /bin/ls linux-vdso.so.1 (0x00007ffff7fce000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so....
hanshenrik's user avatar
2 votes
1 answer
135 views

Understanding command ls .*

I found that command ls .* shows all files and folders in upper directory. It is the same like I do cd .. ls * But how this achieved with one command ls .*? What is the meaning of . and * in this ...
vico's user avatar
  • 4,597
2 votes
1 answer
3k views

display the filenames with 4 or more characters using ls

How to display the filenames with 4 or more characters using the ls command
ben sunny's user avatar
-2 votes
1 answer
64 views

Packages and meaning of gcc-8

ls -la commands below brings file information gcc-8 that looks strange for me. I suppose it is not link. I know there are different GCC packages with different GCC versions and it looks like I have ...
vico's user avatar
  • 4,597
0 votes
2 answers
742 views

Which file operations trigger directory modification time and date to change?

I have a directory named IT-documentation. Using ls -l in the terminal at its parent directory level yields (among numerous other lines) drwxr-xr-x 16 robin robin 4096 Oct 31 08:02 IT-documentation ...
robin's user avatar
  • 1
0 votes
2 answers
2k views

Accidently make ls colors (folders, files, links...) to white

I accidentally delete/change LS colors when listing directories with the 'ls' command, so I tried the command "ls --color=auto" it works temporarily because when I reboot my terminal ls ...
Moez Ben Rebah's user avatar
-1 votes
3 answers
2k views

How to list all ASCII files present in a directory?

I want to list all ASCII files that are without extensions(.txt) in my present working directory(home). I started with the ls command in the terminal but i don't know what i should put in the options ...
skekmal's user avatar
  • 165
0 votes
0 answers
436 views

I can't create a "nordvpn" folder in /run

As you can see on the joined picture. 1 - When I type : sudo mkdir nordvpn in /run I can create a folder "nordvpn". I type once "ls"; I can see the folder, I type a second times &...
AndyFromParis's user avatar
0 votes
1 answer
131 views

Why do `ls -1 filename` just lists the filename?

When I run ls -1 filename, it just lists the filename, instead of permissions with filename. However, according to online resources, the output should also have permissions details of the file. I used ...
svyslf's user avatar
  • 3
2 votes
0 answers
2k views

ls (list) not showing all the files

A few days ago I was trying to see a few files in a directory after trying the ls command, and noticed some of them were missing. After retrying the command all files showed up. However this same ...
vitoruser's user avatar

1
2 3 4 5
8