Basic linux operations (1): Basic linux operations
Easy to write
1. Basic commands.
(1) ls (list directory content)
Ls. Current Directory;
Ls... directory on the upper layer;
Ls-l is listed as a list;
Ls-a lists all objects-all;
Ls-h has the unit-human-readable;
Ls-t is arranged in chronological order-time;
Ls-R recursively lists all information in all directories, including subdirectories;
(2) touch
If the file does not exist, create the file. If the file exists, update the file time without changing the file content;
(3) create a directory using mkdir
Mkdir directorys you can create multiple single-level directories;
Mkdir directory1/directory2 if 1 does not exist,-p creates a multi-level directory;
(4) cd change working directory
Cd home directory;
Cd ~ Home Directory;
Cd-to the last hop directory (from where to where );
Cd/to the root directory;
(5) rm remove files or directorys
Rm-r deletes a directory;
When rm-f is deleted, the system does not prompt force deletion;
(6) cp copy file or directory
Cp file1 file2 copy file1 to file2;
Cp file1 directory copies the file to the directory;
Cp file1 file2 directory3 file... n directory copies the file or directory to a directory, but the last one must be a directory;
Cp *. c AAA copies all files ending with. c to the AAA directory;
\ Cp overwrite mode does not prompt whether to overwrite;
Cp directory1 directory2-r if directory2 does not exist, copy it to the next level directory of directory2 if directory2 exists;
(7) cut or rename mv move
Mv file1 file2
Mv directory1 directory2 rename if directory2 does not exist. If directory2 exists, it is cut to the directory2 directory;
(10) shutdown command
Shutdown
Halt
Halt-p-f direct power switch
Init 0
Restart
Reboot