Questions tagged [ls]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
58 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
3answers
34 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
0answers
18 views

No directory highlighting in ls

I see no directory highlighting in zsh console when doing ls:
0
votes
1answer
38 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
2answers
516 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
0answers
58 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
0answers
46 views

How to display the correct list files without gibberish?

I installed Ubuntu 18.04 on my computer. I mounted USB flash disk using command sudo mount /dev/sdb1 /media/usb0 Then I issued ls to get list folder and files and I get the name files/folder with &...
0
votes
1answer
88 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
1answer
50 views

Difference between la vs ls -a command? [duplicate]

There is a slightly difference between when comparing those commands.
1
vote
4answers
517 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
1answer
68 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
3answers
64 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
2answers
113 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
1answer
75 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 ...
0
votes
0answers
19 views

assign different colors to the output of ls depending on whether the files are regular or link targets

I'm using this command ls -L -AltGF * to list files in my directory, but follow links to targets. What I'd like to do is distinguish between which files are links and which are not. So for ...
3
votes
1answer
261 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
0answers
62 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
0answers
22 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
1answer
566 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
1answer
566 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
1answer
108 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
3answers
165 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
131 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
149 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
25 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
83 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 ...
5
votes
1answer
4k 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
155 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
39 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
33 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
76 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
133 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
428 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
84 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
900 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
76 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
574 views

Font has been changed

why has the font of my terminal been changed?
0
votes
0answers
2k 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
637 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
1answer
324 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
62 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
369 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
115 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
390 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
38 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
336 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
249 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
48 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
102 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". ...
4
votes
1answer
2k 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

1
2 3 4 5
7