Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question

What do the linux command below do ?

ls -lh

Answer

Another frequently used ls option is -h . It shows the numbers (file sizes) in a more human readable format. Also shown below is some variation in the way you can give the options to ls . We will explain the details of the output later in this book.

Note that we use the letter L as an option in this screenshot, not the number 1.

paul@debian8:~$ ls -l -h total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$ ls -lh total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$ ls -hl total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$ ls -h -l total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$

Question

What do the linux command below do ?

ls -lh

Answer
?

Question

What do the linux command below do ?

ls -lh

Answer

Another frequently used ls option is -h . It shows the numbers (file sizes) in a more human readable format. Also shown below is some variation in the way you can give the options to ls . We will explain the details of the output later in this book.

Note that we use the letter L as an option in this screenshot, not the number 1.

paul@debian8:~$ ls -l -h total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$ ls -lh total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$ ls -hl total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$ ls -h -l total 17M
-rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt
-rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt
-rw-r--r-- 1 paul paul 20K Sep 17 00:04 services
drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff
-rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt
paul@debian8:~$
If you want to change selection, open document below and click on "Move attachment"

Chapter 8. working with directories
--r-- 1 paul paul 96650 Sep 17 00:03 dmesg.txt -rw-r--r-- 1 paul paul 19558 Sep 17 00:04 services drwxr-xr-x 2 paul paul 4096 Sep 17 00:04 stuff -rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt <span>ls -lh Another frequently used ls option is -h. It shows the numbers (file sizes) in a more human readable format. Also shown below is some variation in the way you can give the options to ls. We will explain the details of the output later in this book. Note that we use the letter L as an option in this screenshot, not the number 1. paul@debian8:~$ ls -l -h total 17M -rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt -rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt -rw-r--r-- 1 paul paul 20K Sep 17 00:04 services drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff -rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt paul@debian8:~$ ls -lh total 17M -rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt -rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt -rw-r--r-- 1 paul paul 20K Sep 17 00:04 services drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff -rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt paul@debian8:~$ ls -hl total 17M -rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt -rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt -rw-r--r-- 1 paul paul 20K Sep 17 00:04 services drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff -rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt paul@debian8:~$ ls -h -l total 17M -rw-r--r-- 1 paul paul 17M Sep 17 00:03 allfiles.txt -rw-r--r-- 1 paul paul 95K Sep 17 00:03 dmesg.txt -rw-r--r-- 1 paul paul 20K Sep 17 00:04 services drwxr-xr-x 2 paul paul 4.0K Sep 17 00:04 stuff -rw-r--r-- 1 paul paul 0 Sep 17 00:04 summer.txt paul@debian8:~$ mkdir Walking around the Unix file tree is fun, but it is even more fun to create your own directories with mkdir. You have to give at least one parameter to mkdir, the name of the new

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.