Linux file and directory
Linux file and directory
File and Directory Management
- mkdir <dir> Create new folder named <dir>
- mkdir -p <dir>/<dir> Create nested folders
- mkdir <dir1> <dir2> <dir3> Create several folders at once
- mkdir "<dir>" Create a folder with a space in the filename
- rmdir <dir> Delete a folder (only works on empty folders)
- rm -R <dir> Delete a folder and its contents
- touch <file> Create a new file without any extension
- cp <file> <dir> Copy a file to the folder
- cp <file> <new file> Copy a file to the current folder
- cp <file>~/<dir>/<new file> Copy a file to the folder and rename the copied file
- cp -R <dir> <"new dir"> Copy a folder to a new folder with spaces in the filename
- cp -i <file><dir> Prompts you before copying a file with a warning overwrite message
- cp <file1> <file2> <file3>/Users/<dir> Copy multiple files to a folder
- rm <file> Delete a file (This deletes the file permanently; use with caution.)
- rm -i <file> Delete a file only when you give confirmation
- rm -f <file> Force removal without confirmation
- rm <file1> <file2> <file3> Delete multiple files without any confirmation
- mv <file> <new file name> Move/rename
- mv <file> <dir> Move a file to the folder, possibly by overwriting an existing file
- mv -i <file> <dir> Optional -i flag to warn you before overwriting the file
- mv *.png ~/<dir> Move all PNG files from current folder to a different folder
THANKS
Easy to understand it's command
ReplyDeleteThanks ๐คญ
Delete