#File / directory display under
ls file name
ls -l File name
ll file name
#Login with root privileges
su -
#View current working directory
pwd
#Directory move
cd destination path
#Directory creation
mkdir directory name
#Directory deletion
rm -r directory name
#File deletion
rm file name
#File name change/Move file storage destination
mv file source file destination
#File copy
cp copy source copy destination
#View the contents of a text file
cat file name
#Log monitoring
tail -f Log file name
#Add user
adduser username
#Change user password
passwd
#Delete user
deluser username
#File owner change
chown username:Group name File name
#Change file permissions
chmod 644 filename
* 644 is "rw"- r-- r--Represents
Example
421 421 421
rwx rw- rw- ← r: read, w: write, x:Abbreviation for execute
↑ ↑ ↑
Your own group Other groups
#Server stop
shutdown -h now
#Server restart
shutdown -r now
#Date change
date 010123592020
* January 01, 23:59, 2020
#Service status check
systemctl status
#Service outage
sysytemctl stop
#Service start
sysytemctl start
#Service restart
sysytemctl restart
#vi command
#View file
vi
#Input mode from the cursor position
i
#Add line below the cursor
o
#Delete line at cursor position
dd
#Delete the character at the cursor position
x
#Normal mode
esc key
#End
:q
#Save and exit
:wq
Recommended Posts