[Beginners guide] must know terminal commands to start with

Targeted audience : level `-1` to get them to level `0`

·

2 min read

How to launch terminal in different os

  1. type terminal in spotlight search in mac
  2. type cmd in all programs of windows
  3. ctrl+shift+t in linux

pwd - Print Working Directory

Use Case :

to get current working directory

Command :

pwd

Available options :

pwd [-LP]

Open Open a folder structure in folder viewer

Command :

Open .

ls - list directory contents

Use Case :

to get List of all the files and folders/directory

Command :

ls

Command : get list of files + folders + hidden files

ls -a

Command : get list of files and folders with permission level

ls -la

Available options :

ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]

clear - Clear

Command :

clear

Use Case :

clear the terminal edit window and move cursor/control to first line

cd : catch directory

Command : to navigate to parent of current folder

cd ..

Command : to navigate to root directory

cd /

Command : to navigate to user's home

cd ~

Create file using terminal

Command : create file using terminal in current directory

touch testfile.txt

Available options :

touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file

Delete file using terminal

Command : delete file using terminal in current directory

rm testfile.txt

Create folder/directory using terminal

Command : create directory using terminal in current directory

mkdir testFolder

Available options :

touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file

Delete directory using terminal

Command : delete file using terminal in current directory

rmdir testFolder

Command :

man ls

replace ls with the command you want to get information about

q exit from any edit window

Command :

q

history get list of commands used recently

Command :

history

Bookmark if you find it helpful. Happy testing!