MarcoTech

Cyber Security

By: Pix3l
Search

Linux - Basic Command's

In this article we will learn some Basic Linux command's.
With every command ill show a Demo and the Output of said command.


The Basic command's that you have to remember (takes a huge part in your linux work time) are:
$pwdPrint Working Directory, will give an output of your current Path:
┌──(kali㉿kali)-[~]
└─$
pwd
/home/kali

$cd <Path> Change Directory, if you want to navigate to another library in you Linux OS through CLI/Terminal.
┌──(kali㉿kali)-[~]
└─$
cd Desktop

$ls Lists current working directory.

┌──(kali㉿kali)-[~]
└─$
ls
Desktop    Downloads    genymotion-logs-20210411-062904.zip  mtu    Nessus-8.14.0-debian6_amd64.deb  Pictures  Public         TBomb      Videos
Documents  File-Binder  killshot     Music       php-reverse-shell                Pompem     Templates

$cp <FilePath> <NewPath>Copy any file to another destination.
┌──(kali㉿kali)-[~]
└─$
cp test.txt Desktop/Tools

$mv <FilePath> <NewPath>Move any file to another directory.
┌──(kali㉿kali)-[~]
└─$
mv test.txt Desktop/HackTheBox

$whoami Show current active user
┌──(kali㉿kali)-[~]
└─$
whoami                                                                                   
kali

$passwd <Username> Changing user password.
┌──(kali㉿kali)-[~]
└─$
passwd                                                                                                                                                    
Changing password for kali.
Current password: 
 
$mkdir <DirName>Creating a new Directory in the current path.
┌──(kali㉿kali)-[~]
└─$
mkdir test

$rm <FileName>Deleting a File or an empty folder.
┌──(kali㉿kali)-[~]
└─$
rm test.txt

$rm -r <File\Dir Name>Performing a recursive delete to a folder or a file.
┌──(kali㉿kali)-[~]
└─$
rm -r Folder/ 

$ifconfigShows network configuration.
┌──(kali㉿kali)-[~]
└─$
ifconfig                                      
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.88.149  netmask 255.255.255.0  broadcast 192.168.88.255
        inet6 fe80::a00:27ff:fea6:1f86  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:a6:1f:86  txqueuelen 1000  (Ethernet)
        RX packets 6749475  bytes 3934986411 (3.6 GiB)
        RX errors 0  dropped 1361788  overruns 0  frame 0
        TX packets 1356052  bytes 163050943 (155.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4133907  bytes 669914641 (638.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4133907  bytes 669914641 (638.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0