unix commands

2
UNIX COMMANDS man wc Unix will show command lists ls list files ls – a list hidden files also mkdir make directory cd change directory cd. stay in current directory cd.. back to home directory pwd present/print working directory cd~ change to home directory ls – l long listing of files cp copy files mv move files / rename files rm remove files rmdir remove directory clear clear screen cat display the content of the file less shows one page of a file ( used for long files ) head first 10 lines of a file tail last 10 lines of a file grep search specific word or pattern grep –i To ignore upper/lower case distinctions grep –v To display those lines that do not match grep –n Precede each matching line with line number grep –c Prints total count of matched lines grep –ivc Three commands at a time command s To run a command in background

Upload: gokul-krish

Post on 01-Feb-2016

3 views

Category:

Documents


0 download

DESCRIPTION

Notes

TRANSCRIPT

Page 1: Unix Commands

UNIX COMMANDS

man wc Unix will show command lists

ls list files

ls – a list hidden files also

mkdir make directory

cd change directory

cd. stay in current directory

cd.. back to home directory

pwd present/print working directory

cd~ change to home directory

ls – l long listing of files

cp copy files

mv move files / rename files

rm remove files

rmdir remove directory

clear clear screen

cat display the content of the file

less shows one page of a file ( used for long files )

head first 10 lines of a file

tail last 10 lines of a file

grep search specific word or pattern

grep –i To ignore upper/lower case distinctions

grep –v To display those lines that do not match

grep –n Precede each matching line with line number

grep –c Prints total count of matched lines

grep –ivc Three commands at a time

command s To run a command in background

ctrl+c Kill the job running in foreground

ctrl+z Suspend the job running in foreground

quota –v To check how much memory has been used

Page 2: Unix Commands

df Space (i.e.) memory space left

du –s* Summarizes all files & directories sizes

gzip Compress a file (i.e.) like zipping

gunzip Expands a file (i.e) like unzipping

zcat Helps to read zipped files without expanding

file* Classifies the types of files used in a directory

diff compares the contents of two files

history Show command history unit

!! Recall last command

!-3 Recall last three command

!5 Recall 5th command

!grep Recall command starting with grep