Linux: files and directories


** All Linix is represented as a file **

In other words, of course, documents and images are also saved as files.

The entire system is also made up of files.

The Linux kernel, hardware, and keyboard all input and output are assigned to files, and devices can be operated through those files.

Role of each Linux directory

/bin ** List the most important commands required for Linux operation **

/dev Directory for storing device files. A special file that allows the hardware to be treated as a file

/etc A directory that stores files that describe various applications and the settings of Linux itself.

/home Home directory assigned to each Linux user.

/sbin The directory where the executable file is placed.

View current directory

A command to display the current directory.

$ pwd

View files and directories in the current directory

$ ls
bin home games ....
$ ls / /home =>You can also specify multiple directories

You can also move with a relative path

$cd .. =>Go up one level

You can also complete with the Tab key

$ cd ho

Tab key here

$ cd home
$ cd home/local

And the path name can be completed.

Move to home directory

$ cd


List of files starting with ho

$ ls *ho

home homeground hoge
$ ls *.html

index.html hoge.html

Find a file that starts with ho and is 4 characters long

$ ho??


ls command options

$ ls -l =>Display file attributes
$ ls -a =>Show hidden files

Options can be combined and connected for writing.

Recommended Posts

Linux: files and directories
Differences between Windows and Linux directories
Find large files / directories on Linux
OS and Linux distribution
Rename and move files (directories) with mv command
Maintain directory structure on Linux and move old files
Get files from Linux using paramiko and scp [Python]
Recursively search for files and directories in Python and output
Studying Linux commands and frustration
CLI and Linux basic terms
Device and Linux file system
Reading and writing csv files
Recording and playback on Linux
Linux file and directory permissions
[Linux] Compress folders and transfer files from remote to local
Commands and files to check the version of CentOS Linux
Basic knowledge of Linux and basic commands
Are macOS and Linux completely different?
(Windows10) Install Linux environment and gnuplot.
[linux] Swap Caps Lock and Ctrl
Manipulate files and folders in Python
Read and use Python files from Python
Permission and ownership change command [Linux]
Linux archiving and compression (tar and gzip)
Check and move directories in Python
Save and retrieve files with Pepper
[Linux] File and directory operation commands
Export and output files in Python
Note: Linux concepts and minimum commands
What are the directories such as Linux, / etc and / var / log?
For Windows: Get a list of directories and files under a specific directory.
[High-speed version] Search files or directories and delete them all at once
[UE4] Build DedicatedServer on Windows and Linux
Linux (for users and su / sudo commands)
Install wsl2 and master linux on windows
Edit and save read-only files with vim
[linux] Split files to the specified size
Install and launch k3s on Manjaro Linux
Install and Configure TigerVNC server on Linux
Read and write csv files with numpy
Learn sshd_config and authorized_keys (on Amazon Linux 2)
Read and write JSON files in Python
What are Linux POSIX options and GNU options?
Replacing rmtrash on Mac and replacing rm on Linux
How to find large files on Linux