LINUX COMMANDS

LINUX COMMANDS

COMMANDS

Linux commands on bugtraq

INTRODUCTION
  • Learn linux commands as much as you can .
  • These commands help you to learn how to work on Unix & Linux systems .
  • These command are helpful for students and system administrators .
  • In this tutorial you will also learn who is the author of linux commands.
CREATE BLANK FILES
Touch Command
  • Touch command is used to create a blank files on linux systems .
  • Touch command was written by Paul Rubin , Arnold Robbins, Jim Kingdom, David MacKenzie and Randy Smith .
 EXAMPLES OF TOUCH COMMANDS 
CREATE SINGLE BLANK FILES
  • You can create multiple blank files with a simple command as shown below.
Command : touch Unix
Here linux  , loves, hackingDNA are directories .
create blank file with touch command

CREATE MULTIPLE BLANK FILES
Command :touch linux loves hackingDNA
  • This command will create mulltiple blank files .
  • See the below image for more details -
create multiple blank files

CREATE FILE AND INSERT TEXT 
Command : cat > file01
  • This command will create file and allow you to enter text .
  • See the below image for more details -
create file and insert text

Example : CONCATENATE FILES
Command : cat hDNA1 hDNA2 > hackingDNA
  • With this command you will join two files together.
  • See the below example image , in this first we create two files and then we  concatenate these files .
concatenate files using cat command

CREATE HIDDEN FILE 
Command : cat >.Underground
  • This command will create hidden file .
  • See the below image for more details -
create hidden files using cat command

VIEW HIDDEN FILE 
Command : ls -a 
  • This command will display all the hidden files on your linux shell . 
  • See the below image for more details -
View hidden files on linux

WORD COUNT 
  • The wc command is created by Paul Rubin and David MacKenzie.
  • With this command you can count the number of words in your file .
  • See the below image for more details -
wc commands on linux

TEST COMMAND EXMAPLE 

  • This command will check file type and compare values .
  • Test command is written by Kevin Braunsdorf and Matthew Bradburn .
  • See the below image for more details -

test command


STRING HANDLING AND COMPUTATION USING EXPRESSION 
expr commands
  

PS (Process Command )

  • It display the information of the active process.
  • ps command was written by Branko Lankester , Michael K. Johnson.
  • Command : ps 
  • See the below image for more details -
ps command

Example 2: All users processes.
  • Command : ps -u 
  • This command will shows users, Process ID , CPU , Memory  etc .
  • See the below image for more details -
process command

Example 3 : view system processes
  • COMMAND : This command will view the system processes.
  • See the below image for more details -
ps -c command

HOW TO CREATE USER IN BUGTRAQ 
  • This command help you to create user in bugtraq operating system .
  • To create user , you should have superuser account .
  • To access superuser , enter the command " su " and enter the password : 123456 in bugtraq .
  • Once you are in superuser account .
  • Now enter the user creation account .
  • Command : useradd < account name >
  •                : passwd  <account name >
  • Enter unix password : < Enter password >
  • Retype new Unix password : < Enter password again >
  • See the below image for more details -
create user in bugtraq

Login into hackingDNA Account 

  • Command : login 
  • With this command you can login into the account you have created .
  • See the below image for more details -
login

Delete User from command line 

  • Command : userdel < account name >
  • This command help to delete the user account .
  • Remember : You need a superuser account in bugtraq to delete the user.
  • See the below image for more details -
user delete command

LISTING FILES AND DIRECTORIES

  • The" ls " command  is written by Richard M. Stallman and David MacKenzie.
  • See the below image for more details -
ls command

LIST FILES AND DIRECTORIES WITH PERMISSION 

  • Command : ls -l 
  • This command will display the list and directories with permissions .
  • See the below image for more details -
ls -l :  List files and directories with permission

Ls –a ( List all the  hidden files )

  • Command : ls -a 
  • This command will display all the hidden files .
  • See the below image for more details -
 View hidden files on linux

LIST FILE AND DIRECTORIES WITH MORE COMMAND 

ls -l | more command : shows page wise

LIST ALL THE FILES WHOSE NAME STARTING WITH  " H" USING WILDCARD *
list all the files starting with h

PRINT THE INDEX NUMBER OF FILES
LIST INDEX NUMBER OF FILES

Example : ls –R , k= List subdirectories recursively

ls -R

Example : List recursively .
Command : ls –r
  • This command display  the name of files in reverse order .
  • See the below image for more details -
ls -r

CREATE DIRECTORIES

EXAMPLE  
CREATE SINGLE  & MULTIPLE DIRECTORIES
  • Command : mkdir <directory name >
  • Command : mkdir dir1 dir2 dir3 dir4 dir5 
  • The above command will create a single & multiple directories .
  • See the below image for more details -
CREATE SINGLE AND MULTIPLE DIRECTORIES


REMOVE FILE AND DIRECTORIES

To remove file and directories we use a rm and rmdir command .
Example 1 :  Remove single file
  • Command : rm <filename>
  • See the below example . here we remove the single file named file01 .
REMOVE COMMAND

Example 2 :  Remove  Multiple file 
  • Command : rm <file1> <file2>
  • The above command help to remove multiple files .
  • See the below image for more details -
REMOVE  MULTIPLE FILE


Example 3 : REMOVING SINGLE & MULTIPLE DIRECTORIES
REMOVE MULTIPLE DIRECTORIES


Example 4 : Remove file Interrractively 
  • Command : rm -i < filename >
  • This command will remove your fille interactively . 
  • See the below image for more details -
REMOVE FILE INTERACTIVELY
  

WHO COMMAND

  • Who command shows who is logged in .
  • The author of this command is Joseph Arceneaux, David MacKenzie , and Michael Stone.
Example 1 :
Command : who 
  • This command will shows who is logged on .
  • See the below example image for more details -
WHO COMMAND

Example 2 : 
  • Command : who -b 
  • This command will shows the time of the last system boot.
  • See the below image for more details - 
WHO COMMAND WITH -b OPTION

Example 3 :SHOW ALL INFORMATION 
  • Command : who -a 
  • This command shows all informations like last system boot , run levels, login users etc .
  • See the below image for more details -
WHO COMMAND WITH -a OPTION

Example 4 : Heading 
  • Command : who -H 
  • This command will print the column headings .
  • See the below image for more details -
WHO COMMAND WITH -H OPTION

Example 5 :Run  level
  • Run level : A run level is a present operating state on Linux operating system .
  • There are 7 run level supported by the linux kernel -
  1. run-level 0 : System halt , the system can be safely powered down .
  2. run-level 1 : Single user .
  3. run-level 2 : Multiple User , no NFS ( Network File System ).
  4. run-level 3 : Multiple User , command line ( i.e all in text ).
  5. run-level 4 : User definable .
  6. run-level 5 : Multiple user GUI ( Graphical User Interface ).
  7. run-level 6 : Reboot .
Command : who -r 
  • As you know  what is run-level now  , With this command you can see my system run-level state i.e -> 2 
  • See the below image for more details -
WHO COMMAND WITH -r OPTION

Example 6 : Short
WHO COMMAND WITH -s OPTION
Example 7 : Users 
who -u

HEAD  COMMAND

  • Head command is used to see the top 10 lines from a text file .
  • You can also use this head command with different arguments .
  • See the below example images for more details
EXAMPLE 1 
HEAD COMMAND
Example 2 
HEAD COMMAND WITH -N OPTION

TAIL COMMAND

Tail command is used to display the last  bottom 10 line of a text file .
Example 1 
TAIL COMMAND
Example 2 
TAILCOMMAND

DISPLAY THE TEXT ON SHELL USING ECHO AND PRINTF COMMAND

Example 1 : 
echo print command
Uname
  • Uname command is used to print the system name .
  • This program was written by  “ David MacKenzie “.
Example 1 : Print Operating system name 
uname command

Example 2 : Print all information 
uname -a command
Example 3 : Kernel name 
uname -s shows kernel name

Example 5 : Print the network node hostname 
uname -n command
Example 6 : Print the kernel version 
uname -r command

Example 7 : Print the machine hardware name 
uname -m
Example 8 : Print the operating system 
uname -o

PRINT WORKING DIRECTORY

  • To print the working directory.
  • This program is written by  Jim Meyering .
Example 1 : 
pwd command

DATE COMMAND

Date command was written by David MacKenzie.
Example 1 :  Date command .
date command

Calendar

  • Written by Wolfgang Helbig
  • The cal utility display a simple calendar in traditional format  and offer alternative layout .
Example 1 : To see the current month calender.
cal command

Example 2 : To see specific month . 
cal command to see specific month

Example 3 : To see yearly calender
  • Command used  : cal 2013
  • See the below image for the result -
cal command to see yearly colender

COPY COMMAND

Example 1
copy command on bugtraq

CHANGE DIRECTORY EXAMPLES
Examples 1 : 
cd command

LESS COMMAND
  • Display the list from the end .
  • See the below image for more details -
LESS COMMAND


Whatis Command
  • Whatis command display the one line description of command .
  • See the below image for  more information .
whatis command

COMPARE TWO FILES 
  • command : cmp hDNA1 hDNA2 
  • See the below example image for more details -
compare two file with cmp command

COMMON COMMAND 
  • See  the below example image for more details -
COMMON COMMAND

AT THE END 
  • When you practise these commands in your daily routine , its easy to work on all the linux platforms .
  • So keep learn all the command and sharp your  commands skills .
THIS TUTORIAL IS JUST FOR EDUCATIONAL PURPOSE ONLY /- 

Comments

Popular Posts