This will be a memo for learning.
A directory is a folder. A folder that stores files. The directories are nested.
Store configuration file
The configuration file of the application that runs on Linux and the file related to the configuration of Linux itself are placed.
Home directory (personal directory assigned to each Linux user) is placed
Users are free to create files and directories in their home directory
Command to move directory
There is a special way to specify the current directory, parent directory, and home directory.
|directory||meaning||How to specify|
|Current directory||The directory you are currently in||「.」|
|Parent directory||One level higher directory||「..」|
|Home directory||「/home/Username directory||「~」|
pwd [option] #ほとんどoptionをつけることはない
Command to display the current directory (current directory) A command that tells you where you are now
ls [option][Directory file name]
Command to display a list of files and directories Find out which folders/files are in your current directory
You can specify multiple files at once using pathname expansion
|？||Any one character|
Concrete example #Display a list of files with the extension html $ls *.html index.html home.html job.html #Show files starting with z and ending with 4 characters $ls /bin/z??? /bin/zcat /bin/zcmp /bin/znew
ls -l View detailed information about the file
ls -a Show all files, including hidden files
ls -F Show file type
mkdir [option]<Directory name to create>
Command to create a directory
-p Create deep directories at once With the -p option, you don't have to create a directory called test, 2019 in advance.
$mkdir -p test/2019/08
rmdir <Directory name>
Command to delete an empty directory (an error will occur if you try to delete a non-empty directory) I rarely use it (mostly I use the rm command)
The path is the address information of a directory or file. Represent the directory hierarchy delimiter with "/"
The absolute path is the path starting from the root directory ("/").
Relative path is the path starting from the current directory.
Display help messages for commands with the
<command> --help #Concrete example ls --help Usage: ls[option]...[File]...
It will give you an overview of how to use the command, a list of available options, and use it when you want to understand the outline of the command.
Display the command manual with the man command It's more detailed than the --help option, so use it when you want to understand the command properly.
man <Command name you want to look up> #Concrete example man ls NAME ls -list directory contents #You can search by keyword man -k move