# service status sudo service mysql status # check the status sudo service mysql start # start mysql sudo service mysql stop # stop mysql sudo service mysql restart # restart mysql
# get into the client sudo mysql -u root -p ```
If you meet the problem `su: warning: cannot change directory to /nonexistent: No such file or directory`, try the following commands in sequences.
```bash sudo service mysql stop sudo usermod -d /var/lib/mysql/ mysql sudo service mysql start
# system uname -srm # show kernal name + release version + hardware framework name dpkg --get-selections | grep linux # show all kernals
lshw # show hardware lsusb # show usb devices
cat /etc/shadow # show all users
pwd# show working directory mkdir dir_name # make new folder rmdir dir_name # remove a folder echo"content" >> file_name # write content to a file touch file_name # make new file rm file_name # remove a file rm -r dir_name # remove a folder cp src dst # copy scr to dst mv src dst # move or rename file from src to dst
du -h --max-depth=1 | sort -rh # show disk usage and sort reversely
# unzip file tar -xvzf file_name -C target_folder
# vi vi <file name> # open or create file i # insert
h # left move l # right move j # down move k # up move