[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

About the ls command that you can't ask about now

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.

If you found this article helpful , please give it a like!
1
Loading...
1 vote, average: 1.00 / 11
9,168
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author

Junichiro Okazaki

Extensive experience in relocating and operating smartphone games.

He handles multi-cloud operations, server construction and relocation on a daily basis. As the number of cases has increased, I am considering how to improve the efficiency of my work. We often consider methods for relocating servers based on the merits of each cloud.

While we were relocating between clouds and from physical to cloud, we achieved two consecutive victories in a competition held by the Japan MSP Association.