Mehmet Mercimek

ITU Enerji Enstitüsü Maslak/İstanbul

rm : delete files.
rm -r [directory] : empties and deletes directory recursively.
mkdir : Creates a directory.
cd : Change to directory.
mv : Move or Rename a file / directory
ls : Directory / file listing.

ls -al / long directory listing
rm -f / remove files, force...it doesn't ask...
rm -rf / remove, force, recursive (subdirs and files)
du / how much disk space you are using.
df / how much disk space is available.
du -m / how much disk space you are using in megabytes.
wc / count words in a file or files.
wc -l / count lines in a file or files.

su Super-User (must have root password)
find finds files (there are some switches that are needed)
chmod change permissions of a dir
chown change the owner of a dir
chgrp change the group of a dir
cd ~ takes you to your home dir
The tab key is also a very useful tool, you can type for instance "cd /ho{tab}" and you go to Linux types the rest of the dir name for you.

Komutlar

LİNUX

Vi Editörü

Script:

 

Those "batch"-files are called scripts in Linux put all the commands you want in a text file and make it executable with chmod +x filename. then you can execute when you want or  add it to another script.

libc.so.6/glibc-2.3.4-8mdk
libc.so.6/glibc-debug-2.2.93-5.i386.rpm
libc.so.6/rlinux_en_10.exe

For this Purpose

Use this vi Command Syntax

To insert new text

esc + i ( You have to press 'escape' key then 'i')

To save file

esc + : + w (Press 'escape' key  then 'colon' and finally 'w')

To save file with file name (save as)

esc + : + w  "filename"

To quit the vi editor

esc + : + q

To quit without saving

esc + : + q!

To save and quit vi editor

esc + : + wq

To search for specified word in forward direction

esc + /word (Press 'escape' key, type /word-to-find, for e.g. to find word 'shri', type as
/shri)

To continue with search 

n

To search for specified word in backward direction

esc + ?word (Press 'escape' key, type word-to-find)

To copy the line where cursor is located

esc + yy

To paste the text just deleted or copied at the cursor

esc + p

To delete entire line where cursor is located

esc + dd

To delete word from cursor position

esc + dw

To Find all occurrence of given word and Replace then globally without confirmation 

esc + :$s/word-to-find/word-to-replace/g

For. e.g. :$s/mumbai/pune/g
Here word "mumbai" is replace with "pune"

 

To Find all occurrence of given word and Replace then globally with confirmation

esc + :$s/word-to-find/word-to-replace/cg

To run shell command like ls, cp or date etc within vi

esc + :!shell-command

For e.g. :!pwd