Skip to content
root / Terminal Tricks: LINUX

Terminal Tricks: LINUX

CHANGE DIRECTORY

Keyword: cd

Usage: Takes your terminal to the directory you choose.

Examplecd Desktop

Types:

A. cd..

Usage: Takes you to the Main folder from a Sub-folder

CLEAR SCREEN

Keyword: clear

Usage: Clears the Terminal Screen

Exampleclear

MAKE A FOLDER USING TERMINAL

Keyword: mkdir

Usage: Used to make a folder from the terminal

Examplemkdir example_folder

LIST OF FILES AND SUB-FOLDERS

Keyword: ls

Usage: Displays the files and subfolders in a directory

Examplels

The output from folder “example_folder” with a new folder named “folder_1”

VERSION OF PYTHON

Keyword: python –version

Usage: Gives the version of python you are using

Examplepython --version

Output:

VISUAL EDITOR IN TERMINAL

Keyword: vi

Usage: Will open an editor in Terminal. It requires special Keywords to type, save, exit

Example:vi example.txt

Output:

Now to type Enter:i

You will see a --INSERT--in the bottom

Now, Start type your code

To exit the vi at any time just press: Esc + :q!

Then, It will return to the place you started

DATE AND TIME

Keyworddate

Usage: displays the current date and time

CALENDAR

Keywordcal

Usage: Shows the month’s calendar

USER AND MORE

Keywordfinger user

Usage: Displays information about the user

DISK USAGE

Keyworddf

Usage: Shows the Disk usage

WHO AM I?

Keywordwhoami

Tags: