1. Create a Directory
mkdir format mkdir [OPTION] ... DIRECTORY ... Option- p recursive creation- v creation prompt example: [email protected]:/home/eko/x# mkdir-pv a/b/cmkdir:created directory ' a ' mkdir:created dir Ectory ' A/b ' mkdir:created directory ' a/b/c '
2. Create a file
Touch is meant to change the file time touch [OPTION] ... FILE ...
Cases:
[Email protected]:/home/eko/x# Touch Abc.txt
3. Delete files/directories
RMRM [OPTION] ... [FILE] ... Option:- f ignores nonexistent files and parameters- r Recursive Delete example: [Email protected]:/home/eko# rm-rf x
4. Copying files
CP (allow only one file to be copied to another file or copy multiple files to a directory) CP [OPTION] ... [-T] SOURCE DEST CP [OPTION] ... SOURCE ... Directory CP [OPTION] ...-t DIRECTORY SOURCE ... Option- R Recursive copy- F if the target file has a forced overwrite
-P Reserved file owner
-A archive replication, commonly used for backup example: Copy one file to another # CP/ETC/PASSWD/HOME/EKO/X/PASSWD copy multiple files to a directory # cp/etc/passwd/etc/issue/home/ eko/x/
5. Move File/rename
MV MV [OPTION] ... [-T] SOURCE DEST mv [OPTION] ... SOURCE ... Directory mv [OPTION] ...-t DIRECTORY SOURCE ... Option: -F If the target exists, Force override example: Move File # mv./a.txt. /y/Rename # mv A.txt abc.txt
6. View the directory structure
Tree Dictory
Cases:
# Tree/home/eko
7. View text files
1. Cat connects and displays (can connect multiple files) cat [OPTION] ... [FILE] ... Option: -N Displays line number -e displays line terminator 2 per line. TAC Flashback Display
Linux instructions (i) File/directory operations