Questions tagged [ls]

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

Filter by
Sorted by
Tagged with
3
votes
3answers
67 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
1answer
35 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
1answer
33 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
0answers
14 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
0answers
13 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 ...
0
votes
0answers
28 views

Changing ls highlight colors in Windows Terminal with WSL

I'm trying to change the highlight colors in my shell for WSL, but there's a lot going on here so I'm not sure where to look. I am using Windows Terminal and running WSL with Ubuntu. My default shell ...
0
votes
1answer
24 views

Passing commands as a string to shell sudo bash –c “ls -l /home” gives the error bash: –c: No such file or directory

$ bash –c "ls -l /home" bash: –c: No such file or directory I don't understand why I am getting this error. I understand if you are passing commands as a string to shell then it should be able to ls ...
-3
votes
1answer
31 views

How to filter users home directories to get a list of users with a symbolic link - see picture [closed]

I'm doing a basic Linux course and as you can see in the picture I'm supposed to enter in a command or command chain to get the output shown in the picture. anyone know the command I would use to get ...
0
votes
0answers
32 views

What is the difference between ls and ls -l? [duplicate]

I am very new to linux. While practicing the file management commands I have found that 'ls' and 'ls -l' gives 2 different outputs but they appears to be related to each other. The content of the ...
0
votes
2answers
59 views

Select elements in list in groups of 2 - Bash

I am trying to select elements in a list of files using a sequence. For this I have created a list of all my files following a pattern in a folder: ls -d -1 /my/path/S1*.zip Where the output is: /...
0
votes
1answer
32 views

How to list all files in a specific directory that starts with 'sh' including inode number in one line

Assuming I'm in the home directory I'm trying to list all the files in /etc to show all files that start with sh along with the inode number I tried the following: sudo find /etc -name 'sh*' # this ...
0
votes
1answer
64 views

check if a file exist with -f and convert the result into variable

trying to make the follwoing command to look for a full fine name work correctly but i can't for now. The command i use to look for file "Lista*": PathFileIN_Elab=/root/Testms/Files ChkFileName="$(...
2
votes
0answers
48 views

Green highlights on some directories on running ls command [duplicate]

On running the ls command to under any directory, I find that some directories (and this happens with directories only) have an annoying green highlight around them for no apparent reason. Would ...
0
votes
1answer
64 views

Is it possible to get ls to show file size, not allocated size?

When downloading a large file, there is a big discrepancy beween the actual file size (which I care about) and the allocated (ie, final) size (which I usually don't.) $ ls -lshk 9962420 -rw-r--r-- 1 ...
2
votes
1answer
49 views

How can I find out which file was changed a few minutes ago?

I want to transport a configuration from one user to another one. But I don't know in which file the program in question stores its configuration. In order to find out where the configuration is ...
3
votes
1answer
461 views

Font has been changed

why has the font of my terminal been changed?
0
votes
0answers
159 views

Why doesn't ls list all the directories? [duplicate]

I am a complete beginner in Ubuntu I need little help. After dual booting, my system with Windows and Ubuntu I install the google chrome using the terminal window command with some source on the web. ...
8
votes
1answer
568 views

When you type dir in terminal, the name file with space separate with symbol backslash \

Terminal Text $ cd LALALA ~/LALALA $ dir la\ la\ 1 la\ la\ 2 ~/LALALA $ Directory Image When I use dir command in terminal, the list of file show \ (backslash) to separate their word (see: ...
1
vote
0answers
59 views

Change the color of directories in GNOME Terminal

When I type ls in gnome terminal directories show up highlighted in green and the text is blue, making it very hard to read the directories. I've tried Edit → Preferences and playing around with the ...
1
vote
1answer
34 views

Why are the file sizes appearing differently with the ls command?

The command I'm running is: ls -alFs --block-size=1 The following is the output: 4096 -rw-rw-r-- 1 dkm dkm 320 Oct 5 15:28 QRN_1570310934.charbin 4096 -rw-rw-r-- 1 dkm dkm 320 Oct 5 15:29 ...
0
votes
1answer
127 views

The 'ls -lS' command shows weird folders sizes

My laptop says the disk is full, so I'm trying to make some space by removing some files. But the ls output doesn't make sense for me. The Downloads directory, in reality, is empty... I guess the ...
2
votes
1answer
65 views

List all entries in the current directory whose names contain only uppercase letters

In one of my lab questions I was asked to list all entries(both files and folders) in the current directory whose names contain only uppercase letters using piping and grep command. Folders must have ...
2
votes
2answers
254 views

Linux command symbol !ls meaning

What is the meaning of ! in a command? For example ls command, what is the output after put in from of it (!ls)?
0
votes
0answers
29 views

How to copy some lines from old folder after using ls to new blank file [duplicate]

My old folder has this output when I ls -lh drwxr-xr-x 2 ahmet sistem 4,0K Eyl 17 22:33 ahmet drwxr-xr-x 2 ali sistem 4,0K Eyl 20 16:08 ali drwxrwxr-x 2 hexcake hexcake 4,0K Eyl 13 18:57 ...
2
votes
0answers
76 views

Display all of the files where the extension starts with a certain letter using ls command

How do I display all files where its extension start with a certain letter using ls command? I tried doing ls d* but that display all files starting with letter d, not extension starting with letter ...
0
votes
1answer
108 views

Special character at the end of commands

Do commands like ls and ps actually end with a special character to indicate termination of response?
0
votes
0answers
38 views

Grub rescue mode ls not listing

In grub rescue mode when I type ls (hd0,msdos1)/ nothing is coming. ls (hd0,msdos1) giving filesystem is ext2. Pls help. What will be the cause?
-1
votes
1answer
43 views

Cannot see files with “ls” when i copy paste files or download with rightclick save as

I am new to Linux-like environment. Currently, using Ubuntu on Windows. When i download a file by rightclick and save as or copy/paste a file to a folder, I cannot see them or access them using "ls". ...
3
votes
1answer
252 views

What is difference between ls -lh and du -sh?

$ ls -lh file1.tar -rw-r--r-- 1 wnice wnice 40K Aug 6 20:41 file1.tar $ du -sh file1.tar 80K file1.tar Why is it showing different sizes of same file? Please help me understand
-5
votes
1answer
86 views

What does an ls command with “[”, “]”, and “?” do? [duplicate]

I am interested in this command: ls [A-D]?.txt This is a Unix question on an assessment. We are asked to define what this command does.
0
votes
2answers
3k views

rm: cannot remove : No such file or directory

but the file clearly exists and I can open the contents in it, just the 'link' field is 0 when trying ls -Al, so I couldn't delete it, I am using Ubuntu app from the Windows 10 store Any help is ...
1
vote
2answers
161 views

Grep finds file, ls/rm does not

I have got an email I cant delete, so ran grep -rnwil . -e 'HMG Capital' to locate it. grep found the file and the output is: ./1563972300.M254363P6352.xxx.codes,S=5606,W=5728:2, Now when I try ...
1
vote
0answers
164 views

What does 'c' stand for in ls -ld on device files? [duplicate]

I was wondering what 'c' stands for in the below command result. rohith@rohith-pc:~$ ls -ld /dev/null crw-rw-rw- 1 root root 1, 3 Jul 8 06:31 /dev/null rohith@rohith-pc:~$ I could see that this '...
1
vote
1answer
208 views

How to display number of items in sub-directories from command line

In Ubuntu graphical user-interface, I can list the sub-directories in a directory where one column represents the number of items in these sub-directories. As shown here: Is there a way to get the ...
0
votes
0answers
53 views

How to save list of files in folder to TXT-file by using FileManager-Actions?

I am trying to save a list of the files in a TXT-file by using FileManager-Actions (former nautilus-actions) but I can't get the command correct. When I do this stuff in terminal by this: cd go/to/...
1
vote
1answer
67 views

How to combine JPG-file and MP3-file to MP4-file using FileManager-Actions?

I just installed »FileManager-Actions« Now i try to get a command working for combining a JPG-file (its always 1920x1080px) with a MP3-file into a MP4-file. Normally is used this command in terminal ...
0
votes
1answer
263 views

I've installed lsd in ubuntu 19.04. But when I run lsd command, it shows command not found

Command 'lsd' is available in '/snap/bin/lsd' The command could not be located because '/snap/bin' is not included in the PATH environment variable. lsd: command not found
4
votes
2answers
62 views

Examine a folder named `-F/` [duplicate]

I think this folder was probably created by accident at some point, but I can't ls or cd to it to check. Things I have tried: ls '-F' ls "-F" ls \-F ls \\\-F ls \\-F and the cd equivalents
1
vote
1answer
114 views

How can I make an alias for a long ls command?

When I type in xfce4-terminal the command: ls -pltrh --color=always --time-style="+%d-%b-%Y $newline%H:%M" | grep --color=never -v / | cut -d ' ' -f6- echo -e -n '\033[1;5;36m'"Diretório §⮕ " echo -...
2
votes
1answer
105 views

How to find a binary name with only the prefix?

Context: I have a bash script that generates a windows import library from a MinGW cross-compiled DLL. As part of the build process, it runs llvm-dlltool-6.0, because that happens to be the specific ...
2
votes
1answer
270 views

File size differs between ls and ncdu

I'm a little confused. With ls -laght a file with the size 1,0T is displayed: -rw------- 1 nogroup 1,0T May 6 14:01 nextcloud-flat.vmdk with ncdu only 9,1 GB: /mnt/backup/backup/nextcloud/nextcloud-...
1
vote
1answer
68 views

how to delete all but X last items from find

I want to find some dirs and delete all but the 10 latest dirs. I can find . -maxdepth 1 -type d -name "XXX*" | xargs rm -rf but that would remove all of them. I can't use head / tail because I don'...
0
votes
1answer
40 views

listing folder ending with whitespace

I would like to list this folder mnt/test. (test with a whitespace at the end) I tried the following different syntaxes: ls mnt/test ls "mnt/test " ls mnt/test\ ls "mnt/test\ " All of these ...
1
vote
1answer
877 views

Show permissions of a folder using `ls`

A folder named Dog is within the working directory on my Linux system. What is the shell command to list the access permissions of this folder? I tried ls -l Dog, but the output is total 0.
0
votes
1answer
1k views

Why I can't read file?

Please look at output: deploy@li445-201:~$ sudo ls -al /var/log/nginx/ total 152 drw-rw-r-- 2 root adm 4096 Mar 26 16:08 . drwxrwxr-x 14 root syslog 4096 Mar 26 06:25 .. -rw-r--r-- 1 ...
7
votes
1answer
688 views

/bin/ls output does not match manpage

ls manpage says: List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. and -a, --all do not ignore ...
27
votes
2answers
7k views

Why is there an extra space when I type “ls” in the Desktop directory?

Just out of curiosity, I was wondering if there is a reason for the extra space when I type ls in the Desktop directory. Compare... ~/Desktop$ ls file1 file2 file3 ...to... ~/Documents$ ls file1 ...
0
votes
0answers
501 views

lsd from snap not working [duplicate]

I tried to install LSD, from snap, but after installation I tried to run it with lsd, and I got the error cannot open directory'.': Permission denied (os error 13) Any ideas? Edit
1
vote
4answers
761 views

ls command: Show time only (in iso-format)

I found a way to show the date in iso-format: How to make ls produce ISO 8601 format Now I want to show only the time, not the columns before: ls --time-style=long-iso -l drwxr-xr-x 11 foo foo ...
1
vote
1answer
40 views

Why does ls color two supposedly similar files differently?

So, here's the peculiar situation: $ ls -l foo.sqlite foo.ssqlite -rw-r--r-- 1 xie xie 8192 Jan 22 19:25 foo.sqlite -rw-r--r-- 1 xie xie 8192 Jan 23 11:48 foo.ssqlite In the output, foo.sqlite is ...

1
2 3 4 5
7