COMMANDS

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 MULTIPLE BLANK FILES
Command :touch linux loves hackingDNA
- This command will create mulltiple blank files .
- See the below image for more details -

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 -

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 .

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

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 -

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 -

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 -

STRING HANDLING AND COMPUTATION USING EXPRESSION

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 -

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 -

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

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 -

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 -

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 -

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

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 –a ( List all the hidden files )
- Command : ls -a
- This command will display all the hidden files .
- See the below image for more details -

LIST FILE AND DIRECTORIES WITH MORE COMMAND

LIST ALL THE FILES WHOSE NAME STARTING WITH " H" USING WILDCARD *

PRINT THE INDEX NUMBER OF FILES

Example : ls –R , k= List subdirectories recursively

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

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 -

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 .

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

Example 3 : REMOVING SINGLE & 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 -

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 -

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

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 -

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

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 -
- run-level 0 : System halt , the system can be safely powered down .
- run-level 1 : Single user .
- run-level 2 : Multiple User , no NFS ( Network File System ).
- run-level 3 : Multiple User , command line ( i.e all in text ).
- run-level 4 : User definable .
- run-level 5 : Multiple user GUI ( Graphical User Interface ).
- 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 -

Example 6 : Short

Example 7 : Users

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

Example 2

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

Example 2

DISPLAY THE TEXT ON SHELL USING ECHO AND PRINTF COMMAND
Example 1 :

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

Example 2 : Print all information

Example 3 : Kernel name

Example 5 : Print the network node hostname

Example 6 : Print the kernel version

Example 7 : Print the machine hardware name

Example 8 : Print the operating system

PRINT WORKING DIRECTORY
- To print the working directory.
- This program is written by Jim Meyering .
Example 1 :

DATE COMMAND
Date command was written by David MacKenzie.
Example 1 : 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.

Example 2 : To see specific month .

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

COPY COMMAND
Example 1

CHANGE DIRECTORY EXAMPLES
Examples 1 :

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

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

COMPARE TWO FILES
- command : cmp hDNA1 hDNA2
- See the below example image for more details -

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

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