Basic Linux commands on the Command Line Interface (CLI)

Anna Ikoki
1 min readAug 10, 2022

create directory/folder: mkdir

create file: touch

remove directory: rmdir foldername

clear terminal: clear

change directory1(parent) to an inner directory2(child): cd directory2 or cd .. (this goes back to parent directory1), or cd to the initial root directory

list files in the current folder: ls

copy file-one to file-two: cp fileone filetwo

rename a file (rather, move a file from fileone to a newly created filetwo and delete fileone. Can also move to another newly created file in another directory as well and dele): mv fileone filetwo or mv fileone ..

show contents of file: cat filename.ext

open editor: nano filename.ext

tell interpreter language command to use to parse/execute the rest of the file (run the script) using shebangline: !#/bin/python3 or !#/bin/env python3

assign execute permission to file: chmod +x filename.py

run file with dot slash: ./filename.ext

delete file: rm

Arrow up and down to get back to prior commands

current directory: .

--

--