REVIEW OF FREQUENTLY USED UNIX COMMANDS

GENERAL COMMAND SYNTAX:

$ command –[options] <arguments>

DISPLAYING CONTENTS OF A DIRECTORY:

$ ls      (simple form)

$ ls –l   (long form)

$ ls –la  [long form and all files including hidden files. (hidden filenames begin with a dot)]

DISPLAYING FILENAMES THAT HAVE COMMON START/END:

$ ls –l chapter*  (shows filenames like chapter01, chapter02, chapterfour, etc)

$ ls –l *.txt     (shows filenames like book.txt, song.txt, readme.txt, etc)

DISPLAYING CONTENTS OF ONE OR MORE FILES:

$ cat song.txt

$ cat song.txt book.txt readme.txt

COPYING/MOVING/RENAMING FILES:

$ cp file1.txt file2.txt  (copies! file1.txt also exists)

$ mv file1.txt file2.txt  (renames! file1.txt NO longer exists)

$ mv file1.txt docs/year2005/file1.txt  (moves! from current directory to docs/year2005 directory)

$ mv file1.txt docs/year2005/file2.txt  (moves and renames! from current directory to docs/year2005 directory)

CREATING DIRECTORIES:

$ mkdir year2005 year2006
$ mkdir year2005/docs year2005/pics

CREATING/MODIFYING FILES USING pico EDITOR:

$ pico year2005/docs/myfile.txt

            pathname

            type in

press Ctrl + X to EXIT

DELETING FILES/DIRECTORIES:

$ rm year2005/docs/myfile.txt      (deletes myfile.txt)

$ rm song.txt book.txt readme.txt  (deletes song.txt and readme.txt)

$ rmdir year2006     (deletes the empty directory year2006)

$ rm -r year2005     (deletes the non-empty directory year2005)

CHANGING FILE PERMISSIONS:
Users:
    a-all
    u-owner
    g-group
    o-others

Permissions:
    r-read
    w-write
    x-execute

$ chmod a+x hello2     (gives all users execute permission for the file hello2)

$ chmod go-w hwk1.txt  (removes write permission from group and other users for the file hwk1.txt)

$ chmod g+rw song.txt  (gives read and write permissions to group users for the file song.txt)

Kaynak: sct.emu.edu.tr
belgesi-1156

Belgeci

Share
Published by
Belgeci

Recent Posts

Türkiye Islam’ın Manevi Merkezi

İngiltere, Türkiye'yi ortadan kaldırmak isterken, bu ülkeyi, bütün İslâmî fikir ve düşüncenin kaynaştığı manevî bir…

11 saat ago

Bakû Kongresi ve Doğu’da Bolşevizm

Asya'da kitle halindeki bu ayaklanmanın sebepleri Türkiye'de bulunmaktadır ve bu akım mütarekeden sonra başlamıştır. Bunu…

23 saat ago

Kervanların Ulaştırdıkları

1920 yılının Ağustos ve Eylül aylarında Bakû'da toplanan ikinci kongrede Lenin, Doğu için, en acil…

1 gün ago

İstanbul’a Nasıl Girildi ?

Dukas, şehre girişi, Ulubatlı Hasan efsanesi temelinde değil de, açık bırakılmış olan Kerkoporta Kapısı'ndan gerçekleştiğini,…

2 gün ago

Tek Mesele

Hiçbir şey, bir yığın hatırayı sıraya koymak için gereken ilk sessizlik anları kadar değerli olamaz.…

2 gün ago

The role of technology in reshaping the gambling landscape

The role of technology in reshaping the gambling landscape The Evolution of Online Gambling The…

2 gün ago