About the ls command that you can't ask about now
table of contents
Hello. My name is Okazaki from the System Solutions Department.
to check file and directory information when managing a server
is "ls".
It is also probably
the command that everyone used when they were new or when they first touched the server
I would like to introduce the "ls" command, which is one of the commands that server administrators often use
What is the ls command?
The ls command is a command that displays information about directories and files.
By adding options when displaying,
you can display various information about files and directories.
About how to use
The basic usage is as follows.
$ ls [options] [file or directory]
(Example 1)
If you want to get the access privileges, owner size, and last updated date of a file/directory, add the "-l" option as shown below.
$ ls -l [file or directory]
(Example 2)
If you want to display hidden files starting with ".", add the "-a" option.
$ ls -a [file or directory]
(Example 3)
If you want to display the items in the order of the last updated time, add "-t", and if you want to reverse the order, add "-r".
$ ls -t [file or directory]
$ ls -r [file or directory]
(Example 4)
You can also combine all the previous commands.
$ ls -altr [file or directory]
(Example 5)
summary
It is a command that is used frequently in daily operations and operations, but I
often forget the key and search for it, or the command I usually use
only uses certain options, and when I look it up again, I find
that there are options that are unexpectedly useful. I will.
This time I introduced a few options of the "ls" command, but
there are many more options, so I would like to introduce more in the future.