Skip to content
ShawshankLabs
Go back

Useful Linux commands I keep forgetting

Not gonna lie but people(including me) forget basic commands more than they admit! so here are few commands that someone definitely needs to know and remember🤓.

pwd prints name of your working directory

cd is used to change directory.

cd .. brings you back one directory
cd ~ brings you to home directory

ls is used to list files & folders in a directory
if you want more details use ls -l navigation

File Handling

touch is used to create files

rm is used to remove files

cp is used to copy file and folders, use -r to copy items in folder too

mv is used to move files and folders, use -r arguments to copy folder items recursively

mv is also used to rename files, use mv <name_one> <name_two>
here is the process of rename files on linux using mv rename

Viewing Files

cat is used to read text files

use this to read text files and scroll through pages

prints first few lines of a text file

prints last few lines of a text file

cat here cat,head & tail all showed the same output cause the file only contained a single line of text

System Basics

prints the username

prints the hostname of the machine

tells previously used commands

this command prints out the date in terminal


Share this post on:

Next Post
First