zeus 4 years ago
parent
commit
79662bede0
  1. 28
      index_ls.yml
  2. 1
      ls/0_ls_basic/code
  3. 1
      ls/0_ls_basic/codeanswer
  4. 1
      ls/0_ls_basic/codehelp
  5. 24692
      ls/0_ls_basic/data
  6. 65
      ls/0_ls_basic/info
  7. 9
      ls/0_ls_basic/q-info
  8. 5
      ls/intro

28
index_ls.yml

@ -0,0 +1,28 @@
--- # Programming language
name: "ls"
base_url: "https://git.swarmlab.io:3000/llo/LabLearningObject/raw/branch/master"
author: "zeus"
intro: "intro"
0_ls_basic:
display_name: "ls_basic"
swarmlabservice: "os2"
info:
file: "0_ls_basic/info"
code:
lang: "bash"
exec: "/bin/bash"
file: "0_ls_basic/code"
data: "0_ls_basic/data"
options: ""
mimetype: "bash"
output:
log: "console"
mimetype: "bash"
challenge:
question: "0_ls_basic/q-info"
codehelp: "0_ls_basic/codehelp"
codeanswer: "0_ls_basic/codeanswer"
mimetype: "bash"
points: "" # ELO
output:
log: "bash"

1
ls/0_ls_basic/code

@ -0,0 +1 @@
ls -l /

1
ls/0_ls_basic/codeanswer

@ -0,0 +1 @@
ls -al /home

1
ls/0_ls_basic/codehelp

@ -0,0 +1 @@
ls -a list all files including hidden file starting with '.'

24692
ls/0_ls_basic/data

File diff suppressed because it is too large

65
ls/0_ls_basic/info

@ -0,0 +1,65 @@
The syntax for the ls command is as follows:
[source,bash]
----
ls [OPTIONS] [FILES]
----
When used with no options and arguments, *ls* displays a list of the names of all files in the
[source,bash]
----
bin cdrom dev home lib64 media opt root sbin srv tmp var
boot etc initrd.img lib mnt proc run snap sys usr
----
Long Listing Format
The -l option causes ls to print files in a long listing format.
When the long listing format is used, the ls command will display the following file information:
[source,bash]
----
drwxr-xr-x 1 root root 4096 Jul 24 14:45 home
-rwxr-xr-- 1 root root 4096 Jul 24 14:45 home/text
----
- The file type
-- – file
-- d directory
-- l symbolic link
- The file permissions
-- The characters are pretty easy to remember.
--- r = read permission
--- w = write permission
--- x = execute permission
--- - = no permission
*file permissions in a three-digit octal number*
[source,bash]
----
Number Permission Type Symbol
0 No Permission ---
1 Execute --x
2 Write -w-
3 Execute + Write -wx
4 Read r--
5 Read + Execute r-x
6 Read +Write rw-
7 Read + Write +Execute rwx
----
- File owner
- File group
- File size
- Date and Time
- File name

9
ls/0_ls_basic/q-info

@ -0,0 +1,9 @@
Try to run
[source,sh]
----
ls -al /home
----
and see the Results!

5
ls/intro

@ -0,0 +1,5 @@
ls command is one of the most useful & important command used in Linux.
It is used to list information about files and directories within the file system.
In this *LO*, we will see the most used ls Commands examples in Linux.
Loading…
Cancel
Save