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

PC’den TV’ye Görüntü Aktarmak

S-Video standartina uygun baglanti, bilgisayarin PS/2 Mouse girisine çok benzer bir görüntüde. RCA standartina uygun…

10 saat ago

Php Nedir ?

Php Nedir? PHP adini "Personal Home Page" kelimelerinin bas harflerinden almistir. PHP, özellikle dinamik web…

22 saat ago

Helmint Taxanomy

Helmintlerin Sınıflaması PHYLUM (Anaç) PLATYHELMİNTHES Class (Sınıf) Trematoda (fluke) Order (Takım) Aspidogastreans (monogenetic trematodes) Genus…

1 gün ago

Arthropoda Taxa (Sınıflandırma)

Kingdom (Alem): ANIMALIA Phylum (Kök-Anaç): Arthropoda Subphylum (Altkök): Mandibulata Superclass (Sınıf üstü): Hexapoda Class Insecta…

2 gün ago

Karakuş Tümülüsü / Adıyaman

Karakuş Tümülüsü, ( M.Ö 1. yy ) Kommagene Krallık ailesine ait bir anıt mezardır. Güneydeki…

2 gün ago

Parasitoloji Labaratuvarı

1) DIŞKI MUAYENELERİ: Güvenlik: Dışkı örneği ile çalışan laboratuvarlarda potansiyel olarak bulunan tehlikeler şunlardır. Parazit…

3 gün ago