Introduction To Kali LInux command Line 2

Linux Man Pages

To learn more about a command and its option and arguments and its documentation can be viewed using man command
root@kali:~# man ls
LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List  information  about  the FILEs (the current directory by default).
       Sort entries alphabetically if none of -cftuvSUX nor --sort  is  speci‐
       fied.
       Mandatory  arguments  to  long  options are mandatory for short options
       too.
       -a, --all
              do not ignore entries starting with .
       -A, --almost-all
              do not list implied . and ..
       --author


The man page gives useful information about ls command including its usage, description.
From the above example we can see that ls -a command it list every directory,files including hidden file.

Adding Users in Linux

By default kali offers only the privileged root account.Though many security tools require root privileges to run, you may want to add another unprivileged account for everyday use to reduce the potential for damage to your system. Remember,the root account can do anything on Linux,including removing the root file systems.
To add  new user to your kali linux system we can use addusercommand
root@kali:~# adduser teja
Adding user `teja' ...
Adding new group `teja' (1000) ...
Adding new user `teja' (1000) with group `teja' ...
Creating home directory `/home/teja' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for teja
Enter the new value, or press ENTER for the default
    Full Name []: teja
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
Is the information correct? [Y/n] y


Adding a User to sudo group

root@kali:~# adduser teja sudo
Adding user `teja' to group `sudo' ...
Adding user teja to group sudo
Done.


Switching Users

To switch from root user to normal user use su command
root@kali:~# su teja
teja@kali:/root$ su
Password:
root@kali:~#

sucommand switches the user from root to teja.Then to again switch from teja
type su we need to provide the password for root to switch back

To create a new directory

root@kali:~# mkdir newdirectory
root@kali:~# ls
newdirectory


To create a new file

use touch command
root@kali:~# touch file
root@kali:~#ls
file


Copy command

syntax for copy is cp source destination
root@kali:~# cp file newdirectory

Moving command

syntax for move is mv source destination
root@kali:~# mv file newdirectory

Remove command

To remove a file use rm command
root@kali:~# rm file
To remove a directory you cannot use same command
root@kali:~# rm -r newdirectory/

Adding Text to a File

we use echo command to echo a text to terminal
root@kali:~#echo hello world
hello world


Instead of printing the text we can write the text to a file
root@kali:~#echo hello world > file

To see the contents of the file

root@kali:~#cat file
hello world

If we echo another text to the file
root@kali:~#echo hello world again >file
root@kali:~#cat file
hello world again


The previous contents of the file are erased and new content overwrites the file.

To Append the File

root@kali:~#echo hai world >> file
root@kali:~#cat  file
hello world again
hai world


File Permissions

If you see the output of ls -l file
root@kali:~#ls -l file
-rw-r--r-- 1 root root      file
-rw-r--r-- says about the file permissions.

Linux files have permission to read(r), write (w) and execute (x) and three sets of user permission, three sets of group permission and three sets for all users

Using Grep

The command grep search for the string which is given as argument
root@kali:~#cat file
hello world again
hai world
root@kali:~#grep again file
hello world again

Comments

  1. My wife was putting up some attitude and acting strange,and we have been married for eight years,I explained my problems to my friend and he recommended brillianthackers800@gmail.com,I sent him a mail explaining my situation to him and he helped me hack into her phone,Walt sent me a WhatsApp conversation between my wife and her concubine which she told him everything about me and our marriage and he also recorded a call conversation between she and her concubine talking about how they were going to kill me and take my money and properties,I took this to court and I won the case,they were locked up in prison all thanks to Walt who saved my life through his hacking experience,every dollar I spent on this job was worth it,message him and he will help you with your problems.

    ReplyDelete

Post a Comment

Weekly Posts

HOW TO HACK ANY PC CONNECTED TO THE NETWORK USING KALI LINUX

HOW TO CRACK MAIL PASSWORDS USING HYDRA ON KALI LINUX .( GMAIL , YAHOO , LIVE) /bruteforce method .

How to crack wpa/wpa2 using crunch