[Linux command] ls command option list [Must-see for beginners]

[Linux command] ls command option list [Must-see for beginners]

Summary Linux command list

What is the ls command?

This command is for displaying file and directory information. "ls" stands for "list directory contents".

How to use the ls command

/home/hoge


$ ls 
test hoge.txt test2 

List of options for the ls command

option Description
-a Show all
-l Detail View
-1 Arrange the list vertically
-r Reverse order display
-t Display in order of update time
-S Sort by file size
-X Arrange in order of extension (every)
-R Recursively display directory contents
--full-time View timestamp details
-h Display units in an easy-to-read format
-k Display in KB
-F After the directory name' / ',After the executable file name' * 'Put on

-a option

Hidden files with a period at the beginning of the file name are also displayed.

/home/hoge


$ ls -a
test hoge.txt test2 .hidden

-l option

View file details.

/home/hoge


$ ls -l
-rw-r--r-- 1 root root   11 Feb 24 17:11 hoge.txt
drwxr-xr-x 2 root root 4096 Feb 24 17:14 test
drwxr-xr-x 2 root root 4096 Feb 24 17:15 test2

How to read the details, but if you explain in the first line

item Description
-rw-r--r-- File type (1 character on the left) + permissions
1 Number of hard links
root owner
root Owned group
11 File size
Feb 24 17:11 Creation date and time
hoge.txt file name

-R option

Display directory contents recursively.

/home/hoge


$ ls -R
hoge.txt test test2

./test
test.txt ex.txt test.log

./test2
test2.txt ex2.txt test2.log

-h option

The unit of file size is nice and nice.

/home/hoge


$ ls -lh
-rw-r--r-- 1 root root  11B Feb 24 17:11 hoge.txt
drwxr-xr-x 2 root root 4.0K Feb 24 17:14 test
drwxr-xr-x 2 root root 4.0K Feb 24 17:15 test2

List of options for other Linux commands

pwd, mkdir, cd , cat, cp, ls, touch, less, mv, rm, ssh, man, ** Adding at any time **

Advertising space

We undertake various development and construction contracts and mentor work for beginners. If you are interested, please go to ** here **

Recommended Posts

[Linux command] ls command option list [Must-see for beginners]
[Linux command] cp command option list [Must-see for beginners]
[Linux command] touch command option list [Must-see for beginners]
[Linux command] less command option list [Must-see for beginners]
[Linux command] cat command option list [Must-see for beginners]
[Linux command] pwd command option list [Must-see for beginners]
[Linux command] rm command option list [Must-see for beginners]
[Linux command] cd command option list [Must-see for beginners]
[Linux command] mv command option list [Must-see for beginners]
[Linux command] man command option list [Must-see for beginners]
[Linux command] ssh command option list [Must-see for beginners]
[Linux command] mkdir command option list [Must-see for beginners]
[Linux command summary] Command list [Must-see for beginners]
Linux command memorandum [for beginners]
[Must-see for beginners] Basics of Linux
Linux command list
Linux operation for beginners Basic command summary
Linux command for self-collection
What is Linux? [Command list]
Linux distribution recommended for beginners
Linux Command Dictionary (for myself)
Python #list for super beginners
Convenient Linux shortcuts (for beginners)
Frequently used Linux commands (for beginners)
Linux command # 4
Linux command # 3
Linux command # 5
How to create a shortcut command for LINUX
linux at command
ls command options
[Linux] Search command
Roadmap for beginners
Linux command <Basic 2>
Linux [directory command]
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux Command Summary
[Basic] linux command
Linux [shell command]
[Linux] Command / Knowledge
pyenv for linux
My linux command
Linux command <Basic 1>
Linux command collection
Linux mkdir command
Linux command basics
[Linux] Git command
Linux (command memory)
[Linux] A list of Linux commands that beginners should know
[For beginners] How to use say command in python!
[Linux] Basics of authority setting by chmod for beginners
Understand the attributes of Linux files (ls -l command)