Why important ? You must know how to: Create a file Create a - - PowerPoint PPT Presentation

why important
SMART_READER_LITE
LIVE PREVIEW

Why important ? You must know how to: Create a file Create a - - PowerPoint PPT Presentation

Why important ? You must know how to: Create a file Create a folder Delete a file Delete a folder Show current Path Navigate through folders Show content in folder Show content in file Copy


slide-1
SLIDE 1

Why important ?

  • You must know how to:

○ Create a file ○ Create a folder ○ Delete a file ○ Delete a folder ○ Show current Path ○ Navigate through folders ○ Show content in folder ○ Show content in file ○ Copy a File/Folder ○ Compile a C program ○ Execute a C program

slide-2
SLIDE 2

First of all, open the linux Terminal

Command: Ctrl + Alt + T

slide-3
SLIDE 3

In the Linux Terminal, Type:

touch name_of_file.extension Examples:

  • touch hello.txt
  • touch cs256.pdf
  • touch code.c
slide-4
SLIDE 4

In the Linux Terminal, Type:

mkdir name_of_folder Examples:

  • mkdir home
  • mkdir CS
slide-5
SLIDE 5

In the Linux Terminal, Type:

rm name_of_file.extension Examples:

  • rm hello.txt
  • rm cs256.pdf
  • rm code.c
slide-6
SLIDE 6

In the Linux Terminal, Type:

rm -rf name_of_file.extension Examples:

  • rm -rf home
  • rm -rf CS
slide-7
SLIDE 7

In the Linux Terminal, Type:

pwd

slide-8
SLIDE 8

In the Linux Terminal, Type:

  • To navigate

cd path_of_folder

  • To return to previous folder

○ cd ..

  • To return to main page(Desktop)

cd Examples:

  • cd Desktop/Download ( To go to the Downloads folder)
  • cd ..
slide-9
SLIDE 9

In the Linux Terminal, Type:

  • For folder

○ ls or ls name_of_folder

  • For file

○ cat name_of_file

Examples:

  • ls Desktop
  • cat hello.txt
slide-10
SLIDE 10

Command: → ~ means home directory

. means current directory

  • File

○ cp src dest

  • Folder

○ cp -r src dest Examples:

  • File:

○ cp /u1/junk/shakespeare.txt ~

  • Folder

○ cp -r /u1/junk/MST .

slide-11
SLIDE 11

In the Linux Terminal, Type:

gcc name_of_file.extension Examples:

  • gcc test.c
slide-12
SLIDE 12

In the Linux Terminal, Type:

./a.out

slide-13
SLIDE 13
  • Create a folder named cs256_linux
  • Go to cs256_linux folder
  • Create a file named my_file.txt
  • Copy the content of file from “/u1/junk/shakespeare.txt“ to your

my_file.txt

  • Show the content of the file
  • Delete the file my_file.txt
  • Copy folder from “/u1/junk/MST” to your cs256_linux folder
  • Delete the folder cs256_linux