BASH shell introduction

Simple commands

Manual:
Man

Clear terminal:
clear

See history of commands:
history

See current directory:
pwd


List directory content:
ls

list hidden content: 
ls -a

list as a list: 
ls -l

list in human readable: 
ls -h

We can combine it like this:
ls -lha


Make empty directory:
mkdir

remove empty directory:
rmdir


Change directory:
cd

Example going to root directory & back:
cd /
cd [empty space]


Determine file type:
file

Create file:
touch


Remove a file/directory:
rm

Remove a directory:
rm -fr
-f = force
-r = recurse


Copy files & directories:
cp

Make another copy in the same location:
cp test.txt fd.txt

Copy a file to another directory:
cp test.txt /home/bryan/Documents/


Move or rename a file:
mv

Rename:
mv fd.txt file2.txt

Move and rename:
mv file2.txt test/file3.txt

Leave a Reply

Your email address will not be published. Required fields are marked *