Questions tagged [ls]
Questions relating to the Linux 'list' command (ls)
355
questions
0
votes
1
answer
34
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 ...
0
votes
3
answers
48
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.
9
votes
1
answer
1k
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?
0
votes
2
answers
40
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 ...
-2
votes
1
answer
57
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
...
1
vote
2
answers
213
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 ...
-1
votes
1
answer
42
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 ...
0
votes
0
answers
34
views
Can see nothing after typying command ls
Hi Ansible is installed at the Ubuntu whick is installed at Windows10. The Ubuntu used to work well, but now nothing can be seen after entering command ls or dir. And then, after a new file is created ...
0
votes
0
answers
109
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 ...
3
votes
1
answer
197
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 ...
1
vote
0
answers
126
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 ...
0
votes
0
answers
21
views
How can I append the output of `lsattr` at the start of every line in the output of `ls -l`?
I'd like to get the following output:
----i---------------- 201820 -r--r----- 1 root root 0 Dec 5 10:22 .indestructible
--------------------- 170834 -rw-rw-r--+ 1 user101 user101 3K Dec 2 12:...
0
votes
1
answer
89
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....
2
votes
1
answer
109
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 ...
2
votes
1
answer
662
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
-2
votes
1
answer
37
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 ...
0
votes
2
answers
28
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
...
0
votes
2
answers
335
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 ...
0
votes
3
answers
309
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 ...
0
votes
0
answers
146
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 &...
0
votes
1
answer
38
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 ...
1
vote
0
answers
223
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 ...
-1
votes
1
answer
50
views
What is the difference between -l and -lt
I tried the command "ls -l" and "ls -lt" in the same directory, But it shows me the same output.
Do they have any difference?
3
votes
1
answer
348
views
Real time file sizes?
In order to take a look at the sizes of my VM disk images, I tried ls -lh (as it was suggested here). And here is what it returned:
leo@ubuntu:~$ sudo ls -lh /var/lib/libvirt/images
total 65G
-rw-----...
-1
votes
1
answer
134
views
why `ls -d .` does not list all dirs, as `ls -d */` does? [duplicate]
Like it says in the heading, I don't get why the "correct" usage of ls -d should add */ in order for ls to find the directories in my current dir, where adding the trivial . isn't helpful
3
votes
1
answer
191
views
broke my 'ls' command (and few more)
This is how my ls command looks like now in htop:
Also, when I try to run ls (or gimp or libreoffice) I get running stegsolve app that I can't reinstall (even found stegsolve binaries).
$ cat /etc/os-...
0
votes
2
answers
3k
views
ls command doesn't show any files in home directory
tommy@LAPTOP-6AUB639F:~$ pwd
/home/tommy
tommy@LAPTOP-6AUB639F:~$ ls
tommy@LAPTOP-6AUB639F:~$
1
vote
1
answer
93
views
Where is the tab completion "compspec" for commands like cat and ls defined?
Some pretext:
I'm installing Jenkins locally, and following the installation, I'm asked to produce a password from a text file in this folder: /var/lib/jenkins/secrets/
However, after entering
cat /...
0
votes
3
answers
51
views
How to isolate file permission and file name from results of ls -l?
I want see only the file name and the corresponding file permission. How to do that?
ls -l gives
-rw-rw-r-- 1 jb jb 102 Apr 28 12:48 hello2.txt
-rw-rw-r-- 1 jb jb 102 Apr 28 12:53 hello.txt
I ...
0
votes
1
answer
160
views
how to select the specific string from 'ls' command console output?
I am newbie on linux os. My target is selecting files which have the specific string values in filenames on console mode
This is my sample filename,
filename : apnic-2016-02-01
condition : The first ...
4
votes
4
answers
1k
views
How to recursively list only hidden files from a terminal
I would like to do something like
ls -RA .?* >> LSRA.list
but with this command and some other variants I tried, I always get also all non-hidden files in the directory where I am.
Namely, if ...
0
votes
0
answers
188
views
Ubuntu terminal ls lists folders but not files
I'm pretty new to Ubuntu so I'm thinking I might've installed it incorrectly or something since this never happened on my old laptop, but here's what's happening:
I'm using the ubuntu terminal from ...
0
votes
1
answer
98
views
Trying to create a file to meet three conditions
I need to make a file that lists the first 5 lines of the /sbin directory, with having all 5 lines numbered AND all lines capitalized.
Here is one string of commands that I tried:
tr [a-z] [A-Z] < ...
0
votes
1
answer
65
views
Difference between la vs ls -a command? [duplicate]
There is a slightly difference between when comparing those commands.
1
vote
4
answers
703
views
`ls -l` output duration instead of date/time eg "5 mins"/"6 hours"/"7 days" etc?
If I last modified a file 5 minutes ago, is it possible to make ls-l output something like "5 mins" instead of the actual date/time?
0
votes
1
answer
97
views
The -F attribute for "ls" command
I'm finishing LFS101x so I'm rather new to Linux. Towards the end of the course, the author says:
You can view the full list of configuration files by typing ls -lF /etc/cups.
This is obviously ...
0
votes
3
answers
135
views
How to find files that user and group have the same permission [closed]
I would like to find the files that the user and the others have the same permissions. I tried ls -l and egrep but I don't know how I'll say that position 234 will be the same with position 567.
...
1
vote
2
answers
238
views
How to copy files with certain permissions to directory
I'm trying to make a copy of files with read and write permissions for the owner only, and then redirect that file to a directory named $dirA. I tried to use this command:
cp (ls -l ~| grep -type f-...
2
votes
1
answer
97
views
How do you list the folder permissions of only certain directories that follow a common pattern in a particular directory?
For example, in the /etc/ directory there are several files named rc0.d, rc1.d, rc2.d, rc3.d etc
lets say you want to list the permissions or the sizes of these directories while ignoring other ...
3
votes
1
answer
737
views
run ls but skip first 3 files
Let's say ls -t returns:
1
2
3
4
5
6
How can I skip the first 3 results? So the result is only:
4
5
6
I am aware I can run ls -t | head -3 but that will simply take the first 3 lines, but I need to ...
0
votes
0
answers
286
views
How to ls certain range of number
I have a directory that contains fifty folders named F01, F02....,F05. I want to count the total file number in F25 ~ F48, however, the only way I know is ls -1d F2[5-9]/*|wc -l and then type ls -1d F[...
1
vote
0
answers
68
views
Some commands can see a directory but not others?
There's a directory that had gone missing, I never intentionally deleted it (might've been accidental). Assume the directory structure is:
/parent
/dir
dirFile.js
parentFile.js
If I'm in /...
4
votes
1
answer
813
views
How do I determine file type in Linux?
I'm editing the LS_COLORS environment variable. dircolors lists the default colors for different file types. The file types are denoted as follows:
bd = (BLOCK, BLK) Block device (buffered) special ...
1
vote
1
answer
1k
views
Why is total stat block size of a directory twice of ls block size of a directory?
I am fairly new to Ubuntu and would like to learn more Linux programming.
Each time I print ls -l and compare it again my own codes to add st_blocks of each file, the result is always stat block being ...
1
vote
1
answer
359
views
.vimrc does not appear when I 'ls', but I can open it when it type 'vim .vimrc' in same directory. why? [duplicate]
I was searching for my vimrc so I could change my settings in vim, but was struggling to find it. I followed this which gave me the directory of the vimrc (user/home/.vimrc) that my vim is currently ...
3
votes
3
answers
835
views
How can I exclude . and .. when listing hidden items? [duplicate]
ls -d .* lists only hidden "items" (files & directories). (I think) technically it lists every item beginning with ., which includes the current . and above .. directories.
I also know that ls -A ...
0
votes
1
answer
381
views
what is orange colored files in dev directory?
i looked up in whole root directory
but i didn't understand one thing
what does orange color in dev directory mean? i know its directory for system devices
but i didn't understand the c in ls -l ...
1
vote
1
answer
317
views
How to disable ls colors on ntfs-mounted partitions only? [duplicate]
I love ls colors and do not want to disable them everywhere, but the ls colors are useless on ntfs-mounted (and probably other similar file systems - like exfat) partitions, because all files there ...
0
votes
0
answers
37
views
why are folder names green in color ubuntu 20.04 [duplicate]
I have folders in green color when I do ls -l then they appear colored
you can see in the link folders are all green in color
what could be reason for this.
1
vote
0
answers
98
views
file explorer changes
I have downloaded a file onto the working directory and can see the file when I look at file explorer. However, the file does not show up when I use the ls command. I have triple checked that I'm ...