Summary Linux command list
This command is for displaying file and directory information. "ls" stands for "list directory contents".
/home/hoge
$ ls
test hoge.txt test2
| 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 |
Hidden files with a period at the beginning of the file name are also displayed.
/home/hoge
$ ls -a
test hoge.txt test2 .hidden
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 |
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
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
pwd, mkdir, cd , cat, cp, ls, touch, less, mv, rm, ssh, man, ** Adding at any time **
We undertake various development and construction contracts and mentor work for beginners. If you are interested, please go to ** here **
Recommended Posts