pwd displays the full path of the current working directory
ls lists files in a directory
ls -a lists all files under the file, including hidden files starting with "." (the hidden files of files under linux start with ., if there is .. on behalf of the existence of the parent directory) ls -l lists the details of the file, such as creator, creation time, list of read and write permissions for the file, etc. ls -F Adds a character to the end of each file indicating the type of the file. "@" means symbolic link, "|" means FIFOS, "/" means directory, "=" means socket ls -s prints the size of the files after each file. size (size) ls -t sort files by time Time (time) ls -A lists files other than "." and "..". ls -R lists the files in all subdirectories in the directory, which is equivalent to the "recursive" implementation in our programming ls -L List link names of files. Link ls -S sort by file size
usage of cd
cd /home to enter the home directory cd ~ to enter the user's home directory (sa's directory) cd / to enter the system directory (file system) cd - return to the directory where you were before entering this directory; cd .. go back to the previous directory cd ../.. go back two levels up
Move (mv) and copy (cp) files and folders
mv is similar to cut under windows mv aaa /test/user moves aaa to the /test/user directory mv /tv/aaa /test/user Move aaa in the /tv directory to the /test/user directory mv -r aaa /test/user will recursively move the aaa folder to the /test/user directory, without -r it will cause an error mv aaa bbb rename aaa to bbb -b: When the file exists, before overwriting, create a backup of it; -f: If the target file or directory is duplicated with an existing file or directory, the existing file or directory will be overwritten directly; -i: Interactive operation, ask the user before overwriting, if the source file has the same name as the target file or a file in the target directory, ask the user whether to overwrite the target file. -u: The move operation is performed only when the source file is newer than the target file or the target file does not exist. -f: Forcibly copy the file or directory, regardless of whether the target file or directory already exists; -i: ask the user before overwriting existing files; -s: establish a symbolic link to the source file instead of copying the file; -R/r: Recursive processing, processing all files and subdirectories in the specified directory together The usage of cp is similar to mv
delete command rm
rm -rf aaa Force delete aaa folder or file -r delete recursively -f force delete, don't ask
Create new folders (mkdir) and files (touch)
mkdir aaa Create aaa folder in the current directory mkdir /test/user/aaa creates the aaa folder in the /test/user directory mkdir -p /test/user/aaa If the user folder does not exist, you need to use -p to create the folder touch abc.txt to create abc.txt file in the current directory