zeus
4 years ago
8 changed files with 24802 additions and 0 deletions
@ -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" |
@ -0,0 +1 @@ |
|||||
|
ls -l / |
@ -0,0 +1 @@ |
|||||
|
ls -al /home |
@ -0,0 +1 @@ |
|||||
|
ls -a list all files including hidden file starting with '.' |
File diff suppressed because it is too large
@ -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 |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,9 @@ |
|||||
|
|
||||
|
Try to run |
||||
|
|
||||
|
[source,sh] |
||||
|
---- |
||||
|
ls -al /home |
||||
|
---- |
||||
|
|
||||
|
and see the Results! |
@ -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…
Reference in new issue