ls

  1. list the content of a directory
  2. lots of options

ls

  1. most basic

ls *somestring

ls *pl  will list just the files ending in pl

ls somestrint*

ls hat* will list just the files starting with hat

ls *somestring*somestring

ls *Uni*gb will list the files containing the string Uni and ending in the string gb

ls –l

  1. probably the most important
    1. some people set up an alias so ls is really ls –l
    2. gives you lots of information
      1. whether it is a directory or file
      2. permissions for you, your group, everyone else
      3. who created the file/directory
      4. what group it belongs to
      5. the size of the file in bytes
      6. when it was created/changed
      7. the name of the file/directory

ls –a

  1. show all files including those starting with .
  2. usually doesn’t show much but try in your home directory and see all the hidden files
    1. configuration files for various applications
    2. configuration files for your session
      1. .bashrc
      2. .profile.orig

ls –lS

ls –G vs ls –-color

  1. ls -lG on mac

ls -l –color on perun

  1. highlighted green=directory
  2. green letters=files that are executable
  3. basic black=non executable file

ls –S ls -lS

  1. sorts the files by size

ls –lh

  1. lists file size in human readable format

956M vs 1001818676

  1. an approximate of the genome size

ls -lh *fasta

	9.7M Jul 12  2016 Pinvadens_endo_genome_july2016.fasta
		-actual size is  9.9 M
		

ls -lt

  1. show the last time the file was modified with newest first
  2. notice that some of them have the year
    1. if older than 6 months the year will be shown

ls -ltr

  1. show the last time the file was modified with oldest first.