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

learn more… | top users | synonyms

37
votes
10answers
115k views

How to show only hidden files in Terminal?

I have a directory that contains thousands of files, some of them are hidden. The command ls -a list all files, including hidden ones, but I need just to list hidden files. What command should I use?...
0
votes
2answers
19 views

Unknown ending in a transferred file name

I've used rsync to transfer a file from a local machine to the remote. The intended way of destination was /usr/share/nginx/html, however in the file name there is an additional line mentioning a ...
26
votes
7answers
4k views

Why doesn't the command “ls | file” work?

I've been studying about the command line and learned that | (pipeline) is meant to redirect the output from a command to the input of another one. So why does the command ls | file doesn't work? ...
-1
votes
1answer
50 views

Display all the files with read and write permissions and display result in a file

I need to display all the files with read and write permissions and save the result in a file. Can anybody help me with that? It's easy but I am little bit confused, so please help me on this.
0
votes
0answers
21 views

dev/pts doesn't show in ls command

I'm fairly new to ubuntu, I'm running it in a virtual machine online on an application called cloud 9. I've run the commands sudo -i, followed by cd \, cd dev, and ls. When I ran ls it gave me: ...
3
votes
3answers
51 views

folder not shown when being created by command line

I have an issue when I am creating a folder by command line. I create it by typing: mkdir TEST and it does not appear on the graphical desktop view. But if I type the command "ls" in the Terminal I ...
0
votes
0answers
25 views

Stuck at grub rescue and when I type “ls” it comes up with “unknown command”

I'm running Ubuntu 12.04 on an old HP Compaq. When I boot the computer it goes straight to grub rescue saying: "error: symbol not found: "grub_register_command_proi"". After looking on various forums ...
22
votes
5answers
12k views

In the output of 'ls -n', what does the the second column mean?

When I run: ls -n I get something like: -rwxrwxrwx 1 1000 1000 765528 2009-10-15 18:41 file1 drwxr-xr-x 10 1000 1000 4096 2010-12-07 20:50 dir1 drwxr-xr-x 3 1000 1000 4096 2010-10-24 ...
30
votes
7answers
119k views

How to list all symbolic links in a directory

I have a symbolic link in my /var/www/ directory that links to WordPress. When I run the command ls -la from the /var/www/ directory the link to WordPress doesn't show up. Is there a way to list all ...
-1
votes
1answer
51 views

Store file list of current directory to a file [duplicate]

How can I get a list of all files in the current directory and store that to a file named mycurrent using the command-line?
-3
votes
1answer
46 views

display 1st and 10th line of user login [duplicate]

how to Redirect the list of all the users and their login date/time that are currently logged in into “data.txt” and display 1st and 10th line from data.txt
19
votes
2answers
3k views

How does ls -l format its output so neatly?

How does ls -l format its output so that column contents line up neatly?
2
votes
2answers
55 views

Getting file name in hex or base64

Due to a question on Software Recommendations, I thought I could implement a program that parses the output of ls -l and displays the files in an Explorer like style. This approach was suggested on ...
10
votes
3answers
23k views

How can I direct a pipe input to ls command?

When I type something like: find . -name *foo* | ls -lah it returns the same result as a plain ls command, as though it had no input. However: ls -lah $( find . -name *foo* ) works well, but ...
0
votes
2answers
36 views

ls and cd give no output when used with sudo

In my root user directory, ls outputs this: Desktop Downloads Music Public Videos Documents examples.desktop Pictures Templates However, sudo -i ls does not give any output ...
0
votes
1answer
31 views

Why does not pipe work with 'find' and 'ls'

Why does not pipe work with 'find' and 'ls' If I do find . -name *foo* | ls -lah , it does a ls on $PWD and not the output of find. The solution however is find . -name *foo* | xargs -r ls -alh or ...
4
votes
2answers
5k views

What does 'ls -la' do?

When I entered the -al attribute with the ls command, I got the following: anupam@JAZZ:~/blog$ ls -al total 76 drwxrwxr-x 13 anupam anupam 4096 Aug 28 21:45 . drwxr-xr-x 34 anupam anupam 4096 Aug 28 ...
-5
votes
2answers
68 views

why does everyone use ls more often than tree -L 2? [closed]

tree -L 2 gives better view of the documents,folders it seems to be better than ls.
0
votes
1answer
46 views

How to run a command at login

So I've been looking around and I can find ways to run commands every time you open a new terminal and inadvertently figured out how to make a continuous loop of opening terminals. I've edited ....
25
votes
9answers
38k views

How to list all the files in a tree (a directory and its subdirs)?

For a task of mine I need to list all the files in a tree (a directory, all its subdirs, all subdirs of those, etc.). I'd prefer to see them in Nautilus or Krusader, but a command-line solution is ...
40
votes
3answers
233k views

How to Search for Files Recursively into Subdirectories

I am trying to look for all XML files in a particular directory and all sub-directories (recursively) inside it. ls -R *.xml is only listing files in the current directory. I am quite sure, the sub-...
1
vote
0answers
21 views

How can I enable different color for FORTRAN files (or for that matter any other extension files with different colors) when listing files?

I want to display different color for different kinds of files. For example, all script files are generally highlighted in green color in bash. Similarly, I want to have a different color for all ...
0
votes
0answers
49 views

Change ls colors only in home directory not in mounted disk

I try change color of Dir in ls so i add this into my .bashrc: alias ls='ls --color=auto LS_COLORS=$LS_COLORS:'di=1;33:' export LS_COLORS and it works. But when i'm in my mounted disk it does not ...
1
vote
0answers
20 views

Set -h as default for ls? [duplicate]

I use the -h flag to make ls report in M,K,G etc Can I set the -h flag to be the defaul for ls so I don't need to write it every time ?
0
votes
2answers
38 views

In the sentence “ls -Ral /bin > TalhaA452.txt” [duplicate]

what does -Ral do? I dont know what this word means in the sentence "ls -Ral /bin > TalhaA452.txt"
1
vote
2answers
52 views

Does the terminal learn common typos? [duplicate]

This may seem like a stupid question. I'm using Ubuntu 15.10 with GNOME Terminal 3.16.2. When I was new to the system, I often typed 'l' or 'la' instead of 'ls' to list files, and would then be told ...
3
votes
4answers
733 views

Why doesn't ls combined with awk show exact sizes?

I am trying to find the size of the files on my hard drive in exact bytes, but whenever the size gets too big the number turns all weird (like 1.98329e+12). Can I stop it from doing this or convert ...
13
votes
1answer
2k views

What do the symbols like =, * and | in the output of “ls -F” mean?

I am working on creating a 'cheat sheet' of shell commands. I am currently researching the ls command and its flags. For the -F flag I know what the majority of the appended indicators mean but for; = ...
7
votes
7answers
29k views

Count total number of files in particular directory with specific extension

I want to count the total number of files in particular directory that ends with ".mp4" extension. I am getting following command: ls -F |grep -v / | wc -l It count all the files in particular ...
0
votes
1answer
520 views

Can I change the default of “block-size” in commands?

Several commands use --block-size 1K as the default and I find myself counting numbers. Is there a way to automatically and permanently change the block-size of commands like du,ls,df to greater ...
3
votes
1answer
76 views

ls output not compact anymore

I wanted to ask about the ls command in lubuntu 15.10. Now there is a new line for every entry. I know from other distributions that there is also an output style where ls outputs the content of ...
1
vote
1answer
52 views

Sort files by name as if they were dates

I have a backup bash script which hashes everything into a tar.gz in a backup dir. For a restore script, I need to be able to select the single newest one from bash. the format of my backup folder is ...
0
votes
1answer
28 views

could someone explain the outcome entries into a file? [duplicate]

I have read a really good answer explaining what -rwxr-xr-x 1 root root 523454 Aug 8 2014 name means. However, It did not explain the number before the root root. Also, could you explain what ...
2
votes
1answer
101 views

Difference in default “ls” and execvp “ls” call [duplicate]

I called "ls" command using the execvp system call from inside a c file. But there seems to be a slight difference. The exe files in the default ls call are highlighted green But not in my own ...
0
votes
1answer
45 views

How to list file names with a total of X letters

Say I have a list of the following files in my current dir: lab1.jav mytst2 pie.c prog2.c tst3.ex tst5:5.tlab2jav lab2jav.ext new.c prog1.c tst1 tst4.exc tst6:6123.tA7-tst.c fred....
0
votes
0answers
17 views

funky permissions, what does it mean? [duplicate]

I was having a hard time with a particular folder. When I looked at the folder, this is what I saw: $ls -al ?????????? 2 denis denis 4096 Feb 20 09:32 public_html I changed it, with chmod, but....
0
votes
2answers
687 views

What is the la command?

I just mistyped ls as la. Without noticing, I ran it: tim@Hairy:~$ la detection.sh output-2.jpg output-4.jpg output-6.jpg output-8.jpg Test1.pdf output-1.jpg output-3.jpg output-5.jpg output-...
0
votes
2answers
241 views

Long Commands Pasting Into The Terminal

I can't paste the long command into the terminal. There is a ls command which takes alot of argumnets and i'm trying to insert in into the terminal by copying. But it runs every single line. So i ...
7
votes
4answers
927 views

List all recently changed files (recursive)

So, I want to display (via ls for example) all files, which were changed in the last seven days. If I'm in my docroot-folder, it should be able to look "deeper". For example: File Last ...
0
votes
1answer
42 views

Can't execute this file [closed]

I can't execute the skype file. I have the permissions I need. What's the meaning of filename* in the ll output?
4
votes
3answers
549 views

Size of device file ( missing in ls -l output )

When I try to print the device file output shows binary data in hexadecimal format. But upon doing a ls -l /dev/sda I get: brw-rw---- 1 root disk 8, 0 Jan 29 12:29 /dev/sda I don't ...
4
votes
2answers
3k views
0
votes
0answers
26 views

what do the columns in 'ls -l' mean? [duplicate]

I am looking specifically for the second column and how to change it. I know it has something to do with owners or groups but I cannot find a direct definition of what it means
0
votes
1answer
30 views

What do these files mean and how should I replace?

In order to get into Symphony framework I had to install Virtual Box (VB) and Vagrant and SSH into the Ubuntu system I created with the default values of Puphpet. In order for my application to work ...
0
votes
1answer
26 views

5030 in ls output.?

I am getting the following in the output of ls for the home directory of arcsight user. drwxr-xr-x 2 5030 tspplatformadmin 4096 2016-01-28 02:51 arcsight What I expected the output to be: ...
1
vote
1answer
106 views

Meaning of “b” and “c” in file privileges description (output of ls -l)

Basic question regarding the ls utility. What do letters "b" and "c" mean at the beginning of the 10-symbol code describing the item privileges ? From what I understand, when typing ls -l, the ...
0
votes
1answer
82 views

Display the name of all files with home directory which is smaller (in size) than 10 KB but bigger than 5 KB

Display the name of all files with home directory which is smaller (in size) than 10 KB but bigger than 5 KB. using Linux comand. pls help me
6
votes
3answers
11k views

Why doesn't this wildcard work the way I expect?

On my user folder, I have folders like D ropbox, D ocuments, D ownloads & d ump. ls a* should list all the files whose name starts with a. Right? But when I gives the command ls d*, instead of ...
0
votes
4answers
1k views

No command is working, edited .bashrc file

I edited .bashrc file with PATH value, but when I open a new terminal after this, none of command is working. When i am opening a new terminal its giving : bash: export: `/usr/lib/java/jdk1.7.0_51': ...
1
vote
3answers
177 views

ls command to view particular string in filename within directory

I have bunch of files in one directory. I want to list specific files within this directory whose name as follows; stacov_abcd0230.15o stacov_abcd0240.15o stacov_ab120240.15o stacov_01020240.15o ...